feat: ingredient product

This commit is contained in:
ferdiansyah783
2025-08-12 21:29:24 +07:00
parent c3780af341
commit f3dfad4cb3
36 changed files with 1731 additions and 465 deletions
+5 -1
View File
@@ -7,6 +7,8 @@ import paymentMethodReducer from '@/redux-store/slices/paymentMethod'
import ingredientReducer from '@/redux-store/slices/ingredient'
import orderReducer from '@/redux-store/slices/order'
import productRecipeReducer from '@/redux-store/slices/productRecipe'
import organizationReducer from '@/redux-store/slices/organization'
import userReducer from '@/redux-store/slices/user'
export const store = configureStore({
reducer: {
@@ -15,7 +17,9 @@ export const store = configureStore({
paymentMethodReducer,
ingredientReducer,
orderReducer,
productRecipeReducer
productRecipeReducer,
organizationReducer,
userReducer
},
middleware: getDefaultMiddleware => getDefaultMiddleware({ serializableCheck: false })
})
+37
View File
@@ -0,0 +1,37 @@
// Third-party Imports
import type { PayloadAction } from '@reduxjs/toolkit'
import { createSlice } from '@reduxjs/toolkit'
// Type Imports
// Data Imports
import { Organization } from '../../types/services/organization'
const initialState: { currentOrganization: Organization } = {
currentOrganization: {
id: '',
name: '',
email: '',
phone_number: '',
plan_type: 'basic',
created_at: '',
updated_at: ''
}
}
export const organizationSlice = createSlice({
name: 'organization',
initialState,
reducers: {
setOrganization: (state, action: PayloadAction<Organization>) => {
state.currentOrganization = action.payload
},
resetOrganization: state => {
state.currentOrganization = initialState.currentOrganization
}
}
})
export const { setOrganization, resetOrganization } = organizationSlice.actions
export default organizationSlice.reducer
+40
View File
@@ -0,0 +1,40 @@
// Third-party Imports
import type { PayloadAction } from '@reduxjs/toolkit'
import { createSlice } from '@reduxjs/toolkit'
// Type Imports
// Data Imports
import { User } from '../../types/services/user'
const initialState: { currentUser: User } = {
currentUser: {
id: '',
organization_id: '',
outlet_id: '',
name: '',
email: '',
role: '',
permissions: {},
is_active: false,
created_at: '',
updated_at: ''
}
}
export const userSlice = createSlice({
name: 'user',
initialState,
reducers: {
setUser: (state, action: PayloadAction<User>) => {
state.currentUser = action.payload
},
resetUser: state => {
state.currentUser = initialState.currentUser
}
}
})
export const { setUser, resetUser } = userSlice.actions
export default userSlice.reducer