feat: payment & customer

This commit is contained in:
ferdiansyah783
2025-08-07 14:31:42 +07:00
parent a72a64215a
commit a5d22db27b
35 changed files with 2033 additions and 599 deletions
+3 -1
View File
@@ -3,11 +3,13 @@ import { configureStore } from '@reduxjs/toolkit'
import productReducer from '@/redux-store/slices/product'
import customerReducer from '@/redux-store/slices/customer'
import paymentMethodReducer from '@/redux-store/slices/paymentMethod'
export const store = configureStore({
reducer: {
productReducer,
customerReducer
customerReducer,
paymentMethodReducer
},
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 { PaymentMethod } from '../../types/services/paymentMethod'
const initialState: { currentPaymentMethod: PaymentMethod } = {
currentPaymentMethod: {
id: '',
organization_id: '',
name: '',
type: '',
is_active: true,
created_at: '',
updated_at: ''
}
}
export const paymentMethodSlice = createSlice({
name: 'paymentMethod',
initialState,
reducers: {
setPaymentMethod: (state, action: PayloadAction<PaymentMethod>) => {
state.currentPaymentMethod = action.payload
},
resetPaymentMethod: state => {
state.currentPaymentMethod = initialState.currentPaymentMethod
}
}
})
export const { setPaymentMethod, resetPaymentMethod } = paymentMethodSlice.actions
export default paymentMethodSlice.reducer