dstpabuaran.com/resources/js/pages/admin/manage/restock/columns.tsx
Yoga Pangestu b85bbb1ba4 feat: enhance purchase and restock management with variant support
- Added existing_material_ids to PurchaseForEdit and RestockForEdit types.
- Introduced RawMaterialVariant and ProductVariantForRestock types for better variant handling.
- Updated PurchaseCreate and PurchaseEdit components to fetch and display raw material variants.
- Enhanced RestockCreate and RestockEdit components to manage product variants dynamically.
- Modified TransactionCreate and TransactionEdit components to support product variants.
- Added routes for fetching active products and raw materials.
2026-08-20 10:48:24 +07:00

75 lines
1.5 KiB
TypeScript

export type RestockStockType = 'good' | 'reject';
export type RestockItem = {
id: number;
product_variant_id: number;
quantity: number;
unit_price: number;
subtotal: number;
product_variant: {
id: number;
name: string;
photo_url: string | null;
photo_conversion_url: string | null;
product: {
id: number;
name: string;
};
};
};
export type Restock = {
id: number;
created_by_id: number;
total: number;
notes: string | null;
stock_type: RestockStockType;
created_at: string;
items_count: number;
total_qty: number;
product_names: string | null;
photo_urls: string[];
photo_conversion_urls: string[];
created_by: {
id: number;
user_profile: {
full_name: string;
};
};
restock_items?: RestockItem[];
};
export type RestockForEdit = {
id: number;
stock_type: RestockStockType;
notes: string | null;
photo_key: string | null;
photo_url: string | null;
existing_product_ids: number[];
items: {
id: number;
product_variant_id: number;
quantity: number;
unit_price: number;
}[];
};
export type ProductVariantForRestock = {
id: number;
name: string;
stock: number;
reject_stock: number;
photo_url: string | null;
capital_price: number;
reject_price: number;
};
export type ProductForRestock = {
id: number;
name: string;
};
export type RestockCreateData = {
products: ProductForRestock[];
};