@classytic/revenue 1.0.2 → 1.1.2

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 (53) hide show
  1. package/README.md +603 -486
  2. package/dist/application/services/index.d.ts +6 -0
  3. package/dist/application/services/index.js +3288 -0
  4. package/dist/application/services/index.js.map +1 -0
  5. package/dist/core/events.d.ts +455 -0
  6. package/dist/core/events.js +122 -0
  7. package/dist/core/events.js.map +1 -0
  8. package/dist/core/index.d.ts +12 -889
  9. package/dist/core/index.js +2361 -705
  10. package/dist/core/index.js.map +1 -1
  11. package/dist/enums/index.d.ts +54 -25
  12. package/dist/enums/index.js +143 -14
  13. package/dist/enums/index.js.map +1 -1
  14. package/dist/escrow.enums-CE0VQsfe.d.ts +76 -0
  15. package/dist/{index-BnJWVXuw.d.ts → index-DxIK0UmZ.d.ts} +281 -26
  16. package/dist/index-EnfKzDbs.d.ts +806 -0
  17. package/dist/{index-ChVD3P9k.d.ts → index-cLJBLUvx.d.ts} +55 -81
  18. package/dist/index.d.ts +16 -15
  19. package/dist/index.js +2583 -2066
  20. package/dist/index.js.map +1 -1
  21. package/dist/infrastructure/plugins/index.d.ts +267 -0
  22. package/dist/infrastructure/plugins/index.js +292 -0
  23. package/dist/infrastructure/plugins/index.js.map +1 -0
  24. package/dist/money-widWVD7r.d.ts +111 -0
  25. package/dist/payment.enums-C1BiGlRa.d.ts +69 -0
  26. package/dist/plugin-Bb9HOE10.d.ts +336 -0
  27. package/dist/providers/index.d.ts +19 -6
  28. package/dist/providers/index.js +22 -3
  29. package/dist/providers/index.js.map +1 -1
  30. package/dist/reconciliation/index.d.ts +215 -0
  31. package/dist/reconciliation/index.js +140 -0
  32. package/dist/reconciliation/index.js.map +1 -0
  33. package/dist/{retry-80lBCmSe.d.ts → retry-D4hFUwVk.d.ts} +1 -41
  34. package/dist/schemas/index.d.ts +1927 -166
  35. package/dist/schemas/index.js +357 -40
  36. package/dist/schemas/index.js.map +1 -1
  37. package/dist/schemas/validation.d.ts +87 -12
  38. package/dist/schemas/validation.js +71 -17
  39. package/dist/schemas/validation.js.map +1 -1
  40. package/dist/settlement.enums-ByC1x0ye.d.ts +130 -0
  41. package/dist/settlement.schema-CpamV7ZY.d.ts +343 -0
  42. package/dist/split.enums-DG3TxQf9.d.ts +42 -0
  43. package/dist/tax-CV8A0sxl.d.ts +60 -0
  44. package/dist/utils/index.d.ts +487 -13
  45. package/dist/utils/index.js +370 -235
  46. package/dist/utils/index.js.map +1 -1
  47. package/package.json +27 -13
  48. package/dist/actions-CwG-b7fR.d.ts +0 -519
  49. package/dist/services/index.d.ts +0 -3
  50. package/dist/services/index.js +0 -1632
  51. package/dist/services/index.js.map +0 -1
  52. package/dist/split.enums-Bh24jw8p.d.ts +0 -255
  53. package/dist/split.schema-DYVP7Wu2.d.ts +0 -958
