refactor(FE-363): Update logistic report API endpoint and types

This commit is contained in:
rstubryan
2025-12-16 10:00:39 +07:00
parent 7ea9e10ad2
commit 4d997256ad
2 changed files with 19 additions and 27 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ export class LogisticApiService extends BaseApiService<
): Promise<BaseApiResponse<LogisticPurchasePerSupplierReport> | undefined> {
return await this.customRequest<
BaseApiResponse<LogisticPurchasePerSupplierReport>
>(`logistic-stock`, {
>(`purchase-supplier`, {
method: 'GET',
params: {
area_id: area_id,
@@ -43,5 +43,5 @@ export class LogisticApiService extends BaseApiService<
// TODO: REPLACE WITH PRODUCTION URL
export const LogisticApi = new LogisticApiService(
'http://localhost:4010/api/report'
'http://localhost:4010/api/reports/logistics'
);
+17 -25
View File
@@ -1,31 +1,23 @@
import { BaseMetadata } from '@/types/api/api-general';
import { Supplier } from '@/types/api/supplier/supplier';
import { Product } from '@/types/api/product/product';
import { Area } from '@/types/api/area/area';
export type LogisticPurchasePerSupplierItems = {
id: number;
received_date: string;
po_date: string;
po_number: string;
product: Product;
area: Area;
destination_warehouse: string;
qty: number;
price: number;
transport_per_item: number;
transport_total: number;
expedition_vendor_id: number;
expedition_vendor_name: string;
travel_number: string;
};
export type LogisticPurchasePerSupplier = {
id: number;
supplier: Supplier;
items: LogisticPurchasePerSupplierItems[];
};
import { Warehouse } from '@/types/api/warehouse/warehouse';
export type LogisticPurchasePerSupplierReport = BaseMetadata & {
data: LogisticPurchasePerSupplier[];
rows: {
supplier: Supplier;
receive_date: string;
po_date: string;
po_number: string;
product: Product;
warehouse: Warehouse;
qty: number;
unit_price: number;
purchase_value: number;
transport_unit_price: number;
transport_value: number;
total_amount: number;
expedition: string;
delivery_number: string;
}[];
};