founder-schema 0.10.0 → 0.12.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.
Files changed (84) hide show
  1. package/README.md +98 -0
  2. package/dist/access/access.d.ts +10 -6
  3. package/dist/access/access.d.ts.map +1 -1
  4. package/dist/access/access.js +8 -1
  5. package/dist/access/access.js.map +1 -1
  6. package/dist/access/permissions.d.ts +60 -3
  7. package/dist/access/permissions.d.ts.map +1 -1
  8. package/dist/access/permissions.js +24 -0
  9. package/dist/access/permissions.js.map +1 -1
  10. package/dist/access/roles.d.ts +3 -3
  11. package/dist/access/standing.d.ts +59 -0
  12. package/dist/access/standing.d.ts.map +1 -0
  13. package/dist/access/standing.js +52 -0
  14. package/dist/access/standing.js.map +1 -0
  15. package/dist/core/errors.d.ts +47 -1
  16. package/dist/core/errors.d.ts.map +1 -1
  17. package/dist/core/errors.js +82 -1
  18. package/dist/core/errors.js.map +1 -1
  19. package/dist/core/limits.d.ts +39 -3
  20. package/dist/core/limits.d.ts.map +1 -1
  21. package/dist/core/limits.js +41 -3
  22. package/dist/core/limits.js.map +1 -1
  23. package/dist/core/responses.d.ts +55 -0
  24. package/dist/core/responses.d.ts.map +1 -1
  25. package/dist/core/responses.js +6 -0
  26. package/dist/core/responses.js.map +1 -1
  27. package/dist/core/validation.d.ts +14 -0
  28. package/dist/core/validation.d.ts.map +1 -1
  29. package/dist/core/validation.js +14 -0
  30. package/dist/core/validation.js.map +1 -1
  31. package/dist/domains/audit/audit.d.ts +28 -7
  32. package/dist/domains/audit/audit.d.ts.map +1 -1
  33. package/dist/domains/audit/audit.js +17 -0
  34. package/dist/domains/audit/audit.js.map +1 -1
  35. package/dist/domains/billing/billing.d.ts +1179 -0
  36. package/dist/domains/billing/billing.d.ts.map +1 -0
  37. package/dist/domains/billing/billing.js +393 -0
  38. package/dist/domains/billing/billing.js.map +1 -0
  39. package/dist/domains/billing/gst.d.ts +229 -0
  40. package/dist/domains/billing/gst.d.ts.map +1 -0
  41. package/dist/domains/billing/gst.js +117 -0
  42. package/dist/domains/billing/gst.js.map +1 -0
  43. package/dist/domains/chat/chat.d.ts +85 -0
  44. package/dist/domains/chat/chat.d.ts.map +1 -1
  45. package/dist/domains/chat/chat.js +62 -0
  46. package/dist/domains/chat/chat.js.map +1 -1
  47. package/dist/domains/communities/communities.d.ts +11 -11
  48. package/dist/domains/dashboard/dashboard.d.ts +9 -1
  49. package/dist/domains/dashboard/dashboard.d.ts.map +1 -1
  50. package/dist/domains/dashboard/dashboard.js +15 -0
  51. package/dist/domains/dashboard/dashboard.js.map +1 -1
  52. package/dist/domains/feed/feed.d.ts.map +1 -1
  53. package/dist/domains/feed/feed.js +7 -1
  54. package/dist/domains/feed/feed.js.map +1 -1
  55. package/dist/domains/members/members.d.ts +30 -5
  56. package/dist/domains/members/members.d.ts.map +1 -1
  57. package/dist/domains/members/members.js +23 -0
  58. package/dist/domains/members/members.js.map +1 -1
  59. package/dist/domains/membership/membership.d.ts +239 -0
  60. package/dist/domains/membership/membership.d.ts.map +1 -0
  61. package/dist/domains/membership/membership.js +153 -0
  62. package/dist/domains/membership/membership.js.map +1 -0
  63. package/dist/domains/notifications/notifications.d.ts +43 -1
  64. package/dist/domains/notifications/notifications.d.ts.map +1 -1
  65. package/dist/domains/notifications/notifications.js +19 -0
  66. package/dist/domains/notifications/notifications.js.map +1 -1
  67. package/dist/domains/products/products.d.ts +44 -12
  68. package/dist/domains/products/products.d.ts.map +1 -1
  69. package/dist/domains/products/products.js +33 -3
  70. package/dist/domains/products/products.js.map +1 -1
  71. package/dist/domains/profile/founder-profile.d.ts +178 -0
  72. package/dist/domains/profile/founder-profile.d.ts.map +1 -1
  73. package/dist/domains/profile/founder-profile.js +77 -0
  74. package/dist/domains/profile/founder-profile.js.map +1 -1
  75. package/dist/domains/reviews/reviews.d.ts +3 -0
  76. package/dist/domains/reviews/reviews.d.ts.map +1 -1
  77. package/dist/domains/reviews/reviews.js +6 -1
  78. package/dist/domains/reviews/reviews.js.map +1 -1
  79. package/dist/domains/team/team.d.ts +4 -4
  80. package/dist/index.d.ts +7 -4
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +9 -4
  83. package/dist/index.js.map +1 -1
  84. package/package.json +1 -1
