Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page

This commit is contained in:
rstubryan
2025-12-29 14:15:29 +07:00
54 changed files with 4457 additions and 2464 deletions
+60
View File
@@ -0,0 +1,60 @@
export type Finance = {
id: number;
payment_code: string;
reference_number: string;
transaction_type: string;
party: FinanceParty;
payment_date: string;
created_at: string;
payment_method: string;
bank: FinanceBank;
expense_amount: number;
income_amount: number;
nominal: number;
notes: string;
};
export type FinanceParty = {
id: number;
name: string;
type: string;
account_number: string;
};
export type FinanceBank = {
id: number;
name: string;
alias: string;
owner: string;
account_number: string;
};
export type CreateFinancePayment = {
party_id: number;
party_type: string;
payment_date: string;
payment_method: string;
bank_id: number;
reference_number: string;
nominal: number;
notes: string;
};
export type UpdateFinancePayment = CreateFinancePayment;
export type CreateInitialBalance = {
party_type: string;
party_id: number;
bank_id: number;
reference_number: string;
initial_balance_type: string;
nominal: number;
note: string;
};
export type UpdateInitialBalance = CreateInitialBalance;
export type CreateInjection = {
bank_id: number;
adjustment_date: string;
nominal: number;
notes: string;
};
export type UpdateInjection = CreateInjection;
+71
View File
@@ -0,0 +1,71 @@
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;
growth_standard_detail: StandardGrowthDetails;
egg_production_standard_detail: 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;
feed_intake: number;
}
export interface CreateProductionStandardPayload {
name: string;
project_category: string;
details: {
week: number;
growth_standard_detail: {
target_mean_bw: number;
max_depletion: number;
min_uniformity: number;
feed_intake: number;
};
egg_production_standard_detail: {
target_hen_day_production: number;
target_hen_house_production: number;
target_egg_weight: number;
target_egg_mass: number;
};
}[];
}
export interface UpdateProductionStandardPayload {
name: string;
project_category: string;
details: {
week: number;
growth_standard_detail: {
target_mean_bw: number;
max_depletion: number;
min_uniformity: number;
feed_intake: number;
};
egg_production_standard_detail: {
target_hen_day_production: number;
target_hen_house_production: number;
target_egg_weight: number;
target_egg_mass: number;
};
}[];
}
+26 -1
View File
@@ -1,4 +1,4 @@
import type { ReactNode } from 'react';
import type { ProductionStandardRepeaterFormSchemaValues } from '@/components/pages/master-data/production-standard/form/ProductionStandardForm.schema';
type MainUiSlice = {
mainDrawerOpen: boolean;
@@ -21,3 +21,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;