@classytic/revenue 1.1.4 → 2.0.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 (82) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +638 -632
  3. package/dist/audit-B39B0Sdq.mjs +53 -0
  4. package/dist/audit-DZ0eTr9g.d.mts +89 -0
  5. package/dist/bridges/index.d.mts +2 -0
  6. package/dist/bridges/index.mjs +1 -0
  7. package/dist/context-DRqSeTPM.d.mts +35 -0
  8. package/dist/core/state-machines.d.mts +35 -0
  9. package/dist/core/state-machines.mjs +134 -0
  10. package/dist/engine-types-CcjIb4Fy.d.mts +611 -0
  11. package/dist/enums/index.d.mts +3 -157
  12. package/dist/enums/index.mjs +3 -55
  13. package/dist/errors-DHa8JVQ-.mjs +92 -0
  14. package/dist/escrow.schema-BBv9oVEW.mjs +322 -0
  15. package/dist/escrow.schema-CC8XuD46.d.mts +629 -0
  16. package/dist/event-constants-CEMitnIV.mjs +53 -0
  17. package/dist/events/index.d.mts +3 -0
  18. package/dist/events/index.mjs +4 -0
  19. package/dist/index.d.mts +77 -9
  20. package/dist/index.mjs +465 -29
  21. package/dist/monetization.enums-BtiU3t8o.mjs +39 -0
  22. package/dist/monetization.enums-D2xbxXJM.d.mts +34 -0
  23. package/dist/plugins/plugin.interface.d.mts +28 -0
  24. package/dist/plugins/plugin.interface.mjs +26 -0
  25. package/dist/providers/index.d.mts +2 -3
  26. package/dist/providers/index.mjs +2 -2
  27. package/dist/{base-DCoyIUj6.mjs → registry-DhFMsSn5.mjs} +34 -36
  28. package/dist/{base-CsTlVQJe.d.mts → registry-SvIGPAx_.d.mts} +73 -66
  29. package/dist/repositories/create-repositories.d.mts +21 -0
  30. package/dist/repositories/create-repositories.mjs +12 -0
  31. package/dist/revenue-bridges-sdlrR85c.d.mts +145 -0
  32. package/dist/revenue-event-catalog-BX3g7RUi.d.mts +823 -0
  33. package/dist/revenue-event-catalog-LqxPnsU_.mjs +388 -0
  34. package/dist/settlement.repository-Cy3mMWGH.mjs +771 -0
  35. package/dist/shared/index.d.mts +2 -0
  36. package/dist/shared/index.mjs +4 -0
  37. package/dist/split.enums-CQE3ekH1.mjs +172 -0
  38. package/dist/split.enums-Dw4zCrcZ.d.mts +154 -0
  39. package/dist/splits-BAfY-a9P.mjs +123 -0
  40. package/dist/validators/index.d.mts +2 -0
  41. package/dist/validators/index.mjs +3 -0
  42. package/package.json +33 -37
  43. package/dist/application/services/index.d.mts +0 -4
  44. package/dist/application/services/index.mjs +0 -3
  45. package/dist/category-resolver-DV83N8ok.mjs +0 -284
  46. package/dist/commission-split-BzB8cd39.mjs +0 -485
  47. package/dist/core/events.d.mts +0 -294
  48. package/dist/core/events.mjs +0 -100
  49. package/dist/core/index.d.mts +0 -9
  50. package/dist/core/index.mjs +0 -8
  51. package/dist/errors-rRdOqnWx.d.mts +0 -787
  52. package/dist/escrow.enums-CZGrrdg7.mjs +0 -101
  53. package/dist/escrow.enums-DwdLuuve.d.mts +0 -78
  54. package/dist/idempotency-DaYcUGY1.mjs +0 -172
  55. package/dist/index-Dsp7H5Wb.d.mts +0 -471
  56. package/dist/infrastructure/plugins/index.d.mts +0 -239
  57. package/dist/infrastructure/plugins/index.mjs +0 -345
  58. package/dist/money-CvrDOijQ.mjs +0 -271
  59. package/dist/money-DPG8AtJ8.d.mts +0 -112
  60. package/dist/payment.enums-HAuAS9Pp.d.mts +0 -70
  61. package/dist/payment.enums-tEFVa-Xp.mjs +0 -69
  62. package/dist/plugin-BbK0OVHy.d.mts +0 -327
  63. package/dist/plugin-Cd_V04Em.mjs +0 -210
  64. package/dist/reconciliation/index.d.mts +0 -193
  65. package/dist/reconciliation/index.mjs +0 -192
  66. package/dist/retry-HHCOXYdn.d.mts +0 -186
  67. package/dist/revenue-BhdS7nXh.mjs +0 -553
  68. package/dist/schemas/index.d.mts +0 -2665
  69. package/dist/schemas/index.mjs +0 -717
  70. package/dist/schemas/validation.d.mts +0 -375
  71. package/dist/schemas/validation.mjs +0 -325
  72. package/dist/settlement.enums-DFhkqZEY.d.mts +0 -132
  73. package/dist/settlement.schema-DnNSFpGd.d.mts +0 -344
  74. package/dist/settlement.service-DjzAjezU.d.mts +0 -594
  75. package/dist/settlement.service-DmdKv0Zu.mjs +0 -2511
  76. package/dist/split.enums-BrjabxIX.mjs +0 -86
  77. package/dist/split.enums-DmskfLOM.d.mts +0 -43
  78. package/dist/tax-BoCt5cEd.d.mts +0 -61
  79. package/dist/tax-EQ15DO81.mjs +0 -162
  80. package/dist/transaction.enums-pCyMFT4Z.mjs +0 -96
  81. package/dist/utils/index.d.mts +0 -428
  82. package/dist/utils/index.mjs +0 -346