@@ -0,0 +1,1179 @@
1
+ /**
2
+ * founder-schema: buying, paying, invoices, refunds and coupons (0.12.0)
3
+ *
4
+ * POST /api/v1/billing/quote quoteBodySchema -> quoteSchema
5
+ * POST /api/v1/billing/orders createOrderBodySchema -> createOrderResponseSchema
6
+ * GET /api/v1/billing/orders/:orderId orderStateSchema (polled while "processing")
7
+ * POST /api/v1/billing/orders/:orderId/confirm confirmOrderBodySchema -> orderStateSchema
8
+ * GET /api/v1/billing/payments paymentPageSchema (mine)
9
+ * GET /api/v1/billing/payments/:orderId paymentDetailSchema (mine, with the invoice)
10
+ *
11
+ * Staff (by the ability: support reads; managers refund and run coupons):
12
+ * GET /api/v1/staff/payments staffPaymentsQuerySchema -> staffPaymentPageSchema
13
+ * GET /api/v1/staff/payments/:orderId staffPaymentDetailSchema
14
+ * POST /api/v1/staff/payments/:orderId/refund refundPaymentBodySchema -> staffPaymentDetailSchema
15
+ * GET /api/v1/staff/coupons couponListSchema
16
+ * POST /api/v1/staff/coupons createCouponBodySchema -> couponSchema
17
+ * PATCH /api/v1/staff/coupons/:couponId updateCouponBodySchema -> couponSchema
18
+ * PUT /api/v1/members/:memberId/membership setMembershipBodySchema -> memberDetailSchema
19
+ *
20
+ * THE ONE RULE: THE SERVER PRICES, THE CLIENT CHOOSES. A request names what it
21
+ * wants (an item) and maybe a coupon CODE; it never names an amount. Every
22
+ * amount here is the server's, in integer paise, GST included.
23
+ *
24
+ * TWO PATHS IN, ONE GRANT. A payment reaches the server from the browser the
25
+ * moment checkout returns (`confirm`) and from the gateway's webhook. Either
26
+ * grants; the second is a no-op. So a member who closes the tab is still
27
+ * granted, and `confirm` failing never means "not paid": the web says
28
+ * "processing" and polls the order.
29
+ *
30
+ * GST: the company is registered, every captured payment gets a tax invoice,
31
+ * every refund a credit note. Where the buyer is decides the tax: in the
32
+ * supplier's state CGST + SGST, elsewhere IGST. So checkout asks for the state.
33
+ *
34
+ * @module founder-schema/domains/billing
35
+ */
36
+ import { z } from 'zod';
37
+ export { type BillingDetails, billingDetailsSchema, GST_RATE_PERCENT, GST_STATE_CODE_VALUES, GST_STATES, type GstStateCode, gstinChecksumValid, gstinSchema, gstStateCodeSchema, gstStateName, } from './gst.js';
38
+ /** ⚠ Stored on every order: append only. */
39
+ export declare const PURCHASE_KIND_VALUES: readonly ["membership", "plan", "upgrade"];
40
+ export declare const purchaseKindSchema: z.ZodEnum<{
41
+ membership: "membership";
42
+ plan: "plan";
43
+ upgrade: "upgrade";
44
+ }>;
45
+ export type PurchaseKind = z.infer<typeof purchaseKindSchema>;
46
+ /**
47
+ * The thing asked for.
48
+ *
49
+ * membership Rs 99, once
50
+ * plan a month or a year of Premium or Business, appended
51
+ * upgrade the Premium time left, turned into Business, for the difference
52
+ */
53
+ export declare const purchaseItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
54
+ kind: z.ZodLiteral<"membership">;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ kind: z.ZodLiteral<"plan">;
57
+ tier: z.ZodEnum<{
58
+ premium: "premium";
59
+ business: "business";
60
+ }>;
61
+ period: z.ZodEnum<{
62
+ month: "month";
63
+ year: "year";
64
+ }>;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ kind: z.ZodLiteral<"upgrade">;
67
+ }, z.core.$strip>], "kind">;
68
+ export type PurchaseItem = z.infer<typeof purchaseItemSchema>;
69
+ /** A coupon code as typed: letters, digits, hyphens; compared upper-case. */
70
+ export declare const couponCodeSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
71
+ /**
72
+ * The tax inside a total. `taxable + cgst + sgst + igst = total`; either
73
+ * CGST + SGST (buyer in the supplier's state) or IGST, never both.
74
+ */
75
+ export declare const taxSplitSchema: z.ZodObject<{
76
+ ratePercent: z.ZodNumber;
77
+ taxable: z.ZodNumber;
78
+ cgst: z.ZodNumber;
79
+ sgst: z.ZodNumber;
80
+ igst: z.ZodNumber;
81
+ total: z.ZodNumber;
82
+ }, z.core.$strip>;
83
+ export type TaxSplit = z.infer<typeof taxSplitSchema>;
84
+ /** `POST /billing/quote`. The state is optional: without it, no tax split. */
85
+ export declare const quoteBodySchema: z.ZodObject<{
86
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
87
+ kind: z.ZodLiteral<"membership">;
88
+ }, z.core.$strip>, z.ZodObject<{
89
+ kind: z.ZodLiteral<"plan">;
90
+ tier: z.ZodEnum<{
91
+ premium: "premium";
92
+ business: "business";
93
+ }>;
94
+ period: z.ZodEnum<{
95
+ month: "month";
96
+ year: "year";
97
+ }>;
98
+ }, z.core.$strip>, z.ZodObject<{
99
+ kind: z.ZodLiteral<"upgrade">;
100
+ }, z.core.$strip>], "kind">;
101
+ couponCode: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
102
+ stateCode: z.ZodOptional<z.ZodEnum<{
103
+ "01": "01";
104
+ "02": "02";
105
+ "03": "03";
106
+ "04": "04";
107
+ "05": "05";
108
+ "06": "06";
109
+ "07": "07";
110
+ "08": "08";
111
+ "09": "09";
112
+ 10: "10";
113
+ 11: "11";
114
+ 12: "12";
115
+ 13: "13";
116
+ 14: "14";
117
+ 15: "15";
118
+ 16: "16";
119
+ 17: "17";
120
+ 18: "18";
121
+ 19: "19";
122
+ 20: "20";
123
+ 21: "21";
124
+ 22: "22";
125
+ 23: "23";
126
+ 24: "24";
127
+ 26: "26";
128
+ 27: "27";
129
+ 29: "29";
130
+ 30: "30";
131
+ 31: "31";
132
+ 32: "32";
133
+ 33: "33";
134
+ 34: "34";
135
+ 35: "35";
136
+ 36: "36";
137
+ 37: "37";
138
+ 38: "38";
139
+ }>>;
140
+ }, z.core.$strip>;
141
+ export type QuoteBody = z.infer<typeof quoteBodySchema>;
142
+ /** What a plan or an upgrade would do to the plan, priced now. */
143
+ export declare const planEffectSchema: z.ZodObject<{
144
+ tier: z.ZodEnum<{
145
+ premium: "premium";
146
+ business: "business";
147
+ }>;
148
+ startsAt: z.ZodISODateTime;
149
+ endsAt: z.ZodISODateTime;
150
+ upgradedDays: z.ZodNullable<z.ZodNumber>;
151
+ }, z.core.$strip>;
152
+ export type PlanEffect = z.infer<typeof planEffectSchema>;
153
+ export declare const quoteSchema: z.ZodObject<{
154
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
155
+ kind: z.ZodLiteral<"membership">;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ kind: z.ZodLiteral<"plan">;
158
+ tier: z.ZodEnum<{
159
+ premium: "premium";
160
+ business: "business";
161
+ }>;
162
+ period: z.ZodEnum<{
163
+ month: "month";
164
+ year: "year";
165
+ }>;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ kind: z.ZodLiteral<"upgrade">;
168
+ }, z.core.$strip>], "kind">;
169
+ title: z.ZodString;
170
+ listPrice: z.ZodNumber;
171
+ discount: z.ZodNumber;
172
+ total: z.ZodNumber;
173
+ coupon: z.ZodNullable<z.ZodObject<{
174
+ code: z.ZodString;
175
+ label: z.ZodString;
176
+ }, z.core.$strip>>;
177
+ plan: z.ZodNullable<z.ZodObject<{
178
+ tier: z.ZodEnum<{
179
+ premium: "premium";
180
+ business: "business";
181
+ }>;
182
+ startsAt: z.ZodISODateTime;
183
+ endsAt: z.ZodISODateTime;
184
+ upgradedDays: z.ZodNullable<z.ZodNumber>;
185
+ }, z.core.$strip>>;
186
+ tax: z.ZodNullable<z.ZodObject<{
187
+ ratePercent: z.ZodNumber;
188
+ taxable: z.ZodNumber;
189
+ cgst: z.ZodNumber;
190
+ sgst: z.ZodNumber;
191
+ igst: z.ZodNumber;
192
+ total: z.ZodNumber;
193
+ }, z.core.$strip>>;
194
+ refundWindowDays: z.ZodNumber;
195
+ }, z.core.$strip>;
196
+ export type Quote = z.infer<typeof quoteSchema>;
197
+ /**
198
+ * Where an order stands. ⚠ Stored: append only.
199
+ *
200
+ * created checkout open, nothing paid yet
201
+ * paid captured and granted; has an invoice
202
+ * granted_free a free coupon: granted with no payment and no invoice
203
+ * expired not paid within `ORDER_TTL_MINUTES`
204
+ * refund_pending staff refunded it; the gateway is returning the money
205
+ * refunded the money is back; has a credit note
206
+ * refund_failed the gateway could not return it; staff act from its dashboard
207
+ */
208
+ export declare const ORDER_STATUS_VALUES: readonly ["created", "paid", "granted_free", "expired", "refund_pending", "refunded", "refund_failed"];
209
+ export declare const orderStatusSchema: z.ZodEnum<{
210
+ paid: "paid";
211
+ created: "created";
212
+ granted_free: "granted_free";
213
+ expired: "expired";
214
+ refund_pending: "refund_pending";
215
+ refunded: "refunded";
216
+ refund_failed: "refund_failed";
217
+ }>;
218
+ export type OrderStatus = z.infer<typeof orderStatusSchema>;
219
+ /**
220
+ * `POST /billing/orders`. Billing details are required for anything paid (the
221
+ * invoice needs a place of supply): the server refuses a paid order without
222
+ * them (`billing.stateCode`, VALIDATION_ERROR). A free coupon issues no
223
+ * invoice, so it needs none (0.12.0).
224
+ */
225
+ export declare const createOrderBodySchema: z.ZodObject<{
226
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
227
+ kind: z.ZodLiteral<"membership">;
228
+ }, z.core.$strip>, z.ZodObject<{
229
+ kind: z.ZodLiteral<"plan">;
230
+ tier: z.ZodEnum<{
231
+ premium: "premium";
232
+ business: "business";
233
+ }>;
234
+ period: z.ZodEnum<{
235
+ month: "month";
236
+ year: "year";
237
+ }>;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ kind: z.ZodLiteral<"upgrade">;
240
+ }, z.core.$strip>], "kind">;
241
+ couponCode: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
242
+ billing: z.ZodOptional<z.ZodObject<{
243
+ stateCode: z.ZodEnum<{
244
+ "01": "01";
245
+ "02": "02";
246
+ "03": "03";
247
+ "04": "04";
248
+ "05": "05";
249
+ "06": "06";
250
+ "07": "07";
251
+ "08": "08";
252
+ "09": "09";
253
+ 10: "10";
254
+ 11: "11";
255
+ 12: "12";
256
+ 13: "13";
257
+ 14: "14";
258
+ 15: "15";
259
+ 16: "16";
260
+ 17: "17";
261
+ 18: "18";
262
+ 19: "19";
263
+ 20: "20";
264
+ 21: "21";
265
+ 22: "22";
266
+ 23: "23";
267
+ 24: "24";
268
+ 26: "26";
269
+ 27: "27";
270
+ 29: "29";
271
+ 30: "30";
272
+ 31: "31";
273
+ 32: "32";
274
+ 33: "33";
275
+ 34: "34";
276
+ 35: "35";
277
+ 36: "36";
278
+ 37: "37";
279
+ 38: "38";
280
+ }>;
281
+ gstin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
282
+ legalName: z.ZodOptional<z.ZodString>;
283
+ address: z.ZodOptional<z.ZodString>;
284
+ }, z.core.$strip>>;
285
+ }, z.core.$strip>;
286
+ export type CreateOrderBody = z.infer<typeof createOrderBodySchema>;
287
+ /**
288
+ * Either done (a free coupon granted at once) or a checkout to open. The
289
+ * checkout fields are Razorpay Checkout's own options; identity (name, email,
290
+ * phone) is the server's, never typed by the caller.
291
+ */
292
+ export declare const createOrderResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
293
+ status: z.ZodLiteral<"granted">;
294
+ orderId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
295
+ }, z.core.$strip>, z.ZodObject<{
296
+ status: z.ZodLiteral<"checkout">;
297
+ orderId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
298
+ expiresAt: z.ZodISODateTime;
299
+ checkout: z.ZodObject<{
300
+ keyId: z.ZodString;
301
+ razorpayOrderId: z.ZodString;
302
+ amount: z.ZodNumber;
303
+ currency: z.ZodLiteral<"INR">;
304
+ name: z.ZodString;
305
+ description: z.ZodString;
306
+ prefill: z.ZodObject<{
307
+ name: z.ZodString;
308
+ email: z.ZodString;
309
+ contact: z.ZodOptional<z.ZodString>;
310
+ }, z.core.$strip>;
311
+ }, z.core.$strip>;
312
+ }, z.core.$strip>], "status">;
313
+ export type CreateOrderResponse = z.infer<typeof createOrderResponseSchema>;
314
+ export declare const orderParamsSchema: z.ZodObject<{
315
+ orderId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
316
+ }, z.core.$strip>;
317
+ export type OrderParams = z.infer<typeof orderParamsSchema>;
318
+ /** What Razorpay Checkout's `handler` hands back, as it names it. */
319
+ export declare const confirmOrderBodySchema: z.ZodObject<{
320
+ razorpayOrderId: z.ZodString;
321
+ razorpayPaymentId: z.ZodString;
322
+ razorpaySignature: z.ZodString;
323
+ }, z.core.$strip>;
324
+ export type ConfirmOrderBody = z.infer<typeof confirmOrderBodySchema>;
325
+ /** An order as its buyer polls it. */
326
+ export declare const orderStateSchema: z.ZodObject<{
327
+ orderId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
328
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
329
+ kind: z.ZodLiteral<"membership">;
330
+ }, z.core.$strip>, z.ZodObject<{
331
+ kind: z.ZodLiteral<"plan">;
332
+ tier: z.ZodEnum<{
333
+ premium: "premium";
334
+ business: "business";
335
+ }>;
336
+ period: z.ZodEnum<{
337
+ month: "month";
338
+ year: "year";
339
+ }>;
340
+ }, z.core.$strip>, z.ZodObject<{
341
+ kind: z.ZodLiteral<"upgrade">;
342
+ }, z.core.$strip>], "kind">;
343
+ status: z.ZodEnum<{
344
+ paid: "paid";
345
+ created: "created";
346
+ granted_free: "granted_free";
347
+ expired: "expired";
348
+ refund_pending: "refund_pending";
349
+ refunded: "refunded";
350
+ refund_failed: "refund_failed";
351
+ }>;
352
+ notApplied: z.ZodBoolean;
353
+ }, z.core.$strip>;
354
+ export type OrderState = z.infer<typeof orderStateSchema>;
355
+ /** A party on an invoice. The supplier always has a GSTIN on a real invoice; a buyer, only on B2B. */
356
+ export declare const invoicePartySchema: z.ZodObject<{
357
+ name: z.ZodString;
358
+ address: z.ZodNullable<z.ZodString>;
359
+ gstin: z.ZodNullable<z.ZodString>;
360
+ stateCode: z.ZodEnum<{
361
+ "01": "01";
362
+ "02": "02";
363
+ "03": "03";
364
+ "04": "04";
365
+ "05": "05";
366
+ "06": "06";
367
+ "07": "07";
368
+ "08": "08";
369
+ "09": "09";
370
+ 10: "10";
371
+ 11: "11";
372
+ 12: "12";
373
+ 13: "13";
374
+ 14: "14";
375
+ 15: "15";
376
+ 16: "16";
377
+ 17: "17";
378
+ 18: "18";
379
+ 19: "19";
380
+ 20: "20";
381
+ 21: "21";
382
+ 22: "22";
383
+ 23: "23";
384
+ 24: "24";
385
+ 26: "26";
386
+ 27: "27";
387
+ 29: "29";
388
+ 30: "30";
389
+ 31: "31";
390
+ 32: "32";
391
+ 33: "33";
392
+ 34: "34";
393
+ 35: "35";
394
+ 36: "36";
395
+ 37: "37";
396
+ 38: "38";
397
+ }>;
398
+ stateName: z.ZodString;
399
+ }, z.core.$strip>;
400
+ export type InvoiceParty = z.infer<typeof invoicePartySchema>;
401
+ /** A tax invoice, frozen when the payment was captured. */
402
+ export declare const invoiceSchema: z.ZodObject<{
403
+ number: z.ZodString;
404
+ issuedAt: z.ZodISODateTime;
405
+ test: z.ZodBoolean;
406
+ supplier: z.ZodObject<{
407
+ name: z.ZodString;
408
+ address: z.ZodNullable<z.ZodString>;
409
+ gstin: z.ZodNullable<z.ZodString>;
410
+ stateCode: z.ZodEnum<{
411
+ "01": "01";
412
+ "02": "02";
413
+ "03": "03";
414
+ "04": "04";
415
+ "05": "05";
416
+ "06": "06";
417
+ "07": "07";
418
+ "08": "08";
419
+ "09": "09";
420
+ 10: "10";
421
+ 11: "11";
422
+ 12: "12";
423
+ 13: "13";
424
+ 14: "14";
425
+ 15: "15";
426
+ 16: "16";
427
+ 17: "17";
428
+ 18: "18";
429
+ 19: "19";
430
+ 20: "20";
431
+ 21: "21";
432
+ 22: "22";
433
+ 23: "23";
434
+ 24: "24";
435
+ 26: "26";
436
+ 27: "27";
437
+ 29: "29";
438
+ 30: "30";
439
+ 31: "31";
440
+ 32: "32";
441
+ 33: "33";
442
+ 34: "34";
443
+ 35: "35";
444
+ 36: "36";
445
+ 37: "37";
446
+ 38: "38";
447
+ }>;
448
+ stateName: z.ZodString;
449
+ }, z.core.$strip>;
450
+ buyer: z.ZodObject<{
451
+ name: z.ZodString;
452
+ address: z.ZodNullable<z.ZodString>;
453
+ gstin: z.ZodNullable<z.ZodString>;
454
+ stateCode: z.ZodEnum<{
455
+ "01": "01";
456
+ "02": "02";
457
+ "03": "03";
458
+ "04": "04";
459
+ "05": "05";
460
+ "06": "06";
461
+ "07": "07";
462
+ "08": "08";
463
+ "09": "09";
464
+ 10: "10";
465
+ 11: "11";
466
+ 12: "12";
467
+ 13: "13";
468
+ 14: "14";
469
+ 15: "15";
470
+ 16: "16";
471
+ 17: "17";
472
+ 18: "18";
473
+ 19: "19";
474
+ 20: "20";
475
+ 21: "21";
476
+ 22: "22";
477
+ 23: "23";
478
+ 24: "24";
479
+ 26: "26";
480
+ 27: "27";
481
+ 29: "29";
482
+ 30: "30";
483
+ 31: "31";
484
+ 32: "32";
485
+ 33: "33";
486
+ 34: "34";
487
+ 35: "35";
488
+ 36: "36";
489
+ 37: "37";
490
+ 38: "38";
491
+ }>;
492
+ stateName: z.ZodString;
493
+ }, z.core.$strip>;
494
+ kind: z.ZodEnum<{
495
+ b2b: "b2b";
496
+ b2c: "b2c";
497
+ }>;
498
+ sac: z.ZodString;
499
+ description: z.ZodString;
500
+ tax: z.ZodObject<{
501
+ ratePercent: z.ZodNumber;
502
+ taxable: z.ZodNumber;
503
+ cgst: z.ZodNumber;
504
+ sgst: z.ZodNumber;
505
+ igst: z.ZodNumber;
506
+ total: z.ZodNumber;
507
+ }, z.core.$strip>;
508
+ reverseCharge: z.ZodLiteral<false>;
509
+ razorpayPaymentId: z.ZodString;
510
+ }, z.core.$strip>;
511
+ export type Invoice = z.infer<typeof invoiceSchema>;
512
+ /** A refund's credit note, against its invoice. */
513
+ export declare const creditNoteSchema: z.ZodObject<{
514
+ number: z.ZodString;
515
+ issuedAt: z.ZodISODateTime;
516
+ invoiceNumber: z.ZodString;
517
+ tax: z.ZodObject<{
518
+ ratePercent: z.ZodNumber;
519
+ taxable: z.ZodNumber;
520
+ cgst: z.ZodNumber;
521
+ sgst: z.ZodNumber;
522
+ igst: z.ZodNumber;
523
+ total: z.ZodNumber;
524
+ }, z.core.$strip>;
525
+ }, z.core.$strip>;
526
+ export type CreditNote = z.infer<typeof creditNoteSchema>;
527
+ /** One purchase in a member's history. Only settled orders are listed, never an abandoned checkout. */
528
+ export declare const paymentSummarySchema: z.ZodObject<{
529
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
530
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
531
+ kind: z.ZodLiteral<"membership">;
532
+ }, z.core.$strip>, z.ZodObject<{
533
+ kind: z.ZodLiteral<"plan">;
534
+ tier: z.ZodEnum<{
535
+ premium: "premium";
536
+ business: "business";
537
+ }>;
538
+ period: z.ZodEnum<{
539
+ month: "month";
540
+ year: "year";
541
+ }>;
542
+ }, z.core.$strip>, z.ZodObject<{
543
+ kind: z.ZodLiteral<"upgrade">;
544
+ }, z.core.$strip>], "kind">;
545
+ title: z.ZodString;
546
+ total: z.ZodNumber;
547
+ status: z.ZodEnum<{
548
+ paid: "paid";
549
+ created: "created";
550
+ granted_free: "granted_free";
551
+ expired: "expired";
552
+ refund_pending: "refund_pending";
553
+ refunded: "refunded";
554
+ refund_failed: "refund_failed";
555
+ }>;
556
+ paidAt: z.ZodISODateTime;
557
+ invoiceNumber: z.ZodNullable<z.ZodString>;
558
+ refundableUntil: z.ZodNullable<z.ZodISODateTime>;
559
+ }, z.core.$strip>;
560
+ export type PaymentSummary = z.infer<typeof paymentSummarySchema>;
561
+ export declare const paymentPageSchema: z.ZodObject<{
562
+ items: z.ZodArray<z.ZodObject<{
563
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
564
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
565
+ kind: z.ZodLiteral<"membership">;
566
+ }, z.core.$strip>, z.ZodObject<{
567
+ kind: z.ZodLiteral<"plan">;
568
+ tier: z.ZodEnum<{
569
+ premium: "premium";
570
+ business: "business";
571
+ }>;
572
+ period: z.ZodEnum<{
573
+ month: "month";
574
+ year: "year";
575
+ }>;
576
+ }, z.core.$strip>, z.ZodObject<{
577
+ kind: z.ZodLiteral<"upgrade">;
578
+ }, z.core.$strip>], "kind">;
579
+ title: z.ZodString;
580
+ total: z.ZodNumber;
581
+ status: z.ZodEnum<{
582
+ paid: "paid";
583
+ created: "created";
584
+ granted_free: "granted_free";
585
+ expired: "expired";
586
+ refund_pending: "refund_pending";
587
+ refunded: "refunded";
588
+ refund_failed: "refund_failed";
589
+ }>;
590
+ paidAt: z.ZodISODateTime;
591
+ invoiceNumber: z.ZodNullable<z.ZodString>;
592
+ refundableUntil: z.ZodNullable<z.ZodISODateTime>;
593
+ }, z.core.$strip>>;
594
+ nextCursor: z.ZodNullable<z.ZodString>;
595
+ }, z.core.$strip>;
596
+ export type PaymentPage = z.infer<typeof paymentPageSchema>;
597
+ export declare const paymentDetailSchema: z.ZodObject<{
598
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
599
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
600
+ kind: z.ZodLiteral<"membership">;
601
+ }, z.core.$strip>, z.ZodObject<{
602
+ kind: z.ZodLiteral<"plan">;
603
+ tier: z.ZodEnum<{
604
+ premium: "premium";
605
+ business: "business";
606
+ }>;
607
+ period: z.ZodEnum<{
608
+ month: "month";
609
+ year: "year";
610
+ }>;
611
+ }, z.core.$strip>, z.ZodObject<{
612
+ kind: z.ZodLiteral<"upgrade">;
613
+ }, z.core.$strip>], "kind">;
614
+ title: z.ZodString;
615
+ total: z.ZodNumber;
616
+ status: z.ZodEnum<{
617
+ paid: "paid";
618
+ created: "created";
619
+ granted_free: "granted_free";
620
+ expired: "expired";
621
+ refund_pending: "refund_pending";
622
+ refunded: "refunded";
623
+ refund_failed: "refund_failed";
624
+ }>;
625
+ paidAt: z.ZodISODateTime;
626
+ invoiceNumber: z.ZodNullable<z.ZodString>;
627
+ refundableUntil: z.ZodNullable<z.ZodISODateTime>;
628
+ listPrice: z.ZodNumber;
629
+ discount: z.ZodNumber;
630
+ coupon: z.ZodNullable<z.ZodObject<{
631
+ code: z.ZodString;
632
+ label: z.ZodString;
633
+ }, z.core.$strip>>;
634
+ invoice: z.ZodNullable<z.ZodObject<{
635
+ number: z.ZodString;
636
+ issuedAt: z.ZodISODateTime;
637
+ test: z.ZodBoolean;
638
+ supplier: z.ZodObject<{
639
+ name: z.ZodString;
640
+ address: z.ZodNullable<z.ZodString>;
641
+ gstin: z.ZodNullable<z.ZodString>;
642
+ stateCode: z.ZodEnum<{
643
+ "01": "01";
644
+ "02": "02";
645
+ "03": "03";
646
+ "04": "04";
647
+ "05": "05";
648
+ "06": "06";
649
+ "07": "07";
650
+ "08": "08";
651
+ "09": "09";
652
+ 10: "10";
653
+ 11: "11";
654
+ 12: "12";
655
+ 13: "13";
656
+ 14: "14";
657
+ 15: "15";
658
+ 16: "16";
659
+ 17: "17";
660
+ 18: "18";
661
+ 19: "19";
662
+ 20: "20";
663
+ 21: "21";
664
+ 22: "22";
665
+ 23: "23";
666
+ 24: "24";
667
+ 26: "26";
668
+ 27: "27";
669
+ 29: "29";
670
+ 30: "30";
671
+ 31: "31";
672
+ 32: "32";
673
+ 33: "33";
674
+ 34: "34";
675
+ 35: "35";
676
+ 36: "36";
677
+ 37: "37";
678
+ 38: "38";
679
+ }>;
680
+ stateName: z.ZodString;
681
+ }, z.core.$strip>;
682
+ buyer: z.ZodObject<{
683
+ name: z.ZodString;
684
+ address: z.ZodNullable<z.ZodString>;
685
+ gstin: z.ZodNullable<z.ZodString>;
686
+ stateCode: z.ZodEnum<{
687
+ "01": "01";
688
+ "02": "02";
689
+ "03": "03";
690
+ "04": "04";
691
+ "05": "05";
692
+ "06": "06";
693
+ "07": "07";
694
+ "08": "08";
695
+ "09": "09";
696
+ 10: "10";
697
+ 11: "11";
698
+ 12: "12";
699
+ 13: "13";
700
+ 14: "14";
701
+ 15: "15";
702
+ 16: "16";
703
+ 17: "17";
704
+ 18: "18";
705
+ 19: "19";
706
+ 20: "20";
707
+ 21: "21";
708
+ 22: "22";
709
+ 23: "23";
710
+ 24: "24";
711
+ 26: "26";
712
+ 27: "27";
713
+ 29: "29";
714
+ 30: "30";
715
+ 31: "31";
716
+ 32: "32";
717
+ 33: "33";
718
+ 34: "34";
719
+ 35: "35";
720
+ 36: "36";
721
+ 37: "37";
722
+ 38: "38";
723
+ }>;
724
+ stateName: z.ZodString;
725
+ }, z.core.$strip>;
726
+ kind: z.ZodEnum<{
727
+ b2b: "b2b";
728
+ b2c: "b2c";
729
+ }>;
730
+ sac: z.ZodString;
731
+ description: z.ZodString;
732
+ tax: z.ZodObject<{
733
+ ratePercent: z.ZodNumber;
734
+ taxable: z.ZodNumber;
735
+ cgst: z.ZodNumber;
736
+ sgst: z.ZodNumber;
737
+ igst: z.ZodNumber;
738
+ total: z.ZodNumber;
739
+ }, z.core.$strip>;
740
+ reverseCharge: z.ZodLiteral<false>;
741
+ razorpayPaymentId: z.ZodString;
742
+ }, z.core.$strip>>;
743
+ creditNote: z.ZodNullable<z.ZodObject<{
744
+ number: z.ZodString;
745
+ issuedAt: z.ZodISODateTime;
746
+ invoiceNumber: z.ZodString;
747
+ tax: z.ZodObject<{
748
+ ratePercent: z.ZodNumber;
749
+ taxable: z.ZodNumber;
750
+ cgst: z.ZodNumber;
751
+ sgst: z.ZodNumber;
752
+ igst: z.ZodNumber;
753
+ total: z.ZodNumber;
754
+ }, z.core.$strip>;
755
+ }, z.core.$strip>>;
756
+ refundedAt: z.ZodNullable<z.ZodISODateTime>;
757
+ }, z.core.$strip>;
758
+ export type PaymentDetail = z.infer<typeof paymentDetailSchema>;
759
+ /** Who paid, as they are now, so staff can find them. Email only for a role that may read it. */
760
+ export declare const payerSchema: z.ZodObject<{
761
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
762
+ displayName: z.ZodString;
763
+ email: z.ZodNullable<z.ZodString>;
764
+ }, z.core.$strip>;
765
+ export type Payer = z.infer<typeof payerSchema>;
766
+ export declare const staffPaymentsQuerySchema: z.ZodObject<{
767
+ limit: z.ZodPreprocess<z.ZodDefault<z.ZodCoercedNumber<unknown>>, unknown>;
768
+ cursor: z.ZodOptional<z.ZodString>;
769
+ status: z.ZodOptional<z.ZodEnum<{
770
+ paid: "paid";
771
+ created: "created";
772
+ granted_free: "granted_free";
773
+ expired: "expired";
774
+ refund_pending: "refund_pending";
775
+ refunded: "refunded";
776
+ refund_failed: "refund_failed";
777
+ }>>;
778
+ memberId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
779
+ needsAction: z.ZodPreprocess<z.ZodDefault<z.ZodCodec<z.ZodString, z.ZodBoolean>>, unknown>;
780
+ }, z.core.$strip>;
781
+ export type StaffPaymentsQuery = z.infer<typeof staffPaymentsQuerySchema>;
782
+ export type StaffPaymentsQueryInput = z.input<typeof staffPaymentsQuerySchema>;
783
+ export declare const staffPaymentSummarySchema: z.ZodObject<{
784
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
785
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
786
+ kind: z.ZodLiteral<"membership">;
787
+ }, z.core.$strip>, z.ZodObject<{
788
+ kind: z.ZodLiteral<"plan">;
789
+ tier: z.ZodEnum<{
790
+ premium: "premium";
791
+ business: "business";
792
+ }>;
793
+ period: z.ZodEnum<{
794
+ month: "month";
795
+ year: "year";
796
+ }>;
797
+ }, z.core.$strip>, z.ZodObject<{
798
+ kind: z.ZodLiteral<"upgrade">;
799
+ }, z.core.$strip>], "kind">;
800
+ title: z.ZodString;
801
+ total: z.ZodNumber;
802
+ status: z.ZodEnum<{
803
+ paid: "paid";
804
+ created: "created";
805
+ granted_free: "granted_free";
806
+ expired: "expired";
807
+ refund_pending: "refund_pending";
808
+ refunded: "refunded";
809
+ refund_failed: "refund_failed";
810
+ }>;
811
+ paidAt: z.ZodISODateTime;
812
+ invoiceNumber: z.ZodNullable<z.ZodString>;
813
+ refundableUntil: z.ZodNullable<z.ZodISODateTime>;
814
+ payer: z.ZodObject<{
815
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
816
+ displayName: z.ZodString;
817
+ email: z.ZodNullable<z.ZodString>;
818
+ }, z.core.$strip>;
819
+ needsAction: z.ZodBoolean;
820
+ }, z.core.$strip>;
821
+ export type StaffPaymentSummary = z.infer<typeof staffPaymentSummarySchema>;
822
+ export declare const staffPaymentPageSchema: z.ZodObject<{
823
+ items: z.ZodArray<z.ZodObject<{
824
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
825
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
826
+ kind: z.ZodLiteral<"membership">;
827
+ }, z.core.$strip>, z.ZodObject<{
828
+ kind: z.ZodLiteral<"plan">;
829
+ tier: z.ZodEnum<{
830
+ premium: "premium";
831
+ business: "business";
832
+ }>;
833
+ period: z.ZodEnum<{
834
+ month: "month";
835
+ year: "year";
836
+ }>;
837
+ }, z.core.$strip>, z.ZodObject<{
838
+ kind: z.ZodLiteral<"upgrade">;
839
+ }, z.core.$strip>], "kind">;
840
+ title: z.ZodString;
841
+ total: z.ZodNumber;
842
+ status: z.ZodEnum<{
843
+ paid: "paid";
844
+ created: "created";
845
+ granted_free: "granted_free";
846
+ expired: "expired";
847
+ refund_pending: "refund_pending";
848
+ refunded: "refunded";
849
+ refund_failed: "refund_failed";
850
+ }>;
851
+ paidAt: z.ZodISODateTime;
852
+ invoiceNumber: z.ZodNullable<z.ZodString>;
853
+ refundableUntil: z.ZodNullable<z.ZodISODateTime>;
854
+ payer: z.ZodObject<{
855
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
856
+ displayName: z.ZodString;
857
+ email: z.ZodNullable<z.ZodString>;
858
+ }, z.core.$strip>;
859
+ needsAction: z.ZodBoolean;
860
+ }, z.core.$strip>>;
861
+ nextCursor: z.ZodNullable<z.ZodString>;
862
+ }, z.core.$strip>;
863
+ export type StaffPaymentPage = z.infer<typeof staffPaymentPageSchema>;
864
+ export declare const staffPaymentDetailSchema: z.ZodObject<{
865
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
866
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
867
+ kind: z.ZodLiteral<"membership">;
868
+ }, z.core.$strip>, z.ZodObject<{
869
+ kind: z.ZodLiteral<"plan">;
870
+ tier: z.ZodEnum<{
871
+ premium: "premium";
872
+ business: "business";
873
+ }>;
874
+ period: z.ZodEnum<{
875
+ month: "month";
876
+ year: "year";
877
+ }>;
878
+ }, z.core.$strip>, z.ZodObject<{
879
+ kind: z.ZodLiteral<"upgrade">;
880
+ }, z.core.$strip>], "kind">;
881
+ title: z.ZodString;
882
+ total: z.ZodNumber;
883
+ status: z.ZodEnum<{
884
+ paid: "paid";
885
+ created: "created";
886
+ granted_free: "granted_free";
887
+ expired: "expired";
888
+ refund_pending: "refund_pending";
889
+ refunded: "refunded";
890
+ refund_failed: "refund_failed";
891
+ }>;
892
+ paidAt: z.ZodISODateTime;
893
+ invoiceNumber: z.ZodNullable<z.ZodString>;
894
+ refundableUntil: z.ZodNullable<z.ZodISODateTime>;
895
+ listPrice: z.ZodNumber;
896
+ discount: z.ZodNumber;
897
+ coupon: z.ZodNullable<z.ZodObject<{
898
+ code: z.ZodString;
899
+ label: z.ZodString;
900
+ }, z.core.$strip>>;
901
+ invoice: z.ZodNullable<z.ZodObject<{
902
+ number: z.ZodString;
903
+ issuedAt: z.ZodISODateTime;
904
+ test: z.ZodBoolean;
905
+ supplier: z.ZodObject<{
906
+ name: z.ZodString;
907
+ address: z.ZodNullable<z.ZodString>;
908
+ gstin: z.ZodNullable<z.ZodString>;
909
+ stateCode: z.ZodEnum<{
910
+ "01": "01";
911
+ "02": "02";
912
+ "03": "03";
913
+ "04": "04";
914
+ "05": "05";
915
+ "06": "06";
916
+ "07": "07";
917
+ "08": "08";
918
+ "09": "09";
919
+ 10: "10";
920
+ 11: "11";
921
+ 12: "12";
922
+ 13: "13";
923
+ 14: "14";
924
+ 15: "15";
925
+ 16: "16";
926
+ 17: "17";
927
+ 18: "18";
928
+ 19: "19";
929
+ 20: "20";
930
+ 21: "21";
931
+ 22: "22";
932
+ 23: "23";
933
+ 24: "24";
934
+ 26: "26";
935
+ 27: "27";
936
+ 29: "29";
937
+ 30: "30";
938
+ 31: "31";
939
+ 32: "32";
940
+ 33: "33";
941
+ 34: "34";
942
+ 35: "35";
943
+ 36: "36";
944
+ 37: "37";
945
+ 38: "38";
946
+ }>;
947
+ stateName: z.ZodString;
948
+ }, z.core.$strip>;
949
+ buyer: z.ZodObject<{
950
+ name: z.ZodString;
951
+ address: z.ZodNullable<z.ZodString>;
952
+ gstin: z.ZodNullable<z.ZodString>;
953
+ stateCode: z.ZodEnum<{
954
+ "01": "01";
955
+ "02": "02";
956
+ "03": "03";
957
+ "04": "04";
958
+ "05": "05";
959
+ "06": "06";
960
+ "07": "07";
961
+ "08": "08";
962
+ "09": "09";
963
+ 10: "10";
964
+ 11: "11";
965
+ 12: "12";
966
+ 13: "13";
967
+ 14: "14";
968
+ 15: "15";
969
+ 16: "16";
970
+ 17: "17";
971
+ 18: "18";
972
+ 19: "19";
973
+ 20: "20";
974
+ 21: "21";
975
+ 22: "22";
976
+ 23: "23";
977
+ 24: "24";
978
+ 26: "26";
979
+ 27: "27";
980
+ 29: "29";
981
+ 30: "30";
982
+ 31: "31";
983
+ 32: "32";
984
+ 33: "33";
985
+ 34: "34";
986
+ 35: "35";
987
+ 36: "36";
988
+ 37: "37";
989
+ 38: "38";
990
+ }>;
991
+ stateName: z.ZodString;
992
+ }, z.core.$strip>;
993
+ kind: z.ZodEnum<{
994
+ b2b: "b2b";
995
+ b2c: "b2c";
996
+ }>;
997
+ sac: z.ZodString;
998
+ description: z.ZodString;
999
+ tax: z.ZodObject<{
1000
+ ratePercent: z.ZodNumber;
1001
+ taxable: z.ZodNumber;
1002
+ cgst: z.ZodNumber;
1003
+ sgst: z.ZodNumber;
1004
+ igst: z.ZodNumber;
1005
+ total: z.ZodNumber;
1006
+ }, z.core.$strip>;
1007
+ reverseCharge: z.ZodLiteral<false>;
1008
+ razorpayPaymentId: z.ZodString;
1009
+ }, z.core.$strip>>;
1010
+ creditNote: z.ZodNullable<z.ZodObject<{
1011
+ number: z.ZodString;
1012
+ issuedAt: z.ZodISODateTime;
1013
+ invoiceNumber: z.ZodString;
1014
+ tax: z.ZodObject<{
1015
+ ratePercent: z.ZodNumber;
1016
+ taxable: z.ZodNumber;
1017
+ cgst: z.ZodNumber;
1018
+ sgst: z.ZodNumber;
1019
+ igst: z.ZodNumber;
1020
+ total: z.ZodNumber;
1021
+ }, z.core.$strip>;
1022
+ }, z.core.$strip>>;
1023
+ refundedAt: z.ZodNullable<z.ZodISODateTime>;
1024
+ payer: z.ZodObject<{
1025
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1026
+ displayName: z.ZodString;
1027
+ email: z.ZodNullable<z.ZodString>;
1028
+ }, z.core.$strip>;
1029
+ razorpay: z.ZodObject<{
1030
+ orderId: z.ZodNullable<z.ZodString>;
1031
+ paymentId: z.ZodNullable<z.ZodString>;
1032
+ refundId: z.ZodNullable<z.ZodString>;
1033
+ }, z.core.$strip>;
1034
+ refundReason: z.ZodNullable<z.ZodString>;
1035
+ grantFailed: z.ZodNullable<z.ZodString>;
1036
+ disputedAt: z.ZodNullable<z.ZodISODateTime>;
1037
+ refundedOutside: z.ZodNumber;
1038
+ strayPayments: z.ZodArray<z.ZodObject<{
1039
+ paymentId: z.ZodString;
1040
+ amount: z.ZodNumber;
1041
+ refunded: z.ZodBoolean;
1042
+ at: z.ZodISODateTime;
1043
+ }, z.core.$strip>>;
1044
+ viewer: z.ZodObject<{
1045
+ canRefund: z.ZodBoolean;
1046
+ }, z.core.$strip>;
1047
+ }, z.core.$strip>;
1048
+ export type StaffPaymentDetail = z.infer<typeof staffPaymentDetailSchema>;
1049
+ /** `POST /staff/payments/:orderId/refund`. The reason is on the audit record. */
1050
+ export declare const refundPaymentBodySchema: z.ZodObject<{
1051
+ reason: z.ZodString;
1052
+ }, z.core.$strip>;
1053
+ export type RefundPaymentBody = z.infer<typeof refundPaymentBodySchema>;
1054
+ /**
1055
+ * `PUT /members/:memberId/membership`: grant (a partner, a press account) or
1056
+ * revoke (a fake or duplicate account holding a founding place). A paid one
1057
+ * is never revoked: refund its payment.
1058
+ */
1059
+ export declare const setMembershipBodySchema: z.ZodObject<{
1060
+ granted: z.ZodBoolean;
1061
+ reason: z.ZodString;
1062
+ }, z.core.$strip>;
1063
+ export type SetMembershipBody = z.infer<typeof setMembershipBodySchema>;
1064
+ /** What a coupon is good for. A percent coupon names what it applies to. */
1065
+ export declare const COUPON_TARGET_VALUES: readonly ["membership", "premium", "business"];
1066
+ export declare const couponTargetSchema: z.ZodEnum<{
1067
+ premium: "premium";
1068
+ business: "business";
1069
+ membership: "membership";
1070
+ }>;
1071
+ export type CouponTarget = z.infer<typeof couponTargetSchema>;
1072
+ /**
1073
+ * ⚠ Stored: append only.
1074
+ *
1075
+ * free_membership the membership at Rs 0; `founding` numbers its holders
1076
+ * ("Founding member #N")
1077
+ * percent_off a share off the listed price of what it applies to
1078
+ */
1079
+ export declare const couponBenefitSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1080
+ kind: z.ZodLiteral<"free_membership">;
1081
+ founding: z.ZodBoolean;
1082
+ }, z.core.$strip>, z.ZodObject<{
1083
+ kind: z.ZodLiteral<"percent_off">;
1084
+ percent: z.ZodNumber;
1085
+ appliesTo: z.ZodArray<z.ZodEnum<{
1086
+ premium: "premium";
1087
+ business: "business";
1088
+ membership: "membership";
1089
+ }>>;
1090
+ }, z.core.$strip>], "kind">;
1091
+ export type CouponBenefit = z.infer<typeof couponBenefitSchema>;
1092
+ export declare const couponSchema: z.ZodObject<{
1093
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1094
+ code: z.ZodString;
1095
+ label: z.ZodString;
1096
+ benefit: z.ZodDiscriminatedUnion<[z.ZodObject<{
1097
+ kind: z.ZodLiteral<"free_membership">;
1098
+ founding: z.ZodBoolean;
1099
+ }, z.core.$strip>, z.ZodObject<{
1100
+ kind: z.ZodLiteral<"percent_off">;
1101
+ percent: z.ZodNumber;
1102
+ appliesTo: z.ZodArray<z.ZodEnum<{
1103
+ premium: "premium";
1104
+ business: "business";
1105
+ membership: "membership";
1106
+ }>>;
1107
+ }, z.core.$strip>], "kind">;
1108
+ max: z.ZodNullable<z.ZodNumber>;
1109
+ used: z.ZodNumber;
1110
+ active: z.ZodBoolean;
1111
+ validFrom: z.ZodNullable<z.ZodISODateTime>;
1112
+ validUntil: z.ZodNullable<z.ZodISODateTime>;
1113
+ createdAt: z.ZodISODateTime;
1114
+ }, z.core.$strip>;
1115
+ export type Coupon = z.infer<typeof couponSchema>;
1116
+ /** Never paged: coupons are few. Newest first. */
1117
+ export declare const couponListSchema: z.ZodObject<{
1118
+ items: z.ZodArray<z.ZodObject<{
1119
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1120
+ code: z.ZodString;
1121
+ label: z.ZodString;
1122
+ benefit: z.ZodDiscriminatedUnion<[z.ZodObject<{
1123
+ kind: z.ZodLiteral<"free_membership">;
1124
+ founding: z.ZodBoolean;
1125
+ }, z.core.$strip>, z.ZodObject<{
1126
+ kind: z.ZodLiteral<"percent_off">;
1127
+ percent: z.ZodNumber;
1128
+ appliesTo: z.ZodArray<z.ZodEnum<{
1129
+ premium: "premium";
1130
+ business: "business";
1131
+ membership: "membership";
1132
+ }>>;
1133
+ }, z.core.$strip>], "kind">;
1134
+ max: z.ZodNullable<z.ZodNumber>;
1135
+ used: z.ZodNumber;
1136
+ active: z.ZodBoolean;
1137
+ validFrom: z.ZodNullable<z.ZodISODateTime>;
1138
+ validUntil: z.ZodNullable<z.ZodISODateTime>;
1139
+ createdAt: z.ZodISODateTime;
1140
+ }, z.core.$strip>>;
1141
+ }, z.core.$strip>;
1142
+ export type CouponList = z.infer<typeof couponListSchema>;
1143
+ export declare const couponParamsSchema: z.ZodObject<{
1144
+ couponId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1145
+ }, z.core.$strip>;
1146
+ export type CouponParams = z.infer<typeof couponParamsSchema>;
1147
+ export declare const createCouponBodySchema: z.ZodObject<{
1148
+ code: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1149
+ label: z.ZodString;
1150
+ benefit: z.ZodDiscriminatedUnion<[z.ZodObject<{
1151
+ kind: z.ZodLiteral<"free_membership">;
1152
+ founding: z.ZodBoolean;
1153
+ }, z.core.$strip>, z.ZodObject<{
1154
+ kind: z.ZodLiteral<"percent_off">;
1155
+ percent: z.ZodNumber;
1156
+ appliesTo: z.ZodArray<z.ZodEnum<{
1157
+ premium: "premium";
1158
+ business: "business";
1159
+ membership: "membership";
1160
+ }>>;
1161
+ }, z.core.$strip>], "kind">;
1162
+ max: z.ZodNullable<z.ZodNumber>;
1163
+ validFrom: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1164
+ validUntil: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1165
+ }, z.core.$strip>;
1166
+ export type CreateCouponBody = z.infer<typeof createCouponBodySchema>;
1167
+ /**
1168
+ * What may change on a live coupon. The code and the benefit never change: a
1169
+ * redemption is a record of what a code gave when it was used.
1170
+ */
1171
+ export declare const updateCouponBodySchema: z.ZodObject<{
1172
+ label: z.ZodOptional<z.ZodString>;
1173
+ active: z.ZodOptional<z.ZodBoolean>;
1174
+ max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1175
+ validFrom: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1176
+ validUntil: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1177
+ }, z.core.$strip>;
1178
+ export type UpdateCouponBody = z.infer<typeof updateCouponBodySchema>;
1179
+ //# sourceMappingURL=billing.d.ts.map