Files
lti-web-client/src/services/api/report/finance-report.ts
T

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'
);