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_url: string | null;
    photo_conversion_url: string | null;
    created_at: string;
    formatted_created_at: string;
    created_by: {
        id: number;
        user_profile: {
            full_name: string;
        };
    };
    cutting_results: CuttingResult[];
    cutting_materials: {
        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;
            };
        };
    }[];
    cutting_material_combinations: {
        id: number;
        material_result: number | null;
    }[];
};

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_key: string | null;
    photo_url: string | null;
};

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;
        }[];
    }[];
};