@@ -1,958 +0,0 @@
1
- import * as mongoose from 'mongoose';
2
- import { Schema } from 'mongoose';
3
-
4
- /**
5
- * Base metadata schema for transactions
6
- */
7
- declare const baseMetadataSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
8
- _id: false;
9
- strict: false;
10
- }, {}, mongoose.Document<unknown, {}, {}, {
11
- id: string;
12
- }, mongoose.ResolveSchemaOptions<{
13
- _id: false;
14
- strict: false;
15
- }>> & Omit<Required<{
16
- _id: unknown;
17
- }> & {
18
- __v: number;
19
- }, "id"> & {
20
- id: string;
21
- }, {
22
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
23
- } | {
24
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {}, {
25
- id: string;
26
- }, mongoose.ResolveSchemaOptions<{
27
- _id: false;
28
- strict: false;
29
- }>> & Omit<Required<{
30
- _id: unknown;
31
- }> & {
32
- __v: number;
33
- }, "id"> & {
34
- id: string;
35
- }> | undefined;
36
- }, {} & Required<{
37
- _id: unknown;
38
- }> & {
39
- __v: number;
40
- }>;
41
- /**
42
- * Reference schema for polymorphic associations
43
- */
44
- declare const referenceSchema: {
45
- referenceId: {
46
- type: typeof Schema.Types.ObjectId;
47
- refPath: string;
48
- index: boolean;
49
- };
50
- referenceModel: {
51
- type: StringConstructor;
52
- enum: string[];
53
- };
54
- };
55
-
56
- /**
57
- * Gateway Schema - Embedded in Transaction
58
- * Tracks payment gateway details
59
- */
60
- declare const gatewaySchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
61
- _id: false;
62
- }, {
63
- type: string;
64
- metadata: any;
65
- sessionId?: string | null | undefined;
66
- paymentIntentId?: string | null | undefined;
67
- provider?: string | null | undefined;
68
- verificationData?: any;
69
- }, mongoose.Document<unknown, {}, {
70
- type: string;
71
- metadata: any;
72
- sessionId?: string | null | undefined;
73
- paymentIntentId?: string | null | undefined;
74
- provider?: string | null | undefined;
75
- verificationData?: any;
76
- }, {
77
- id: string;
78
- }, mongoose.ResolveSchemaOptions<{
79
- _id: false;
80
- }>> & Omit<{
81
- type: string;
82
- metadata: any;
83
- sessionId?: string | null | undefined;
84
- paymentIntentId?: string | null | undefined;
85
- provider?: string | null | undefined;
86
- verificationData?: any;
87
- } & {
88
- _id: mongoose.Types.ObjectId;
89
- } & {
90
- __v: number;
91
- }, "id"> & {
92
- id: string;
93
- }, {
94
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
95
- } | {
96
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
97
- type: string;
98
- metadata: any;
99
- sessionId?: string | null | undefined;
100
- paymentIntentId?: string | null | undefined;
101
- provider?: string | null | undefined;
102
- verificationData?: any;
103
- }, {
104
- id: string;
105
- }, mongoose.ResolveSchemaOptions<{
106
- _id: false;
107
- }>> & Omit<{
108
- type: string;
109
- metadata: any;
110
- sessionId?: string | null | undefined;
111
- paymentIntentId?: string | null | undefined;
112
- provider?: string | null | undefined;
113
- verificationData?: any;
114
- } & {
115
- _id: mongoose.Types.ObjectId;
116
- } & {
117
- __v: number;
118
- }, "id"> & {
119
- id: string;
120
- }> | undefined;
121
- }, {
122
- type: string;
123
- metadata: any;
124
- sessionId?: string | null | undefined;
125
- paymentIntentId?: string | null | undefined;
126
- provider?: string | null | undefined;
127
- verificationData?: any;
128
- } & {
129
- _id: mongoose.Types.ObjectId;
130
- } & {
131
- __v: number;
132
- }>;
133
-
134
- /**
135
- * Current Payment Schema
136
- * Use this in your model: currentPayment: { type: currentPaymentSchema }
137
- *
138
- * Tracks the latest payment transaction for an entity
139
- */
140
- declare const currentPaymentSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
141
- _id: false;
142
- }, {
143
- status: "pending" | "verified" | "failed" | "cancelled" | "refunded";
144
- transactionId?: mongoose.Types.ObjectId | null | undefined;
145
- amount?: number | null | undefined;
146
- method?: string | null | undefined;
147
- verifiedAt?: NativeDate | null | undefined;
148
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
149
- reference?: string | null | undefined;
150
- }, mongoose.Document<unknown, {}, {
151
- status: "pending" | "verified" | "failed" | "cancelled" | "refunded";
152
- transactionId?: mongoose.Types.ObjectId | null | undefined;
153
- amount?: number | null | undefined;
154
- method?: string | null | undefined;
155
- verifiedAt?: NativeDate | null | undefined;
156
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
157
- reference?: string | null | undefined;
158
- }, {
159
- id: string;
160
- }, mongoose.ResolveSchemaOptions<{
161
- _id: false;
162
- }>> & Omit<{
163
- status: "pending" | "verified" | "failed" | "cancelled" | "refunded";
164
- transactionId?: mongoose.Types.ObjectId | null | undefined;
165
- amount?: number | null | undefined;
166
- method?: string | null | undefined;
167
- verifiedAt?: NativeDate | null | undefined;
168
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
169
- reference?: string | null | undefined;
170
- } & {
171
- _id: mongoose.Types.ObjectId;
172
- } & {
173
- __v: number;
174
- }, "id"> & {
175
- id: string;
176
- }, {
177
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
178
- } | {
179
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
180
- status: "pending" | "verified" | "failed" | "cancelled" | "refunded";
181
- transactionId?: mongoose.Types.ObjectId | null | undefined;
182
- amount?: number | null | undefined;
183
- method?: string | null | undefined;
184
- verifiedAt?: NativeDate | null | undefined;
185
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
186
- reference?: string | null | undefined;
187
- }, {
188
- id: string;
189
- }, mongoose.ResolveSchemaOptions<{
190
- _id: false;
191
- }>> & Omit<{
192
- status: "pending" | "verified" | "failed" | "cancelled" | "refunded";
193
- transactionId?: mongoose.Types.ObjectId | null | undefined;
194
- amount?: number | null | undefined;
195
- method?: string | null | undefined;
196
- verifiedAt?: NativeDate | null | undefined;
197
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
198
- reference?: string | null | undefined;
199
- } & {
200
- _id: mongoose.Types.ObjectId;
201
- } & {
202
- __v: number;
203
- }, "id"> & {
204
- id: string;
205
- }> | undefined;
206
- }, {
207
- status: "pending" | "verified" | "failed" | "cancelled" | "refunded";
208
- transactionId?: mongoose.Types.ObjectId | null | undefined;
209
- amount?: number | null | undefined;
210
- method?: string | null | undefined;
211
- verifiedAt?: NativeDate | null | undefined;
212
- verifiedBy?: mongoose.Types.ObjectId | null | undefined;
213
- reference?: string | null | undefined;
214
- } & {
215
- _id: mongoose.Types.ObjectId;
216
- } & {
217
- __v: number;
218
- }>;
219
- /**
220
- * Payment Summary Schema
221
- * Use this in your model: paymentSummary: { type: paymentSummarySchema }
222
- *
223
- * Tracks payment history and totals
224
- */
225
- declare const paymentSummarySchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
226
- _id: false;
227
- }, {
228
- totalPayments: number;
229
- totalAmountPaid: number;
230
- lastPaymentDate?: NativeDate | null | undefined;
231
- lastPaymentAmount?: number | null | undefined;
232
- }, mongoose.Document<unknown, {}, {
233
- totalPayments: number;
234
- totalAmountPaid: number;
235
- lastPaymentDate?: NativeDate | null | undefined;
236
- lastPaymentAmount?: number | null | undefined;
237
- }, {
238
- id: string;
239
- }, mongoose.ResolveSchemaOptions<{
240
- _id: false;
241
- }>> & Omit<{
242
- totalPayments: number;
243
- totalAmountPaid: number;
244
- lastPaymentDate?: NativeDate | null | undefined;
245
- lastPaymentAmount?: number | null | undefined;
246
- } & {
247
- _id: mongoose.Types.ObjectId;
248
- } & {
249
- __v: number;
250
- }, "id"> & {
251
- id: string;
252
- }, {
253
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
254
- } | {
255
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
256
- totalPayments: number;
257
- totalAmountPaid: number;
258
- lastPaymentDate?: NativeDate | null | undefined;
259
- lastPaymentAmount?: number | null | undefined;
260
- }, {
261
- id: string;
262
- }, mongoose.ResolveSchemaOptions<{
263
- _id: false;
264
- }>> & Omit<{
265
- totalPayments: number;
266
- totalAmountPaid: number;
267
- lastPaymentDate?: NativeDate | null | undefined;
268
- lastPaymentAmount?: number | null | undefined;
269
- } & {
270
- _id: mongoose.Types.ObjectId;
271
- } & {
272
- __v: number;
273
- }, "id"> & {
274
- id: string;
275
- }> | undefined;
276
- }, {
277
- totalPayments: number;
278
- totalAmountPaid: number;
279
- lastPaymentDate?: NativeDate | null | undefined;
280
- lastPaymentAmount?: number | null | undefined;
281
- } & {
282
- _id: mongoose.Types.ObjectId;
283
- } & {
284
- __v: number;
285
- }>;
286
- /**
287
- * Payment Details Schema (for manual payments)
288
- * Embedded in Transaction model
289
- */
290
- declare const paymentDetailsSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
291
- _id: false;
292
- }, {
293
- provider?: string | null | undefined;
294
- walletNumber?: string | null | undefined;
295
- walletType?: string | null | undefined;
296
- trxId?: string | null | undefined;
297
- bankName?: string | null | undefined;
298
- accountNumber?: string | null | undefined;
299
- accountName?: string | null | undefined;
300
- proofUrl?: string | null | undefined;
301
- }, mongoose.Document<unknown, {}, {
302
- provider?: string | null | undefined;
303
- walletNumber?: string | null | undefined;
304
- walletType?: string | null | undefined;
305
- trxId?: string | null | undefined;
306
- bankName?: string | null | undefined;
307
- accountNumber?: string | null | undefined;
308
- accountName?: string | null | undefined;
309
- proofUrl?: string | null | undefined;
310
- }, {
311
- id: string;
312
- }, mongoose.ResolveSchemaOptions<{
313
- _id: false;
314
- }>> & Omit<{
315
- provider?: string | null | undefined;
316
- walletNumber?: string | null | undefined;
317
- walletType?: string | null | undefined;
318
- trxId?: string | null | undefined;
319
- bankName?: string | null | undefined;
320
- accountNumber?: string | null | undefined;
321
- accountName?: string | null | undefined;
322
- proofUrl?: string | null | undefined;
323
- } & {
324
- _id: mongoose.Types.ObjectId;
325
- } & {
326
- __v: number;
327
- }, "id"> & {
328
- id: string;
329
- }, {
330
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
331
- } | {
332
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
333
- provider?: string | null | undefined;
334
- walletNumber?: string | null | undefined;
335
- walletType?: string | null | undefined;
336
- trxId?: string | null | undefined;
337
- bankName?: string | null | undefined;
338
- accountNumber?: string | null | undefined;
339
- accountName?: string | null | undefined;
340
- proofUrl?: string | null | undefined;
341
- }, {
342
- id: string;
343
- }, mongoose.ResolveSchemaOptions<{
344
- _id: false;
345
- }>> & Omit<{
346
- provider?: string | null | undefined;
347
- walletNumber?: string | null | undefined;
348
- walletType?: string | null | undefined;
349
- trxId?: string | null | undefined;
350
- bankName?: string | null | undefined;
351
- accountNumber?: string | null | undefined;
352
- accountName?: string | null | undefined;
353
- proofUrl?: string | null | undefined;
354
- } & {
355
- _id: mongoose.Types.ObjectId;
356
- } & {
357
- __v: number;
358
- }, "id"> & {
359
- id: string;
360
- }> | undefined;
361
- }, {
362
- provider?: string | null | undefined;
363
- walletNumber?: string | null | undefined;
364
- walletType?: string | null | undefined;
365
- trxId?: string | null | undefined;
366
- bankName?: string | null | undefined;
367
- accountNumber?: string | null | undefined;
368
- accountName?: string | null | undefined;
369
- proofUrl?: string | null | undefined;
370
- } & {
371
- _id: mongoose.Types.ObjectId;
372
- } & {
373
- __v: number;
374
- }>;
375
- /**
376
- * Tenant Snapshot Schema
377
- * Captures organization payment details at transaction time (audit trail)
378
- */
379
- declare const tenantSnapshotSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
380
- _id: false;
381
- }, {
382
- paymentInstructions?: string | null | undefined;
383
- bkashNumber?: string | null | undefined;
384
- nagadNumber?: string | null | undefined;
385
- bankAccount?: string | null | undefined;
386
- }, mongoose.Document<unknown, {}, {
387
- paymentInstructions?: string | null | undefined;
388
- bkashNumber?: string | null | undefined;
389
- nagadNumber?: string | null | undefined;
390
- bankAccount?: string | null | undefined;
391
- }, {
392
- id: string;
393
- }, mongoose.ResolveSchemaOptions<{
394
- _id: false;
395
- }>> & Omit<{
396
- paymentInstructions?: string | null | undefined;
397
- bkashNumber?: string | null | undefined;
398
- nagadNumber?: string | null | undefined;
399
- bankAccount?: string | null | undefined;
400
- } & {
401
- _id: mongoose.Types.ObjectId;
402
- } & {
403
- __v: number;
404
- }, "id"> & {
405
- id: string;
406
- }, {
407
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
408
- } | {
409
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
410
- paymentInstructions?: string | null | undefined;
411
- bkashNumber?: string | null | undefined;
412
- nagadNumber?: string | null | undefined;
413
- bankAccount?: string | null | undefined;
414
- }, {
415
- id: string;
416
- }, mongoose.ResolveSchemaOptions<{
417
- _id: false;
418
- }>> & Omit<{
419
- paymentInstructions?: string | null | undefined;
420
- bkashNumber?: string | null | undefined;
421
- nagadNumber?: string | null | undefined;
422
- bankAccount?: string | null | undefined;
423
- } & {
424
- _id: mongoose.Types.ObjectId;
425
- } & {
426
- __v: number;
427
- }, "id"> & {
428
- id: string;
429
- }> | undefined;
430
- }, {
431
- paymentInstructions?: string | null | undefined;
432
- bkashNumber?: string | null | undefined;
433
- nagadNumber?: string | null | undefined;
434
- bankAccount?: string | null | undefined;
435
- } & {
436
- _id: mongoose.Types.ObjectId;
437
- } & {
438
- __v: number;
439
- }>;
440
-
441
- /**
442
- * Commission Schema - Embedded in Transaction
443
- * Tracks platform commission with gateway fee deduction
444
- *
445
- * Usage: commission: commissionSchema
446
- */
447
- declare const commissionSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
448
- _id: false;
449
- }, {
450
- status: "pending" | "paid" | "waived" | "reversed";
451
- splits: string[];
452
- grossAmount?: number | null | undefined;
453
- netAmount?: number | null | undefined;
454
- rate?: number | null | undefined;
455
- gatewayFeeRate?: number | null | undefined;
456
- gatewayFeeAmount?: number | null | undefined;
457
- affiliate?: {
458
- recipientId?: string | null | undefined;
459
- grossAmount?: number | null | undefined;
460
- netAmount?: number | null | undefined;
461
- rate?: number | null | undefined;
462
- recipientType?: "user" | "organization" | "partner" | null | undefined;
463
- } | null | undefined;
464
- }, mongoose.Document<unknown, {}, {
465
- status: "pending" | "paid" | "waived" | "reversed";
466
- splits: string[];
467
- grossAmount?: number | null | undefined;
468
- netAmount?: number | null | undefined;
469
- rate?: number | null | undefined;
470
- gatewayFeeRate?: number | null | undefined;
471
- gatewayFeeAmount?: number | null | undefined;
472
- affiliate?: {
473
- recipientId?: string | null | undefined;
474
- grossAmount?: number | null | undefined;
475
- netAmount?: number | null | undefined;
476
- rate?: number | null | undefined;
477
- recipientType?: "user" | "organization" | "partner" | null | undefined;
478
- } | null | undefined;
479
- }, {
480
- id: string;
481
- }, mongoose.ResolveSchemaOptions<{
482
- _id: false;
483
- }>> & Omit<{
484
- status: "pending" | "paid" | "waived" | "reversed";
485
- splits: string[];
486
- grossAmount?: number | null | undefined;
487
- netAmount?: number | null | undefined;
488
- rate?: number | null | undefined;
489
- gatewayFeeRate?: number | null | undefined;
490
- gatewayFeeAmount?: number | null | undefined;
491
- affiliate?: {
492
- recipientId?: string | null | undefined;
493
- grossAmount?: number | null | undefined;
494
- netAmount?: number | null | undefined;
495
- rate?: number | null | undefined;
496
- recipientType?: "user" | "organization" | "partner" | null | undefined;
497
- } | null | undefined;
498
- } & {
499
- _id: mongoose.Types.ObjectId;
500
- } & {
501
- __v: number;
502
- }, "id"> & {
503
- id: string;
504
- }, {
505
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
506
- } | {
507
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
508
- status: "pending" | "paid" | "waived" | "reversed";
509
- splits: string[];
510
- grossAmount?: number | null | undefined;
511
- netAmount?: number | null | undefined;
512
- rate?: number | null | undefined;
513
- gatewayFeeRate?: number | null | undefined;
514
- gatewayFeeAmount?: number | null | undefined;
515
- affiliate?: {
516
- recipientId?: string | null | undefined;
517
- grossAmount?: number | null | undefined;
518
- netAmount?: number | null | undefined;
519
- rate?: number | null | undefined;
520
- recipientType?: "user" | "organization" | "partner" | null | undefined;
521
- } | null | undefined;
522
- }, {
523
- id: string;
524
- }, mongoose.ResolveSchemaOptions<{
525
- _id: false;
526
- }>> & Omit<{
527
- status: "pending" | "paid" | "waived" | "reversed";
528
- splits: string[];
529
- grossAmount?: number | null | undefined;
530
- netAmount?: number | null | undefined;
531
- rate?: number | null | undefined;
532
- gatewayFeeRate?: number | null | undefined;
533
- gatewayFeeAmount?: number | null | undefined;
534
- affiliate?: {
535
- recipientId?: string | null | undefined;
536
- grossAmount?: number | null | undefined;
537
- netAmount?: number | null | undefined;
538
- rate?: number | null | undefined;
539
- recipientType?: "user" | "organization" | "partner" | null | undefined;
540
- } | null | undefined;
541
- } & {
542
- _id: mongoose.Types.ObjectId;
543
- } & {
544
- __v: number;
545
- }, "id"> & {
546
- id: string;
547
- }> | undefined;
548
- }, {
549
- status: "pending" | "paid" | "waived" | "reversed";
550
- splits: string[];
551
- grossAmount?: number | null | undefined;
552
- netAmount?: number | null | undefined;
553
- rate?: number | null | undefined;
554
- gatewayFeeRate?: number | null | undefined;
555
- gatewayFeeAmount?: number | null | undefined;
556
- affiliate?: {
557
- recipientId?: string | null | undefined;
558
- grossAmount?: number | null | undefined;
559
- netAmount?: number | null | undefined;
560
- rate?: number | null | undefined;
561
- recipientType?: "user" | "organization" | "partner" | null | undefined;
562
- } | null | undefined;
563
- } & {
564
- _id: mongoose.Types.ObjectId;
565
- } & {
566
- __v: number;
567
- }>;
568
-
569
- /**
570
- * Plan Schema - for defining subscription plans
571
- */
572
- declare const planSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
573
- _id: false;
574
- }, {
575
- amount: number;
576
- currency: string;
577
- metadata: any;
578
- name: string;
579
- key: "monthly" | "quarterly" | "yearly";
580
- isActive: boolean;
581
- interval: "day" | "week" | "month" | "year";
582
- intervalCount: number;
583
- features: string[];
584
- description?: string | null | undefined;
585
- }, mongoose.Document<unknown, {}, {
586
- amount: number;
587
- currency: string;
588
- metadata: any;
589
- name: string;
590
- key: "monthly" | "quarterly" | "yearly";
591
- isActive: boolean;
592
- interval: "day" | "week" | "month" | "year";
593
- intervalCount: number;
594
- features: string[];
595
- description?: string | null | undefined;
596
- }, {
597
- id: string;
598
- }, mongoose.ResolveSchemaOptions<{
599
- _id: false;
600
- }>> & Omit<{
601
- amount: number;
602
- currency: string;
603
- metadata: any;
604
- name: string;
605
- key: "monthly" | "quarterly" | "yearly";
606
- isActive: boolean;
607
- interval: "day" | "week" | "month" | "year";
608
- intervalCount: number;
609
- features: string[];
610
- description?: string | null | undefined;
611
- } & {
612
- _id: mongoose.Types.ObjectId;
613
- } & {
614
- __v: number;
615
- }, "id"> & {
616
- id: string;
617
- }, {
618
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
619
- } | {
620
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
621
- amount: number;
622
- currency: string;
623
- metadata: any;
624
- name: string;
625
- key: "monthly" | "quarterly" | "yearly";
626
- isActive: boolean;
627
- interval: "day" | "week" | "month" | "year";
628
- intervalCount: number;
629
- features: string[];
630
- description?: string | null | undefined;
631
- }, {
632
- id: string;
633
- }, mongoose.ResolveSchemaOptions<{
634
- _id: false;
635
- }>> & Omit<{
636
- amount: number;
637
- currency: string;
638
- metadata: any;
639
- name: string;
640
- key: "monthly" | "quarterly" | "yearly";
641
- isActive: boolean;
642
- interval: "day" | "week" | "month" | "year";
643
- intervalCount: number;
644
- features: string[];
645
- description?: string | null | undefined;
646
- } & {
647
- _id: mongoose.Types.ObjectId;
648
- } & {
649
- __v: number;
650
- }, "id"> & {
651
- id: string;
652
- }> | undefined;
653
- }, {
654
- amount: number;
655
- currency: string;
656
- metadata: any;
657
- name: string;
658
- key: "monthly" | "quarterly" | "yearly";
659
- isActive: boolean;
660
- interval: "day" | "week" | "month" | "year";
661
- intervalCount: number;
662
- features: string[];
663
- description?: string | null | undefined;
664
- } & {
665
- _id: mongoose.Types.ObjectId;
666
- } & {
667
- __v: number;
668
- }>;
669
-
670
- /**
671
- * Subscription Info Schema
672
- * Use this in your entity models that have subscriptions
673
- *
674
- * @example
675
- * const OrganizationSchema = new Schema({
676
- * name: String,
677
- * subscription: { type: subscriptionInfoSchema },
678
- * });
679
- */
680
- declare const subscriptionInfoSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
681
- _id: false;
682
- }, {
683
- planKey: "monthly" | "quarterly" | "yearly";
684
- status: "pending" | "cancelled" | "expired" | "active" | "paused" | "inactive";
685
- isActive: boolean;
686
- renewalCount: number;
687
- pausedAt?: NativeDate | null | undefined;
688
- endDate?: NativeDate | null | undefined;
689
- lastPaymentDate?: NativeDate | null | undefined;
690
- lastPaymentAmount?: number | null | undefined;
691
- startDate?: NativeDate | null | undefined;
692
- canceledAt?: NativeDate | null | undefined;
693
- cancelAt?: NativeDate | null | undefined;
694
- }, mongoose.Document<unknown, {}, {
695
- planKey: "monthly" | "quarterly" | "yearly";
696
- status: "pending" | "cancelled" | "expired" | "active" | "paused" | "inactive";
697
- isActive: boolean;
698
- renewalCount: number;
699
- pausedAt?: NativeDate | null | undefined;
700
- endDate?: NativeDate | null | undefined;
701
- lastPaymentDate?: NativeDate | null | undefined;
702
- lastPaymentAmount?: number | null | undefined;
703
- startDate?: NativeDate | null | undefined;
704
- canceledAt?: NativeDate | null | undefined;
705
- cancelAt?: NativeDate | null | undefined;
706
- }, {
707
- id: string;
708
- }, mongoose.ResolveSchemaOptions<{
709
- _id: false;
710
- }>> & Omit<{
711
- planKey: "monthly" | "quarterly" | "yearly";
712
- status: "pending" | "cancelled" | "expired" | "active" | "paused" | "inactive";
713
- isActive: boolean;
714
- renewalCount: number;
715
- pausedAt?: NativeDate | null | undefined;
716
- endDate?: NativeDate | null | undefined;
717
- lastPaymentDate?: NativeDate | null | undefined;
718
- lastPaymentAmount?: number | null | undefined;
719
- startDate?: NativeDate | null | undefined;
720
- canceledAt?: NativeDate | null | undefined;
721
- cancelAt?: NativeDate | null | undefined;
722
- } & {
723
- _id: mongoose.Types.ObjectId;
724
- } & {
725
- __v: number;
726
- }, "id"> & {
727
- id: string;
728
- }, {
729
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
730
- } | {
731
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
732
- planKey: "monthly" | "quarterly" | "yearly";
733
- status: "pending" | "cancelled" | "expired" | "active" | "paused" | "inactive";
734
- isActive: boolean;
735
- renewalCount: number;
736
- pausedAt?: NativeDate | null | undefined;
737
- endDate?: NativeDate | null | undefined;
738
- lastPaymentDate?: NativeDate | null | undefined;
739
- lastPaymentAmount?: number | null | undefined;
740
- startDate?: NativeDate | null | undefined;
741
- canceledAt?: NativeDate | null | undefined;
742
- cancelAt?: NativeDate | null | undefined;
743
- }, {
744
- id: string;
745
- }, mongoose.ResolveSchemaOptions<{
746
- _id: false;
747
- }>> & Omit<{
748
- planKey: "monthly" | "quarterly" | "yearly";
749
- status: "pending" | "cancelled" | "expired" | "active" | "paused" | "inactive";
750
- isActive: boolean;
751
- renewalCount: number;
752
- pausedAt?: NativeDate | null | undefined;
753
- endDate?: NativeDate | null | undefined;
754
- lastPaymentDate?: NativeDate | null | undefined;
755
- lastPaymentAmount?: number | null | undefined;
756
- startDate?: NativeDate | null | undefined;
757
- canceledAt?: NativeDate | null | undefined;
758
- cancelAt?: NativeDate | null | undefined;
759
- } & {
760
- _id: mongoose.Types.ObjectId;
761
- } & {
762
- __v: number;
763
- }, "id"> & {
764
- id: string;
765
- }> | undefined;
766
- }, {
767
- planKey: "monthly" | "quarterly" | "yearly";
768
- status: "pending" | "cancelled" | "expired" | "active" | "paused" | "inactive";
769
- isActive: boolean;
770
- renewalCount: number;
771
- pausedAt?: NativeDate | null | undefined;
772
- endDate?: NativeDate | null | undefined;
773
- lastPaymentDate?: NativeDate | null | undefined;
774
- lastPaymentAmount?: number | null | undefined;
775
- startDate?: NativeDate | null | undefined;
776
- canceledAt?: NativeDate | null | undefined;
777
- cancelAt?: NativeDate | null | undefined;
778
- } & {
779
- _id: mongoose.Types.ObjectId;
780
- } & {
781
- __v: number;
782
- }>;
783
-
784
- /**
785
- * Hold/Escrow Schema
786
- * @classytic/revenue
787
- *
788
- * Schema for platform-as-intermediary escrow flow
789
- * Spread into transaction schema when needed
790
- */
791
- declare const holdSchema: {
792
- readonly status: {
793
- readonly type: StringConstructor;
794
- readonly enum: ("pending" | "cancelled" | "expired" | "held" | "released" | "partially_released")[];
795
- readonly default: "pending";
796
- readonly index: true;
797
- };
798
- readonly heldAmount: {
799
- readonly type: NumberConstructor;
800
- readonly required: false;
801
- };
802
- readonly releasedAmount: {
803
- readonly type: NumberConstructor;
804
- readonly default: 0;
805
- };
806
- readonly reason: {
807
- readonly type: StringConstructor;
808
- readonly enum: ("payment_verification" | "fraud_check" | "manual_review" | "dispute" | "compliance")[];
809
- readonly required: false;
810
- };
811
- readonly holdUntil: {
812
- readonly type: DateConstructor;
813
- readonly required: false;
814
- };
815
- readonly heldAt: DateConstructor;
816
- readonly releasedAt: DateConstructor;
817
- readonly cancelledAt: DateConstructor;
818
- readonly releases: readonly [{
819
- readonly amount: NumberConstructor;
820
- readonly recipientId: StringConstructor;
821
- readonly recipientType: StringConstructor;
822
- readonly releasedAt: DateConstructor;
823
- readonly releasedBy: StringConstructor;
824
- readonly reason: StringConstructor;
825
- readonly metadata: ObjectConstructor;
826
- }];
827
- readonly metadata: {
828
- readonly type: ObjectConstructor;
829
- readonly default: {};
830
- };
831
- };
832
-
833
- /**
834
- * Split Schema - Embedded in Transaction
835
- */
836
- declare const splitSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
837
- _id: false;
838
- }, {
839
- type: "platform_commission" | "affiliate_commission" | "referral_commission" | "partner_commission" | "custom";
840
- metadata: any;
841
- recipientId: string;
842
- grossAmount: number;
843
- netAmount: number;
844
- status: "pending" | "cancelled" | "due" | "paid" | "waived";
845
- rate: number;
846
- gatewayFeeRate: number;
847
- gatewayFeeAmount: number;
848
- recipientType: "user" | "platform" | "organization" | "affiliate" | "partner";
849
- dueDate?: NativeDate | null | undefined;
850
- paidDate?: NativeDate | null | undefined;
851
- payoutMethod?: "manual" | "bank_transfer" | "mobile_wallet" | "platform_balance" | "crypto" | "check" | null | undefined;
852
- payoutTransactionId?: string | null | undefined;
853
- }, mongoose.Document<unknown, {}, {
854
- type: "platform_commission" | "affiliate_commission" | "referral_commission" | "partner_commission" | "custom";
855
- metadata: any;
856
- recipientId: string;
857
- grossAmount: number;
858
- netAmount: number;
859
- status: "pending" | "cancelled" | "due" | "paid" | "waived";
860
- rate: number;
861
- gatewayFeeRate: number;
862
- gatewayFeeAmount: number;
863
- recipientType: "user" | "platform" | "organization" | "affiliate" | "partner";
864
- dueDate?: NativeDate | null | undefined;
865
- paidDate?: NativeDate | null | undefined;
866
- payoutMethod?: "manual" | "bank_transfer" | "mobile_wallet" | "platform_balance" | "crypto" | "check" | null | undefined;
867
- payoutTransactionId?: string | null | undefined;
868
- }, {
869
- id: string;
870
- }, mongoose.ResolveSchemaOptions<{
871
- _id: false;
872
- }>> & Omit<{
873
- type: "platform_commission" | "affiliate_commission" | "referral_commission" | "partner_commission" | "custom";
874
- metadata: any;
875
- recipientId: string;
876
- grossAmount: number;
877
- netAmount: number;
878
- status: "pending" | "cancelled" | "due" | "paid" | "waived";
879
- rate: number;
880
- gatewayFeeRate: number;
881
- gatewayFeeAmount: number;
882
- recipientType: "user" | "platform" | "organization" | "affiliate" | "partner";
883
- dueDate?: NativeDate | null | undefined;
884
- paidDate?: NativeDate | null | undefined;
885
- payoutMethod?: "manual" | "bank_transfer" | "mobile_wallet" | "platform_balance" | "crypto" | "check" | null | undefined;
886
- payoutTransactionId?: string | 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
- type: "platform_commission" | "affiliate_commission" | "referral_commission" | "partner_commission" | "custom";
898
- metadata: any;
899
- recipientId: string;
900
- grossAmount: number;
901
- netAmount: number;
902
- status: "pending" | "cancelled" | "due" | "paid" | "waived";
903
- rate: number;
904
- gatewayFeeRate: number;
905
- gatewayFeeAmount: number;
906
- recipientType: "user" | "platform" | "organization" | "affiliate" | "partner";
907
- dueDate?: NativeDate | null | undefined;
908
- paidDate?: NativeDate | null | undefined;
909
- payoutMethod?: "manual" | "bank_transfer" | "mobile_wallet" | "platform_balance" | "crypto" | "check" | null | undefined;
910
- payoutTransactionId?: string | null | undefined;
911
- }, {
912
- id: string;
913
- }, mongoose.ResolveSchemaOptions<{
914
- _id: false;
915
- }>> & Omit<{
916
- type: "platform_commission" | "affiliate_commission" | "referral_commission" | "partner_commission" | "custom";
917
- metadata: any;
918
- recipientId: string;
919
- grossAmount: number;
920
- netAmount: number;
921
- status: "pending" | "cancelled" | "due" | "paid" | "waived";
922
- rate: number;
923
- gatewayFeeRate: number;
924
- gatewayFeeAmount: number;
925
- recipientType: "user" | "platform" | "organization" | "affiliate" | "partner";
926
- dueDate?: NativeDate | null | undefined;
927
- paidDate?: NativeDate | null | undefined;
928
- payoutMethod?: "manual" | "bank_transfer" | "mobile_wallet" | "platform_balance" | "crypto" | "check" | null | undefined;
929
- payoutTransactionId?: string | null | undefined;
930
- } & {
931
- _id: mongoose.Types.ObjectId;
932
- } & {
933
- __v: number;
934
- }, "id"> & {
935
- id: string;
936
- }> | undefined;
937
- }, {
938
- type: "platform_commission" | "affiliate_commission" | "referral_commission" | "partner_commission" | "custom";
939
- metadata: any;
940
- recipientId: string;
941
- grossAmount: number;
942
- netAmount: number;
943
- status: "pending" | "cancelled" | "due" | "paid" | "waived";
944
- rate: number;
945
- gatewayFeeRate: number;
946
- gatewayFeeAmount: number;
947
- recipientType: "user" | "platform" | "organization" | "affiliate" | "partner";
948
- dueDate?: NativeDate | null | undefined;
949
- paidDate?: NativeDate | null | undefined;
950
- payoutMethod?: "manual" | "bank_transfer" | "mobile_wallet" | "platform_balance" | "crypto" | "check" | null | undefined;
951
- payoutTransactionId?: string | null | undefined;
952
- } & {
953
- _id: mongoose.Types.ObjectId;
954
- } & {
955
- __v: number;
956
- }>;
957
-
958
- export { paymentDetailsSchema as a, baseMetadataSchema as b, currentPaymentSchema as c, commissionSchema as d, planSchema as e, splitSchema as f, gatewaySchema as g, holdSchema as h, paymentSummarySchema as p, referenceSchema as r, subscriptionInfoSchema as s, tenantSnapshotSchema as t };