@classytic/revenue 1.0.6 → 1.1.3

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 (81) hide show
  1. package/README.md +582 -633
  2. package/dist/application/services/index.d.mts +4 -0
  3. package/dist/application/services/index.mjs +3 -0
  4. package/dist/base-CsTlVQJe.d.mts +136 -0
  5. package/dist/base-DCoyIUj6.mjs +152 -0
  6. package/dist/category-resolver-DV83N8ok.mjs +284 -0
  7. package/dist/commission-split-BzB8cd39.mjs +485 -0
  8. package/dist/core/events.d.mts +294 -0
  9. package/dist/core/events.mjs +100 -0
  10. package/dist/core/index.d.mts +9 -0
  11. package/dist/core/index.mjs +8 -0
  12. package/dist/enums/index.d.mts +157 -0
  13. package/dist/enums/index.mjs +56 -0
  14. package/dist/errors-CorrWz7A.d.mts +787 -0
  15. package/dist/escrow.enums-CZGrrdg7.mjs +101 -0
  16. package/dist/escrow.enums-DwdLuuve.d.mts +78 -0
  17. package/dist/idempotency-DaYcUGY1.mjs +172 -0
  18. package/dist/index-Dsp7H5Wb.d.mts +471 -0
  19. package/dist/index.d.mts +9 -0
  20. package/dist/index.mjs +38 -0
  21. package/dist/infrastructure/plugins/index.d.mts +239 -0
  22. package/dist/infrastructure/plugins/index.mjs +345 -0
  23. package/dist/money-CvrDOijQ.mjs +271 -0
  24. package/dist/money-DPG8AtJ8.d.mts +112 -0
  25. package/dist/payment.enums-HAuAS9Pp.d.mts +70 -0
  26. package/dist/payment.enums-tEFVa-Xp.mjs +69 -0
  27. package/dist/plugin-BbK0OVHy.d.mts +327 -0
  28. package/dist/plugin-Cd_V04Em.mjs +210 -0
  29. package/dist/providers/index.d.mts +3 -0
  30. package/dist/providers/index.mjs +3 -0
  31. package/dist/reconciliation/index.d.mts +193 -0
  32. package/dist/reconciliation/index.mjs +192 -0
  33. package/dist/retry-HHCOXYdn.d.mts +186 -0
  34. package/dist/revenue-9scqKSef.mjs +553 -0
  35. package/dist/schemas/index.d.mts +2665 -0
  36. package/dist/schemas/index.mjs +717 -0
  37. package/dist/schemas/validation.d.mts +375 -0
  38. package/dist/schemas/validation.mjs +325 -0
  39. package/dist/settlement.enums-DFhkqZEY.d.mts +132 -0
  40. package/dist/settlement.schema-D5uWB5tP.d.mts +344 -0
  41. package/dist/settlement.service-BxuiHpNC.d.mts +594 -0
  42. package/dist/settlement.service-CUxbUTzT.mjs +2510 -0
  43. package/dist/split.enums-BrjabxIX.mjs +86 -0
  44. package/dist/split.enums-DmskfLOM.d.mts +43 -0
  45. package/dist/tax-BoCt5cEd.d.mts +61 -0
  46. package/dist/tax-EQ15DO81.mjs +162 -0
  47. package/dist/transaction.enums-pCyMFT4Z.mjs +96 -0
  48. package/dist/utils/index.d.mts +428 -0
  49. package/dist/utils/index.mjs +346 -0
  50. package/package.json +48 -33
  51. package/dist/actions-Ctf2XUL-.d.ts +0 -519
  52. package/dist/core/index.d.ts +0 -890
  53. package/dist/core/index.js +0 -3005
  54. package/dist/core/index.js.map +0 -1
  55. package/dist/enums/index.d.ts +0 -138
  56. package/dist/enums/index.js +0 -263
  57. package/dist/enums/index.js.map +0 -1
  58. package/dist/index-BnEXsnLJ.d.ts +0 -378
  59. package/dist/index-C5SsOrV0.d.ts +0 -534
  60. package/dist/index.d.ts +0 -43
  61. package/dist/index.js +0 -4498
  62. package/dist/index.js.map +0 -1
  63. package/dist/payment.enums-B_RwB8iR.d.ts +0 -184
  64. package/dist/providers/index.d.ts +0 -132
  65. package/dist/providers/index.js +0 -122
  66. package/dist/providers/index.js.map +0 -1
  67. package/dist/retry-80lBCmSe.d.ts +0 -234
  68. package/dist/schemas/index.d.ts +0 -1051
  69. package/dist/schemas/index.js +0 -627
  70. package/dist/schemas/index.js.map +0 -1
  71. package/dist/schemas/validation.d.ts +0 -384
  72. package/dist/schemas/validation.js +0 -302
  73. package/dist/schemas/validation.js.map +0 -1
  74. package/dist/services/index.d.ts +0 -3
  75. package/dist/services/index.js +0 -1702
  76. package/dist/services/index.js.map +0 -1
  77. package/dist/split.schema-DLVF3XBI.d.ts +0 -1122
  78. package/dist/transaction.enums-7uBnuswI.d.ts +0 -87
  79. package/dist/utils/index.d.ts +0 -24
  80. package/dist/utils/index.js +0 -1140
  81. package/dist/utils/index.js.map +0 -1
