Files
ERP_Distribution/distribution_fe/lib/api/received-cheques.ts
Kalana B. Thilakarathna 87c807c16c
CI/CD - ERP Distribution / Build & Deploy Backend (pull_request) Failing after 11m8s
CI/CD - ERP Distribution / Build & Deploy Frontend (pull_request) Failing after 14m49s
feat: add cheque books and received cheques management
- 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.
2026-10-19 16:09:05 +05:30

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),
}