@mohasinac/appkit 4.41.17 → 4.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +2 -30
- package/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.js +1 -1
- package/dist/_internal/server/features/checkout/actions.d.ts +16 -14
- package/dist/_internal/server/features/checkout/actions.js +145 -97
- package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +1 -1
- package/dist/_internal/server/features/checkout/index.d.ts +1 -1
- package/dist/_internal/server/features/checkout/index.js +1 -1
- package/dist/_internal/server/features/checkout/locked-lines.js +1 -1
- package/dist/_internal/server/features/checkout/source-context.js +2 -2
- package/dist/_internal/server/features/maintenance/analyze.js +1 -1
- package/dist/_internal/server/features/refunds/actions.d.ts +4 -4
- package/dist/_internal/server/features/refunds/actions.js +9 -8
- package/dist/_internal/server/functions/scheduled.d.ts +1 -2
- package/dist/_internal/server/functions/scheduled.js +1 -9
- package/dist/_internal/server/jobs/core/index.d.ts +0 -1
- package/dist/_internal/server/jobs/core/index.js +0 -1
- package/dist/_internal/server/jobs/handlers/index.d.ts +0 -1
- package/dist/_internal/server/jobs/handlers/index.js +0 -1
- package/dist/_internal/shared/actions/action-registry.js +2 -2
- package/dist/_internal/shared/checkout/order-math.d.ts +1 -1
- package/dist/_internal/shared/checkout/order-math.js +1 -1
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +2 -2
- package/dist/_internal/shared/features/blog/schema.d.ts +4 -4
- package/dist/_internal/shared/features/cart/schema.d.ts +6 -6
- package/dist/_internal/shared/features/orders/refund-copy.d.ts +1 -1
- package/dist/_internal/shared/features/orders/refund-copy.js +1 -1
- package/dist/_internal/shared/features/orders/schema.d.ts +5 -5
- package/dist/_internal/shared/features/orders/schema.js +1 -1
- package/dist/_internal/shared/features/products/schema.d.ts +2 -2
- package/dist/_internal/shared/features/promotions/schema.d.ts +4 -4
- package/dist/_internal/shared/features/reviews/schema.d.ts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/configs/next.js +2 -2
- package/dist/constants/field-names.d.ts +1 -1
- package/dist/constants/field-names.js +1 -1
- package/dist/contracts/index.d.ts +0 -2
- package/dist/contracts/index.js +0 -1
- package/dist/contracts/payment.d.ts +13 -2
- package/dist/contracts/payment.js +2 -2
- package/dist/core/integration-keys.d.ts +7 -3
- package/dist/core/integration-keys.js +13 -7
- package/dist/core/money.d.ts +11 -0
- package/dist/core/money.js +15 -0
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/messages.d.ts +1 -0
- package/dist/errors/messages.js +1 -0
- package/dist/errors/{razorpay-unreachable.d.ts → payment-provider-unreachable.d.ts} +1 -1
- package/dist/errors/{razorpay-unreachable.js → payment-provider-unreachable.js} +1 -1
- package/dist/features/addresses/schemas/address-form.d.ts +20 -20
- package/dist/features/addresses/schemas/index.d.ts +2 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +32 -16
- package/dist/features/admin/constants/site-settings-tabs.d.ts +1 -1
- package/dist/features/admin/schemas/admin-ops-forms.d.ts +10 -10
- package/dist/features/admin/schemas/admin-user-form.d.ts +2 -2
- package/dist/features/admin/schemas/firestore.d.ts +17 -8
- package/dist/features/admin/schemas/firestore.js +1 -1
- package/dist/features/admin/schemas/nav-item-form.d.ts +2 -2
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/auth/schemas/index.d.ts +2 -2
- package/dist/features/before-after/schemas/index.d.ts +2 -2
- package/dist/features/blog/actions/blog-actions.d.ts +4 -4
- package/dist/features/blog/schemas/blog-form.d.ts +2 -2
- package/dist/features/blog/schemas/index.d.ts +4 -4
- package/dist/features/cart/schemas/index.d.ts +3 -3
- package/dist/features/catalogue/schemas/validation.d.ts +4 -4
- package/dist/features/categories/schemas/index.d.ts +2 -2
- package/dist/features/checkout/index.d.ts +0 -4
- package/dist/features/checkout/index.js +0 -3
- package/dist/features/checkout/types/index.d.ts +0 -25
- package/dist/features/checkout/types/index.js +1 -2
- package/dist/features/collections/schemas/index.d.ts +2 -2
- package/dist/features/consultation/schemas/index.d.ts +4 -4
- package/dist/features/corporate/schemas/index.d.ts +2 -2
- package/dist/features/events/schemas/index.d.ts +4 -4
- package/dist/features/grouped/schemas/index.d.ts +2 -2
- package/dist/features/homepage/schemas/index.d.ts +2 -2
- package/dist/features/layout/AppLayoutShell.js +2 -2
- package/dist/features/layout/BottomNavLayout.d.ts +9 -3
- package/dist/features/layout/BottomNavLayout.js +9 -3
- package/dist/features/lottery/schemas/zod.d.ts +4 -4
- package/dist/features/loyalty/schemas/index.d.ts +6 -6
- package/dist/features/orders/components/OrderPaymentSummary.d.ts +1 -1
- package/dist/features/orders/components/OrderPaymentSummary.js +5 -5
- package/dist/features/orders/components/RefundHistoryTable.js +1 -1
- package/dist/features/orders/repository/orders.repository.d.ts +10 -1
- package/dist/features/orders/repository/orders.repository.js +17 -1
- package/dist/features/orders/schemas/firestore.d.ts +11 -12
- package/dist/features/orders/schemas/firestore.js +0 -1
- package/dist/features/orders/schemas/index.d.ts +48 -48
- package/dist/features/orders/schemas/index.js +1 -1
- package/dist/features/orders/types/index.d.ts +1 -3
- package/dist/features/orders/types/index.js +1 -2
- package/dist/features/payments/manifest.js +1 -1
- package/dist/features/payments/repository/payout.repository.d.ts +1 -4
- package/dist/features/payments/repository/payout.repository.js +0 -29
- package/dist/features/payments/schemas/firestore.d.ts +8 -15
- package/dist/features/payments/schemas/firestore.js +7 -5
- package/dist/features/payments/schemas/index.d.ts +52 -125
- package/dist/features/payments/schemas/index.js +0 -58
- package/dist/features/payments/types/index.d.ts +2 -4
- package/dist/features/payments/types/index.js +1 -2
- package/dist/features/products/schemas/index.d.ts +14 -14
- package/dist/features/products/schemas/product-features.validators.d.ts +10 -10
- package/dist/features/promotions/schemas/index.d.ts +20 -20
- package/dist/features/reviews/schemas/index.d.ts +8 -8
- package/dist/features/scams/schemas/index.d.ts +10 -10
- package/dist/features/search/action-index/settings-entries.js +4 -4
- package/dist/features/seller/schemas/index.d.ts +12 -12
- package/dist/features/seller/schemas/order-forms.d.ts +4 -4
- package/dist/features/shipments/schemas/validation.d.ts +28 -28
- package/dist/features/store-extensions/schemas/payout-method-form.d.ts +50 -50
- package/dist/features/store-extensions/schemas/report-create-form.d.ts +2 -2
- package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +10 -10
- package/dist/features/support/schemas/index.d.ts +14 -14
- package/dist/features/tester/actions/checklist-item-actions.d.ts +4 -4
- package/dist/features/tester/schemas/checklist-item-form.d.ts +2 -2
- package/dist/features/tester/seed-data/_money-flows.js +145 -0
- package/dist/features/tester/seed-data/authored/admin__site-system.js +38 -0
- package/dist/features/tester/seed-data/authored/buying__buying-checkout.js +10 -10
- package/dist/features/tester/seed-data/authored/buying__offers.js +11 -10
- package/dist/features/tester/seed-data/authored/buying__user-dashboard-navigation.js +6 -5
- package/dist/features/tester/seed-data/authored/cta-layout__checkout-bottom-bar.js +1 -1
- package/dist/features/tester/seed-data/authored/design-ux__hand-mode-layout.js +3 -3
- package/dist/features/tester/seed-data/authored/selling__store-dashboard-navigation.js +6 -5
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +27 -15
- package/dist/features/wishlist/schemas/index.d.ts +2 -2
- package/dist/index.d.ts +6 -28
- package/dist/index.js +8 -51
- package/dist/jobs.d.ts +1 -1
- package/dist/jobs.js +1 -1
- package/dist/providers/payment-phonepe/index.d.ts +117 -0
- package/dist/providers/payment-phonepe/index.js +221 -0
- package/dist/providers.d.ts +3 -2
- package/dist/providers.js +3 -2
- package/dist/schemas/registry.d.ts +163 -2623
- package/dist/schemas/registry.js +1 -6
- package/dist/seed/faq-seed-data.js +5 -5
- package/dist/seed/payouts-seed-data.js +3 -3
- package/dist/seed/site-settings-seed-data.js +7 -4
- package/dist/server-entry.d.ts +1 -2
- package/dist/server-entry.js +1 -3
- package/dist/server.d.ts +3 -9
- package/dist/server.js +5 -23
- package/dist/validation/schemas.d.ts +2 -2
- package/package.json +5 -4
- package/dist/_internal/server/features/payments/actions.d.ts +0 -30
- package/dist/_internal/server/features/payments/actions.js +0 -45
- package/dist/_internal/server/features/payments/data.d.ts +0 -13
- package/dist/_internal/server/features/payments/data.js +0 -20
- package/dist/_internal/server/features/payments/index.d.ts +0 -3
- package/dist/_internal/server/features/payments/index.js +0 -3
- package/dist/_internal/server/jobs/core/payoutBatch.d.ts +0 -2
- package/dist/_internal/server/jobs/core/payoutBatch.js +0 -120
- package/dist/_internal/server/jobs/handlers/payoutBatch.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/payoutBatch.js +0 -2
- package/dist/_internal/shared/features/payments/config.d.ts +0 -3
- package/dist/_internal/shared/features/payments/config.js +0 -3
- package/dist/contracts/client-payment-gateway.d.ts +0 -64
- package/dist/contracts/client-payment-gateway.js +0 -25
- package/dist/features/checkout/hooks/useCheckout.d.ts +0 -9
- package/dist/features/checkout/hooks/useCheckout.js +0 -24
- package/dist/features/checkout/hooks/useCheckoutApi.d.ts +0 -72
- package/dist/features/checkout/hooks/useCheckoutApi.js +0 -47
- package/dist/features/checkout/hooks/usePaymentCheckout.d.ts +0 -77
- package/dist/features/checkout/hooks/usePaymentCheckout.js +0 -192
- package/dist/providers/payment-razorpay/index.d.ts +0 -115
- package/dist/providers/payment-razorpay/index.js +0 -208
- package/dist/schemas/webhooks/razorpay.d.ts +0 -2634
- package/dist/schemas/webhooks/razorpay.js +0 -104
|
@@ -452,7 +452,7 @@ export declare const categoryFirestoreSchema: z.ZodObject<{
|
|
|
452
452
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
453
453
|
featuredPriority?: number | undefined;
|
|
454
454
|
isBrand?: boolean | undefined;
|
|
455
|
-
createdByType?: "
|
|
455
|
+
createdByType?: "store" | "admin" | undefined;
|
|
456
456
|
createdByStoreId?: string | undefined;
|
|
457
457
|
itemCode?: string | undefined;
|
|
458
458
|
brandWebsite?: string | undefined;
|
|
@@ -551,7 +551,7 @@ export declare const categoryFirestoreSchema: z.ZodObject<{
|
|
|
551
551
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
552
552
|
featuredPriority?: number | undefined;
|
|
553
553
|
isBrand?: boolean | undefined;
|
|
554
|
-
createdByType?: "
|
|
554
|
+
createdByType?: "store" | "admin" | undefined;
|
|
555
555
|
createdByStoreId?: string | undefined;
|
|
556
556
|
itemCode?: string | undefined;
|
|
557
557
|
brandWebsite?: string | undefined;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
2
|
export * from "./schemas";
|
|
3
|
-
export * from "./hooks/useCheckout";
|
|
4
|
-
export { useCheckout as useCheckoutApi } from "./hooks/useCheckoutApi";
|
|
5
|
-
export type { AddressListResponse, CartApiResponse, PlaceOrderResponse, CreatePaymentOrderResponse, UnavailableItem, PreflightResponse, } from "./hooks/useCheckoutApi";
|
|
6
|
-
export * from "./hooks/usePaymentCheckout";
|
|
7
3
|
export * from "./components";
|
|
8
4
|
export { manifest } from "./manifest";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
2
|
export * from "./schemas";
|
|
3
|
-
export * from "./hooks/useCheckout";
|
|
4
|
-
export { useCheckout as useCheckoutApi } from "./hooks/useCheckoutApi";
|
|
5
|
-
export * from "./hooks/usePaymentCheckout";
|
|
6
3
|
export * from "./components";
|
|
7
4
|
export { manifest } from "./manifest";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type PaymentGateway, PaymentGatewayValues } from "../../payments/schemas";
|
|
2
|
-
export { type PaymentGateway, PaymentGatewayValues };
|
|
3
1
|
export interface UserAddress {
|
|
4
2
|
id: string;
|
|
5
3
|
label?: string;
|
|
@@ -21,26 +19,3 @@ export interface ShippingOption {
|
|
|
21
19
|
currency?: string;
|
|
22
20
|
estimatedDays?: number;
|
|
23
21
|
}
|
|
24
|
-
export interface CheckoutState {
|
|
25
|
-
step: CheckoutStep;
|
|
26
|
-
address?: UserAddress;
|
|
27
|
-
shippingOption?: ShippingOption;
|
|
28
|
-
paymentGateway?: PaymentGateway;
|
|
29
|
-
couponCode?: string;
|
|
30
|
-
notes?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface CheckoutSummary {
|
|
33
|
-
subtotal: number;
|
|
34
|
-
shippingCost: number;
|
|
35
|
-
discount?: number;
|
|
36
|
-
tax?: number;
|
|
37
|
-
total: number;
|
|
38
|
-
currency: string;
|
|
39
|
-
}
|
|
40
|
-
export interface PlaceOrderInput {
|
|
41
|
-
address: UserAddress;
|
|
42
|
-
shippingOptionId: string;
|
|
43
|
-
paymentGateway: PaymentGateway;
|
|
44
|
-
couponCode?: string;
|
|
45
|
-
notes?: string;
|
|
46
|
-
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { PaymentGatewayValues };
|
|
1
|
+
export {};
|
|
@@ -25,9 +25,9 @@ export declare const collectionItemSchema: z.ZodObject<{
|
|
|
25
25
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
26
26
|
}, "strip", z.ZodTypeAny, {
|
|
27
27
|
title: string;
|
|
28
|
-
sortOrder: number;
|
|
29
28
|
slug: string;
|
|
30
29
|
active: boolean;
|
|
30
|
+
sortOrder: number;
|
|
31
31
|
image?: string | undefined;
|
|
32
32
|
createdAt?: string | undefined;
|
|
33
33
|
brandSlug?: string | undefined;
|
|
@@ -42,12 +42,12 @@ export declare const collectionItemSchema: z.ZodObject<{
|
|
|
42
42
|
slug: string;
|
|
43
43
|
image?: string | undefined;
|
|
44
44
|
createdAt?: string | undefined;
|
|
45
|
-
sortOrder?: number | undefined;
|
|
46
45
|
brandSlug?: string | undefined;
|
|
47
46
|
productCount?: number | undefined;
|
|
48
47
|
active?: boolean | undefined;
|
|
49
48
|
description?: string | undefined;
|
|
50
49
|
subtitle?: string | undefined;
|
|
50
|
+
sortOrder?: number | undefined;
|
|
51
51
|
bannerImage?: string | undefined;
|
|
52
52
|
franchiseSlug?: string | undefined;
|
|
53
53
|
manualProductIds?: string[] | undefined;
|
|
@@ -26,16 +26,16 @@ export declare const consultationBookingSchema: z.ZodObject<{
|
|
|
26
26
|
adminNote: z.ZodOptional<z.ZodString>;
|
|
27
27
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
status: "pending" | "
|
|
29
|
+
status: "pending" | "confirmed" | "completed" | "cancelled" | "no_show";
|
|
30
30
|
id: string;
|
|
31
31
|
email: string;
|
|
32
32
|
name: string;
|
|
33
33
|
message?: string | undefined;
|
|
34
34
|
createdAt?: string | undefined;
|
|
35
|
-
adminNote?: string | undefined;
|
|
36
35
|
userId?: string | undefined;
|
|
37
36
|
phone?: string | undefined;
|
|
38
37
|
mode?: "phone" | "online" | "in_person" | undefined;
|
|
38
|
+
adminNote?: string | undefined;
|
|
39
39
|
concern?: string[] | undefined;
|
|
40
40
|
preferredDate?: string | undefined;
|
|
41
41
|
preferredTime?: string | undefined;
|
|
@@ -44,12 +44,12 @@ export declare const consultationBookingSchema: z.ZodObject<{
|
|
|
44
44
|
email: string;
|
|
45
45
|
name: string;
|
|
46
46
|
message?: string | undefined;
|
|
47
|
-
status?: "pending" | "
|
|
47
|
+
status?: "pending" | "confirmed" | "completed" | "cancelled" | "no_show" | undefined;
|
|
48
48
|
createdAt?: string | undefined;
|
|
49
|
-
adminNote?: string | undefined;
|
|
50
49
|
userId?: string | undefined;
|
|
51
50
|
phone?: string | undefined;
|
|
52
51
|
mode?: "phone" | "online" | "in_person" | undefined;
|
|
52
|
+
adminNote?: string | undefined;
|
|
53
53
|
concern?: string[] | undefined;
|
|
54
54
|
preferredDate?: string | undefined;
|
|
55
55
|
preferredTime?: string | undefined;
|
|
@@ -33,8 +33,8 @@ export declare const corporateInquirySchema: z.ZodObject<{
|
|
|
33
33
|
contactPerson: string;
|
|
34
34
|
customBranding: boolean;
|
|
35
35
|
createdAt?: string | undefined;
|
|
36
|
-
adminNote?: string | undefined;
|
|
37
36
|
phone?: string | undefined;
|
|
37
|
+
adminNote?: string | undefined;
|
|
38
38
|
designation?: string | undefined;
|
|
39
39
|
units?: number | undefined;
|
|
40
40
|
budgetPerUnit?: number | undefined;
|
|
@@ -47,8 +47,8 @@ export declare const corporateInquirySchema: z.ZodObject<{
|
|
|
47
47
|
contactPerson: string;
|
|
48
48
|
status?: "pending" | "contacted" | "proposal_sent" | "negotiating" | "closed_won" | "closed_lost" | undefined;
|
|
49
49
|
createdAt?: string | undefined;
|
|
50
|
-
adminNote?: string | undefined;
|
|
51
50
|
phone?: string | undefined;
|
|
51
|
+
adminNote?: string | undefined;
|
|
52
52
|
designation?: string | undefined;
|
|
53
53
|
units?: number | undefined;
|
|
54
54
|
budgetPerUnit?: number | undefined;
|
|
@@ -938,7 +938,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
938
938
|
updatedAt: z.ZodString;
|
|
939
939
|
}, "strip", z.ZodTypeAny, {
|
|
940
940
|
type: "lottery" | "sale" | "offer" | "poll" | "survey" | "feedback" | "raffle" | "spin_wheel";
|
|
941
|
-
status: "ended" | "
|
|
941
|
+
status: "ended" | "active" | "draft" | "cancelled" | "paused";
|
|
942
942
|
id: string;
|
|
943
943
|
title: string;
|
|
944
944
|
createdAt: string;
|
|
@@ -1093,7 +1093,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
1093
1093
|
rafflePrizeProductIds?: string[] | undefined;
|
|
1094
1094
|
}, {
|
|
1095
1095
|
type: "lottery" | "sale" | "offer" | "poll" | "survey" | "feedback" | "raffle" | "spin_wheel";
|
|
1096
|
-
status: "ended" | "
|
|
1096
|
+
status: "ended" | "active" | "draft" | "cancelled" | "paused";
|
|
1097
1097
|
id: string;
|
|
1098
1098
|
title: string;
|
|
1099
1099
|
createdAt: string;
|
|
@@ -1255,14 +1255,14 @@ export declare const eventListParamsSchema: z.ZodObject<{
|
|
|
1255
1255
|
}, "strip", z.ZodTypeAny, {
|
|
1256
1256
|
type?: "lottery" | "sale" | "offer" | "poll" | "survey" | "feedback" | "raffle" | "spin_wheel" | undefined;
|
|
1257
1257
|
sort?: string | undefined;
|
|
1258
|
-
status?: "ended" | "
|
|
1258
|
+
status?: "ended" | "active" | "draft" | "cancelled" | "paused" | undefined;
|
|
1259
1259
|
page?: number | undefined;
|
|
1260
1260
|
q?: string | undefined;
|
|
1261
1261
|
perPage?: number | undefined;
|
|
1262
1262
|
}, {
|
|
1263
1263
|
type?: "lottery" | "sale" | "offer" | "poll" | "survey" | "feedback" | "raffle" | "spin_wheel" | undefined;
|
|
1264
1264
|
sort?: string | undefined;
|
|
1265
|
-
status?: "ended" | "
|
|
1265
|
+
status?: "ended" | "active" | "draft" | "cancelled" | "paused" | undefined;
|
|
1266
1266
|
page?: number | undefined;
|
|
1267
1267
|
q?: string | undefined;
|
|
1268
1268
|
perPage?: number | undefined;
|
|
@@ -51,9 +51,9 @@ export declare const groupedListingFirestoreSchema: z.ZodObject<{
|
|
|
51
51
|
visibilityStatus: "hidden" | "visible";
|
|
52
52
|
minActiveMembers: number;
|
|
53
53
|
activeMemberCount: number;
|
|
54
|
-
storeId?: string | undefined;
|
|
55
54
|
categorySlug?: string | undefined;
|
|
56
55
|
brandSlug?: string | undefined;
|
|
56
|
+
storeId?: string | undefined;
|
|
57
57
|
description?: string | undefined;
|
|
58
58
|
coverImage?: string | undefined;
|
|
59
59
|
}, {
|
|
@@ -74,9 +74,9 @@ export declare const groupedListingFirestoreSchema: z.ZodObject<{
|
|
|
74
74
|
visibilityStatus: "hidden" | "visible";
|
|
75
75
|
minActiveMembers: number;
|
|
76
76
|
activeMemberCount: number;
|
|
77
|
-
storeId?: string | undefined;
|
|
78
77
|
categorySlug?: string | undefined;
|
|
79
78
|
brandSlug?: string | undefined;
|
|
79
|
+
storeId?: string | undefined;
|
|
80
80
|
description?: string | undefined;
|
|
81
81
|
coverImage?: string | undefined;
|
|
82
82
|
}>;
|
|
@@ -335,7 +335,7 @@ export declare const carouselFirestoreSchema: z.ZodObject<{
|
|
|
335
335
|
slideIds: z.ZodArray<z.ZodString, "many">;
|
|
336
336
|
createdBy: z.ZodString;
|
|
337
337
|
}, "strip", z.ZodTypeAny, {
|
|
338
|
-
status: "
|
|
338
|
+
status: "active" | "draft";
|
|
339
339
|
id: string;
|
|
340
340
|
name: string;
|
|
341
341
|
createdAt: string | Date | z.objectOutputType<{
|
|
@@ -347,7 +347,7 @@ export declare const carouselFirestoreSchema: z.ZodObject<{
|
|
|
347
347
|
createdBy: string;
|
|
348
348
|
slideIds: string[];
|
|
349
349
|
}, {
|
|
350
|
-
status: "
|
|
350
|
+
status: "active" | "draft";
|
|
351
351
|
id: string;
|
|
352
352
|
name: string;
|
|
353
353
|
createdAt: string | Date | z.objectInputType<{
|
|
@@ -139,7 +139,7 @@ export function AppLayoutShell({ children, navItems, sidebarItems = [], sidebarS
|
|
|
139
139
|
const pathname = usePathname();
|
|
140
140
|
useEffect(() => { setSidebarOpen(false); }, [pathname]);
|
|
141
141
|
const { theme, toggleTheme, activeTheme } = useTheme();
|
|
142
|
-
const { closeNav: closeDashboardNav
|
|
142
|
+
const { closeNav: closeDashboardNav } = useDashboardNav();
|
|
143
143
|
const { user: authUser } = useAuth();
|
|
144
144
|
const headerRef = useRef(null);
|
|
145
145
|
useEffect(() => {
|
|
@@ -200,5 +200,5 @@ export function AppLayoutShell({ children, navItems, sidebarItems = [], sidebarS
|
|
|
200
200
|
// main-to-footer — it never clears the bottom of the page, which is
|
|
201
201
|
// what the fixed nav + tier actually overlap. That reservation now
|
|
202
202
|
// lives on the footer's own padding-bottom.
|
|
203
|
-
className: "w-full flex-1 flex flex-col", children: _jsx(Div, { padding: "y-lg", className: `flex-1 ${contentClassName ?? "mx-auto w-full max-w-screen-xl px-[var(--appkit-space-5)] md:px-[var(--appkit-space-6)] lg:px-[var(--appkit-space-8)]"}`, children: children }) })] }), _jsx(BackToTop, {}), _jsx(FooterLayout, { ...footer }), _jsx(BottomChrome, { children: _jsx(BottomActions, {}) }), showBottomNav && (_jsx(BottomNavbar, { user: user, userId: userId, homeHref: homeHref, shopHref: shopHref, cartHref: cartHref, wishlistHref: wishlistHref, profileHref: profileHref, loginHref: loginHref, onSearchToggle: () => setSearchOpen((prev) => !prev), navItems: navItems, onMoreToggle:
|
|
203
|
+
className: "w-full flex-1 flex flex-col", children: _jsx(Div, { padding: "y-lg", className: `flex-1 ${contentClassName ?? "mx-auto w-full max-w-screen-xl px-[var(--appkit-space-5)] md:px-[var(--appkit-space-6)] lg:px-[var(--appkit-space-8)]"}`, children: children }) })] }), _jsx(BackToTop, {}), _jsx(FooterLayout, { ...footer }), _jsx(BottomChrome, { children: _jsx(BottomActions, {}) }), showBottomNav && (_jsx(BottomNavbar, { user: user, userId: userId, homeHref: homeHref, shopHref: shopHref, cartHref: cartHref, wishlistHref: wishlistHref, profileHref: profileHref, loginHref: loginHref, onSearchToggle: () => setSearchOpen((prev) => !prev), navItems: navItems, onMoreToggle: handleTogglePublicSidebar })), _jsx(UnsavedChangesModal, {})] }) }));
|
|
204
204
|
}
|
|
@@ -18,8 +18,14 @@ export interface BottomNavLayoutProps {
|
|
|
18
18
|
*
|
|
19
19
|
* Hand mode: the item strip carries `appkit-hand-mirror`, so slot order
|
|
20
20
|
* reverses in left-hand mode (CSS-only via `[data-hand]` — applies on the
|
|
21
|
-
* first paint, no flash).
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* first paint, no flash).
|
|
22
|
+
*
|
|
23
|
+
* `BottomNavbar` (`./BottomNavbar.tsx`) is the sole consumer, and it renders
|
|
24
|
+
* unconditionally on every route including admin/store/user dashboards —
|
|
25
|
+
* there is deliberately no second, dashboard-specific bottom bar (removed
|
|
26
|
+
* 2026-09-28; dashboard section navigation lives on the header hamburger
|
|
27
|
+
* instead, via `DashboardNavContext`). Never add a second component that
|
|
28
|
+
* mounts through this shell — exactly one bottom nav may exist per route,
|
|
29
|
+
* since this is the sole publisher of `--bottom-nav-height`.
|
|
24
30
|
*/
|
|
25
31
|
export declare function BottomNavLayout({ ariaLabel, children, id, className, }: BottomNavLayoutProps): React.JSX.Element;
|
|
@@ -16,9 +16,15 @@ import { useVisualViewportInset } from "../../react/hooks/useVisualViewportInset
|
|
|
16
16
|
*
|
|
17
17
|
* Hand mode: the item strip carries `appkit-hand-mirror`, so slot order
|
|
18
18
|
* reverses in left-hand mode (CSS-only via `[data-hand]` — applies on the
|
|
19
|
-
* first paint, no flash).
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* first paint, no flash).
|
|
20
|
+
*
|
|
21
|
+
* `BottomNavbar` (`./BottomNavbar.tsx`) is the sole consumer, and it renders
|
|
22
|
+
* unconditionally on every route including admin/store/user dashboards —
|
|
23
|
+
* there is deliberately no second, dashboard-specific bottom bar (removed
|
|
24
|
+
* 2026-09-28; dashboard section navigation lives on the header hamburger
|
|
25
|
+
* instead, via `DashboardNavContext`). Never add a second component that
|
|
26
|
+
* mounts through this shell — exactly one bottom nav may exist per route,
|
|
27
|
+
* since this is the sole publisher of `--bottom-nav-height`.
|
|
22
28
|
*/
|
|
23
29
|
export function BottomNavLayout({ ariaLabel, children, id = "bottom-navbar", className, }) {
|
|
24
30
|
const isKeyboardOpen = useVisualViewportInset();
|
|
@@ -66,8 +66,8 @@ export declare const submitLotteryPullSchema: z.ZodEffects<z.ZodObject<{
|
|
|
66
66
|
purchasedItemNumber: z.ZodNumber;
|
|
67
67
|
userPhone: z.ZodString;
|
|
68
68
|
}, "strip", z.ZodTypeAny, {
|
|
69
|
-
transactionId: string;
|
|
70
69
|
userId: string;
|
|
70
|
+
transactionId: string;
|
|
71
71
|
userPhone: string;
|
|
72
72
|
sourceType: "event" | "product";
|
|
73
73
|
paymentTime: string;
|
|
@@ -77,8 +77,8 @@ export declare const submitLotteryPullSchema: z.ZodEffects<z.ZodObject<{
|
|
|
77
77
|
eventId?: string | undefined;
|
|
78
78
|
userDisplayName?: string | undefined;
|
|
79
79
|
}, {
|
|
80
|
-
transactionId: string;
|
|
81
80
|
userId: string;
|
|
81
|
+
transactionId: string;
|
|
82
82
|
userPhone: string;
|
|
83
83
|
sourceType: "event" | "product";
|
|
84
84
|
paymentTime: string;
|
|
@@ -88,8 +88,8 @@ export declare const submitLotteryPullSchema: z.ZodEffects<z.ZodObject<{
|
|
|
88
88
|
eventId?: string | undefined;
|
|
89
89
|
userDisplayName?: string | undefined;
|
|
90
90
|
}>, {
|
|
91
|
-
transactionId: string;
|
|
92
91
|
userId: string;
|
|
92
|
+
transactionId: string;
|
|
93
93
|
userPhone: string;
|
|
94
94
|
sourceType: "event" | "product";
|
|
95
95
|
paymentTime: string;
|
|
@@ -99,8 +99,8 @@ export declare const submitLotteryPullSchema: z.ZodEffects<z.ZodObject<{
|
|
|
99
99
|
eventId?: string | undefined;
|
|
100
100
|
userDisplayName?: string | undefined;
|
|
101
101
|
}, {
|
|
102
|
-
transactionId: string;
|
|
103
102
|
userId: string;
|
|
103
|
+
transactionId: string;
|
|
104
104
|
userPhone: string;
|
|
105
105
|
sourceType: "event" | "product";
|
|
106
106
|
paymentTime: string;
|
|
@@ -11,13 +11,13 @@ export declare const coinHistoryEntrySchema: z.ZodObject<{
|
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
reason: "redemption" | "order_reward" | "referral" | "review_reward" | "manual_credit" | "manual_debit" | "expiry";
|
|
13
13
|
delta: number;
|
|
14
|
-
orderId?: string | undefined;
|
|
15
14
|
timestamp?: string | undefined;
|
|
15
|
+
orderId?: string | undefined;
|
|
16
16
|
}, {
|
|
17
17
|
reason: "redemption" | "order_reward" | "referral" | "review_reward" | "manual_credit" | "manual_debit" | "expiry";
|
|
18
18
|
delta: number;
|
|
19
|
-
orderId?: string | undefined;
|
|
20
19
|
timestamp?: string | undefined;
|
|
20
|
+
orderId?: string | undefined;
|
|
21
21
|
}>;
|
|
22
22
|
/**
|
|
23
23
|
* Base Zod schema for a loyalty balance record.
|
|
@@ -40,13 +40,13 @@ export declare const loyaltyBalanceSchema: z.ZodObject<{
|
|
|
40
40
|
}, "strip", z.ZodTypeAny, {
|
|
41
41
|
reason: "redemption" | "order_reward" | "referral" | "review_reward" | "manual_credit" | "manual_debit" | "expiry";
|
|
42
42
|
delta: number;
|
|
43
|
-
orderId?: string | undefined;
|
|
44
43
|
timestamp?: string | undefined;
|
|
44
|
+
orderId?: string | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
reason: "redemption" | "order_reward" | "referral" | "review_reward" | "manual_credit" | "manual_debit" | "expiry";
|
|
47
47
|
delta: number;
|
|
48
|
-
orderId?: string | undefined;
|
|
49
48
|
timestamp?: string | undefined;
|
|
49
|
+
orderId?: string | undefined;
|
|
50
50
|
}>, "many">>;
|
|
51
51
|
}, "strip", z.ZodTypeAny, {
|
|
52
52
|
uid: string;
|
|
@@ -54,8 +54,8 @@ export declare const loyaltyBalanceSchema: z.ZodObject<{
|
|
|
54
54
|
coinHistory?: {
|
|
55
55
|
reason: "redemption" | "order_reward" | "referral" | "review_reward" | "manual_credit" | "manual_debit" | "expiry";
|
|
56
56
|
delta: number;
|
|
57
|
-
orderId?: string | undefined;
|
|
58
57
|
timestamp?: string | undefined;
|
|
58
|
+
orderId?: string | undefined;
|
|
59
59
|
}[] | undefined;
|
|
60
60
|
}, {
|
|
61
61
|
uid: string;
|
|
@@ -63,8 +63,8 @@ export declare const loyaltyBalanceSchema: z.ZodObject<{
|
|
|
63
63
|
coinHistory?: {
|
|
64
64
|
reason: "redemption" | "order_reward" | "referral" | "review_reward" | "manual_credit" | "manual_debit" | "expiry";
|
|
65
65
|
delta: number;
|
|
66
|
-
orderId?: string | undefined;
|
|
67
66
|
timestamp?: string | undefined;
|
|
67
|
+
orderId?: string | undefined;
|
|
68
68
|
}[] | undefined;
|
|
69
69
|
}>;
|
|
70
70
|
export declare const loyaltyConfigSchema: z.ZodObject<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OrderPaymentSummary — the single place both admin and seller order-detail
|
|
3
3
|
* views render payment info from, regardless of how the buyer paid (manual
|
|
4
|
-
* cash/UPI proof,
|
|
4
|
+
* cash/UPI proof, PhonePe, or COD). Reads `order.paymentRecord` when present;
|
|
5
5
|
* falls back to an adapter over the pre-existing legacy fields
|
|
6
6
|
* (`paymentMethod`/`paymentId`/`paymentProofUrl`/`paymentTransactionId`) for
|
|
7
7
|
* orders placed before Feature C shipped, so old orders keep rendering
|
|
@@ -4,14 +4,14 @@ import { Badge, Div, Heading, Row, Stack, Text } from "../../../ui";
|
|
|
4
4
|
import { formatCurrency } from "../../../utils/number.formatter";
|
|
5
5
|
const METHOD_LABEL = {
|
|
6
6
|
manual: "Manual (Cash / UPI)",
|
|
7
|
-
|
|
7
|
+
phonepe: "PhonePe",
|
|
8
8
|
cod: "Cash on Delivery",
|
|
9
9
|
};
|
|
10
10
|
function legacyFallback(order) {
|
|
11
11
|
if (!order.paymentMethod)
|
|
12
12
|
return null;
|
|
13
|
-
const method = order.paymentMethod === "
|
|
14
|
-
? "
|
|
13
|
+
const method = order.paymentMethod === "online"
|
|
14
|
+
? "phonepe"
|
|
15
15
|
: order.paymentMethod === "cod"
|
|
16
16
|
? "cod"
|
|
17
17
|
: "manual";
|
|
@@ -20,7 +20,7 @@ function legacyFallback(order) {
|
|
|
20
20
|
transactionId: order.paymentTransactionId ?? order.paymentId,
|
|
21
21
|
proofUrl: order.paymentProofUrl,
|
|
22
22
|
amount: order.totalPrice,
|
|
23
|
-
verificationMethod: method === "
|
|
23
|
+
verificationMethod: method === "phonepe" ? "order_status" : method === "cod" ? "cod_collection" : "manual_review",
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
export function OrderPaymentSummary({ order, className = "" }) {
|
|
@@ -28,5 +28,5 @@ export function OrderPaymentSummary({ order, className = "" }) {
|
|
|
28
28
|
if (!record) {
|
|
29
29
|
return (_jsx(Div, { className: className, rounded: "xl", padding: "md", surface: "muted", border: "default", children: _jsx(Text, { size: "sm", color: "muted", children: "No payment information recorded yet." }) }));
|
|
30
30
|
}
|
|
31
|
-
return (_jsxs(Div, { className: className, rounded: "xl", padding: "md", surface: "muted", border: "default", children: [_jsxs(Row, { justify: "between", align: "center", className: "mb-2", children: [_jsx(Heading, { level: 3, size: "sm", weight: "semibold", color: "muted", children: "Payment" }), _jsx(Badge, { variant: order.paymentStatus === "paid" ? "success" : "default", children: order.paymentStatus ?? "pending" })] }), _jsxs(Stack, { gap: "xs", children: [_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Method" }), _jsx(Text, { size: "sm", weight: "medium", children: METHOD_LABEL[record.method] })] }), _jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Amount" }), _jsx(Text, { size: "sm", weight: "medium", children: formatCurrency(record.amount, order.currency ?? "INR") })] }), record.transactionId && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Reference" }), _jsx(Text, { size: "sm", weight: "medium", children: record.transactionId })] })), record.paidAt && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Paid at" }), _jsx(Text, { size: "sm", children: new Date(record.paidAt).toLocaleString() })] })), record.verifiedBy && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Verified by" }), _jsx(Text, { size: "sm", children: record.verifiedBy })] })), record.gatewayRef?.
|
|
31
|
+
return (_jsxs(Div, { className: className, rounded: "xl", padding: "md", surface: "muted", border: "default", children: [_jsxs(Row, { justify: "between", align: "center", className: "mb-2", children: [_jsx(Heading, { level: 3, size: "sm", weight: "semibold", color: "muted", children: "Payment" }), _jsx(Badge, { variant: order.paymentStatus === "paid" ? "success" : "default", children: order.paymentStatus ?? "pending" })] }), _jsxs(Stack, { gap: "xs", children: [_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Method" }), _jsx(Text, { size: "sm", weight: "medium", children: METHOD_LABEL[record.method] })] }), _jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Amount" }), _jsx(Text, { size: "sm", weight: "medium", children: formatCurrency(record.amount, order.currency ?? "INR") })] }), record.transactionId && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Reference" }), _jsx(Text, { size: "sm", weight: "medium", children: record.transactionId })] })), record.paidAt && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Paid at" }), _jsx(Text, { size: "sm", children: new Date(record.paidAt).toLocaleString() })] })), record.verifiedBy && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Verified by" }), _jsx(Text, { size: "sm", children: record.verifiedBy })] })), record.gatewayRef?.phonepeOrderId && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Gateway order ID" }), _jsx(Text, { size: "sm", children: record.gatewayRef.phonepeOrderId })] }))] })] }));
|
|
32
32
|
}
|
|
@@ -10,7 +10,7 @@ function formatDate(d) {
|
|
|
10
10
|
return dt.toLocaleDateString("en-IN", { day: "numeric", month: "short", year: "numeric" });
|
|
11
11
|
}
|
|
12
12
|
function RefundRow({ event, currency }) {
|
|
13
|
-
return (_jsxs(Row, { border: "subtle", justify: "between", align: "start", gap: "sm", className: "border-b last:border-0", padding: "y-sm", children: [_jsxs(Stack, { gap: "xs", className: "flex-1", children: [_jsxs(Row, { gap: "sm", align: "center", children: [_jsx(Badge, { variant: event.type === "full" ? "danger" : "warning", children: event.type === "full" ? REFUND_COPY.history.badgeFull : REFUND_COPY.history.badgePartial }), _jsx(Text, { size: "xs", color: "muted", children: formatDate(event.refundedAt) })] }), _jsx(Text, { size: "sm", children: event.reason }), event.manualTransactionId && (_jsxs(Text, { size: "xs", color: "muted", children: [REFUND_COPY.history.labelTxn, " ", event.manualTransactionId] })), event.
|
|
13
|
+
return (_jsxs(Row, { border: "subtle", justify: "between", align: "start", gap: "sm", className: "border-b last:border-0", padding: "y-sm", children: [_jsxs(Stack, { gap: "xs", className: "flex-1", children: [_jsxs(Row, { gap: "sm", align: "center", children: [_jsx(Badge, { variant: event.type === "full" ? "danger" : "warning", children: event.type === "full" ? REFUND_COPY.history.badgeFull : REFUND_COPY.history.badgePartial }), _jsx(Text, { size: "xs", color: "muted", children: formatDate(event.refundedAt) })] }), _jsx(Text, { size: "sm", children: event.reason }), event.manualTransactionId && (_jsxs(Text, { size: "xs", color: "muted", children: [REFUND_COPY.history.labelTxn, " ", event.manualTransactionId] })), event.phonepeRefundId && (_jsxs(Text, { size: "xs", color: "muted", children: [REFUND_COPY.history.labelPhonePe, " ", event.phonepeRefundId] }))] }), _jsx(Text, { size: "sm", weight: "semibold", className: "shrink-0", children: formatCurrency(event.amount, currency) })] }));
|
|
14
14
|
}
|
|
15
15
|
/** Warning triangle icon — inline SVG kept here since it's a single-use decorative element. */
|
|
16
16
|
function WarningIcon() {
|
|
@@ -66,7 +66,7 @@ declare class OrderRepository extends BaseRepository<OrderDocument> {
|
|
|
66
66
|
markPacked(orderId: string): Promise<OrderDocument>;
|
|
67
67
|
/**
|
|
68
68
|
* Payment Detail Parity (Feature C) — the COD counterpart to the manual
|
|
69
|
-
* proof-upload /
|
|
69
|
+
* proof-upload / PhonePe-webhook write paths. Seller or admin confirms
|
|
70
70
|
* the cash was physically collected; there is no external gateway to
|
|
71
71
|
* verify against, so `verifiedBy` is the acting user's uid and
|
|
72
72
|
* `verificationMethod` is always "cod_collection".
|
|
@@ -299,6 +299,15 @@ declare class OrderRepository extends BaseRepository<OrderDocument> {
|
|
|
299
299
|
postRefundEvent(orderId: string, event: OrderRefundEvent, becomeRefunded?: boolean, ctx?: OrderWriteContext): Promise<OrderDocument>;
|
|
300
300
|
/** Fetch all orders sharing a paymentBatchId (for sibling-orders display). */
|
|
301
301
|
findByPaymentBatchId(batchId: string): Promise<OrderDocument[]>;
|
|
302
|
+
/**
|
|
303
|
+
* Fetch every order recorded against a single gateway payment id (e.g. a
|
|
304
|
+
* PhonePe `merchantOrderId`, which one checkout can split into several
|
|
305
|
+
* per-seller orders). Used by the checkout idempotency guard — the buyer's
|
|
306
|
+
* `/verify` call and the async webhook can both race to place orders for
|
|
307
|
+
* the same payment, and whichever loses the claim needs to know what the
|
|
308
|
+
* winner already created.
|
|
309
|
+
*/
|
|
310
|
+
findByPaymentId(paymentId: string): Promise<OrderDocument[]>;
|
|
302
311
|
/**
|
|
303
312
|
* Cloud Functions: find pending orders created before a timeout threshold.
|
|
304
313
|
* Used by the payment-timeout cleanup job to cancel stale unconfirmed orders.
|
|
@@ -139,7 +139,7 @@ class OrderRepository extends BaseRepository {
|
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* Payment Detail Parity (Feature C) — the COD counterpart to the manual
|
|
142
|
-
* proof-upload /
|
|
142
|
+
* proof-upload / PhonePe-webhook write paths. Seller or admin confirms
|
|
143
143
|
* the cash was physically collected; there is no external gateway to
|
|
144
144
|
* verify against, so `verifiedBy` is the acting user's uid and
|
|
145
145
|
* `verificationMethod` is always "cod_collection".
|
|
@@ -400,6 +400,22 @@ class OrderRepository extends BaseRepository {
|
|
|
400
400
|
.get();
|
|
401
401
|
return snap.docs.map((d) => this.decryptOrder({ id: d.id, ...d.data() }));
|
|
402
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Fetch every order recorded against a single gateway payment id (e.g. a
|
|
405
|
+
* PhonePe `merchantOrderId`, which one checkout can split into several
|
|
406
|
+
* per-seller orders). Used by the checkout idempotency guard — the buyer's
|
|
407
|
+
* `/verify` call and the async webhook can both race to place orders for
|
|
408
|
+
* the same payment, and whichever loses the claim needs to know what the
|
|
409
|
+
* winner already created.
|
|
410
|
+
*/
|
|
411
|
+
async findByPaymentId(paymentId) {
|
|
412
|
+
const snap = await this.db
|
|
413
|
+
.collection(this.collection)
|
|
414
|
+
.where(ORDER_FIELDS.PAYMENT_ID, "==", paymentId)
|
|
415
|
+
.limit(20)
|
|
416
|
+
.get();
|
|
417
|
+
return snap.docs.map((d) => this.decryptOrder({ id: d.id, ...d.data() }));
|
|
418
|
+
}
|
|
403
419
|
/**
|
|
404
420
|
* Cloud Functions: find pending orders created before a timeout threshold.
|
|
405
421
|
* Used by the payment-timeout cleanup job to cancel stale unconfirmed orders.
|
|
@@ -130,7 +130,6 @@ export declare const PaymentMethodValues: {
|
|
|
130
130
|
readonly CASH: "cash";
|
|
131
131
|
readonly ONLINE: "online";
|
|
132
132
|
readonly UPI_MANUAL: "upi_manual";
|
|
133
|
-
readonly RAZORPAY: "razorpay";
|
|
134
133
|
readonly ADMIN_BYPASS: "admin_bypass";
|
|
135
134
|
readonly EMI: "emi";
|
|
136
135
|
};
|
|
@@ -245,8 +244,8 @@ export interface OrderRefundEvent {
|
|
|
245
244
|
reasonCode?: ReturnReason;
|
|
246
245
|
refundedAt: Date;
|
|
247
246
|
refundedBy: string;
|
|
248
|
-
/** Set when
|
|
249
|
-
|
|
247
|
+
/** Set when PhonePe processed the refund. */
|
|
248
|
+
phonepeRefundId?: string;
|
|
250
249
|
/** Set when refund was processed manually (offline). */
|
|
251
250
|
manualTransactionId?: string;
|
|
252
251
|
/** Proof document URL (via /api/media signed-URL flow). */
|
|
@@ -545,24 +544,24 @@ export interface OrderDocument extends BaseDocument {
|
|
|
545
544
|
/** Set true only when an automatic partial refund (for dropped Razorpay items) failed and needs manual follow-up. */
|
|
546
545
|
refundPending?: boolean;
|
|
547
546
|
}
|
|
548
|
-
export type OrderPaymentRecordMethod = "manual" | "
|
|
549
|
-
export type OrderPaymentVerificationMethod = "manual_review" | "webhook" | "cod_collection";
|
|
547
|
+
export type OrderPaymentRecordMethod = "manual" | "phonepe" | "cod";
|
|
548
|
+
export type OrderPaymentVerificationMethod = "manual_review" | "webhook" | "cod_collection" | "order_status";
|
|
550
549
|
export interface OrderPaymentRecord {
|
|
551
550
|
method: OrderPaymentRecordMethod;
|
|
552
|
-
/** UTR (manual) |
|
|
551
|
+
/** UTR (manual) | PhonePe transactionId (phonepe) | collector note/ref (COD). */
|
|
553
552
|
transactionId?: string;
|
|
554
|
-
/** Manual proof upload | COD collection receipt photo (optional) | n/a for
|
|
553
|
+
/** Manual proof upload | COD collection receipt photo (optional) | n/a for phonepe. */
|
|
555
554
|
proofUrl?: string;
|
|
556
555
|
amount: number;
|
|
557
556
|
paidAt?: Date;
|
|
558
|
-
/** Admin/seller uid (manual/COD) | "
|
|
557
|
+
/** Admin/seller uid (manual/COD) | "phonepe-order-status" or "phonepe-webhook" (phonepe, automatic). */
|
|
559
558
|
verifiedBy?: string;
|
|
560
559
|
verificationMethod: OrderPaymentVerificationMethod;
|
|
561
|
-
/**
|
|
560
|
+
/** PhonePe audit trail only. */
|
|
562
561
|
gatewayRef?: {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
562
|
+
merchantOrderId?: string;
|
|
563
|
+
phonepeOrderId?: string;
|
|
564
|
+
transactionId?: string;
|
|
566
565
|
};
|
|
567
566
|
}
|
|
568
567
|
export declare const ORDER_COLLECTION: "orders";
|