dstpabuaran.com/resources/js/pages/admin/manage/cutting/columns.tsx

112 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[];
};
export type CuttingCreateData = {
rawMaterials: {
id: number;
name: string;
unit: string;
is_active: boolean;
raw_material_prices: {
id: number;
variant: string;
price: number;
stock: number;
photo_url: string | null;
photo_conversion_url: string | null;
}[];
}[];
};