mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE-363): Update logistic report API endpoint and types
This commit is contained in:
@@ -24,7 +24,7 @@ export class LogisticApiService extends BaseApiService<
|
|||||||
): Promise<BaseApiResponse<LogisticPurchasePerSupplierReport> | undefined> {
|
): Promise<BaseApiResponse<LogisticPurchasePerSupplierReport> | undefined> {
|
||||||
return await this.customRequest<
|
return await this.customRequest<
|
||||||
BaseApiResponse<LogisticPurchasePerSupplierReport>
|
BaseApiResponse<LogisticPurchasePerSupplierReport>
|
||||||
>(`logistic-stock`, {
|
>(`purchase-supplier`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
area_id: area_id,
|
area_id: area_id,
|
||||||
@@ -43,5 +43,5 @@ export class LogisticApiService extends BaseApiService<
|
|||||||
|
|
||||||
// TODO: REPLACE WITH PRODUCTION URL
|
// TODO: REPLACE WITH PRODUCTION URL
|
||||||
export const LogisticApi = new LogisticApiService(
|
export const LogisticApi = new LogisticApiService(
|
||||||
'http://localhost:4010/api/report'
|
'http://localhost:4010/api/reports/logistics'
|
||||||
);
|
);
|
||||||
|
|||||||
+17
-25
@@ -1,31 +1,23 @@
|
|||||||
import { BaseMetadata } from '@/types/api/api-general';
|
import { BaseMetadata } from '@/types/api/api-general';
|
||||||
import { Supplier } from '@/types/api/supplier/supplier';
|
import { Supplier } from '@/types/api/supplier/supplier';
|
||||||
import { Product } from '@/types/api/product/product';
|
import { Product } from '@/types/api/product/product';
|
||||||
import { Area } from '@/types/api/area/area';
|
import { Warehouse } from '@/types/api/warehouse/warehouse';
|
||||||
|
|
||||||
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[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type LogisticPurchasePerSupplierReport = BaseMetadata & {
|
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;
|
||||||
|
}[];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user