44 lines
912 B
TypeScript
44 lines
912 B
TypeScript
export type RawMaterialVariant = {
|
|
id: number;
|
|
variant: string;
|
|
price: number;
|
|
stock: number;
|
|
formatted_stock: string;
|
|
photo_url: string | null;
|
|
photo_conversion_url: string | null;
|
|
};
|
|
|
|
export type RawMaterial = {
|
|
id: number;
|
|
name: string;
|
|
unit: string;
|
|
is_active: boolean;
|
|
variants_count: number;
|
|
total_stock: number;
|
|
total_value: number;
|
|
raw_material_prices?: RawMaterialVariant[];
|
|
};
|
|
|
|
export type RawMaterialVariantForEdit = {
|
|
id: number;
|
|
variant: string;
|
|
price: number;
|
|
stock: number;
|
|
photo_key: string | null;
|
|
photo_url: string | null;
|
|
};
|
|
|
|
export type RawMaterialForEdit = {
|
|
id: number;
|
|
name: string;
|
|
unit: string;
|
|
is_active: boolean;
|
|
raw_material_prices: RawMaterialVariantForEdit[];
|
|
};
|
|
|
|
export const UNIT_LABELS: Record<string, string> = {
|
|
kg: 'Kilogram',
|
|
meter: 'Meter',
|
|
yard: 'Yard',
|
|
};
|