87c807c16c
- Implemented ChequeBooksPage for viewing and filtering cheque books. - Added NewReceivedChequePage for recording received cheques. - Created ReceivedChequesPage for listing and managing received cheques. - Introduced API endpoints for bank accounts, cheque books, and received cheques. - Defined types for payments including bank accounts, cheque books, and received cheques.
30 lines
865 B
TypeScript
30 lines
865 B
TypeScript
import { api } from '@/lib/api'
|
|
import type {
|
|
CreateReceivedChequeRequest,
|
|
PagedResult,
|
|
ReceivedChequeResponse,
|
|
ReceivedChequeStatus,
|
|
ReceivedFromType,
|
|
UpdateReceivedChequeStatusRequest,
|
|
} from '@/types/payments'
|
|
|
|
export const receivedCheques = {
|
|
list: (params?: {
|
|
companyId?: number
|
|
branchId?: number
|
|
status?: ReceivedChequeStatus
|
|
receivedFromType?: ReceivedFromType
|
|
page?: number
|
|
pageSize?: number
|
|
}) =>
|
|
api
|
|
.get<PagedResult<ReceivedChequeResponse>>('/received-cheques', { params })
|
|
.then(r => r.data),
|
|
|
|
create: (body: CreateReceivedChequeRequest) =>
|
|
api.post<ReceivedChequeResponse>('/received-cheques', body).then(r => r.data),
|
|
|
|
updateStatus: (id: string, body: UpdateReceivedChequeStatusRequest) =>
|
|
api.put<ReceivedChequeResponse>(`/received-cheques/${id}/status`, body).then(r => r.data),
|
|
}
|