@mohasinac/appkit 4.41.16 → 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/account-auth__signup-login.js +21 -2
- 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
|
@@ -9,14 +9,14 @@ export declare const payoutBankAccountSchema: z.ZodObject<{
|
|
|
9
9
|
ifscCode: z.ZodString;
|
|
10
10
|
bankName: z.ZodString;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
ifscCode: string;
|
|
12
13
|
accountHolderName: string;
|
|
13
14
|
accountNumberMasked: string;
|
|
14
|
-
ifscCode: string;
|
|
15
15
|
bankName: string;
|
|
16
16
|
}, {
|
|
17
|
+
ifscCode: string;
|
|
17
18
|
accountHolderName: string;
|
|
18
19
|
accountNumberMasked: string;
|
|
19
|
-
ifscCode: string;
|
|
20
20
|
bankName: string;
|
|
21
21
|
}>;
|
|
22
22
|
export declare const payoutRefundDeductionSchema: z.ZodObject<{
|
|
@@ -35,18 +35,18 @@ export declare const payoutRefundDeductionSchema: z.ZodObject<{
|
|
|
35
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
36
|
reason: string;
|
|
37
37
|
orderId: string;
|
|
38
|
+
deductedAmount: number;
|
|
38
39
|
refundId: string;
|
|
39
40
|
refundedAmount: number;
|
|
40
|
-
deductedAmount: number;
|
|
41
41
|
appliedAt: string | Date | z.objectOutputType<{
|
|
42
42
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
43
43
|
}, z.ZodTypeAny, "passthrough">;
|
|
44
44
|
}, {
|
|
45
45
|
reason: string;
|
|
46
46
|
orderId: string;
|
|
47
|
+
deductedAmount: number;
|
|
47
48
|
refundId: string;
|
|
48
49
|
refundedAmount: number;
|
|
49
|
-
deductedAmount: number;
|
|
50
50
|
appliedAt: string | Date | z.objectInputType<{
|
|
51
51
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
52
52
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -83,14 +83,14 @@ export declare const payoutFirestoreSchema: z.ZodObject<{
|
|
|
83
83
|
ifscCode: z.ZodString;
|
|
84
84
|
bankName: z.ZodString;
|
|
85
85
|
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
ifscCode: string;
|
|
86
87
|
accountHolderName: string;
|
|
87
88
|
accountNumberMasked: string;
|
|
88
|
-
ifscCode: string;
|
|
89
89
|
bankName: string;
|
|
90
90
|
}, {
|
|
91
|
+
ifscCode: string;
|
|
91
92
|
accountHolderName: string;
|
|
92
93
|
accountNumberMasked: string;
|
|
93
|
-
ifscCode: string;
|
|
94
94
|
bankName: string;
|
|
95
95
|
}>>;
|
|
96
96
|
upiId: z.ZodOptional<z.ZodString>;
|
|
@@ -118,18 +118,18 @@ export declare const payoutFirestoreSchema: z.ZodObject<{
|
|
|
118
118
|
}, "strip", z.ZodTypeAny, {
|
|
119
119
|
reason: string;
|
|
120
120
|
orderId: string;
|
|
121
|
+
deductedAmount: number;
|
|
121
122
|
refundId: string;
|
|
122
123
|
refundedAmount: number;
|
|
123
|
-
deductedAmount: number;
|
|
124
124
|
appliedAt: string | Date | z.objectOutputType<{
|
|
125
125
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
126
126
|
}, z.ZodTypeAny, "passthrough">;
|
|
127
127
|
}, {
|
|
128
128
|
reason: string;
|
|
129
129
|
orderId: string;
|
|
130
|
+
deductedAmount: number;
|
|
130
131
|
refundId: string;
|
|
131
132
|
refundedAmount: number;
|
|
132
|
-
deductedAmount: number;
|
|
133
133
|
appliedAt: string | Date | z.objectInputType<{
|
|
134
134
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
135
135
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -159,46 +159,46 @@ export declare const payoutFirestoreSchema: z.ZodObject<{
|
|
|
159
159
|
updatedAt: string | Date | z.objectOutputType<{
|
|
160
160
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
161
161
|
}, z.ZodTypeAny, "passthrough">;
|
|
162
|
+
amount: number;
|
|
162
163
|
storeId: string;
|
|
164
|
+
sellerName: string;
|
|
165
|
+
sellerEmail: string;
|
|
166
|
+
paymentMethod: "upi" | "bank_transfer";
|
|
167
|
+
platformFee: number;
|
|
163
168
|
requestedAt: string | Date | z.objectOutputType<{
|
|
164
169
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
165
170
|
}, z.ZodTypeAny, "passthrough">;
|
|
166
|
-
|
|
167
|
-
sellerEmail: string;
|
|
168
|
-
amount: number;
|
|
171
|
+
orderIds: string[];
|
|
169
172
|
grossAmount: number;
|
|
170
|
-
platformFee: number;
|
|
171
173
|
platformFeeRate: number;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
+
notes?: string | undefined;
|
|
175
|
+
netAmount?: number | undefined;
|
|
176
|
+
gstRate?: number | undefined;
|
|
177
|
+
gstAmount?: number | undefined;
|
|
178
|
+
refundDeductions?: {
|
|
179
|
+
reason: string;
|
|
180
|
+
orderId: string;
|
|
181
|
+
deductedAmount: number;
|
|
182
|
+
refundId: string;
|
|
183
|
+
refundedAmount: number;
|
|
184
|
+
appliedAt: string | Date | z.objectOutputType<{
|
|
185
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
186
|
+
}, z.ZodTypeAny, "passthrough">;
|
|
187
|
+
}[] | undefined;
|
|
174
188
|
processedAt?: string | Date | z.objectOutputType<{
|
|
175
189
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
176
190
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
191
|
+
upiId?: string | undefined;
|
|
177
192
|
bankAccount?: {
|
|
193
|
+
ifscCode: string;
|
|
178
194
|
accountHolderName: string;
|
|
179
195
|
accountNumberMasked: string;
|
|
180
|
-
ifscCode: string;
|
|
181
196
|
bankName: string;
|
|
182
197
|
} | undefined;
|
|
183
|
-
upiId?: string | undefined;
|
|
184
|
-
notes?: string | undefined;
|
|
185
198
|
adminNote?: string | undefined;
|
|
186
199
|
gatewayFee?: number | undefined;
|
|
187
200
|
gatewayFeeRate?: number | undefined;
|
|
188
|
-
gstAmount?: number | undefined;
|
|
189
|
-
gstRate?: number | undefined;
|
|
190
201
|
isAutomatic?: boolean | undefined;
|
|
191
|
-
refundDeductions?: {
|
|
192
|
-
reason: string;
|
|
193
|
-
orderId: string;
|
|
194
|
-
refundId: string;
|
|
195
|
-
refundedAmount: number;
|
|
196
|
-
deductedAmount: number;
|
|
197
|
-
appliedAt: string | Date | z.objectOutputType<{
|
|
198
|
-
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
199
|
-
}, z.ZodTypeAny, "passthrough">;
|
|
200
|
-
}[] | undefined;
|
|
201
|
-
netAmount?: number | undefined;
|
|
202
202
|
}, {
|
|
203
203
|
currency: string;
|
|
204
204
|
status: "paid" | "failed" | "pending" | "processing";
|
|
@@ -209,120 +209,47 @@ export declare const payoutFirestoreSchema: z.ZodObject<{
|
|
|
209
209
|
updatedAt: string | Date | z.objectInputType<{
|
|
210
210
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
211
211
|
}, z.ZodTypeAny, "passthrough">;
|
|
212
|
+
amount: number;
|
|
212
213
|
storeId: string;
|
|
214
|
+
sellerName: string;
|
|
215
|
+
sellerEmail: string;
|
|
216
|
+
paymentMethod: "upi" | "bank_transfer";
|
|
217
|
+
platformFee: number;
|
|
213
218
|
requestedAt: string | Date | z.objectInputType<{
|
|
214
219
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
215
220
|
}, z.ZodTypeAny, "passthrough">;
|
|
216
|
-
|
|
217
|
-
sellerEmail: string;
|
|
218
|
-
amount: number;
|
|
221
|
+
orderIds: string[];
|
|
219
222
|
grossAmount: number;
|
|
220
|
-
platformFee: number;
|
|
221
223
|
platformFeeRate: number;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
+
notes?: string | undefined;
|
|
225
|
+
netAmount?: number | undefined;
|
|
226
|
+
gstRate?: number | undefined;
|
|
227
|
+
gstAmount?: number | undefined;
|
|
228
|
+
refundDeductions?: {
|
|
229
|
+
reason: string;
|
|
230
|
+
orderId: string;
|
|
231
|
+
deductedAmount: number;
|
|
232
|
+
refundId: string;
|
|
233
|
+
refundedAmount: number;
|
|
234
|
+
appliedAt: string | Date | z.objectInputType<{
|
|
235
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
236
|
+
}, z.ZodTypeAny, "passthrough">;
|
|
237
|
+
}[] | undefined;
|
|
224
238
|
processedAt?: string | Date | z.objectInputType<{
|
|
225
239
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
226
240
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
241
|
+
upiId?: string | undefined;
|
|
227
242
|
bankAccount?: {
|
|
243
|
+
ifscCode: string;
|
|
228
244
|
accountHolderName: string;
|
|
229
245
|
accountNumberMasked: string;
|
|
230
|
-
ifscCode: string;
|
|
231
246
|
bankName: string;
|
|
232
247
|
} | undefined;
|
|
233
|
-
upiId?: string | undefined;
|
|
234
|
-
notes?: string | undefined;
|
|
235
248
|
adminNote?: string | undefined;
|
|
236
249
|
gatewayFee?: number | undefined;
|
|
237
250
|
gatewayFeeRate?: number | undefined;
|
|
238
|
-
gstAmount?: number | undefined;
|
|
239
|
-
gstRate?: number | undefined;
|
|
240
251
|
isAutomatic?: boolean | undefined;
|
|
241
|
-
refundDeductions?: {
|
|
242
|
-
reason: string;
|
|
243
|
-
orderId: string;
|
|
244
|
-
refundId: string;
|
|
245
|
-
refundedAmount: number;
|
|
246
|
-
deductedAmount: number;
|
|
247
|
-
appliedAt: string | Date | z.objectInputType<{
|
|
248
|
-
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
249
|
-
}, z.ZodTypeAny, "passthrough">;
|
|
250
|
-
}[] | undefined;
|
|
251
|
-
netAmount?: number | undefined;
|
|
252
252
|
}>;
|
|
253
253
|
export type PayoutFromSchema = z.infer<typeof payoutFirestoreSchema>;
|
|
254
254
|
/** Zod schema for payout status — use instead of inline `z.enum(["pending",...])`. */
|
|
255
255
|
export declare const payoutStatusSchema: z.ZodEnum<["pending", "processing", "paid", "failed"]>;
|
|
256
|
-
/**
|
|
257
|
-
* Canonical payment gateway identifiers.
|
|
258
|
-
* Use these constants instead of bare string literals.
|
|
259
|
-
*/
|
|
260
|
-
export declare const PaymentGatewayValues: {
|
|
261
|
-
readonly RAZORPAY: "razorpay";
|
|
262
|
-
readonly STRIPE: "stripe";
|
|
263
|
-
readonly PAYPAL: "paypal";
|
|
264
|
-
readonly COD: "cod";
|
|
265
|
-
readonly UPI: "upi";
|
|
266
|
-
readonly WHATSAPP: "whatsapp";
|
|
267
|
-
readonly BANK_TRANSFER: "bank_transfer";
|
|
268
|
-
};
|
|
269
|
-
export type PaymentGateway = (typeof PaymentGatewayValues)[keyof typeof PaymentGatewayValues];
|
|
270
|
-
export declare const paymentGatewaySchema: z.ZodEnum<["razorpay", "stripe", "paypal", "cod", "upi", "whatsapp", "bank_transfer"]>;
|
|
271
|
-
export declare const paymentStatusSchema: z.ZodEnum<["pending", "authorized", "captured", "failed", "refunded", "partially_refunded"]>;
|
|
272
|
-
/**
|
|
273
|
-
* Base Zod schema for a payment record.
|
|
274
|
-
*
|
|
275
|
-
* @example
|
|
276
|
-
* import { paymentRecordSchema } from "@mohasinac/feat-payments";
|
|
277
|
-
*
|
|
278
|
-
* const mySchema = paymentRecordSchema.extend({
|
|
279
|
-
* bankReference: z.string().optional(),
|
|
280
|
-
* });
|
|
281
|
-
*/
|
|
282
|
-
export declare const paymentRecordSchema: z.ZodObject<{
|
|
283
|
-
id: z.ZodString;
|
|
284
|
-
orderId: z.ZodString;
|
|
285
|
-
gateway: z.ZodEnum<["razorpay", "stripe", "paypal", "cod", "upi", "whatsapp", "bank_transfer"]>;
|
|
286
|
-
gatewayPaymentId: z.ZodOptional<z.ZodString>;
|
|
287
|
-
amount: z.ZodNumber;
|
|
288
|
-
currency: z.ZodDefault<z.ZodString>;
|
|
289
|
-
status: z.ZodDefault<z.ZodEnum<["pending", "authorized", "captured", "failed", "refunded", "partially_refunded"]>>;
|
|
290
|
-
createdAt: z.ZodOptional<z.ZodString>;
|
|
291
|
-
}, "strip", z.ZodTypeAny, {
|
|
292
|
-
currency: string;
|
|
293
|
-
status: "failed" | "captured" | "pending" | "authorized" | "refunded" | "partially_refunded";
|
|
294
|
-
id: string;
|
|
295
|
-
amount: number;
|
|
296
|
-
orderId: string;
|
|
297
|
-
gateway: "bank_transfer" | "upi" | "razorpay" | "stripe" | "paypal" | "cod" | "whatsapp";
|
|
298
|
-
createdAt?: string | undefined;
|
|
299
|
-
gatewayPaymentId?: string | undefined;
|
|
300
|
-
}, {
|
|
301
|
-
id: string;
|
|
302
|
-
amount: number;
|
|
303
|
-
orderId: string;
|
|
304
|
-
gateway: "bank_transfer" | "upi" | "razorpay" | "stripe" | "paypal" | "cod" | "whatsapp";
|
|
305
|
-
currency?: string | undefined;
|
|
306
|
-
status?: "failed" | "captured" | "pending" | "authorized" | "refunded" | "partially_refunded" | undefined;
|
|
307
|
-
createdAt?: string | undefined;
|
|
308
|
-
gatewayPaymentId?: string | undefined;
|
|
309
|
-
}>;
|
|
310
|
-
export declare const paymentGatewayConfigSchema: z.ZodObject<{
|
|
311
|
-
id: z.ZodString;
|
|
312
|
-
gateway: z.ZodEnum<["razorpay", "stripe", "paypal", "cod", "upi", "whatsapp", "bank_transfer"]>;
|
|
313
|
-
isEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
314
|
-
displayName: z.ZodString;
|
|
315
|
-
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
316
|
-
}, "strip", z.ZodTypeAny, {
|
|
317
|
-
id: string;
|
|
318
|
-
displayName: string;
|
|
319
|
-
gateway: "bank_transfer" | "upi" | "razorpay" | "stripe" | "paypal" | "cod" | "whatsapp";
|
|
320
|
-
isEnabled: boolean;
|
|
321
|
-
sortOrder: number;
|
|
322
|
-
}, {
|
|
323
|
-
id: string;
|
|
324
|
-
displayName: string;
|
|
325
|
-
gateway: "bank_transfer" | "upi" | "razorpay" | "stripe" | "paypal" | "cod" | "whatsapp";
|
|
326
|
-
isEnabled?: boolean | undefined;
|
|
327
|
-
sortOrder?: number | undefined;
|
|
328
|
-
}>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./firestore";
|
|
2
2
|
export * from "./saved-methods-firestore";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { getDefaultCurrency } from "../../../core/baseline-resolver";
|
|
5
4
|
import { auditTimestampsShape, firestoreDateSchema, rupeesSchema } from "../../../schemas/firestore-helpers";
|
|
6
5
|
// ─── Firestore document schema (W2) ───────────────────────────────────────────
|
|
7
6
|
// Mirrors PayoutDocument + PayoutRefundDeduction + PayoutBankAccount in
|
|
@@ -57,60 +56,3 @@ export const payoutStatusSchema = z.enum([
|
|
|
57
56
|
"paid",
|
|
58
57
|
"failed",
|
|
59
58
|
]);
|
|
60
|
-
/**
|
|
61
|
-
* Canonical payment gateway identifiers.
|
|
62
|
-
* Use these constants instead of bare string literals.
|
|
63
|
-
*/
|
|
64
|
-
export const PaymentGatewayValues = {
|
|
65
|
-
RAZORPAY: "razorpay",
|
|
66
|
-
STRIPE: "stripe",
|
|
67
|
-
PAYPAL: "paypal",
|
|
68
|
-
COD: "cod",
|
|
69
|
-
UPI: "upi",
|
|
70
|
-
WHATSAPP: "whatsapp",
|
|
71
|
-
BANK_TRANSFER: "bank_transfer",
|
|
72
|
-
};
|
|
73
|
-
export const paymentGatewaySchema = z.enum([
|
|
74
|
-
PaymentGatewayValues.RAZORPAY,
|
|
75
|
-
PaymentGatewayValues.STRIPE,
|
|
76
|
-
PaymentGatewayValues.PAYPAL,
|
|
77
|
-
PaymentGatewayValues.COD,
|
|
78
|
-
PaymentGatewayValues.UPI,
|
|
79
|
-
PaymentGatewayValues.WHATSAPP,
|
|
80
|
-
PaymentGatewayValues.BANK_TRANSFER,
|
|
81
|
-
]);
|
|
82
|
-
export const paymentStatusSchema = z.enum([
|
|
83
|
-
"pending",
|
|
84
|
-
"authorized",
|
|
85
|
-
"captured",
|
|
86
|
-
"failed",
|
|
87
|
-
"refunded",
|
|
88
|
-
"partially_refunded",
|
|
89
|
-
]);
|
|
90
|
-
/**
|
|
91
|
-
* Base Zod schema for a payment record.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* import { paymentRecordSchema } from "@mohasinac/feat-payments";
|
|
95
|
-
*
|
|
96
|
-
* const mySchema = paymentRecordSchema.extend({
|
|
97
|
-
* bankReference: z.string().optional(),
|
|
98
|
-
* });
|
|
99
|
-
*/
|
|
100
|
-
export const paymentRecordSchema = z.object({
|
|
101
|
-
id: z.string(),
|
|
102
|
-
orderId: z.string(),
|
|
103
|
-
gateway: paymentGatewaySchema,
|
|
104
|
-
gatewayPaymentId: z.string().optional(),
|
|
105
|
-
amount: z.number(),
|
|
106
|
-
currency: z.string().default(getDefaultCurrency()),
|
|
107
|
-
status: paymentStatusSchema.default("pending"),
|
|
108
|
-
createdAt: z.string().optional(),
|
|
109
|
-
});
|
|
110
|
-
export const paymentGatewayConfigSchema = z.object({
|
|
111
|
-
id: z.string(),
|
|
112
|
-
gateway: paymentGatewaySchema,
|
|
113
|
-
isEnabled: z.boolean().default(false),
|
|
114
|
-
displayName: z.string(),
|
|
115
|
-
sortOrder: z.number().default(0),
|
|
116
|
-
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { type PaymentGateway, PaymentGatewayValues } from "../schemas";
|
|
2
1
|
import type { JsonValue } from "@mohasinac/appkit";
|
|
3
|
-
export { type PaymentGateway, PaymentGatewayValues };
|
|
4
2
|
export type PaymentStatus = "pending" | "processing" | "paid" | "failed" | "refunded" | "partial_refund";
|
|
5
3
|
export interface PaymentGatewayConfig {
|
|
6
4
|
id: string;
|
|
7
|
-
gateway:
|
|
5
|
+
gateway: string;
|
|
8
6
|
isEnabled: boolean;
|
|
9
7
|
displayName?: string;
|
|
10
8
|
credentials?: Record<string, string>;
|
|
@@ -26,7 +24,7 @@ export interface PaymentSettings {
|
|
|
26
24
|
export interface PaymentRecord {
|
|
27
25
|
id: string;
|
|
28
26
|
orderId: string;
|
|
29
|
-
gateway:
|
|
27
|
+
gateway: string;
|
|
30
28
|
gatewayPaymentId?: string;
|
|
31
29
|
amount: number;
|
|
32
30
|
currency: string;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { PaymentGatewayValues };
|
|
1
|
+
export {};
|
|
@@ -325,7 +325,7 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
325
325
|
}[] | undefined;
|
|
326
326
|
}>, "many">>;
|
|
327
327
|
}, "strip", z.ZodTypeAny, {
|
|
328
|
-
status: "
|
|
328
|
+
status: "published" | "draft" | "in_review" | "archived";
|
|
329
329
|
id: string;
|
|
330
330
|
title: string;
|
|
331
331
|
price: number;
|
|
@@ -337,10 +337,10 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
337
337
|
} | undefined;
|
|
338
338
|
createdAt?: string | undefined;
|
|
339
339
|
updatedAt?: string | undefined;
|
|
340
|
-
storeId?: string | undefined;
|
|
341
340
|
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
342
341
|
category?: string | undefined;
|
|
343
342
|
categorySlug?: string | undefined;
|
|
343
|
+
storeId?: string | undefined;
|
|
344
344
|
stockQuantity?: number | undefined;
|
|
345
345
|
rating?: number | undefined;
|
|
346
346
|
publishedAt?: string | undefined;
|
|
@@ -370,10 +370,10 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
370
370
|
}[] | undefined;
|
|
371
371
|
shippingInfo?: string | undefined;
|
|
372
372
|
returnPolicy?: string | undefined;
|
|
373
|
-
condition?: "new" | "
|
|
373
|
+
condition?: "new" | "like_new" | "good" | "fair" | "poor" | "used" | "refurbished" | "broken" | "graded" | undefined;
|
|
374
374
|
insurance?: boolean | undefined;
|
|
375
375
|
insuranceCost?: number | undefined;
|
|
376
|
-
shippingPaidBy?: "
|
|
376
|
+
shippingPaidBy?: "seller" | "buyer" | undefined;
|
|
377
377
|
auctionEndDate?: string | Date | undefined;
|
|
378
378
|
startingBid?: number | undefined;
|
|
379
379
|
currentBid?: number | undefined;
|
|
@@ -464,7 +464,7 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
464
464
|
sellerAvatar?: string | undefined;
|
|
465
465
|
stockCount?: number | undefined;
|
|
466
466
|
}, {
|
|
467
|
-
status: "
|
|
467
|
+
status: "published" | "draft" | "in_review" | "archived";
|
|
468
468
|
id: string;
|
|
469
469
|
title: string;
|
|
470
470
|
price: number;
|
|
@@ -476,10 +476,10 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
476
476
|
} | undefined;
|
|
477
477
|
createdAt?: string | undefined;
|
|
478
478
|
updatedAt?: string | undefined;
|
|
479
|
-
storeId?: string | undefined;
|
|
480
479
|
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
481
480
|
category?: string | undefined;
|
|
482
481
|
categorySlug?: string | undefined;
|
|
482
|
+
storeId?: string | undefined;
|
|
483
483
|
stockQuantity?: number | undefined;
|
|
484
484
|
rating?: number | undefined;
|
|
485
485
|
publishedAt?: string | undefined;
|
|
@@ -509,10 +509,10 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
509
509
|
}[] | undefined;
|
|
510
510
|
shippingInfo?: string | undefined;
|
|
511
511
|
returnPolicy?: string | undefined;
|
|
512
|
-
condition?: "new" | "
|
|
512
|
+
condition?: "new" | "like_new" | "good" | "fair" | "poor" | "used" | "refurbished" | "broken" | "graded" | undefined;
|
|
513
513
|
insurance?: boolean | undefined;
|
|
514
514
|
insuranceCost?: number | undefined;
|
|
515
|
-
shippingPaidBy?: "
|
|
515
|
+
shippingPaidBy?: "seller" | "buyer" | undefined;
|
|
516
516
|
auctionEndDate?: string | Date | undefined;
|
|
517
517
|
startingBid?: number | undefined;
|
|
518
518
|
currentBid?: number | undefined;
|
|
@@ -620,29 +620,29 @@ export declare const productListParamsSchema: z.ZodObject<{
|
|
|
620
620
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
621
621
|
}, "strip", z.ZodTypeAny, {
|
|
622
622
|
sort?: string | undefined;
|
|
623
|
-
status?: "
|
|
623
|
+
status?: "published" | "draft" | "in_review" | "archived" | undefined;
|
|
624
624
|
page?: number | undefined;
|
|
625
625
|
q?: string | undefined;
|
|
626
626
|
perPage?: number | undefined;
|
|
627
|
-
storeId?: string | undefined;
|
|
628
627
|
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
629
628
|
category?: string | undefined;
|
|
629
|
+
storeId?: string | undefined;
|
|
630
630
|
featured?: boolean | undefined;
|
|
631
|
-
condition?: "new" | "
|
|
631
|
+
condition?: "new" | "like_new" | "good" | "fair" | "poor" | "used" | "refurbished" | "broken" | "graded" | undefined;
|
|
632
632
|
minPrice?: number | undefined;
|
|
633
633
|
maxPrice?: number | undefined;
|
|
634
634
|
inStock?: boolean | undefined;
|
|
635
635
|
}, {
|
|
636
636
|
sort?: string | undefined;
|
|
637
|
-
status?: "
|
|
637
|
+
status?: "published" | "draft" | "in_review" | "archived" | undefined;
|
|
638
638
|
page?: number | undefined;
|
|
639
639
|
q?: string | undefined;
|
|
640
640
|
perPage?: number | undefined;
|
|
641
|
-
storeId?: string | undefined;
|
|
642
641
|
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
643
642
|
category?: string | undefined;
|
|
643
|
+
storeId?: string | undefined;
|
|
644
644
|
featured?: boolean | undefined;
|
|
645
|
-
condition?: "new" | "
|
|
645
|
+
condition?: "new" | "like_new" | "good" | "fair" | "poor" | "used" | "refurbished" | "broken" | "graded" | undefined;
|
|
646
646
|
minPrice?: number | undefined;
|
|
647
647
|
maxPrice?: number | undefined;
|
|
648
648
|
inStock?: boolean | undefined;
|
|
@@ -25,7 +25,7 @@ export declare const productFeatureAdminCreateSchema: z.ZodObject<{
|
|
|
25
25
|
label: string;
|
|
26
26
|
scope: "store" | "platform";
|
|
27
27
|
icon: string;
|
|
28
|
-
category: "shipping" | "
|
|
28
|
+
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
29
29
|
isActive: boolean;
|
|
30
30
|
displayOrder: number;
|
|
31
31
|
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
@@ -36,7 +36,7 @@ export declare const productFeatureAdminCreateSchema: z.ZodObject<{
|
|
|
36
36
|
label: string;
|
|
37
37
|
scope: "store" | "platform";
|
|
38
38
|
icon: string;
|
|
39
|
-
category: "shipping" | "
|
|
39
|
+
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
40
40
|
isActive: boolean;
|
|
41
41
|
displayOrder: number;
|
|
42
42
|
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
@@ -57,7 +57,7 @@ export declare const productFeatureStoreCreateSchema: z.ZodObject<{
|
|
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
|
58
58
|
label: string;
|
|
59
59
|
icon: string;
|
|
60
|
-
category: "shipping" | "
|
|
60
|
+
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
61
61
|
isActive: boolean;
|
|
62
62
|
displayOrder: number;
|
|
63
63
|
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
@@ -66,7 +66,7 @@ export declare const productFeatureStoreCreateSchema: z.ZodObject<{
|
|
|
66
66
|
}, {
|
|
67
67
|
label: string;
|
|
68
68
|
icon: string;
|
|
69
|
-
category: "shipping" | "
|
|
69
|
+
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
70
70
|
isActive: boolean;
|
|
71
71
|
displayOrder: number;
|
|
72
72
|
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
@@ -86,7 +86,7 @@ export declare const productFeatureUpdateSchema: z.ZodObject<{
|
|
|
86
86
|
}, "strip", z.ZodTypeAny, {
|
|
87
87
|
label?: string | undefined;
|
|
88
88
|
icon?: string | undefined;
|
|
89
|
-
category?: "shipping" | "
|
|
89
|
+
category?: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder" | undefined;
|
|
90
90
|
description?: string | undefined;
|
|
91
91
|
isActive?: boolean | undefined;
|
|
92
92
|
displayOrder?: number | undefined;
|
|
@@ -95,7 +95,7 @@ export declare const productFeatureUpdateSchema: z.ZodObject<{
|
|
|
95
95
|
}, {
|
|
96
96
|
label?: string | undefined;
|
|
97
97
|
icon?: string | undefined;
|
|
98
|
-
category?: "shipping" | "
|
|
98
|
+
category?: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder" | undefined;
|
|
99
99
|
description?: string | undefined;
|
|
100
100
|
isActive?: boolean | undefined;
|
|
101
101
|
displayOrder?: number | undefined;
|
|
@@ -133,7 +133,7 @@ export declare const productFeatureFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
133
133
|
label: string;
|
|
134
134
|
scope: "store" | "platform";
|
|
135
135
|
icon: string;
|
|
136
|
-
category: "shipping" | "
|
|
136
|
+
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
137
137
|
isActive: boolean;
|
|
138
138
|
displayOrder: number;
|
|
139
139
|
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
@@ -144,7 +144,7 @@ export declare const productFeatureFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
144
144
|
label: string;
|
|
145
145
|
scope: "store" | "platform";
|
|
146
146
|
icon: string;
|
|
147
|
-
category: "shipping" | "
|
|
147
|
+
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
148
148
|
isActive: boolean;
|
|
149
149
|
displayOrder: number;
|
|
150
150
|
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
@@ -155,7 +155,7 @@ export declare const productFeatureFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
155
155
|
label: string;
|
|
156
156
|
scope: "store" | "platform";
|
|
157
157
|
icon: string;
|
|
158
|
-
category: "shipping" | "
|
|
158
|
+
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
159
159
|
isActive: boolean;
|
|
160
160
|
displayOrder: number;
|
|
161
161
|
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
@@ -166,7 +166,7 @@ export declare const productFeatureFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
166
166
|
label: string;
|
|
167
167
|
scope: "store" | "platform";
|
|
168
168
|
icon: string;
|
|
169
|
-
category: "shipping" | "
|
|
169
|
+
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
170
170
|
isActive: boolean;
|
|
171
171
|
displayOrder: number;
|
|
172
172
|
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|