feat(refill): map refill state in cartStore, clarify free loyalty 5% discount UX, and render Refill badges across full app and admin

This commit is contained in:
parsa aghaei committed 2026-07-27 11:39:23 +03:30
1 parent 24c361c4ff
commit b5650c4cbb
7 files changed
+92 -11

No files matched your search

@@ -128,6 +128,8 @@ export const useCartStore = create<CartStore>()(
total: Number(backendOrder.totalAmount),
charityDonation: Number(backendOrder.charityDonation),
status: backendOrder.status as any,
isRefill: (backendOrder as any).isRefill !== undefined ? Boolean((backendOrder as any).isRefill) : Boolean(orderData.isRefill || get().isSubscribed),
paymentMethod: (backendOrder as any).paymentMethod || orderData.paymentMethod,
trackingNumber: backendOrder.trackingNumber || `CN-${Math.floor(Math.random() * 90000) + 10000}`
};
@@ -151,6 +153,8 @@ export const useCartStore = create<CartStore>()(
total: Number(bo.totalAmount),
charityDonation: Number(bo.charityDonation),
status: bo.status,
isRefill: Boolean((bo as any).isRefill),
paymentMethod: (bo as any).paymentMethod,
petId: bo.petId || bo.pet?.id,
shippingAddress: bo.shippingAddress,
trackingNumber: bo.trackingNumber || `CN-${Math.floor(Math.random() * 90000) + 10000}`