dstpabuaran.com/resources/js/pages/admin/manage/cutting/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

114 lines
2.7 KiB
TypeScript

export type CuttingMaterial = {
id: number;
raw_material_price_id: number;
material_usage: number;
material_result: number | null;
combination_id: number | null;
variant_name: string;
};
export type CuttingResult = {
id: number;
product_name: string | null;
cutting_result: number | null;
sample: number | null;
original_outside_sample: number | null;
};
export type CuttingCombination = {
id: number;
material_result: number | null;
};
export type Cutting = {
id: number;
created_by_id: number;
status: string;
description: string | null;
total_material_cost: number | null;
formatted_total_material_cost: string | null;
cost_per_unit: number | null;
formatted_cost_per_unit: string | null;
photo_urls: string[];
photo_conversion_urls: string[];
created_at: string;
formatted_created_at: string;
materials_count: number;
total_usage: number;
product_name: string | null;
cutting_result: number | null;
created_by: {
id: number;
user_profile: {
full_name: string;
};
};
cutting_results?: CuttingResult[];
cutting_materials?: CuttingMaterialDetail[];
cutting_material_combinations?: CuttingCombination[];
};
export type CuttingMaterialDetail = {
id: number;
raw_material_price_id: number;
material_usage: number;
material_result: number | null;
combination_id: number | null;
raw_material_price: {
id: number;
variant: string;
photo_url: string | null;
photo_conversion_url: string | null;
raw_material: {
id: number;
name: string;
unit: string;
};
};
};
export type CuttingForEdit = {
id: number;
status: string;
description: string | null;
product_name: string;
sample: number;
original_outside_sample: number;
cutting_result: number;
materials: {
id: number;
raw_material_price_id: number;
material_usage: number;
material_result: number | null;
combination_id: number | null;
variant: string | null;
photo_url: string | null;
}[];
combinations: {
id: number;
material_result: number | null;
material_indices: number[];
}[];
photo_keys: string[];
photo_urls: string[];
existing_material_ids: number[];
};
export type CuttingCreateData = {
rawMaterials: {
id: number;
name: string;
unit: string;
}[];
};
export type RawMaterialVariant = {
id: number;
raw_material_id: number;
variant: string;
price: number;
stock: number;
photo_url: string | null;
photo_conversion_url: string | null;
};