mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE-345): Add HPP expedition types and API method
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
ClosingOutgoingSapronak,
|
||||
ClosingOverhead,
|
||||
ClosingSapronakCalculation,
|
||||
ClosingCostOfRevenueExpedition,
|
||||
} from '@/types/api/closing';
|
||||
import { httpClient, httpClientFetcher } from '@/services/http/client';
|
||||
import { BaseApiResponse } from '@/types/api/api-general';
|
||||
@@ -194,6 +195,28 @@ export class ClosingApiService extends BaseApiService<Closing, null, null> {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
async getHppEkspedisi(
|
||||
id: number
|
||||
): Promise<BaseApiResponse<ClosingCostOfRevenueExpedition> | undefined> {
|
||||
try {
|
||||
const getHppEkspedisiPath = `${this.basePath}/${id}/hpp-ekspedisi`;
|
||||
const getHppEkspedisiRes =
|
||||
await httpClient<BaseApiResponse<ClosingCostOfRevenueExpedition>>(
|
||||
getHppEkspedisiPath
|
||||
);
|
||||
return getHppEkspedisiRes;
|
||||
} catch (error) {
|
||||
if (
|
||||
axios.isAxiosError<BaseApiResponse<ClosingCostOfRevenueExpedition>>(
|
||||
error
|
||||
)
|
||||
) {
|
||||
return error.response?.data;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const ClosingApi = new ClosingApiService('/closings');
|
||||
|
||||
Vendored
+17
@@ -142,3 +142,20 @@ export type OverheadTotal = {
|
||||
actual_total_amount: number;
|
||||
cost_per_bird: number;
|
||||
};
|
||||
|
||||
export type BaseCostOfRevenueExpedition = {
|
||||
id: number;
|
||||
expedition_vendor_id: number;
|
||||
expedition_vendor_name: string;
|
||||
qty: number;
|
||||
unit_price: number;
|
||||
hpp_amount: number;
|
||||
};
|
||||
|
||||
export type BaseClosingCostOfRevenueExpedition = {
|
||||
expedition_costs: BaseCostOfRevenueExpedition[];
|
||||
total_hpp_amount: number;
|
||||
};
|
||||
|
||||
export type ClosingCostOfRevenueExpedition = BaseMetadata &
|
||||
BaseClosingCostOfRevenueExpedition;
|
||||
|
||||
Reference in New Issue
Block a user