mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { BaseApiService } from '@/services/api/base';
|
|
import { BaseApiResponse } from '@/types/api/api-general';
|
|
import { CustomerPaymentReport } from '@/types/api/report/customer-payment';
|
|
import { DebtSupplier } from '@/types/api/report/debt-supplier';
|
|
|
|
export class FinanceApiService extends BaseApiService<
|
|
CustomerPaymentReport,
|
|
unknown,
|
|
unknown
|
|
> {
|
|
constructor(basePath: string) {
|
|
super(basePath);
|
|
}
|
|
|
|
async getCustomerPaymentReport(
|
|
customer_id?: string,
|
|
sales_id?: string,
|
|
filter_by?: 'do_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_id: sales_id,
|
|
filter_by: filter_by,
|
|
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'
|
|
);
|