mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 06:45:46 +00:00
feat(FE-363): Add Logistic API service and update types
This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
import { BaseApiService } from '@/services/api/base';
|
||||||
|
import { BaseApiResponse } from '@/types/api/api-general';
|
||||||
|
import { LogisticPurchasePerSupplierReport } from '@/types/api/report/logistic-stock';
|
||||||
|
|
||||||
|
export class LogisticApi extends BaseApiService<
|
||||||
|
LogisticPurchasePerSupplierReport,
|
||||||
|
unknown,
|
||||||
|
unknown
|
||||||
|
> {
|
||||||
|
constructor(basePath: string = '') {
|
||||||
|
super(basePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getLogisticStockReport(
|
||||||
|
area_id?: number,
|
||||||
|
supplier_id?: number,
|
||||||
|
product_id?: number,
|
||||||
|
received_date?: string,
|
||||||
|
po_date?: string,
|
||||||
|
start_date?: string,
|
||||||
|
end_date?: string
|
||||||
|
): Promise<BaseApiResponse<LogisticPurchasePerSupplierReport> | undefined> {
|
||||||
|
return await this.customRequest<
|
||||||
|
BaseApiResponse<LogisticPurchasePerSupplierReport>
|
||||||
|
>(`purchase-supplier`, {
|
||||||
|
method: 'GET',
|
||||||
|
params: {
|
||||||
|
area_id: area_id,
|
||||||
|
supplier_id: supplier_id,
|
||||||
|
product_id: product_id,
|
||||||
|
received_date: received_date,
|
||||||
|
po_date: po_date,
|
||||||
|
start_date: start_date,
|
||||||
|
end_date: end_date,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const LogisticService = new LogisticApi('/reports');
|
||||||
+3
-3
@@ -3,7 +3,7 @@ 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 { Area } from '@types/api/area/area';
|
||||||
|
|
||||||
export type LogisticStockItems = {
|
export type LogisticPurchasePerSupplierItems = {
|
||||||
id: number;
|
id: number;
|
||||||
received_date: string;
|
received_date: string;
|
||||||
po_date: string;
|
po_date: string;
|
||||||
@@ -20,11 +20,11 @@ export type LogisticStockItems = {
|
|||||||
travel_number: string;
|
travel_number: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type BaseLogisticStockReport = {
|
export type BaseLogisticPurchasePerSupplierReport = {
|
||||||
id: number;
|
id: number;
|
||||||
supplier: Supplier;
|
supplier: Supplier;
|
||||||
items: LogisticStockItems[];
|
items: LogisticStockItems[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type LogisticStockReportResponse = BaseMetadata &
|
export type LogisticPurchasePerSupplierReport = BaseMetadata &
|
||||||
BaseLogisticStockReport;
|
BaseLogisticStockReport;
|
||||||
|
|||||||
Reference in New Issue
Block a user