mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
feat(FE-345): Add HPP expedition types and API method
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
|||||||
ClosingOutgoingSapronak,
|
ClosingOutgoingSapronak,
|
||||||
ClosingOverhead,
|
ClosingOverhead,
|
||||||
ClosingSapronakCalculation,
|
ClosingSapronakCalculation,
|
||||||
|
ClosingCostOfRevenueExpedition,
|
||||||
} from '@/types/api/closing';
|
} from '@/types/api/closing';
|
||||||
import { httpClient, httpClientFetcher } from '@/services/http/client';
|
import { httpClient, httpClientFetcher } from '@/services/http/client';
|
||||||
import { BaseApiResponse } from '@/types/api/api-general';
|
import { BaseApiResponse } from '@/types/api/api-general';
|
||||||
@@ -194,6 +195,28 @@ export class ClosingApiService extends BaseApiService<Closing, null, null> {
|
|||||||
return undefined;
|
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');
|
export const ClosingApi = new ClosingApiService('/closings');
|
||||||
|
|||||||
Vendored
+17
@@ -142,3 +142,20 @@ export type OverheadTotal = {
|
|||||||
actual_total_amount: number;
|
actual_total_amount: number;
|
||||||
cost_per_bird: 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