feat: complete phase 2 mock removal and db seed
This commit is contained in:
1 parent
40d6393b16
commit
eff6c00a9c
23 files changed
+7209
-53
No files matched your search
@@ -317,7 +317,7 @@ export default function CheckoutPage({ onBack, onComplete }: { onBack: () => voi
|
||||
const code = (e.currentTarget.elements.namedItem('coupon') as HTMLInputElement).value;
|
||||
const success = await useCartStore.getState().applyCoupon(code);
|
||||
if (success) {
|
||||
toast.success("تبریگ! کد تخفیف با موفقیت اعمال شد.");
|
||||
toast.success("تبریک! کد تخفیف با موفقیت اعمال شد.");
|
||||
} else {
|
||||
toast.error("کد تخفیف معتبر نیست.");
|
||||
}
|
||||
|
||||
@@ -59,35 +59,8 @@ interface PetStore {
|
||||
export const usePetStore = create<PetStore>()(
|
||||
persist(
|
||||
(set, get) => ({
|
||||
pets: [
|
||||
{
|
||||
id: "lucy",
|
||||
name: "لوسی",
|
||||
type: "سگ",
|
||||
breed: "گلدن رتریور",
|
||||
age: 3,
|
||||
weight: 28,
|
||||
activityLevel: "زیاد",
|
||||
medicalConditions: ["حساسیت فصلی"],
|
||||
reminders: [],
|
||||
logs: [],
|
||||
consumptions: []
|
||||
},
|
||||
{
|
||||
id: "rocky",
|
||||
name: "رکی",
|
||||
type: "سگ",
|
||||
breed: "ژرمن شپرد",
|
||||
age: 5,
|
||||
weight: 35,
|
||||
activityLevel: "متوسط",
|
||||
medicalConditions: ["دیسپلازی لگن"],
|
||||
reminders: [],
|
||||
logs: [],
|
||||
consumptions: []
|
||||
}
|
||||
],
|
||||
activePetId: "lucy",
|
||||
pets: [],
|
||||
activePetId: null,
|
||||
addPet: async (pet) => {
|
||||
const { useUserStore } = await import("./userStore");
|
||||
const isLoggedIn = useUserStore.getState().isLoggedIn;
|
||||
|
||||
+8
-23
@@ -62,29 +62,14 @@ export const useUserStore = create<UserStore>()(
|
||||
role: "User_Guest",
|
||||
isLoggedIn: false,
|
||||
profile: {
|
||||
firstName: "پارسا",
|
||||
lastName: "آقایی",
|
||||
email: "parsa.aghaee@gmail.com",
|
||||
mobile: "09121234567",
|
||||
walletBalance: 2450000,
|
||||
charityDonationTotal: 45000,
|
||||
addresses: [
|
||||
{
|
||||
id: "1",
|
||||
title: "منزل اصلی",
|
||||
receptorName: "پارسا آقایی",
|
||||
phone: "09121234567",
|
||||
province: "تهران",
|
||||
city: "تهران",
|
||||
detail: "سعادتآباد، خیابان سرو غربی، کوچه هفتم، پلاک ۴",
|
||||
zipCode: "1998765432",
|
||||
isDefault: true
|
||||
}
|
||||
],
|
||||
transactions: [
|
||||
{ id: "TRX-101", type: "top_up", amount: 1000000, date: new Date(Date.now() - 86400000 * 2).toISOString(), status: "success" },
|
||||
{ id: "TRX-102", type: "purchase", amount: -550000, date: new Date(Date.now() - 86400000).toISOString(), status: "success" },
|
||||
],
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
email: "",
|
||||
mobile: "",
|
||||
walletBalance: 0,
|
||||
charityDonationTotal: 0,
|
||||
addresses: [],
|
||||
transactions: [],
|
||||
},
|
||||
setRole: (role) => set({ role }),
|
||||
setLoggedIn: (isLoggedIn) => set({ isLoggedIn }),
|
||||
|
||||
Reference in new issue
Block a user