- Implemented StokOpnameEdit component for editing stock opname entries. - Created StokOpnameIndex component for listing and managing stock opnames. - Added StokOpnameCardRow and StokOpnameItemSubRow components for displaying stock opname details. - Introduced routes for stok opname CRUD operations and actions (submit, verify, reject, cancel). - Integrated UI components for better user interaction and data presentation.
80 lines
1.8 KiB
TypeScript
80 lines
1.8 KiB
TypeScript
export type StokOpnameStatus = 'draft' | 'in_progress' | 'completed' | 'verified' | 'cancelled';
|
|
|
|
export type StockType = 'good' | 'reject' | 'retail';
|
|
|
|
export type StokOpnameItem = {
|
|
id: number;
|
|
product_variant_id: number;
|
|
stock_quality: StockType;
|
|
system_stock: number;
|
|
physical_stock: number;
|
|
difference: number;
|
|
notes: string | null;
|
|
variant_name: string;
|
|
product_name: string;
|
|
photo_url: string | null;
|
|
photo_conversion_url: string | null;
|
|
};
|
|
|
|
export type StokOpname = {
|
|
id: number;
|
|
created_by_id: number;
|
|
verified_by_id: number | null;
|
|
opname_date: string;
|
|
status: StokOpnameStatus;
|
|
notes: string | null;
|
|
verification_notes: string | null;
|
|
created_at: string;
|
|
items_count: number;
|
|
total_difference: number;
|
|
product_names: string | null;
|
|
created_by: {
|
|
id: number;
|
|
user_profile: {
|
|
full_name: string;
|
|
};
|
|
};
|
|
verified_by: {
|
|
id: number;
|
|
user_profile: {
|
|
full_name: string;
|
|
};
|
|
} | null;
|
|
};
|
|
|
|
export type StokOpnameForEdit = {
|
|
id: number;
|
|
opname_date: string;
|
|
status: StokOpnameStatus;
|
|
notes: string | null;
|
|
items: {
|
|
id: number;
|
|
product_variant_id: number;
|
|
stock_quality: StockType;
|
|
system_stock: number;
|
|
physical_stock: number;
|
|
difference: number;
|
|
notes: string | null;
|
|
variant_name: string;
|
|
product_name: string;
|
|
}[];
|
|
};
|
|
|
|
export type ProductForStokOpname = {
|
|
id: number;
|
|
name: string;
|
|
status: string;
|
|
product_variants: {
|
|
id: number;
|
|
name: string;
|
|
stock: number;
|
|
reject_stock: number;
|
|
retail_stock: number;
|
|
photo_url: string | null;
|
|
}[];
|
|
};
|
|
|
|
export type StokOpnameCreateData = {
|
|
products: ProductForStokOpname[];
|
|
};
|