mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 13:55:45 +00:00
feat(FE-357): Add marketing sales report API and types
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import { BaseApiService } from '@/services/api/base';
|
||||
import { BaseApiResponse } from '@/types/api/api-general';
|
||||
import { HppPerkandang } from '@/types/api/report/hpp-per-kandang';
|
||||
|
||||
export class MarketingSaleReportService extends BaseApiService<
|
||||
HppPerkandang,
|
||||
unknown,
|
||||
unknown
|
||||
> {
|
||||
constructor(basePath: string) {
|
||||
super(basePath);
|
||||
}
|
||||
|
||||
async getHppPerKandangReport(
|
||||
area_id?: number,
|
||||
location_id?: number,
|
||||
kandang_id?: number,
|
||||
weight_min?: number,
|
||||
weight_max?: number,
|
||||
period?: string,
|
||||
sort_by?: string,
|
||||
show_unrecorded?: boolean,
|
||||
page?: number,
|
||||
limit?: number
|
||||
): Promise<BaseApiResponse<HppPerkandang> | undefined> {
|
||||
return await this.customRequest<BaseApiResponse<HppPerkandang>>(
|
||||
`hpp-per-kandang`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
area_id: area_id,
|
||||
location_id: location_id,
|
||||
kandang_id: kandang_id,
|
||||
weight_min: weight_min,
|
||||
weight_max: weight_max,
|
||||
period: period,
|
||||
sort_by: sort_by,
|
||||
show_unrecorded: show_unrecorded,
|
||||
page: page,
|
||||
limit: limit,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: REPLACE WITH PRODUCTION URL
|
||||
export const SaleReportApi = new MarketingSaleReportService(
|
||||
'http://localhost:4010/api/reports/marketings/hpp-per-kandang'
|
||||
);
|
||||
Reference in New Issue
Block a user