dstpabuaran.com/resources/js/pages/admin/manage/purchase/columns.tsx
Yoga Pangestu 9637671713 feat: enhance product management and purchase functionality
- Updated ProductIndex component to improve category and product filtering with memoization.
- Refactored Combobox components for better performance and usability.
- Added PurchaseController routes for managing purchases with appropriate permissions.
- Created comprehensive tests for purchase management, covering creation, updating, and deletion scenarios.
- Ensured proper handling of raw materials and their variants during purchase operations.
- Implemented validation for required fields in purchase creation and updates.
2026-08-02 14:07:16 +07:00

96 lines
2.1 KiB
TypeScript

export type PurchaseItem = {
id: number;
raw_material_price_id: number;
quantity: number;
unit_price: number;
subtotal: number;
variant_name: string;
};
export type Purchase = {
id: number;
supplier_id: number;
created_by_id: number;
subtotal: number;
discount: number;
shipping_cost: number;
total: number;
notes: string | null;
photo_url: string | null;
created_at: string;
supplier: {
id: number;
name: string;
};
created_by: {
id: number;
user_profile: {
full_name: string;
};
};
purchase_items: {
id: number;
raw_material_price_id: number;
quantity: number;
unit_price: number;
subtotal: number;
raw_material_price: {
id: number;
variant: string;
price: number;
stock: number;
photo_url: string | null;
raw_material: {
id: number;
name: string;
unit: string;
};
};
}[];
};
export type PurchaseForEdit = {
id: number;
name: string;
unit: string;
supplier_id: number;
discount: number;
shipping_cost: number;
notes: string | null;
photo_key: string | null;
photo_url: string | null;
variants: {
id: number;
variant: string;
price: number;
stock: number;
photo_key: string | null;
photo_url: string | null;
}[];
default_mode: 'new' | 'existing';
existing_material_name: string | null;
existing_quantities: Record<string, number>;
};
export type Supplier = {
id: number;
name: string;
};
export type PurchaseCreateData = {
suppliers: Supplier[];
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;
}[];
}[];
};