feat(FE): add master data production standard, slicing form and index table

This commit is contained in:
randy-ar
2025-12-27 03:23:03 +07:00
parent 4ddd1dc8e3
commit 663c1dea14
16 changed files with 1684 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import { CreatedUser } from '@/types/api/api-general';
export interface ProductionStandard {
id: number;
name: string;
project_category: string;
created_at: string;
updated_at: string;
created_user: CreatedUser;
details: StandardDetails[];
}
export interface StandardDetails {
week: number;
standard_growth_details: StandardGrowthDetails;
production_standard_details: ProductionStandardDetails;
}
export interface ProductionStandardDetails {
target_hen_day_production: number;
target_hen_house_production: number;
target_egg_weight: number;
target_egg_mass: number;
}
export interface StandardGrowthDetails {
target_mean_bw: number;
max_depletion: number;
min_uniformity: number;
max_cv: number;
week: number;
feed_intake: number;
}
+27
View File
@@ -1,3 +1,5 @@
import type { ProductionStandardRepeaterFormSchemaValues } from '@/components/pages/master-data/production-standard/form/ProductionStandardForm.schema';
type MainUiSlice = {
mainDrawerOpen: boolean;
setMainDrawerOpen: (open: boolean) => void;
@@ -13,3 +15,28 @@ type DrawerUISlice = {
};
export type UIStore = MainUiSlice & DrawerUISlice;
type ProductionStandardFormSlice = {
formData: {
name: string;
project_category: string;
details: ProductionStandardRepeaterFormSchemaValues[];
} | null;
editMode: boolean;
editIndex: number | null;
setFormData: (data: {
name: string;
project_category: string;
details: ProductionStandardRepeaterFormSchemaValues[];
}) => void;
setEditMode: (mode: boolean, index: number | null) => void;
addDetail: (detail: ProductionStandardRepeaterFormSchemaValues) => void;
updateDetail: (
index: number,
detail: ProductionStandardRepeaterFormSchemaValues
) => void;
deleteDetail: (index: number) => void;
clearCache: () => void;
};
export type FormStore = ProductionStandardFormSlice;