gift: update UI and voucher & items BS

This commit is contained in:
2025-12-30 11:09:52 +03:00
parent f3b8bdba63
commit 3ed5c4d5d6
17 changed files with 434 additions and 10 deletions

View File

@@ -33,6 +33,7 @@ export interface GiftDetailsType {
senderPhone: string;
senderEmail: string;
isSecret: boolean;
cardId: string;
}
interface DiscountData {
@@ -75,7 +76,9 @@ interface CartState {
hiddenServices: number;
visibleServices: number;
fee: number;
}
giftType: string;
}
// localStorage keys
export const CART_STORAGE_KEYS = {
@@ -108,6 +111,7 @@ export const CART_STORAGE_KEYS = {
TOTAL_SERVICES: "fascano_total_services",
HIDDEN_SERVICES: "fascano_hidden_services",
VISIBLE_SERVICES: "fascano_visible_services",
GIFT_TYPE: "fascano_gift_type",
} as const;
// Utility functions for localStorage
@@ -200,6 +204,7 @@ const initialState: CartState = {
hiddenServices: 0,
visibleServices: 0,
fee: 0,
giftType: getFromLocalStorage(CART_STORAGE_KEYS.GIFT_TYPE, ""),
};
const orderSlice = createSlice({
@@ -681,6 +686,9 @@ const orderSlice = createSlice({
updateCustomerName(state, action: PayloadAction<string>) {
state.customerName = action.payload;
},
updateGiftType(state, action: PayloadAction<string>) {
state.giftType = action.payload;
},
},
});
@@ -720,6 +728,7 @@ export const {
updateOrder,
updateSplitBillAmount,
updateCustomerName,
updateGiftType,
} = orderSlice.actions;
// Tax calculation helper functions