@@ -1,1122 +0,0 @@
1
- import * as mongoose from 'mongoose';
2
- import { Schema } from 'mongoose';
3
- import * as bson from 'bson';
4
- import { M as PaymentStatusValue, Q as PlanKeyValue, O as SubscriptionStatusValue, T as HoldStatusValue, V as HoldReasonValue, W as SplitTypeValue, X as SplitStatusValue, Y as PayoutMethodValue } from './payment.enums-B_RwB8iR.js';
5
-
6
- /**
7
- * Base metadata schema for transactions
8
- */
9
- declare const baseMetadataSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
10
- _id: false;
11
- strict: false;
12
- }, {}, mongoose.Document<unknown, {}, {}, {
13
- id: string;
14
- }, mongoose.ResolveSchemaOptions<{
15
- _id: false;
16
- strict: false;
17
- }>> & Omit<Required<{
18
- _id: unknown;
19
- }> & {
20
- __v: number;
21
- }, "id"> & {
22
- id: string;
23
- }, {
24
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
25
- } | {
26
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {}, {
27
- id: string;
28
- }, mongoose.ResolveSchemaOptions<{
29
- _id: false;
30
- strict: false;
31
- }>> & Omit<Required<{
32
- _id: unknown;
33
- }> & {
34
- __v: number;
35
- }, "id"> & {
36
- id: string;
37
- }> | undefined;
38
- }, {} & Required<{
39
- _id: unknown;
40
- }> & {
41
- __v: number;
42
- }>;
43
- /**
44
- * Reference schema for polymorphic associations
45
- */
46
- declare const referenceSchema: {
47
- referenceId: {
48
- type: typeof Schema.Types.ObjectId;
49
- refPath: string;
50
- };
51
- referenceModel: {
52
- type: StringConstructor;
53
- enum: string[];
54
- };
55
- };
56
-
57
- /**
58
- * Gateway Schema - Embedded in Transaction
59
- * Tracks payment gateway details
60
- */
61
- declare const gatewaySchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
62
- _id: false;
63
- }, {
64
- type: string;
65
- metadata: any;
66
- provider?: string | null | undefined;
67
- sessionId?: string | null | undefined;
68
- paymentIntentId?: string | null | undefined;
69
- verificationData?: any;
70
- }, mongoose.Document<unknown, {}, {
71
- type: string;
72
- metadata: any;
73
- provider?: string | null | undefined;
74
- sessionId?: string | null | undefined;
75
- paymentIntentId?: string | null | undefined;
76
- verificationData?: any;
77
- }, {
78
- id: string;
79
- }, mongoose.ResolveSchemaOptions<{
80
- _id: false;
81
- }>> & Omit<{
82
- type: string;
83
- metadata: any;
84
- provider?: string | null | undefined;
85
- sessionId?: string | null | undefined;
86
- paymentIntentId?: string | null | undefined;
87
- verificationData?: any;
88
- } & {
89
- _id: mongoose.Types.ObjectId;
90
- } & {
91
- __v: number;
92
- }, "id"> & {
93
- id: string;
94
- }, {
95
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
96
- } | {
97
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
98
- type: string;
99
- metadata: any;
100
- provider?: string | null | undefined;
101
- sessionId?: string | null | undefined;
102
- paymentIntentId?: string | null | undefined;
103
- verificationData?: any;
104
- }, {
105
- id: string;
106
- }, mongoose.ResolveSchemaOptions<{
107
- _id: false;
108
- }>> & Omit<{
109
- type: string;
110
- metadata: any;
111
- provider?: string | null | undefined;
112
- sessionId?: string | null | undefined;
113
- paymentIntentId?: string | null | undefined;
114
- verificationData?: any;
115
- } & {
116
- _id: mongoose.Types.ObjectId;
117
- } & {
118
- __v: number;
119
- }, "id"> & {
120
- id: string;
121
- }> | undefined;
122
- }, {
123
- type: string;
124
- metadata: any;
125
- provider?: string | null | undefined;
126
- sessionId?: string | null | undefined;
127
- paymentIntentId?: string | null | undefined;
128
- verificationData?: any;
129
- } & {
130
- _id: mongoose.Types.ObjectId;
131
- } & {
132
- __v: number;
133
- }>;
134
-
135
- /**
136
- * Individual Payment Entry Schema
137
- * For split/multi-payment scenarios (e.g., cash + bank + mobile wallet)
138
- *
139
- * Use in currentPaymentSchema.payments array
140
- */
141
- declare const paymentEntrySchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
142
- _id: false;
143
- }, {
144
- amount: number;
145
- method: string;
146
- reference?: string | null | undefined;
147
- details?: any;
148
- }, mongoose.Document<unknown, {}, {
149
- amount: number;
150
- method: string;
151
- reference?: string | null | undefined;
152
- details?: any;
153
- }, {
154
- id: string;
155
- }, mongoose.ResolveSchemaOptions<{
156
- _id: false;
157
- }>> & Omit<{
158
- amount: number;
159
- method: string;
160
- reference?: string | null | undefined;
161
- details?: any;
162
- } & {
163
- _id: mongoose.Types.ObjectId;
164
- } & {
165
- __v: number;
166
- }, "id"> & {
167
- id: string;
168
- }, {
169
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
170
- } | {
171
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
172
- amount: number;
173
- method: string;
174
- reference?: string | null | undefined;
175
- details?: any;
176
- }, {
177
- id: string;
178
- }, mongoose.ResolveSchemaOptions<{
179
- _id: false;
180
- }>> & Omit<{
181
- amount: number;
182
- method: string;
183
- reference?: string | null | undefined;
184
- details?: any;
185
- } & {
186
- _id: mongoose.Types.ObjectId;
187
- } & {
188
- __v: number;
189
- }, "id"> & {
190
- id: string;
191
- }> | undefined;
192
- }, {
193
- amount: number;
194
- method: string;
195
- reference?: string | null | undefined;
196
- details?: any;
197
- } & {
198
- _id: mongoose.Types.ObjectId;
199
- } & {
200
- __v: number;
201
- }>;
202
- /**
203
- * Current Payment Schema
204
- * Use this in your model: currentPayment: { type: currentPaymentSchema }
205
- *
206
- * Tracks the latest payment transaction for an entity
207
- * Supports both single payments and multi-payment (split) scenarios
208
- */
209
- declare const currentPaymentSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
210
- _id: false;
211
- }, {
212
- status: PaymentStatusValue;
213
- amount?: number | null | undefined;
214
- transactionId?: mongoose.Types.ObjectId | null | undefined;
215
- method?: string | null | undefined;
216
- reference?: string | null | undefined;
217
- payments?: mongoose.Types.DocumentArray<{
218
- amount: number;
219
- method: string;
220
- reference?: string | null | undefined;
221
- details?: any;
222
- }, mongoose.Types.Subdocument<bson.ObjectId, unknown, {
223
- amount: number;
224
- method: string;
225
- reference?: string | null | undefined;
226
- details?: any;
227
- }> & {
228
- amount: number;
229
- method: string;
230
- reference?: string | null | undefined;
231
- details?: any;
232
- }> | null | undefined;
233
- verifiedAt?: NativeDate | null | undefined;
234
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
235
- }, mongoose.Document<unknown, {}, {
236
- status: PaymentStatusValue;
237
- amount?: number | null | undefined;
238
- transactionId?: mongoose.Types.ObjectId | null | undefined;
239
- method?: string | null | undefined;
240
- reference?: string | null | undefined;
241
- payments?: mongoose.Types.DocumentArray<{
242
- amount: number;
243
- method: string;
244
- reference?: string | null | undefined;
245
- details?: any;
246
- }, mongoose.Types.Subdocument<bson.ObjectId, unknown, {
247
- amount: number;
248
- method: string;
249
- reference?: string | null | undefined;
250
- details?: any;
251
- }> & {
252
- amount: number;
253
- method: string;
254
- reference?: string | null | undefined;
255
- details?: any;
256
- }> | null | undefined;
257
- verifiedAt?: NativeDate | null | undefined;
258
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
259
- }, {
260
- id: string;
261
- }, mongoose.ResolveSchemaOptions<{
262
- _id: false;
263
- }>> & Omit<{
264
- status: PaymentStatusValue;
265
- amount?: number | null | undefined;
266
- transactionId?: mongoose.Types.ObjectId | null | undefined;
267
- method?: string | null | undefined;
268
- reference?: string | null | undefined;
269
- payments?: mongoose.Types.DocumentArray<{
270
- amount: number;
271
- method: string;
272
- reference?: string | null | undefined;
273
- details?: any;
274
- }, mongoose.Types.Subdocument<bson.ObjectId, unknown, {
275
- amount: number;
276
- method: string;
277
- reference?: string | null | undefined;
278
- details?: any;
279
- }> & {
280
- amount: number;
281
- method: string;
282
- reference?: string | null | undefined;
283
- details?: any;
284
- }> | null | undefined;
285
- verifiedAt?: NativeDate | null | undefined;
286
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
287
- } & {
288
- _id: mongoose.Types.ObjectId;
289
- } & {
290
- __v: number;
291
- }, "id"> & {
292
- id: string;
293
- }, {
294
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
295
- } | {
296
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
297
- status: PaymentStatusValue;
298
- amount?: number | null | undefined;
299
- transactionId?: mongoose.Types.ObjectId | null | undefined;
300
- method?: string | null | undefined;
301
- reference?: string | null | undefined;
302
- payments?: mongoose.Types.DocumentArray<{
303
- amount: number;
304
- method: string;
305
- reference?: string | null | undefined;
306
- details?: any;
307
- }, mongoose.Types.Subdocument<bson.ObjectId, unknown, {
308
- amount: number;
309
- method: string;
310
- reference?: string | null | undefined;
311
- details?: any;
312
- }> & {
313
- amount: number;
314
- method: string;
315
- reference?: string | null | undefined;
316
- details?: any;
317
- }> | null | undefined;
318
- verifiedAt?: NativeDate | null | undefined;
319
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
320
- }, {
321
- id: string;
322
- }, mongoose.ResolveSchemaOptions<{
323
- _id: false;
324
- }>> & Omit<{
325
- status: PaymentStatusValue;
326
- amount?: number | null | undefined;
327
- transactionId?: mongoose.Types.ObjectId | null | undefined;
328
- method?: string | null | undefined;
329
- reference?: string | null | undefined;
330
- payments?: mongoose.Types.DocumentArray<{
331
- amount: number;
332
- method: string;
333
- reference?: string | null | undefined;
334
- details?: any;
335
- }, mongoose.Types.Subdocument<bson.ObjectId, unknown, {
336
- amount: number;
337
- method: string;
338
- reference?: string | null | undefined;
339
- details?: any;
340
- }> & {
341
- amount: number;
342
- method: string;
343
- reference?: string | null | undefined;
344
- details?: any;
345
- }> | null | undefined;
346
- verifiedAt?: NativeDate | null | undefined;
347
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
348
- } & {
349
- _id: mongoose.Types.ObjectId;
350
- } & {
351
- __v: number;
352
- }, "id"> & {
353
- id: string;
354
- }> | undefined;
355
- }, {
356
- status: PaymentStatusValue;
357
- amount?: number | null | undefined;
358
- transactionId?: mongoose.Types.ObjectId | null | undefined;
359
- method?: string | null | undefined;
360
- reference?: string | null | undefined;
361
- payments?: mongoose.Types.DocumentArray<{
362
- amount: number;
363
- method: string;
364
- reference?: string | null | undefined;
365
- details?: any;
366
- }, mongoose.Types.Subdocument<bson.ObjectId, unknown, {
367
- amount: number;
368
- method: string;
369
- reference?: string | null | undefined;
370
- details?: any;
371
- }> & {
372
- amount: number;
373
- method: string;
374
- reference?: string | null | undefined;
375
- details?: any;
376
- }> | null | undefined;
377
- verifiedAt?: NativeDate | null | undefined;
378
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
379
- } & {
380
- _id: mongoose.Types.ObjectId;
381
- } & {
382
- __v: number;
383
- }>;
384
- /**
385
- * Payment Summary Schema
386
- * Use this in your model: paymentSummary: { type: paymentSummarySchema }
387
- *
388
- * Tracks payment history and totals
389
- */
390
- declare const paymentSummarySchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
391
- _id: false;
392
- }, {
393
- totalPayments: number;
394
- totalAmountPaid: number;
395
- lastPaymentDate?: NativeDate | null | undefined;
396
- lastPaymentAmount?: number | null | undefined;
397
- }, mongoose.Document<unknown, {}, {
398
- totalPayments: number;
399
- totalAmountPaid: number;
400
- lastPaymentDate?: NativeDate | null | undefined;
401
- lastPaymentAmount?: number | null | undefined;
402
- }, {
403
- id: string;
404
- }, mongoose.ResolveSchemaOptions<{
405
- _id: false;
406
- }>> & Omit<{
407
- totalPayments: number;
408
- totalAmountPaid: number;
409
- lastPaymentDate?: NativeDate | null | undefined;
410
- lastPaymentAmount?: number | null | undefined;
411
- } & {
412
- _id: mongoose.Types.ObjectId;
413
- } & {
414
- __v: number;
415
- }, "id"> & {
416
- id: string;
417
- }, {
418
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
419
- } | {
420
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
421
- totalPayments: number;
422
- totalAmountPaid: number;
423
- lastPaymentDate?: NativeDate | null | undefined;
424
- lastPaymentAmount?: number | null | undefined;
425
- }, {
426
- id: string;
427
- }, mongoose.ResolveSchemaOptions<{
428
- _id: false;
429
- }>> & Omit<{
430
- totalPayments: number;
431
- totalAmountPaid: number;
432
- lastPaymentDate?: NativeDate | null | undefined;
433
- lastPaymentAmount?: number | null | undefined;
434
- } & {
435
- _id: mongoose.Types.ObjectId;
436
- } & {
437
- __v: number;
438
- }, "id"> & {
439
- id: string;
440
- }> | undefined;
441
- }, {
442
- totalPayments: number;
443
- totalAmountPaid: number;
444
- lastPaymentDate?: NativeDate | null | undefined;
445
- lastPaymentAmount?: number | null | undefined;
446
- } & {
447
- _id: mongoose.Types.ObjectId;
448
- } & {
449
- __v: number;
450
- }>;
451
- /**
452
- * Payment Details Schema (for manual payments)
453
- * Embedded in Transaction model
454
- */
455
- declare const paymentDetailsSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
456
- _id: false;
457
- }, {
458
- provider?: string | null | undefined;
459
- walletNumber?: string | null | undefined;
460
- walletType?: string | null | undefined;
461
- trxId?: string | null | undefined;
462
- bankName?: string | null | undefined;
463
- accountNumber?: string | null | undefined;
464
- accountName?: string | null | undefined;
465
- proofUrl?: string | null | undefined;
466
- }, mongoose.Document<unknown, {}, {
467
- provider?: string | null | undefined;
468
- walletNumber?: string | null | undefined;
469
- walletType?: string | null | undefined;
470
- trxId?: string | null | undefined;
471
- bankName?: string | null | undefined;
472
- accountNumber?: string | null | undefined;
473
- accountName?: string | null | undefined;
474
- proofUrl?: string | null | undefined;
475
- }, {
476
- id: string;
477
- }, mongoose.ResolveSchemaOptions<{
478
- _id: false;
479
- }>> & Omit<{
480
- provider?: string | null | undefined;
481
- walletNumber?: string | null | undefined;
482
- walletType?: string | null | undefined;
483
- trxId?: string | null | undefined;
484
- bankName?: string | null | undefined;
485
- accountNumber?: string | null | undefined;
486
- accountName?: string | null | undefined;
487
- proofUrl?: string | null | undefined;
488
- } & {
489
- _id: mongoose.Types.ObjectId;
490
- } & {
491
- __v: number;
492
- }, "id"> & {
493
- id: string;
494
- }, {
495
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
496
- } | {
497
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
498
- provider?: string | null | undefined;
499
- walletNumber?: string | null | undefined;
500
- walletType?: string | null | undefined;
501
- trxId?: string | null | undefined;
502
- bankName?: string | null | undefined;
503
- accountNumber?: string | null | undefined;
504
- accountName?: string | null | undefined;
505
- proofUrl?: string | null | undefined;
506
- }, {
507
- id: string;
508
- }, mongoose.ResolveSchemaOptions<{
509
- _id: false;
510
- }>> & Omit<{
511
- provider?: string | null | undefined;
512
- walletNumber?: string | null | undefined;
513
- walletType?: string | null | undefined;
514
- trxId?: string | null | undefined;
515
- bankName?: string | null | undefined;
516
- accountNumber?: string | null | undefined;
517
- accountName?: string | null | undefined;
518
- proofUrl?: string | null | undefined;
519
- } & {
520
- _id: mongoose.Types.ObjectId;
521
- } & {
522
- __v: number;
523
- }, "id"> & {
524
- id: string;
525
- }> | undefined;
526
- }, {
527
- provider?: string | null | undefined;
528
- walletNumber?: string | null | undefined;
529
- walletType?: string | null | undefined;
530
- trxId?: string | null | undefined;
531
- bankName?: string | null | undefined;
532
- accountNumber?: string | null | undefined;
533
- accountName?: string | null | undefined;
534
- proofUrl?: string | null | undefined;
535
- } & {
536
- _id: mongoose.Types.ObjectId;
537
- } & {
538
- __v: number;
539
- }>;
540
- /**
541
- * Tenant Snapshot Schema
542
- * Captures organization payment details at transaction time (audit trail)
543
- */
544
- declare const tenantSnapshotSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
545
- _id: false;
546
- }, {
547
- paymentInstructions?: string | null | undefined;
548
- bkashNumber?: string | null | undefined;
549
- nagadNumber?: string | null | undefined;
550
- bankAccount?: string | null | undefined;
551
- }, mongoose.Document<unknown, {}, {
552
- paymentInstructions?: string | null | undefined;
553
- bkashNumber?: string | null | undefined;
554
- nagadNumber?: string | null | undefined;
555
- bankAccount?: string | null | undefined;
556
- }, {
557
- id: string;
558
- }, mongoose.ResolveSchemaOptions<{
559
- _id: false;
560
- }>> & Omit<{
561
- paymentInstructions?: string | null | undefined;
562
- bkashNumber?: string | null | undefined;
563
- nagadNumber?: string | null | undefined;
564
- bankAccount?: string | null | undefined;
565
- } & {
566
- _id: mongoose.Types.ObjectId;
567
- } & {
568
- __v: number;
569
- }, "id"> & {
570
- id: string;
571
- }, {
572
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
573
- } | {
574
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
575
- paymentInstructions?: string | null | undefined;
576
- bkashNumber?: string | null | undefined;
577
- nagadNumber?: string | null | undefined;
578
- bankAccount?: string | null | undefined;
579
- }, {
580
- id: string;
581
- }, mongoose.ResolveSchemaOptions<{
582
- _id: false;
583
- }>> & Omit<{
584
- paymentInstructions?: string | null | undefined;
585
- bkashNumber?: string | null | undefined;
586
- nagadNumber?: string | null | undefined;
587
- bankAccount?: string | null | undefined;
588
- } & {
589
- _id: mongoose.Types.ObjectId;
590
- } & {
591
- __v: number;
592
- }, "id"> & {
593
- id: string;
594
- }> | undefined;
595
- }, {
596
- paymentInstructions?: string | null | undefined;
597
- bkashNumber?: string | null | undefined;
598
- nagadNumber?: string | null | undefined;
599
- bankAccount?: string | null | undefined;
600
- } & {
601
- _id: mongoose.Types.ObjectId;
602
- } & {
603
- __v: number;
604
- }>;
605
-
606
- /**
607
- * Commission Schema - Embedded in Transaction
608
- * Tracks platform commission with gateway fee deduction
609
- *
610
- * Usage: commission: commissionSchema
611
- */
612
- declare const commissionSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
613
- _id: false;
614
- }, {
615
- splits: string[];
616
- status: "pending" | "paid" | "waived" | "reversed";
617
- gatewayFeeRate?: number | null | undefined;
618
- rate?: number | null | undefined;
619
- affiliate?: {
620
- recipientId?: string | null | undefined;
621
- recipientType?: "user" | "organization" | "partner" | null | undefined;
622
- rate?: number | null | undefined;
623
- grossAmount?: number | null | undefined;
624
- netAmount?: number | null | undefined;
625
- } | null | undefined;
626
- grossAmount?: number | null | undefined;
627
- netAmount?: number | null | undefined;
628
- gatewayFeeAmount?: number | null | undefined;
629
- }, mongoose.Document<unknown, {}, {
630
- splits: string[];
631
- status: "pending" | "paid" | "waived" | "reversed";
632
- gatewayFeeRate?: number | null | undefined;
633
- rate?: number | null | undefined;
634
- affiliate?: {
635
- recipientId?: string | null | undefined;
636
- recipientType?: "user" | "organization" | "partner" | null | undefined;
637
- rate?: number | null | undefined;
638
- grossAmount?: number | null | undefined;
639
- netAmount?: number | null | undefined;
640
- } | null | undefined;
641
- grossAmount?: number | null | undefined;
642
- netAmount?: number | null | undefined;
643
- gatewayFeeAmount?: number | null | undefined;
644
- }, {
645
- id: string;
646
- }, mongoose.ResolveSchemaOptions<{
647
- _id: false;
648
- }>> & Omit<{
649
- splits: string[];
650
- status: "pending" | "paid" | "waived" | "reversed";
651
- gatewayFeeRate?: number | null | undefined;
652
- rate?: number | null | undefined;
653
- affiliate?: {
654
- recipientId?: string | null | undefined;
655
- recipientType?: "user" | "organization" | "partner" | null | undefined;
656
- rate?: number | null | undefined;
657
- grossAmount?: number | null | undefined;
658
- netAmount?: number | null | undefined;
659
- } | null | undefined;
660
- grossAmount?: number | null | undefined;
661
- netAmount?: number | null | undefined;
662
- gatewayFeeAmount?: number | null | undefined;
663
- } & {
664
- _id: mongoose.Types.ObjectId;
665
- } & {
666
- __v: number;
667
- }, "id"> & {
668
- id: string;
669
- }, {
670
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
671
- } | {
672
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
673
- splits: string[];
674
- status: "pending" | "paid" | "waived" | "reversed";
675
- gatewayFeeRate?: number | null | undefined;
676
- rate?: number | null | undefined;
677
- affiliate?: {
678
- recipientId?: string | null | undefined;
679
- recipientType?: "user" | "organization" | "partner" | null | undefined;
680
- rate?: number | null | undefined;
681
- grossAmount?: number | null | undefined;
682
- netAmount?: number | null | undefined;
683
- } | null | undefined;
684
- grossAmount?: number | null | undefined;
685
- netAmount?: number | null | undefined;
686
- gatewayFeeAmount?: number | null | undefined;
687
- }, {
688
- id: string;
689
- }, mongoose.ResolveSchemaOptions<{
690
- _id: false;
691
- }>> & Omit<{
692
- splits: string[];
693
- status: "pending" | "paid" | "waived" | "reversed";
694
- gatewayFeeRate?: number | null | undefined;
695
- rate?: number | null | undefined;
696
- affiliate?: {
697
- recipientId?: string | null | undefined;
698
- recipientType?: "user" | "organization" | "partner" | null | undefined;
699
- rate?: number | null | undefined;
700
- grossAmount?: number | null | undefined;
701
- netAmount?: number | null | undefined;
702
- } | null | undefined;
703
- grossAmount?: number | null | undefined;
704
- netAmount?: number | null | undefined;
705
- gatewayFeeAmount?: number | null | undefined;
706
- } & {
707
- _id: mongoose.Types.ObjectId;
708
- } & {
709
- __v: number;
710
- }, "id"> & {
711
- id: string;
712
- }> | undefined;
713
- }, {
714
- splits: string[];
715
- status: "pending" | "paid" | "waived" | "reversed";
716
- gatewayFeeRate?: number | null | undefined;
717
- rate?: number | null | undefined;
718
- affiliate?: {
719
- recipientId?: string | null | undefined;
720
- recipientType?: "user" | "organization" | "partner" | null | undefined;
721
- rate?: number | null | undefined;
722
- grossAmount?: number | null | undefined;
723
- netAmount?: number | null | undefined;
724
- } | null | undefined;
725
- grossAmount?: number | null | undefined;
726
- netAmount?: number | null | undefined;
727
- gatewayFeeAmount?: number | null | undefined;
728
- } & {
729
- _id: mongoose.Types.ObjectId;
730
- } & {
731
- __v: number;
732
- }>;
733
-
734
- /**
735
- * Plan Schema - for defining subscription plans
736
- */
737
- declare const planSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
738
- _id: false;
739
- }, {
740
- amount: number;
741
- currency: string;
742
- metadata: any;
743
- interval: "day" | "week" | "month" | "year";
744
- intervalCount: number;
745
- name: string;
746
- key: PlanKeyValue;
747
- isActive: boolean;
748
- features: string[];
749
- description?: string | null | undefined;
750
- }, mongoose.Document<unknown, {}, {
751
- amount: number;
752
- currency: string;
753
- metadata: any;
754
- interval: "day" | "week" | "month" | "year";
755
- intervalCount: number;
756
- name: string;
757
- key: PlanKeyValue;
758
- isActive: boolean;
759
- features: string[];
760
- description?: string | null | undefined;
761
- }, {
762
- id: string;
763
- }, mongoose.ResolveSchemaOptions<{
764
- _id: false;
765
- }>> & Omit<{
766
- amount: number;
767
- currency: string;
768
- metadata: any;
769
- interval: "day" | "week" | "month" | "year";
770
- intervalCount: number;
771
- name: string;
772
- key: PlanKeyValue;
773
- isActive: boolean;
774
- features: string[];
775
- description?: string | null | undefined;
776
- } & {
777
- _id: mongoose.Types.ObjectId;
778
- } & {
779
- __v: number;
780
- }, "id"> & {
781
- id: string;
782
- }, {
783
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
784
- } | {
785
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
786
- amount: number;
787
- currency: string;
788
- metadata: any;
789
- interval: "day" | "week" | "month" | "year";
790
- intervalCount: number;
791
- name: string;
792
- key: PlanKeyValue;
793
- isActive: boolean;
794
- features: string[];
795
- description?: string | null | undefined;
796
- }, {
797
- id: string;
798
- }, mongoose.ResolveSchemaOptions<{
799
- _id: false;
800
- }>> & Omit<{
801
- amount: number;
802
- currency: string;
803
- metadata: any;
804
- interval: "day" | "week" | "month" | "year";
805
- intervalCount: number;
806
- name: string;
807
- key: PlanKeyValue;
808
- isActive: boolean;
809
- features: string[];
810
- description?: string | null | undefined;
811
- } & {
812
- _id: mongoose.Types.ObjectId;
813
- } & {
814
- __v: number;
815
- }, "id"> & {
816
- id: string;
817
- }> | undefined;
818
- }, {
819
- amount: number;
820
- currency: string;
821
- metadata: any;
822
- interval: "day" | "week" | "month" | "year";
823
- intervalCount: number;
824
- name: string;
825
- key: PlanKeyValue;
826
- isActive: boolean;
827
- features: string[];
828
- description?: string | null | undefined;
829
- } & {
830
- _id: mongoose.Types.ObjectId;
831
- } & {
832
- __v: number;
833
- }>;
834
-
835
- /**
836
- * Subscription Info Schema
837
- * Use this in your entity models that have subscriptions
838
- *
839
- * @example
840
- * const OrganizationSchema = new Schema({
841
- * name: String,
842
- * subscription: { type: subscriptionInfoSchema },
843
- * });
844
- */
845
- declare const subscriptionInfoSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
846
- _id: false;
847
- }, {
848
- planKey: PlanKeyValue;
849
- status: SubscriptionStatusValue;
850
- isActive: boolean;
851
- renewalCount: number;
852
- pausedAt?: NativeDate | null | undefined;
853
- endDate?: NativeDate | null | undefined;
854
- lastPaymentDate?: NativeDate | null | undefined;
855
- lastPaymentAmount?: number | null | undefined;
856
- startDate?: NativeDate | null | undefined;
857
- canceledAt?: NativeDate | null | undefined;
858
- cancelAt?: NativeDate | null | undefined;
859
- }, mongoose.Document<unknown, {}, {
860
- planKey: PlanKeyValue;
861
- status: SubscriptionStatusValue;
862
- isActive: boolean;
863
- renewalCount: number;
864
- pausedAt?: NativeDate | null | undefined;
865
- endDate?: NativeDate | null | undefined;
866
- lastPaymentDate?: NativeDate | null | undefined;
867
- lastPaymentAmount?: number | null | undefined;
868
- startDate?: NativeDate | null | undefined;
869
- canceledAt?: NativeDate | null | undefined;
870
- cancelAt?: NativeDate | null | undefined;
871
- }, {
872
- id: string;
873
- }, mongoose.ResolveSchemaOptions<{
874
- _id: false;
875
- }>> & Omit<{
876
- planKey: PlanKeyValue;
877
- status: SubscriptionStatusValue;
878
- isActive: boolean;
879
- renewalCount: number;
880
- pausedAt?: NativeDate | null | undefined;
881
- endDate?: NativeDate | null | undefined;
882
- lastPaymentDate?: NativeDate | null | undefined;
883
- lastPaymentAmount?: number | null | undefined;
884
- startDate?: NativeDate | null | undefined;
885
- canceledAt?: NativeDate | null | undefined;
886
- cancelAt?: NativeDate | null | undefined;
887
- } & {
888
- _id: mongoose.Types.ObjectId;
889
- } & {
890
- __v: number;
891
- }, "id"> & {
892
- id: string;
893
- }, {
894
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
895
- } | {
896
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
897
- planKey: PlanKeyValue;
898
- status: SubscriptionStatusValue;
899
- isActive: boolean;
900
- renewalCount: number;
901
- pausedAt?: NativeDate | null | undefined;
902
- endDate?: NativeDate | null | undefined;
903
- lastPaymentDate?: NativeDate | null | undefined;
904
- lastPaymentAmount?: number | null | undefined;
905
- startDate?: NativeDate | null | undefined;
906
- canceledAt?: NativeDate | null | undefined;
907
- cancelAt?: NativeDate | null | undefined;
908
- }, {
909
- id: string;
910
- }, mongoose.ResolveSchemaOptions<{
911
- _id: false;
912
- }>> & Omit<{
913
- planKey: PlanKeyValue;
914
- status: SubscriptionStatusValue;
915
- isActive: boolean;
916
- renewalCount: number;
917
- pausedAt?: NativeDate | null | undefined;
918
- endDate?: NativeDate | null | undefined;
919
- lastPaymentDate?: NativeDate | null | undefined;
920
- lastPaymentAmount?: number | null | undefined;
921
- startDate?: NativeDate | null | undefined;
922
- canceledAt?: NativeDate | null | undefined;
923
- cancelAt?: NativeDate | null | undefined;
924
- } & {
925
- _id: mongoose.Types.ObjectId;
926
- } & {
927
- __v: number;
928
- }, "id"> & {
929
- id: string;
930
- }> | undefined;
931
- }, {
932
- planKey: PlanKeyValue;
933
- status: SubscriptionStatusValue;
934
- isActive: boolean;
935
- renewalCount: number;
936
- pausedAt?: NativeDate | null | undefined;
937
- endDate?: NativeDate | null | undefined;
938
- lastPaymentDate?: NativeDate | null | undefined;
939
- lastPaymentAmount?: number | null | undefined;
940
- startDate?: NativeDate | null | undefined;
941
- canceledAt?: NativeDate | null | undefined;
942
- cancelAt?: NativeDate | null | undefined;
943
- } & {
944
- _id: mongoose.Types.ObjectId;
945
- } & {
946
- __v: number;
947
- }>;
948
-
949
- /**
950
- * Hold/Escrow Schema
951
- * @classytic/revenue
952
- *
953
- * Schema for platform-as-intermediary escrow flow
954
- * Spread into transaction schema when needed
955
- */
956
- declare const holdSchema: {
957
- readonly status: {
958
- readonly type: StringConstructor;
959
- readonly enum: HoldStatusValue[];
960
- readonly default: "pending";
961
- };
962
- readonly heldAmount: {
963
- readonly type: NumberConstructor;
964
- readonly required: false;
965
- };
966
- readonly releasedAmount: {
967
- readonly type: NumberConstructor;
968
- readonly default: 0;
969
- };
970
- readonly reason: {
971
- readonly type: StringConstructor;
972
- readonly enum: HoldReasonValue[];
973
- readonly required: false;
974
- };
975
- readonly holdUntil: {
976
- readonly type: DateConstructor;
977
- readonly required: false;
978
- };
979
- readonly heldAt: DateConstructor;
980
- readonly releasedAt: DateConstructor;
981
- readonly cancelledAt: DateConstructor;
982
- readonly releases: readonly [{
983
- readonly amount: NumberConstructor;
984
- readonly recipientId: StringConstructor;
985
- readonly recipientType: StringConstructor;
986
- readonly releasedAt: DateConstructor;
987
- readonly releasedBy: StringConstructor;
988
- readonly reason: StringConstructor;
989
- readonly metadata: ObjectConstructor;
990
- }];
991
- readonly metadata: {
992
- readonly type: ObjectConstructor;
993
- readonly default: {};
994
- };
995
- };
996
-
997
- /**
998
- * Split Schema - Embedded in Transaction
999
- */
1000
- declare const splitSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
1001
- _id: false;
1002
- }, {
1003
- type: SplitTypeValue;
1004
- metadata: any;
1005
- recipientId: string;
1006
- recipientType: "user" | "affiliate" | "platform" | "organization" | "partner";
1007
- gatewayFeeRate: number;
1008
- rate: number;
1009
- status: SplitStatusValue;
1010
- grossAmount: number;
1011
- netAmount: number;
1012
- gatewayFeeAmount: number;
1013
- dueDate?: NativeDate | null | undefined;
1014
- paidDate?: NativeDate | null | undefined;
1015
- payoutMethod?: PayoutMethodValue | null | undefined;
1016
- payoutTransactionId?: string | null | undefined;
1017
- }, mongoose.Document<unknown, {}, {
1018
- type: SplitTypeValue;
1019
- metadata: any;
1020
- recipientId: string;
1021
- recipientType: "user" | "affiliate" | "platform" | "organization" | "partner";
1022
- gatewayFeeRate: number;
1023
- rate: number;
1024
- status: SplitStatusValue;
1025
- grossAmount: number;
1026
- netAmount: number;
1027
- gatewayFeeAmount: number;
1028
- dueDate?: NativeDate | null | undefined;
1029
- paidDate?: NativeDate | null | undefined;
1030
- payoutMethod?: PayoutMethodValue | null | undefined;
1031
- payoutTransactionId?: string | null | undefined;
1032
- }, {
1033
- id: string;
1034
- }, mongoose.ResolveSchemaOptions<{
1035
- _id: false;
1036
- }>> & Omit<{
1037
- type: SplitTypeValue;
1038
- metadata: any;
1039
- recipientId: string;
1040
- recipientType: "user" | "affiliate" | "platform" | "organization" | "partner";
1041
- gatewayFeeRate: number;
1042
- rate: number;
1043
- status: SplitStatusValue;
1044
- grossAmount: number;
1045
- netAmount: number;
1046
- gatewayFeeAmount: number;
1047
- dueDate?: NativeDate | null | undefined;
1048
- paidDate?: NativeDate | null | undefined;
1049
- payoutMethod?: PayoutMethodValue | null | undefined;
1050
- payoutTransactionId?: string | null | undefined;
1051
- } & {
1052
- _id: mongoose.Types.ObjectId;
1053
- } & {
1054
- __v: number;
1055
- }, "id"> & {
1056
- id: string;
1057
- }, {
1058
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
1059
- } | {
1060
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
1061
- type: SplitTypeValue;
1062
- metadata: any;
1063
- recipientId: string;
1064
- recipientType: "user" | "affiliate" | "platform" | "organization" | "partner";
1065
- gatewayFeeRate: number;
1066
- rate: number;
1067
- status: SplitStatusValue;
1068
- grossAmount: number;
1069
- netAmount: number;
1070
- gatewayFeeAmount: number;
1071
- dueDate?: NativeDate | null | undefined;
1072
- paidDate?: NativeDate | null | undefined;
1073
- payoutMethod?: PayoutMethodValue | null | undefined;
1074
- payoutTransactionId?: string | null | undefined;
1075
- }, {
1076
- id: string;
1077
- }, mongoose.ResolveSchemaOptions<{
1078
- _id: false;
1079
- }>> & Omit<{
1080
- type: SplitTypeValue;
1081
- metadata: any;
1082
- recipientId: string;
1083
- recipientType: "user" | "affiliate" | "platform" | "organization" | "partner";
1084
- gatewayFeeRate: number;
1085
- rate: number;
1086
- status: SplitStatusValue;
1087
- grossAmount: number;
1088
- netAmount: number;
1089
- gatewayFeeAmount: number;
1090
- dueDate?: NativeDate | null | undefined;
1091
- paidDate?: NativeDate | null | undefined;
1092
- payoutMethod?: PayoutMethodValue | null | undefined;
1093
- payoutTransactionId?: string | null | undefined;
1094
- } & {
1095
- _id: mongoose.Types.ObjectId;
1096
- } & {
1097
- __v: number;
1098
- }, "id"> & {
1099
- id: string;
1100
- }> | undefined;
1101
- }, {
1102
- type: SplitTypeValue;
1103
- metadata: any;
1104
- recipientId: string;
1105
- recipientType: "user" | "affiliate" | "platform" | "organization" | "partner";
1106
- gatewayFeeRate: number;
1107
- rate: number;
1108
- status: SplitStatusValue;
1109
- grossAmount: number;
1110
- netAmount: number;
1111
- gatewayFeeAmount: number;
1112
- dueDate?: NativeDate | null | undefined;
1113
- paidDate?: NativeDate | null | undefined;
1114
- payoutMethod?: PayoutMethodValue | null | undefined;
1115
- payoutTransactionId?: string | null | undefined;
1116
- } & {
1117
- _id: mongoose.Types.ObjectId;
1118
- } & {
1119
- __v: number;
1120
- }>;
1121
-
1122
- export { paymentSummarySchema as a, baseMetadataSchema as b, currentPaymentSchema as c, paymentDetailsSchema as d, commissionSchema as e, planSchema as f, gatewaySchema as g, holdSchema as h, splitSchema as i, paymentEntrySchema as p, referenceSchema as r, subscriptionInfoSchema as s, tenantSnapshotSchema as t };