Files
frontend/apps/fo/app/store/store.tsx
T
2025-07-26 19:57:09 +09:00

80 lines
3.0 KiB
TypeScript

import { LoginApi } from '@/src/entities/auth/api/login-service';
import { createStore } from 'zustand/vanilla';
import { CommonReducer, commonState, type CommonStore, type CommonType } from './common';
import { dashBoardInitState, dashBoardReducer, type DashBoardStore, type DashBoardType } from './dashboard';
import {
facilityPrecipitationInitState,
facilityPrecipitationReducer,
type FacilityPrecipitationStore, type FacilityPrecipitationType
} from './facilityPrecipitation';
import {
facilityWaterQltyInitState,
facilityWaterQltyReducer,
type FacilityWaterQltyStore, type FacilityWaterQltyType
} from './facilityWaterQlty';
import { flowRateSearchInitState, flowRateSearchReducer, type FlowRateSearchStore, type FlowRateSearchType } from './flowRate';
import { planSewageInitState, planSewageReducer, type PlanSewageStore, type PlanSewageType } from './planSewage';
import {
processAreaInitState,
processAreaReducer,
type ProcessAreaStore, type ProcessAreaType
} from './processArea';
import {
processFacilityInitState,
processFacilityReducer,
type ProcessFacilityStore, type ProcessFacilityType
} from './processFacility';
import { tableActionsExport, tableStateExport, type tableState, type tableType } from './publicReuseFaciltyInsert/index';
import {
rdiInitState,
rdiReducer,
type RdiStore, type RdiType
} from './rdi';
import {
sewageOccurInitState,
sewageOccurReducer,
type SewageOccurStore, type SewageOccurType
} from './sewageOccur';
import {
underWaterInitState,
underWaterReducer,
type UnderWaterStore, type UnderWaterType
} from './underWaterInput';
export type FoStore = CommonStore & tableType & DashBoardStore & ProcessFacilityStore & ProcessAreaStore & FlowRateSearchStore & FacilityPrecipitationStore & FacilityWaterQltyStore & PlanSewageStore & SewageOccurStore & UnderWaterStore & RdiStore;
export type FoState = CommonType & tableState & ProcessFacilityType & ProcessAreaType & FacilityPrecipitationType & FlowRateSearchType & DashBoardType & FacilityWaterQltyType & PlanSewageType & SewageOccurType & UnderWaterType & RdiType;
export const StoreZus =
(initState: FoState = { ...commonState,
...tableStateExport
, ...processFacilityInitState
, ...processAreaInitState
, ...facilityPrecipitationInitState
, ...dashBoardInitState
, ...flowRateSearchInitState
, ...facilityWaterQltyInitState
, ...planSewageInitState
, ...sewageOccurInitState
, ...underWaterInitState
, ...rdiInitState
}
) => {
return createStore<FoStore>()((set) => {
LoginApi.login({userId: "CLEANWATER", password: "gktneh12!@"})
return {
...initState,
...CommonReducer(set),
...tableActionsExport(set),
...dashBoardReducer(set),
...processFacilityReducer(set),
...processAreaReducer(set),
...facilityPrecipitationReducer(set),
...flowRateSearchReducer(set),
...facilityWaterQltyReducer(set),
...planSewageReducer(set),
...sewageOccurReducer(set),
...underWaterReducer(set),
...rdiReducer(set),
}
})
}
//store 등록하는 부분