feat(FE): US#278 slicing UI from and client side validation

This commit is contained in:
randy-ar
2025-12-02 04:11:01 +07:00
parent 48435a9cbb
commit c76f3a3715
8 changed files with 556 additions and 115 deletions
+11
View File
@@ -4,6 +4,7 @@ import { Flock } from '@/types/api/master-data/flock';
import { Kandang } from '@/types/api/master-data/kandang';
import { Location } from '@/types/api/master-data/location';
import { BaseApproval, BaseMetadata } from '@/types/api/api-general';
import { Nonstock } from '@/types/api/master-data/nonstock';
export type BaseProjectFlock = {
id: number;
@@ -30,6 +31,15 @@ export type PeriodFlock = {
next_period: number;
};
export type ProjectFlockBudget = {
id?: number;
project_flock_id?: number;
nonstock_id: number;
nonstock?: Nonstock;
qty: number;
price: number;
};
export type ProjectFlock = BaseMetadata & BaseProjectFlock;
export type CreateProjectFlockPayload = {
@@ -39,6 +49,7 @@ export type CreateProjectFlockPayload = {
fcr_id: number;
location_id: number;
kandang_ids: number[];
project_budgets?: ProjectFlockBudget[];
};
export type UpdateProjectFlockPayload = CreateProjectFlockPayload;
+1 -10
View File
@@ -3,13 +3,4 @@ type MainUiSlice = {
setMainDrawerOpen: (open: boolean) => void;
};
type DrawerUiSlice = {
triggerValidate: boolean;
toggleValidate: () => void;
subscribeValidate: (callback: () => void) => void;
isValid: boolean;
setIsValid: (v: boolean) => void;
subscribeIsValid: (callback: (isValid: boolean) => void) => () => void;
};
export type UIStore = MainUiSlice & DrawerUiSlice;
export type UIStore = MainUiSlice;