I accidentally created a separate CartItem interface inside cartStore.ts instead of using the existing cart types architecture.
Currently:
types/order.ts contains a CartItem interface.
cartStore.ts contains another local CartItem interface:
interface CartItem {
item: MenuItem;
quantity: number;
}
This creates duplicate sources of truth.
Task 🔢 :
- Review both
CartItem definitions.
- Decide whether the existing
types/order.ts CartItem should be extended or the store structure should be updated.
- Refactor
cartStore.ts to use shared types from types/order.ts.
- Remove the duplicate local
CartItem interface.
Note : Current cart, checkout, and payment flows depend on the existing store structure, so this should be done carefully to avoid breaking those pages.
I accidentally created a separate
CartIteminterface insidecartStore.tsinstead of using the existing cart types architecture.Currently:
types/order.tscontains aCartIteminterface.cartStore.tscontains another localCartIteminterface:interface CartItem {
item: MenuItem;
quantity: number;
}
This creates duplicate sources of truth.
Task 🔢 :
CartItemdefinitions.types/order.tsCartItemshould be extended or the store structure should be updated.cartStore.tsto use shared types fromtypes/order.ts.CartIteminterface.Note : Current cart, checkout, and payment flows depend on the existing store structure, so this should be done carefully to avoid breaking those pages.