mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 13:55:45 +00:00
feat(FE): Add finance report API and customer payment types
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { BaseApiService } from '@/services/api/base';
|
||||
import { BaseApiResponse } from '@/types/api/api-general';
|
||||
import { CustomerPaymentReport } from '@/types/api/report/customer-payment';
|
||||
|
||||
export class FinanceApiService extends BaseApiService<
|
||||
CustomerPaymentReport,
|
||||
unknown,
|
||||
unknown
|
||||
> {
|
||||
constructor(basePath: string) {
|
||||
super(basePath);
|
||||
}
|
||||
|
||||
async getCustomerPaymentReport(
|
||||
customer_id?: string,
|
||||
sales?: string,
|
||||
date_type?: 'do_date' | 'payment_date',
|
||||
start_date?: string,
|
||||
end_date?: string,
|
||||
page?: number,
|
||||
limit?: number
|
||||
): Promise<BaseApiResponse<CustomerPaymentReport> | undefined> {
|
||||
return await this.customRequest<BaseApiResponse<CustomerPaymentReport>>(
|
||||
`customer-payment`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
customer_id: customer_id,
|
||||
sales: sales,
|
||||
date_type: date_type,
|
||||
start_date: start_date,
|
||||
end_date: end_date,
|
||||
page: page,
|
||||
limit: limit,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const FinanceApi = new FinanceApiService('reports');
|
||||
|
||||
// export const FinanceApi = new FinanceApiService(
|
||||
// 'http://localhost:4010/api/reports/finance'
|
||||
// );
|
||||
Reference in New Issue
Block a user