@mohasinac/appkit 4.41.17 → 4.42.0
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/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/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/cta-layout__checkout-bottom-bar.js +1 -1
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +24 -12
- 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
|
@@ -121,37 +121,37 @@ export declare const orderRefundEventSchema: z.ZodObject<{
|
|
|
121
121
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
122
122
|
}, z.ZodTypeAny, "passthrough">>]>;
|
|
123
123
|
refundedBy: z.ZodString;
|
|
124
|
-
|
|
124
|
+
phonepeRefundId: z.ZodOptional<z.ZodString>;
|
|
125
125
|
manualTransactionId: z.ZodOptional<z.ZodString>;
|
|
126
126
|
proofDocumentUrl: z.ZodOptional<z.ZodString>;
|
|
127
127
|
proofDocumentMimeType: z.ZodOptional<z.ZodString>;
|
|
128
128
|
overrideReason: z.ZodOptional<z.ZodString>;
|
|
129
129
|
}, "strip", z.ZodTypeAny, {
|
|
130
130
|
type: "full" | "partial";
|
|
131
|
-
reason: string;
|
|
132
131
|
amount: number;
|
|
132
|
+
reason: string;
|
|
133
133
|
refundId: string;
|
|
134
134
|
refundedAt: string | Date | z.objectOutputType<{
|
|
135
135
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
136
136
|
}, z.ZodTypeAny, "passthrough">;
|
|
137
137
|
refundedBy: string;
|
|
138
138
|
itemIds?: string[] | undefined;
|
|
139
|
-
|
|
139
|
+
phonepeRefundId?: string | undefined;
|
|
140
140
|
manualTransactionId?: string | undefined;
|
|
141
141
|
proofDocumentUrl?: string | undefined;
|
|
142
142
|
proofDocumentMimeType?: string | undefined;
|
|
143
143
|
overrideReason?: string | undefined;
|
|
144
144
|
}, {
|
|
145
145
|
type: "full" | "partial";
|
|
146
|
-
reason: string;
|
|
147
146
|
amount: number;
|
|
147
|
+
reason: string;
|
|
148
148
|
refundId: string;
|
|
149
149
|
refundedAt: string | Date | z.objectInputType<{
|
|
150
150
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
151
151
|
}, z.ZodTypeAny, "passthrough">;
|
|
152
152
|
refundedBy: string;
|
|
153
153
|
itemIds?: string[] | undefined;
|
|
154
|
-
|
|
154
|
+
phonepeRefundId?: string | undefined;
|
|
155
155
|
manualTransactionId?: string | undefined;
|
|
156
156
|
proofDocumentUrl?: string | undefined;
|
|
157
157
|
proofDocumentMimeType?: string | undefined;
|
|
@@ -168,14 +168,14 @@ export declare const appliedOrderDiscountSchema: z.ZodObject<{
|
|
|
168
168
|
code: string;
|
|
169
169
|
type: "auto" | "coupon" | "deal";
|
|
170
170
|
discountAmount: number;
|
|
171
|
-
scope?: "
|
|
171
|
+
scope?: "admin" | "seller" | undefined;
|
|
172
172
|
storeId?: string | undefined;
|
|
173
173
|
couponId?: string | undefined;
|
|
174
174
|
}, {
|
|
175
175
|
code: string;
|
|
176
176
|
type: "auto" | "coupon" | "deal";
|
|
177
177
|
discountAmount: number;
|
|
178
|
-
scope?: "
|
|
178
|
+
scope?: "admin" | "seller" | undefined;
|
|
179
179
|
storeId?: string | undefined;
|
|
180
180
|
couponId?: string | undefined;
|
|
181
181
|
}>;
|
|
@@ -326,14 +326,14 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
326
326
|
code: string;
|
|
327
327
|
type: "auto" | "coupon" | "deal";
|
|
328
328
|
discountAmount: number;
|
|
329
|
-
scope?: "
|
|
329
|
+
scope?: "admin" | "seller" | undefined;
|
|
330
330
|
storeId?: string | undefined;
|
|
331
331
|
couponId?: string | undefined;
|
|
332
332
|
}, {
|
|
333
333
|
code: string;
|
|
334
334
|
type: "auto" | "coupon" | "deal";
|
|
335
335
|
discountAmount: number;
|
|
336
|
-
scope?: "
|
|
336
|
+
scope?: "admin" | "seller" | undefined;
|
|
337
337
|
storeId?: string | undefined;
|
|
338
338
|
couponId?: string | undefined;
|
|
339
339
|
}>, "many">>;
|
|
@@ -457,37 +457,37 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
457
457
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
458
458
|
}, z.ZodTypeAny, "passthrough">>]>;
|
|
459
459
|
refundedBy: z.ZodString;
|
|
460
|
-
|
|
460
|
+
phonepeRefundId: z.ZodOptional<z.ZodString>;
|
|
461
461
|
manualTransactionId: z.ZodOptional<z.ZodString>;
|
|
462
462
|
proofDocumentUrl: z.ZodOptional<z.ZodString>;
|
|
463
463
|
proofDocumentMimeType: z.ZodOptional<z.ZodString>;
|
|
464
464
|
overrideReason: z.ZodOptional<z.ZodString>;
|
|
465
465
|
}, "strip", z.ZodTypeAny, {
|
|
466
466
|
type: "full" | "partial";
|
|
467
|
-
reason: string;
|
|
468
467
|
amount: number;
|
|
468
|
+
reason: string;
|
|
469
469
|
refundId: string;
|
|
470
470
|
refundedAt: string | Date | z.objectOutputType<{
|
|
471
471
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
472
472
|
}, z.ZodTypeAny, "passthrough">;
|
|
473
473
|
refundedBy: string;
|
|
474
474
|
itemIds?: string[] | undefined;
|
|
475
|
-
|
|
475
|
+
phonepeRefundId?: string | undefined;
|
|
476
476
|
manualTransactionId?: string | undefined;
|
|
477
477
|
proofDocumentUrl?: string | undefined;
|
|
478
478
|
proofDocumentMimeType?: string | undefined;
|
|
479
479
|
overrideReason?: string | undefined;
|
|
480
480
|
}, {
|
|
481
481
|
type: "full" | "partial";
|
|
482
|
-
reason: string;
|
|
483
482
|
amount: number;
|
|
483
|
+
reason: string;
|
|
484
484
|
refundId: string;
|
|
485
485
|
refundedAt: string | Date | z.objectInputType<{
|
|
486
486
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
487
487
|
}, z.ZodTypeAny, "passthrough">;
|
|
488
488
|
refundedBy: string;
|
|
489
489
|
itemIds?: string[] | undefined;
|
|
490
|
-
|
|
490
|
+
phonepeRefundId?: string | undefined;
|
|
491
491
|
manualTransactionId?: string | undefined;
|
|
492
492
|
proofDocumentUrl?: string | undefined;
|
|
493
493
|
proofDocumentMimeType?: string | undefined;
|
|
@@ -538,7 +538,7 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
538
538
|
refundPending: z.ZodOptional<z.ZodBoolean>;
|
|
539
539
|
}, "strip", z.ZodTypeAny, {
|
|
540
540
|
currency: string;
|
|
541
|
-
status: "pending" | "
|
|
541
|
+
status: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
542
542
|
id: string;
|
|
543
543
|
createdAt: string | Date | z.objectOutputType<{
|
|
544
544
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
@@ -546,10 +546,10 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
546
546
|
updatedAt: string | Date | z.objectOutputType<{
|
|
547
547
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
548
548
|
}, z.ZodTypeAny, "passthrough">;
|
|
549
|
-
userId: string;
|
|
550
549
|
quantity: number;
|
|
551
550
|
productId: string;
|
|
552
551
|
productTitle: string;
|
|
552
|
+
userId: string;
|
|
553
553
|
userName: string;
|
|
554
554
|
userEmail: string;
|
|
555
555
|
unitPrice: number;
|
|
@@ -558,15 +558,14 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
558
558
|
orderDate: string | Date | z.objectOutputType<{
|
|
559
559
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
560
560
|
}, z.ZodTypeAny, "passthrough">;
|
|
561
|
-
storeId?: string | undefined;
|
|
562
|
-
platformFee?: number | undefined;
|
|
563
|
-
paymentMethod?: string | undefined;
|
|
564
|
-
notes?: string | undefined;
|
|
565
561
|
storeName?: string | undefined;
|
|
562
|
+
storeId?: string | undefined;
|
|
566
563
|
prizeRevealMode?: "scheduled" | "instant" | undefined;
|
|
567
564
|
paymentId?: string | undefined;
|
|
565
|
+
paymentMethod?: string | undefined;
|
|
568
566
|
shippingAddress?: string | undefined;
|
|
569
567
|
trackingNumber?: string | undefined;
|
|
568
|
+
notes?: string | undefined;
|
|
570
569
|
shippingDate?: string | Date | z.objectOutputType<{
|
|
571
570
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
572
571
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -578,7 +577,8 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
578
577
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
579
578
|
cancellationReason?: string | undefined;
|
|
580
579
|
refundAmount?: number | undefined;
|
|
581
|
-
refundStatus?: "pending" | "
|
|
580
|
+
refundStatus?: "pending" | "completed" | "processing" | "rejected" | undefined;
|
|
581
|
+
platformFee?: number | undefined;
|
|
582
582
|
depositAmount?: number | undefined;
|
|
583
583
|
codRemainingAmount?: number | undefined;
|
|
584
584
|
shippingFee?: number | undefined;
|
|
@@ -623,7 +623,7 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
623
623
|
code: string;
|
|
624
624
|
type: "auto" | "coupon" | "deal";
|
|
625
625
|
discountAmount: number;
|
|
626
|
-
scope?: "
|
|
626
|
+
scope?: "admin" | "seller" | undefined;
|
|
627
627
|
storeId?: string | undefined;
|
|
628
628
|
couponId?: string | undefined;
|
|
629
629
|
}[] | undefined;
|
|
@@ -654,15 +654,15 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
654
654
|
paymentBatchId?: string | undefined;
|
|
655
655
|
refunds?: {
|
|
656
656
|
type: "full" | "partial";
|
|
657
|
-
reason: string;
|
|
658
657
|
amount: number;
|
|
658
|
+
reason: string;
|
|
659
659
|
refundId: string;
|
|
660
660
|
refundedAt: string | Date | z.objectOutputType<{
|
|
661
661
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
662
662
|
}, z.ZodTypeAny, "passthrough">;
|
|
663
663
|
refundedBy: string;
|
|
664
664
|
itemIds?: string[] | undefined;
|
|
665
|
-
|
|
665
|
+
phonepeRefundId?: string | undefined;
|
|
666
666
|
manualTransactionId?: string | undefined;
|
|
667
667
|
proofDocumentUrl?: string | undefined;
|
|
668
668
|
proofDocumentMimeType?: string | undefined;
|
|
@@ -686,7 +686,7 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
686
686
|
refundPending?: boolean | undefined;
|
|
687
687
|
}, {
|
|
688
688
|
currency: string;
|
|
689
|
-
status: "pending" | "
|
|
689
|
+
status: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
690
690
|
id: string;
|
|
691
691
|
createdAt: string | Date | z.objectInputType<{
|
|
692
692
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
@@ -694,10 +694,10 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
694
694
|
updatedAt: string | Date | z.objectInputType<{
|
|
695
695
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
696
696
|
}, z.ZodTypeAny, "passthrough">;
|
|
697
|
-
userId: string;
|
|
698
697
|
quantity: number;
|
|
699
698
|
productId: string;
|
|
700
699
|
productTitle: string;
|
|
700
|
+
userId: string;
|
|
701
701
|
userName: string;
|
|
702
702
|
userEmail: string;
|
|
703
703
|
unitPrice: number;
|
|
@@ -706,15 +706,14 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
706
706
|
orderDate: string | Date | z.objectInputType<{
|
|
707
707
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
708
708
|
}, z.ZodTypeAny, "passthrough">;
|
|
709
|
-
storeId?: string | undefined;
|
|
710
|
-
platformFee?: number | undefined;
|
|
711
|
-
paymentMethod?: string | undefined;
|
|
712
|
-
notes?: string | undefined;
|
|
713
709
|
storeName?: string | undefined;
|
|
710
|
+
storeId?: string | undefined;
|
|
714
711
|
prizeRevealMode?: "scheduled" | "instant" | undefined;
|
|
715
712
|
paymentId?: string | undefined;
|
|
713
|
+
paymentMethod?: string | undefined;
|
|
716
714
|
shippingAddress?: string | undefined;
|
|
717
715
|
trackingNumber?: string | undefined;
|
|
716
|
+
notes?: string | undefined;
|
|
718
717
|
shippingDate?: string | Date | z.objectInputType<{
|
|
719
718
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
720
719
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -726,7 +725,8 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
726
725
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
727
726
|
cancellationReason?: string | undefined;
|
|
728
727
|
refundAmount?: number | undefined;
|
|
729
|
-
refundStatus?: "pending" | "
|
|
728
|
+
refundStatus?: "pending" | "completed" | "processing" | "rejected" | undefined;
|
|
729
|
+
platformFee?: number | undefined;
|
|
730
730
|
depositAmount?: number | undefined;
|
|
731
731
|
codRemainingAmount?: number | undefined;
|
|
732
732
|
shippingFee?: number | undefined;
|
|
@@ -771,7 +771,7 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
771
771
|
code: string;
|
|
772
772
|
type: "auto" | "coupon" | "deal";
|
|
773
773
|
discountAmount: number;
|
|
774
|
-
scope?: "
|
|
774
|
+
scope?: "admin" | "seller" | undefined;
|
|
775
775
|
storeId?: string | undefined;
|
|
776
776
|
couponId?: string | undefined;
|
|
777
777
|
}[] | undefined;
|
|
@@ -802,15 +802,15 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
802
802
|
paymentBatchId?: string | undefined;
|
|
803
803
|
refunds?: {
|
|
804
804
|
type: "full" | "partial";
|
|
805
|
-
reason: string;
|
|
806
805
|
amount: number;
|
|
806
|
+
reason: string;
|
|
807
807
|
refundId: string;
|
|
808
808
|
refundedAt: string | Date | z.objectInputType<{
|
|
809
809
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
810
810
|
}, z.ZodTypeAny, "passthrough">;
|
|
811
811
|
refundedBy: string;
|
|
812
812
|
itemIds?: string[] | undefined;
|
|
813
|
-
|
|
813
|
+
phonepeRefundId?: string | undefined;
|
|
814
814
|
manualTransactionId?: string | undefined;
|
|
815
815
|
proofDocumentUrl?: string | undefined;
|
|
816
816
|
proofDocumentMimeType?: string | undefined;
|
|
@@ -869,12 +869,12 @@ export declare const orderTimelineSchema: z.ZodObject<{
|
|
|
869
869
|
timestamp: z.ZodString;
|
|
870
870
|
actor: z.ZodOptional<z.ZodString>;
|
|
871
871
|
}, "strip", z.ZodTypeAny, {
|
|
872
|
-
status: "pending" | "
|
|
872
|
+
status: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
873
873
|
timestamp: string;
|
|
874
874
|
message?: string | undefined;
|
|
875
875
|
actor?: string | undefined;
|
|
876
876
|
}, {
|
|
877
|
-
status: "pending" | "
|
|
877
|
+
status: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
878
878
|
timestamp: string;
|
|
879
879
|
message?: string | undefined;
|
|
880
880
|
actor?: string | undefined;
|
|
@@ -943,12 +943,12 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
943
943
|
timestamp: z.ZodString;
|
|
944
944
|
actor: z.ZodOptional<z.ZodString>;
|
|
945
945
|
}, "strip", z.ZodTypeAny, {
|
|
946
|
-
status: "pending" | "
|
|
946
|
+
status: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
947
947
|
timestamp: string;
|
|
948
948
|
message?: string | undefined;
|
|
949
949
|
actor?: string | undefined;
|
|
950
950
|
}, {
|
|
951
|
-
status: "pending" | "
|
|
951
|
+
status: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
952
952
|
timestamp: string;
|
|
953
953
|
message?: string | undefined;
|
|
954
954
|
actor?: string | undefined;
|
|
@@ -961,8 +961,8 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
961
961
|
address: {} & {
|
|
962
962
|
[k: string]: unknown;
|
|
963
963
|
};
|
|
964
|
-
userId: string;
|
|
965
964
|
total: number;
|
|
965
|
+
userId: string;
|
|
966
966
|
paymentStatus: string;
|
|
967
967
|
items: {
|
|
968
968
|
title: string;
|
|
@@ -975,11 +975,11 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
975
975
|
attributes?: Record<string, string> | undefined;
|
|
976
976
|
}[];
|
|
977
977
|
subtotal: number;
|
|
978
|
-
orderStatus: "pending" | "
|
|
978
|
+
orderStatus: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
979
979
|
createdAt?: string | undefined;
|
|
980
980
|
updatedAt?: string | undefined;
|
|
981
|
-
notes?: string | undefined;
|
|
982
981
|
trackingNumber?: string | undefined;
|
|
982
|
+
notes?: string | undefined;
|
|
983
983
|
shippingCarrier?: string | undefined;
|
|
984
984
|
couponCode?: string | undefined;
|
|
985
985
|
discount?: number | undefined;
|
|
@@ -987,7 +987,7 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
987
987
|
shippingCost?: number | undefined;
|
|
988
988
|
tax?: number | undefined;
|
|
989
989
|
timeline?: {
|
|
990
|
-
status: "pending" | "
|
|
990
|
+
status: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
991
991
|
timestamp: string;
|
|
992
992
|
message?: string | undefined;
|
|
993
993
|
actor?: string | undefined;
|
|
@@ -998,8 +998,8 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
998
998
|
address: {} & {
|
|
999
999
|
[k: string]: unknown;
|
|
1000
1000
|
};
|
|
1001
|
-
userId: string;
|
|
1002
1001
|
total: number;
|
|
1002
|
+
userId: string;
|
|
1003
1003
|
paymentStatus: string;
|
|
1004
1004
|
items: {
|
|
1005
1005
|
title: string;
|
|
@@ -1012,11 +1012,11 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
1012
1012
|
attributes?: Record<string, string> | undefined;
|
|
1013
1013
|
}[];
|
|
1014
1014
|
subtotal: number;
|
|
1015
|
-
orderStatus: "pending" | "
|
|
1015
|
+
orderStatus: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
1016
1016
|
createdAt?: string | undefined;
|
|
1017
1017
|
updatedAt?: string | undefined;
|
|
1018
|
-
notes?: string | undefined;
|
|
1019
1018
|
trackingNumber?: string | undefined;
|
|
1019
|
+
notes?: string | undefined;
|
|
1020
1020
|
shippingCarrier?: string | undefined;
|
|
1021
1021
|
couponCode?: string | undefined;
|
|
1022
1022
|
discount?: number | undefined;
|
|
@@ -1024,7 +1024,7 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
1024
1024
|
shippingCost?: number | undefined;
|
|
1025
1025
|
tax?: number | undefined;
|
|
1026
1026
|
timeline?: {
|
|
1027
|
-
status: "pending" | "
|
|
1027
|
+
status: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned";
|
|
1028
1028
|
timestamp: string;
|
|
1029
1029
|
message?: string | undefined;
|
|
1030
1030
|
actor?: string | undefined;
|
|
@@ -1044,12 +1044,12 @@ export declare const orderListParamsSchema: z.ZodObject<{
|
|
|
1044
1044
|
perPage?: number | undefined;
|
|
1045
1045
|
userId?: string | undefined;
|
|
1046
1046
|
paymentStatus?: string | undefined;
|
|
1047
|
-
orderStatus?: "pending" | "
|
|
1047
|
+
orderStatus?: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned" | undefined;
|
|
1048
1048
|
}, {
|
|
1049
1049
|
sort?: string | undefined;
|
|
1050
1050
|
page?: number | undefined;
|
|
1051
1051
|
perPage?: number | undefined;
|
|
1052
1052
|
userId?: string | undefined;
|
|
1053
1053
|
paymentStatus?: string | undefined;
|
|
1054
|
-
orderStatus?: "pending" | "
|
|
1054
|
+
orderStatus?: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned" | undefined;
|
|
1055
1055
|
}>;
|
|
@@ -60,7 +60,7 @@ export const orderRefundEventSchema = z.object({
|
|
|
60
60
|
reason: z.string(),
|
|
61
61
|
refundedAt: firestoreDateSchema,
|
|
62
62
|
refundedBy: z.string(),
|
|
63
|
-
|
|
63
|
+
phonepeRefundId: z.string().optional(),
|
|
64
64
|
manualTransactionId: z.string().optional(),
|
|
65
65
|
proofDocumentUrl: z.string().optional(),
|
|
66
66
|
proofDocumentMimeType: z.string().optional(),
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type PaymentGateway, PaymentGatewayValues } from "../../payments/schemas";
|
|
2
|
-
export { type PaymentGateway, PaymentGatewayValues };
|
|
3
1
|
import type { ListingType } from "../../products/types/index";
|
|
4
2
|
import type { OrderType } from "../utils/order-splitter";
|
|
5
3
|
import type { AppliedOrderDiscount, OrderSourceContext } from "../schemas/firestore";
|
|
@@ -98,7 +96,7 @@ export interface Order {
|
|
|
98
96
|
orderType?: OrderType;
|
|
99
97
|
/** Set when this order settled an accepted Make-an-Offer. */
|
|
100
98
|
offerId?: string;
|
|
101
|
-
paymentGateway?:
|
|
99
|
+
paymentGateway?: string;
|
|
102
100
|
subtotal: number;
|
|
103
101
|
shippingCost?: number;
|
|
104
102
|
discount?: number;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { PaymentGatewayValues };
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const manifest = {
|
|
2
2
|
name: "payments",
|
|
3
3
|
i18nNamespace: "payments",
|
|
4
|
-
envKeys: ["
|
|
4
|
+
envKeys: ["PHONEPE_CLIENT_ID", "PHONEPE_CLIENT_SECRET"],
|
|
5
5
|
routes: [],
|
|
6
6
|
apiRoutes: [
|
|
7
7
|
{ segment: "api/payments/create", methods: ["POST"] },
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Handles seller payout requests and admin payout processing.
|
|
6
6
|
*/
|
|
7
7
|
import { BaseRepository, parseSieveDateValue, type SieveModel, type FirebaseSieveResult } from "../../../providers/db-firebase";
|
|
8
|
-
import type { DocumentReference
|
|
8
|
+
import type { DocumentReference } from "firebase-admin/firestore";
|
|
9
9
|
import type { PayoutDocument, PayoutCreateInput, PayoutRefundDeduction, PayoutStatus, PayoutUpdateInput } from "../schemas";
|
|
10
10
|
import { type HistoryActor } from "../../../_internal/shared/history/index";
|
|
11
11
|
/** Who/why for a payout write that lands in `statusHistory`. */
|
|
@@ -80,9 +80,6 @@ export declare class PayoutRepository extends BaseRepository<PayoutDocument> {
|
|
|
80
80
|
* fetches the payout to authorise the change (Rule #6).
|
|
81
81
|
*/
|
|
82
82
|
updateStatus(payoutId: string, status: PayoutStatus, extra?: PayoutUpdateInput, ctx?: PayoutWriteContext, prior?: PayoutDocument | null): Promise<PayoutDocument>;
|
|
83
|
-
markProcessing(ref: DocumentReference, ctx?: PayoutWriteContext, prior?: PayoutDocument | null): Promise<WriteResult>;
|
|
84
|
-
recordSuccess(ref: DocumentReference, razorpayPayoutId: string, razorpayStatus: string, ctx?: PayoutWriteContext, prior?: PayoutDocument | null): Promise<WriteResult>;
|
|
85
|
-
recordFailure(ref: DocumentReference, failureCount: number, reason: string, isFinal: boolean, ctx?: PayoutWriteContext, prior?: PayoutDocument | null): Promise<WriteResult>;
|
|
86
83
|
/** Append a timeline entry when the patch touches a tracked field. */
|
|
87
84
|
private withPayoutHistory;
|
|
88
85
|
/**
|
|
@@ -152,35 +152,6 @@ export class PayoutRepository extends BaseRepository {
|
|
|
152
152
|
updatedAt: new Date(),
|
|
153
153
|
}, ctx, "adminUpdatePayout"));
|
|
154
154
|
}
|
|
155
|
-
/*
|
|
156
|
-
* ── Batch dispatch primitives ──────────────────────────────────────────
|
|
157
|
-
*
|
|
158
|
-
* These take a `DocumentReference` rather than an id because the payouts
|
|
159
|
-
* batch already holds one from its query snapshot. `prior` comes from the
|
|
160
|
-
* SAME snapshot, so history costs no read here either — but it must be the
|
|
161
|
-
* caller's running copy, not the original: the sequence is
|
|
162
|
-
* pending → processing → failed, and diffing the final write against the
|
|
163
|
-
* ORIGINAL snapshot would record "pending → failed" and lose the dispatch
|
|
164
|
-
* attempt entirely.
|
|
165
|
-
*/
|
|
166
|
-
markProcessing(ref, ctx, prior) {
|
|
167
|
-
return ref.update(this.withPayoutHistory(prior, { status: "processing", processedAt: new Date(), updatedAt: new Date() }, ctx, "payoutBatch:dispatch"));
|
|
168
|
-
}
|
|
169
|
-
recordSuccess(ref, razorpayPayoutId, razorpayStatus, ctx, prior) {
|
|
170
|
-
return ref.update(this.withPayoutHistory(prior, { razorpayPayoutId, razorpayStatus, updatedAt: new Date() }, ctx, "payoutBatch:accepted"));
|
|
171
|
-
}
|
|
172
|
-
recordFailure(ref, failureCount, reason, isFinal, ctx, prior) {
|
|
173
|
-
return ref.update(this.withPayoutHistory(prior, {
|
|
174
|
-
status: isFinal ? "failed" : "pending",
|
|
175
|
-
failureCount,
|
|
176
|
-
lastFailureReason: reason,
|
|
177
|
-
updatedAt: new Date(),
|
|
178
|
-
},
|
|
179
|
-
// The reason is the point of the entry — `lastFailureReason` is
|
|
180
|
-
// overwritten by the next retry, so history is where the earlier
|
|
181
|
-
// attempts survive.
|
|
182
|
-
{ ...ctx, reason }, isFinal ? "payoutBatch:failedFinal" : "payoutBatch:failedRetrying"));
|
|
183
|
-
}
|
|
184
155
|
/** Append a timeline entry when the patch touches a tracked field. */
|
|
185
156
|
withPayoutHistory(current, patch, ctx, defaultTrigger) {
|
|
186
157
|
const withEntry = withHistory(current, patch, {
|
|
@@ -71,18 +71,6 @@ export interface PayoutDocument extends BaseDocument {
|
|
|
71
71
|
transactionId?: string;
|
|
72
72
|
/** Seller-set personal follow-up flag — surfaced only to the owning seller, never mutated by admin. */
|
|
73
73
|
sellerReminderFlag?: boolean;
|
|
74
|
-
/** Razorpay's payout id, once the API accepted the dispatch. */
|
|
75
|
-
razorpayPayoutId?: string;
|
|
76
|
-
/** Razorpay's own status string — NOT this document's `status`. */
|
|
77
|
-
razorpayStatus?: string;
|
|
78
|
-
/** Consecutive dispatch failures. At MAX_FAILURES the payout goes `failed`. */
|
|
79
|
-
failureCount?: number;
|
|
80
|
-
/**
|
|
81
|
-
* Why the LAST attempt failed. Overwritten by every retry, which is why the
|
|
82
|
-
* timeline tracks it: `statusHistory` is the only place the earlier reasons
|
|
83
|
-
* survive.
|
|
84
|
-
*/
|
|
85
|
-
lastFailureReason?: string;
|
|
86
74
|
/**
|
|
87
75
|
* Who changed what, when, and why. See § "Status History" in CLAUDE.md.
|
|
88
76
|
*
|
|
@@ -99,10 +87,15 @@ export interface PayoutDocument extends BaseDocument {
|
|
|
99
87
|
* `netAmount`/`refundDeductions` are excluded — a refund deduction is money
|
|
100
88
|
* churn before dispatch, and § "Status History" keeps money off the timeline;
|
|
101
89
|
* `refundDeductions[]` on the document is already its own record.
|
|
102
|
-
*
|
|
103
|
-
*
|
|
90
|
+
*
|
|
91
|
+
* The automated RazorpayX payout-dispatch job (and the `razorpayPayoutId` /
|
|
92
|
+
* `razorpayStatus` / `failureCount` / `lastFailureReason` fields it alone
|
|
93
|
+
* wrote) was deleted when Razorpay was replaced by PhonePe — PhonePe has no
|
|
94
|
+
* comparable payout API, so seller payouts are fully manual again via
|
|
95
|
+
* `adminUpdatePayout`. Those four fields no longer exist on `PayoutDocument`;
|
|
96
|
+
* do not re-add them here without a real writer.
|
|
104
97
|
*/
|
|
105
|
-
export declare const PAYOUT_TRACKED_FIELDS: readonly ["status", "processedAt", "transactionId"
|
|
98
|
+
export declare const PAYOUT_TRACKED_FIELDS: readonly ["status", "processedAt", "transactionId"];
|
|
106
99
|
export declare const PAYOUT_COLLECTION: "payouts";
|
|
107
100
|
export declare const PAYOUT_INDEXED_FIELDS: readonly ["storeId", "status", "requestedAt", "createdAt"];
|
|
108
101
|
export declare const DEFAULT_PLATFORM_FEE_RATE: 0.05;
|
|
@@ -14,16 +14,18 @@ export const PayoutStatusValues = {
|
|
|
14
14
|
* `netAmount`/`refundDeductions` are excluded — a refund deduction is money
|
|
15
15
|
* churn before dispatch, and § "Status History" keeps money off the timeline;
|
|
16
16
|
* `refundDeductions[]` on the document is already its own record.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
*
|
|
18
|
+
* The automated RazorpayX payout-dispatch job (and the `razorpayPayoutId` /
|
|
19
|
+
* `razorpayStatus` / `failureCount` / `lastFailureReason` fields it alone
|
|
20
|
+
* wrote) was deleted when Razorpay was replaced by PhonePe — PhonePe has no
|
|
21
|
+
* comparable payout API, so seller payouts are fully manual again via
|
|
22
|
+
* `adminUpdatePayout`. Those four fields no longer exist on `PayoutDocument`;
|
|
23
|
+
* do not re-add them here without a real writer.
|
|
19
24
|
*/
|
|
20
25
|
export const PAYOUT_TRACKED_FIELDS = [
|
|
21
26
|
"status",
|
|
22
27
|
"processedAt",
|
|
23
28
|
"transactionId",
|
|
24
|
-
"razorpayPayoutId",
|
|
25
|
-
"razorpayStatus",
|
|
26
|
-
"lastFailureReason",
|
|
27
29
|
];
|
|
28
30
|
export const PAYOUT_COLLECTION = "payouts";
|
|
29
31
|
export const PAYOUT_INDEXED_FIELDS = [
|