@@ -1,132 +0,0 @@
1
- //#region src/enums/transaction.enums.d.ts
2
- /**
3
- * Transaction Enums
4
- * @classytic/revenue
5
- *
6
- * Library-managed transaction enums only.
7
- * Users should define their own categories and merge with these.
8
- */
9
- /**
10
- * Transaction Flow - Directional money movement
11
- *
12
- * INFLOW: Money coming in (payments, subscriptions, purchases, receipts)
13
- * OUTFLOW: Money going out (refunds, payouts, expenses, disbursements)
14
- *
15
- * Industry-standard terminology compatible with QuickBooks, Xero, and other accounting systems.
16
- * Users can map categories to flow directions via transactionTypeMapping config.
17
- *
18
- * @example
19
- * // Revenue platform
20
- * { type: 'subscription', flow: 'inflow' }
21
- *
22
- * // Payroll platform
23
- * { type: 'salary', flow: 'outflow' }
24
- *
25
- * // Marketplace
26
- * { type: 'commission', flow: 'outflow' } // Paying sellers
27
- * { type: 'platform_fee', flow: 'inflow' } // Platform revenue
28
- */
29
- declare const TRANSACTION_FLOW: {
30
- readonly INFLOW: "inflow";
31
- readonly OUTFLOW: "outflow";
32
- };
33
- /** @deprecated Use TRANSACTION_FLOW instead */
34
- declare const TRANSACTION_TYPE: {
35
- readonly INFLOW: "inflow";
36
- readonly OUTFLOW: "outflow";
37
- };
38
- type TransactionFlow = typeof TRANSACTION_FLOW;
39
- type TransactionFlowValue = TransactionFlow[keyof TransactionFlow];
40
- declare const TRANSACTION_FLOW_VALUES: TransactionFlowValue[];
41
- /** @deprecated Use TransactionFlow instead */
42
- type TransactionType = TransactionFlow;
43
- /** @deprecated Use TransactionFlowValue instead */
44
- type TransactionTypeValue = TransactionFlowValue;
45
- /** @deprecated Use TRANSACTION_FLOW_VALUES instead */
46
- declare const TRANSACTION_TYPE_VALUES: TransactionFlowValue[];
47
- /**
48
- * Transaction Status - Library-managed states
49
- */
50
- declare const TRANSACTION_STATUS: {
51
- readonly PENDING: "pending";
52
- readonly PAYMENT_INITIATED: "payment_initiated";
53
- readonly PROCESSING: "processing";
54
- readonly REQUIRES_ACTION: "requires_action";
55
- readonly VERIFIED: "verified";
56
- readonly COMPLETED: "completed";
57
- readonly FAILED: "failed";
58
- readonly CANCELLED: "cancelled";
59
- readonly EXPIRED: "expired";
60
- readonly REFUNDED: "refunded";
61
- readonly PARTIALLY_REFUNDED: "partially_refunded";
62
- };
63
- type TransactionStatus = typeof TRANSACTION_STATUS;
64
- type TransactionStatusValue = TransactionStatus[keyof TransactionStatus];
65
- declare const TRANSACTION_STATUS_VALUES: TransactionStatusValue[];
66
- /**
67
- * Categories managed by this library
68
- *
69
- * SUBSCRIPTION: Recurring subscription payments
70
- * PURCHASE: One-time purchases
71
- *
72
- * Users should spread these into their own category enums:
73
- *
74
- * @example
75
- * import { LIBRARY_CATEGORIES } from '@classytic/revenue';
76
- *
77
- * export const MY_CATEGORIES = {
78
- * ...LIBRARY_CATEGORIES,
79
- * SALARY: 'salary',
80
- * RENT: 'rent',
81
- * EQUIPMENT: 'equipment',
82
- * } as const;
83
- */
84
- declare const LIBRARY_CATEGORIES: {
85
- readonly SUBSCRIPTION: "subscription";
86
- readonly PURCHASE: "purchase";
87
- };
88
- type LibraryCategories = typeof LIBRARY_CATEGORIES;
89
- type LibraryCategoryValue = LibraryCategories[keyof LibraryCategories];
90
- declare const LIBRARY_CATEGORY_VALUES: LibraryCategoryValue[];
91
- declare function isLibraryCategory(value: unknown): value is LibraryCategoryValue;
92
- declare function isTransactionFlow(value: unknown): value is TransactionFlowValue;
93
- /** @deprecated Use isTransactionFlow instead */
94
- declare function isTransactionType(value: unknown): value is TransactionTypeValue;
95
- declare function isTransactionStatus(value: unknown): value is TransactionStatusValue;
96
- //#endregion
97
- //#region src/enums/settlement.enums.d.ts
98
- /**
99
- * Settlement Enums
100
- * @classytic/revenue
101
- *
102
- * Enums for settlement/payout tracking
103
- */
104
- declare const SETTLEMENT_STATUS: {
105
- readonly PENDING: "pending";
106
- readonly PROCESSING: "processing";
107
- readonly COMPLETED: "completed";
108
- readonly FAILED: "failed";
109
- readonly CANCELLED: "cancelled";
110
- };
111
- type SettlementStatus = typeof SETTLEMENT_STATUS;
112
- type SettlementStatusValue = SettlementStatus[keyof SettlementStatus];
113
- declare const SETTLEMENT_STATUS_VALUES: ("pending" | "processing" | "completed" | "failed" | "cancelled")[];
114
- /**
115
- * Type guard for settlement status
116
- */
117
- declare function isSettlementStatus(value: unknown): value is SettlementStatusValue;
118
- declare const SETTLEMENT_TYPE: {
119
- readonly SPLIT_PAYOUT: "split_payout";
120
- readonly PLATFORM_WITHDRAWAL: "platform_withdrawal";
121
- readonly MANUAL_PAYOUT: "manual_payout";
122
- readonly ESCROW_RELEASE: "escrow_release";
123
- };
124
- type SettlementType = typeof SETTLEMENT_TYPE;
125
- type SettlementTypeValue = SettlementType[keyof SettlementType];
126
- declare const SETTLEMENT_TYPE_VALUES: ("split_payout" | "platform_withdrawal" | "manual_payout" | "escrow_release")[];
127
- /**
128
- * Type guard for settlement type
129
- */
130
- declare function isSettlementType(value: unknown): value is SettlementTypeValue;
131
- //#endregion
132
- export { isTransactionType as A, TransactionStatus as C, isLibraryCategory as D, TransactionTypeValue as E, isTransactionFlow as O, TransactionFlowValue as S, TransactionType as T, TRANSACTION_STATUS as _, SettlementStatus as a, TRANSACTION_TYPE_VALUES as b, SettlementTypeValue as c, LIBRARY_CATEGORIES as d, LIBRARY_CATEGORY_VALUES as f, TRANSACTION_FLOW_VALUES as g, TRANSACTION_FLOW as h, SETTLEMENT_TYPE_VALUES as i, isTransactionStatus as k, isSettlementStatus as l, LibraryCategoryValue as m, SETTLEMENT_STATUS_VALUES as n, SettlementStatusValue as o, LibraryCategories as p, SETTLEMENT_TYPE as r, SettlementType as s, SETTLEMENT_STATUS as t, isSettlementType as u, TRANSACTION_STATUS_VALUES as v, TransactionStatusValue as w, TransactionFlow as x, TRANSACTION_TYPE as y };
@@ -1,344 +0,0 @@
1
- import { i as PayoutMethodValue } from "./split.enums-DmskfLOM.mjs";
2
- import mongoose from "mongoose";
3
-
4
- //#region src/schemas/settlement/settlement.schema.d.ts
5
- /**
6
- * Settlement Schema
7
- * Tracks payouts from platform to vendors/affiliates/partners
8
- *
9
- * Use in your Settlement model:
10
- * ```typescript
11
- * import mongoose from 'mongoose';
12
- * import { settlementSchema } from '@classytic/revenue/schemas';
13
- *
14
- * const Settlement = mongoose.model('Settlement', settlementSchema);
15
- * ```
16
- */
17
- declare const settlementSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
18
- timestamps: true;
19
- }, {
20
- type: "split_payout" | "platform_withdrawal" | "manual_payout" | "escrow_release";
21
- metadata: any;
22
- status: "pending" | "processing" | "completed" | "failed" | "cancelled";
23
- recipientId: mongoose.Types.ObjectId;
24
- recipientType: "affiliate" | "user" | "organization" | "partner" | "platform";
25
- amount: number;
26
- currency: string;
27
- payoutMethod: PayoutMethodValue;
28
- organizationId: mongoose.Types.ObjectId;
29
- sourceTransactionIds: mongoose.Types.ObjectId[];
30
- sourceSplitIds: string[];
31
- retryCount: number;
32
- bankTransferDetails?: {
33
- bankName?: string | null | undefined;
34
- accountNumber?: string | null | undefined;
35
- accountName?: string | null | undefined;
36
- routingNumber?: string | null | undefined;
37
- swiftCode?: string | null | undefined;
38
- iban?: string | null | undefined;
39
- transferReference?: string | null | undefined;
40
- transferredAt?: NativeDate | null | undefined;
41
- } | null | undefined;
42
- mobileWalletDetails?: {
43
- provider?: string | null | undefined;
44
- transactionId?: string | null | undefined;
45
- accountNumber?: string | null | undefined;
46
- transferredAt?: NativeDate | null | undefined;
47
- phoneNumber?: string | null | undefined;
48
- } | null | undefined;
49
- cryptoDetails?: {
50
- transferredAt?: NativeDate | null | undefined;
51
- network?: string | null | undefined;
52
- walletAddress?: string | null | undefined;
53
- transactionHash?: string | null | undefined;
54
- } | null | undefined;
55
- platformBalanceDetails?: {
56
- balanceId?: mongoose.Types.ObjectId | null | undefined;
57
- appliedAt?: NativeDate | null | undefined;
58
- } | null | undefined;
59
- scheduledAt?: NativeDate | null | undefined;
60
- processedAt?: NativeDate | null | undefined;
61
- completedAt?: NativeDate | null | undefined;
62
- failedAt?: NativeDate | null | undefined;
63
- cancelledAt?: NativeDate | null | undefined;
64
- failureReason?: string | null | undefined;
65
- failureCode?: string | null | undefined;
66
- notes?: string | null | undefined;
67
- } & mongoose.DefaultTimestampProps, mongoose.Document<unknown, {}, {
68
- type: "split_payout" | "platform_withdrawal" | "manual_payout" | "escrow_release";
69
- metadata: any;
70
- status: "pending" | "processing" | "completed" | "failed" | "cancelled";
71
- recipientId: mongoose.Types.ObjectId;
72
- recipientType: "affiliate" | "user" | "organization" | "partner" | "platform";
73
- amount: number;
74
- currency: string;
75
- payoutMethod: PayoutMethodValue;
76
- organizationId: mongoose.Types.ObjectId;
77
- sourceTransactionIds: mongoose.Types.ObjectId[];
78
- sourceSplitIds: string[];
79
- retryCount: number;
80
- bankTransferDetails?: {
81
- bankName?: string | null | undefined;
82
- accountNumber?: string | null | undefined;
83
- accountName?: string | null | undefined;
84
- routingNumber?: string | null | undefined;
85
- swiftCode?: string | null | undefined;
86
- iban?: string | null | undefined;
87
- transferReference?: string | null | undefined;
88
- transferredAt?: NativeDate | null | undefined;
89
- } | null | undefined;
90
- mobileWalletDetails?: {
91
- provider?: string | null | undefined;
92
- transactionId?: string | null | undefined;
93
- accountNumber?: string | null | undefined;
94
- transferredAt?: NativeDate | null | undefined;
95
- phoneNumber?: string | null | undefined;
96
- } | null | undefined;
97
- cryptoDetails?: {
98
- transferredAt?: NativeDate | null | undefined;
99
- network?: string | null | undefined;
100
- walletAddress?: string | null | undefined;
101
- transactionHash?: string | null | undefined;
102
- } | null | undefined;
103
- platformBalanceDetails?: {
104
- balanceId?: mongoose.Types.ObjectId | null | undefined;
105
- appliedAt?: NativeDate | null | undefined;
106
- } | null | undefined;
107
- scheduledAt?: NativeDate | null | undefined;
108
- processedAt?: NativeDate | null | undefined;
109
- completedAt?: NativeDate | null | undefined;
110
- failedAt?: NativeDate | null | undefined;
111
- cancelledAt?: NativeDate | null | undefined;
112
- failureReason?: string | null | undefined;
113
- failureCode?: string | null | undefined;
114
- notes?: string | null | undefined;
115
- } & mongoose.DefaultTimestampProps, {
116
- id: string;
117
- }, mongoose.ResolveSchemaOptions<{
118
- timestamps: true;
119
- }>> & Omit<{
120
- type: "split_payout" | "platform_withdrawal" | "manual_payout" | "escrow_release";
121
- metadata: any;
122
- status: "pending" | "processing" | "completed" | "failed" | "cancelled";
123
- recipientId: mongoose.Types.ObjectId;
124
- recipientType: "affiliate" | "user" | "organization" | "partner" | "platform";
125
- amount: number;
126
- currency: string;
127
- payoutMethod: PayoutMethodValue;
128
- organizationId: mongoose.Types.ObjectId;
129
- sourceTransactionIds: mongoose.Types.ObjectId[];
130
- sourceSplitIds: string[];
131
- retryCount: number;
132
- bankTransferDetails?: {
133
- bankName?: string | null | undefined;
134
- accountNumber?: string | null | undefined;
135
- accountName?: string | null | undefined;
136
- routingNumber?: string | null | undefined;
137
- swiftCode?: string | null | undefined;
138
- iban?: string | null | undefined;
139
- transferReference?: string | null | undefined;
140
- transferredAt?: NativeDate | null | undefined;
141
- } | null | undefined;
142
- mobileWalletDetails?: {
143
- provider?: string | null | undefined;
144
- transactionId?: string | null | undefined;
145
- accountNumber?: string | null | undefined;
146
- transferredAt?: NativeDate | null | undefined;
147
- phoneNumber?: string | null | undefined;
148
- } | null | undefined;
149
- cryptoDetails?: {
150
- transferredAt?: NativeDate | null | undefined;
151
- network?: string | null | undefined;
152
- walletAddress?: string | null | undefined;
153
- transactionHash?: string | null | undefined;
154
- } | null | undefined;
155
- platformBalanceDetails?: {
156
- balanceId?: mongoose.Types.ObjectId | null | undefined;
157
- appliedAt?: NativeDate | null | undefined;
158
- } | null | undefined;
159
- scheduledAt?: NativeDate | null | undefined;
160
- processedAt?: NativeDate | null | undefined;
161
- completedAt?: NativeDate | null | undefined;
162
- failedAt?: NativeDate | null | undefined;
163
- cancelledAt?: NativeDate | null | undefined;
164
- failureReason?: string | null | undefined;
165
- failureCode?: string | null | undefined;
166
- notes?: string | null | undefined;
167
- } & mongoose.DefaultTimestampProps & {
168
- _id: mongoose.Types.ObjectId;
169
- } & {
170
- __v: number;
171
- }, "id"> & {
172
- id: string;
173
- }, {
174
- [path: string]: mongoose.SchemaDefinitionProperty<undefined, any, any>;
175
- } | {
176
- [x: string]: mongoose.SchemaDefinitionProperty<any, any, mongoose.Document<unknown, {}, {
177
- type: "split_payout" | "platform_withdrawal" | "manual_payout" | "escrow_release";
178
- metadata: any;
179
- status: "pending" | "processing" | "completed" | "failed" | "cancelled";
180
- recipientId: mongoose.Types.ObjectId;
181
- recipientType: "affiliate" | "user" | "organization" | "partner" | "platform";
182
- amount: number;
183
- currency: string;
184
- payoutMethod: PayoutMethodValue;
185
- organizationId: mongoose.Types.ObjectId;
186
- sourceTransactionIds: mongoose.Types.ObjectId[];
187
- sourceSplitIds: string[];
188
- retryCount: number;
189
- bankTransferDetails?: {
190
- bankName?: string | null | undefined;
191
- accountNumber?: string | null | undefined;
192
- accountName?: string | null | undefined;
193
- routingNumber?: string | null | undefined;
194
- swiftCode?: string | null | undefined;
195
- iban?: string | null | undefined;
196
- transferReference?: string | null | undefined;
197
- transferredAt?: NativeDate | null | undefined;
198
- } | null | undefined;
199
- mobileWalletDetails?: {
200
- provider?: string | null | undefined;
201
- transactionId?: string | null | undefined;
202
- accountNumber?: string | null | undefined;
203
- transferredAt?: NativeDate | null | undefined;
204
- phoneNumber?: string | null | undefined;
205
- } | null | undefined;
206
- cryptoDetails?: {
207
- transferredAt?: NativeDate | null | undefined;
208
- network?: string | null | undefined;
209
- walletAddress?: string | null | undefined;
210
- transactionHash?: string | null | undefined;
211
- } | null | undefined;
212
- platformBalanceDetails?: {
213
- balanceId?: mongoose.Types.ObjectId | null | undefined;
214
- appliedAt?: NativeDate | null | undefined;
215
- } | null | undefined;
216
- scheduledAt?: NativeDate | null | undefined;
217
- processedAt?: NativeDate | null | undefined;
218
- completedAt?: NativeDate | null | undefined;
219
- failedAt?: NativeDate | null | undefined;
220
- cancelledAt?: NativeDate | null | undefined;
221
- failureReason?: string | null | undefined;
222
- failureCode?: string | null | undefined;
223
- notes?: string | null | undefined;
224
- } & mongoose.DefaultTimestampProps, {
225
- id: string;
226
- }, mongoose.ResolveSchemaOptions<{
227
- timestamps: true;
228
- }>> & Omit<{
229
- type: "split_payout" | "platform_withdrawal" | "manual_payout" | "escrow_release";
230
- metadata: any;
231
- status: "pending" | "processing" | "completed" | "failed" | "cancelled";
232
- recipientId: mongoose.Types.ObjectId;
233
- recipientType: "affiliate" | "user" | "organization" | "partner" | "platform";
234
- amount: number;
235
- currency: string;
236
- payoutMethod: PayoutMethodValue;
237
- organizationId: mongoose.Types.ObjectId;
238
- sourceTransactionIds: mongoose.Types.ObjectId[];
239
- sourceSplitIds: string[];
240
- retryCount: number;
241
- bankTransferDetails?: {
242
- bankName?: string | null | undefined;
243
- accountNumber?: string | null | undefined;
244
- accountName?: string | null | undefined;
245
- routingNumber?: string | null | undefined;
246
- swiftCode?: string | null | undefined;
247
- iban?: string | null | undefined;
248
- transferReference?: string | null | undefined;
249
- transferredAt?: NativeDate | null | undefined;
250
- } | null | undefined;
251
- mobileWalletDetails?: {
252
- provider?: string | null | undefined;
253
- transactionId?: string | null | undefined;
254
- accountNumber?: string | null | undefined;
255
- transferredAt?: NativeDate | null | undefined;
256
- phoneNumber?: string | null | undefined;
257
- } | null | undefined;
258
- cryptoDetails?: {
259
- transferredAt?: NativeDate | null | undefined;
260
- network?: string | null | undefined;
261
- walletAddress?: string | null | undefined;
262
- transactionHash?: string | null | undefined;
263
- } | null | undefined;
264
- platformBalanceDetails?: {
265
- balanceId?: mongoose.Types.ObjectId | null | undefined;
266
- appliedAt?: NativeDate | null | undefined;
267
- } | null | undefined;
268
- scheduledAt?: NativeDate | null | undefined;
269
- processedAt?: NativeDate | null | undefined;
270
- completedAt?: NativeDate | null | undefined;
271
- failedAt?: NativeDate | null | undefined;
272
- cancelledAt?: NativeDate | null | undefined;
273
- failureReason?: string | null | undefined;
274
- failureCode?: string | null | undefined;
275
- notes?: string | null | undefined;
276
- } & mongoose.DefaultTimestampProps & {
277
- _id: mongoose.Types.ObjectId;
278
- } & {
279
- __v: number;
280
- }, "id"> & {
281
- id: string;
282
- }> | undefined;
283
- }, {
284
- type: "split_payout" | "platform_withdrawal" | "manual_payout" | "escrow_release";
285
- metadata: any;
286
- status: "pending" | "processing" | "completed" | "failed" | "cancelled";
287
- recipientId: mongoose.Types.ObjectId;
288
- recipientType: "affiliate" | "user" | "organization" | "partner" | "platform";
289
- amount: number;
290
- currency: string;
291
- payoutMethod: PayoutMethodValue;
292
- organizationId: mongoose.Types.ObjectId;
293
- sourceTransactionIds: mongoose.Types.ObjectId[];
294
- sourceSplitIds: string[];
295
- retryCount: number;
296
- bankTransferDetails?: {
297
- bankName?: string | null | undefined;
298
- accountNumber?: string | null | undefined;
299
- accountName?: string | null | undefined;
300
- routingNumber?: string | null | undefined;
301
- swiftCode?: string | null | undefined;
302
- iban?: string | null | undefined;
303
- transferReference?: string | null | undefined;
304
- transferredAt?: NativeDate | null | undefined;
305
- } | null | undefined;
306
- mobileWalletDetails?: {
307
- provider?: string | null | undefined;
308
- transactionId?: string | null | undefined;
309
- accountNumber?: string | null | undefined;
310
- transferredAt?: NativeDate | null | undefined;
311
- phoneNumber?: string | null | undefined;
312
- } | null | undefined;
313
- cryptoDetails?: {
314
- transferredAt?: NativeDate | null | undefined;
315
- network?: string | null | undefined;
316
- walletAddress?: string | null | undefined;
317
- transactionHash?: string | null | undefined;
318
- } | null | undefined;
319
- platformBalanceDetails?: {
320
- balanceId?: mongoose.Types.ObjectId | null | undefined;
321
- appliedAt?: NativeDate | null | undefined;
322
- } | null | undefined;
323
- scheduledAt?: NativeDate | null | undefined;
324
- processedAt?: NativeDate | null | undefined;
325
- completedAt?: NativeDate | null | undefined;
326
- failedAt?: NativeDate | null | undefined;
327
- cancelledAt?: NativeDate | null | undefined;
328
- failureReason?: string | null | undefined;
329
- failureCode?: string | null | undefined;
330
- notes?: string | null | undefined;
331
- createdAt: NativeDate;
332
- updatedAt: NativeDate;
333
- } & {
334
- _id: mongoose.Types.ObjectId;
335
- } & {
336
- __v: number;
337
- }>;
338
- type SettlementDocument = mongoose.InferSchemaType<typeof settlementSchema> & mongoose.Document & {
339
- _id: mongoose.Types.ObjectId;
340
- createdAt: Date;
341
- updatedAt: Date;
342
- };
343
- //#endregion
344
- export { settlementSchema as n, SettlementDocument as t };