mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 14:25:47 +00:00
refactor(FE-212): update purchase types and payloads for requisition handling
This commit is contained in:
Vendored
+16
-9
@@ -3,13 +3,15 @@ import { Supplier } from '@/types/api/master-data/supplier';
|
||||
import { Warehouse } from '@/types/api/master-data/warehouse';
|
||||
import { Product } from '@/types/api/master-data/product';
|
||||
import { ProductWarehouse } from '@/types/api/inventory/product-warehouse';
|
||||
import { Area } from '@/types/api/master-data/area';
|
||||
import { Location } from '@/types/api/master-data/location';
|
||||
|
||||
export type PurchaseItem = {
|
||||
id: number;
|
||||
warehouse: Warehouse;
|
||||
product: Product;
|
||||
product_warehouse: ProductWarehouse;
|
||||
sub_qty: number;
|
||||
quantity: number;
|
||||
};
|
||||
|
||||
export type BasePurchase = {
|
||||
@@ -24,21 +26,26 @@ export type BasePurchase = {
|
||||
notes?: string | null;
|
||||
deleted_at?: string | null;
|
||||
created_by: number;
|
||||
purchase_items?: PurchaseItem[];
|
||||
area?: Area;
|
||||
location?: Location;
|
||||
warehouse?: Warehouse;
|
||||
items?: PurchaseItem[];
|
||||
};
|
||||
|
||||
export type Purchase = BaseMetadata & BasePurchase;
|
||||
|
||||
export type CreatePurchaseRequestPayload = {
|
||||
export type CreatePurchaseRequisitionsPayload = {
|
||||
supplier_id: number;
|
||||
credit_term: number;
|
||||
area_id: number;
|
||||
location_id: number;
|
||||
warehouse_id: number;
|
||||
notes?: string | null;
|
||||
purchase_items: {
|
||||
warehouse_id: number;
|
||||
product_id: number;
|
||||
items: {
|
||||
product_warehouse_id: number;
|
||||
sub_qty: number;
|
||||
product_id: number;
|
||||
quantity: number;
|
||||
}[];
|
||||
};
|
||||
|
||||
export type UpdatePurchaseRequestPayload = CreatePurchaseRequestPayload;
|
||||
export type UpdatePurchaseRequisitionsPayload =
|
||||
CreatePurchaseRequisitionsPayload;
|
||||
|
||||
Reference in New Issue
Block a user