refactor(FE-212): update PurchaseRequestForm schema and validation, streamline warehouse handling and add sub quantity field

This commit is contained in:
rstubryan
2025-11-03 11:04:07 +07:00
parent 1d79e8de1d
commit b4a9c86c2a
4 changed files with 111 additions and 118 deletions
+3 -5
View File
@@ -1,6 +1,5 @@
import { BaseMetadata } from '@/types/api/api-general';
import { Supplier } from '@/types/api/master-data/supplier';
import { Warehouse } from '@/types/api/master-data/warehouse';
export type BasePurchase = {
id: number;
@@ -8,7 +7,6 @@ export type BasePurchase = {
po_number: string;
po_date: string;
supplier: Supplier;
warehouse: Warehouse[];
credit_term: number;
due_date: string;
grand_total: number;
@@ -24,10 +22,10 @@ export type CreatePurchaseRequestPayload = {
credit_term: number;
notes?: string | null;
purchase_items: {
warehouse_ids: number;
warehouse_id: number;
product_id: number;
product_warehouse_id: number;
total_qty: number;
product_warehouse_id?: number | null;
sub_qty: number;
price: number;
}[];
};