@classytic/revenue 1.1.3 → 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 +32 -36
  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-CorrWz7A.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-9scqKSef.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-D5uWB5tP.d.mts +0 -344
  74. package/dist/settlement.service-BxuiHpNC.d.mts +0 -594
  75. package/dist/settlement.service-CUxbUTzT.mjs +0 -2510
  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,594 +0,0 @@
1
- import { A as ReleaseOptions, B as TransactionDocument, C as PaymentVerifyResult, G as WebhookResult, H as TransactionListResult, I as SplitResult, L as SplitRule, M as RenewalParams, N as ResumeOptions, O as RefundOptions, R as SubscriptionDocument, S as PaymentVerifyOptions, f as MonetizationCreateParams, g as PauseOptions, j as ReleaseResult, l as HoldOptions, n as CancelHoldOptions, p as MonetizationCreateResult, r as CancelOptions, s as EscrowStatusResult, t as ActivateOptions, u as ListOptions, v as PaymentProviderInterface, x as PaymentStatusResult, y as PaymentRefundResult } from "./index-Dsp7H5Wb.mjs";
2
- import { t as SettlementDocument } from "./settlement.schema-D5uWB5tP.mjs";
3
-
4
- //#region src/core/container.d.ts
5
- /**
6
- * Dependency Injection Container
7
- * @classytic/revenue
8
- *
9
- * Lightweight DI container for managing dependencies
10
- * Inspired by: Awilix, InversifyJS but much simpler
11
- */
12
- declare class Container {
13
- private _services;
14
- private _singletons;
15
- constructor();
16
- /**
17
- * Register a service
18
- * @param name - Service name
19
- * @param implementation - Service implementation or factory
20
- * @param options - Registration options
21
- */
22
- register<T>(name: string, implementation: T | ((container: Container) => T), options?: {
23
- singleton?: boolean;
24
- factory?: boolean;
25
- }): this;
26
- /**
27
- * Register a singleton service
28
- * @param name - Service name
29
- * @param implementation - Service implementation
30
- */
31
- singleton<T>(name: string, implementation: T): this;
32
- /**
33
- * Register a transient service (new instance each time)
34
- * @param name - Service name
35
- * @param factory - Factory function
36
- */
37
- transient<T>(name: string, factory: (container: Container) => T): this;
38
- /**
39
- * Get a service from the container
40
- * @param name - Service name
41
- * @returns Service instance
42
- */
43
- get<T>(name: string): T;
44
- /**
45
- * Check if service is registered
46
- * @param name - Service name
47
- */
48
- has(name: string): boolean;
49
- /**
50
- * Get all registered service names
51
- */
52
- keys(): string[];
53
- /**
54
- * Clear all services (useful for testing)
55
- */
56
- clear(): void;
57
- /**
58
- * Create a child container (for scoped dependencies)
59
- */
60
- createScope(): Container;
61
- }
62
- //#endregion
63
- //#region src/application/services/monetization.service.d.ts
64
- /**
65
- * Monetization Service
66
- * Uses DI container for all dependencies
67
- *
68
- * Architecture:
69
- * - PluginManager: Wraps operations with lifecycle hooks (before/after)
70
- * - EventBus: Fire-and-forget notifications for completed operations
71
- */
72
- declare class MonetizationService {
73
- private readonly models;
74
- private readonly providers;
75
- private readonly config;
76
- private readonly plugins;
77
- private readonly logger;
78
- private readonly events;
79
- private readonly retryConfig;
80
- private readonly circuitBreaker;
81
- constructor(container: Container);
82
- /**
83
- * Create plugin context for hook execution
84
- * @private
85
- */
86
- private getPluginContext;
87
- /**
88
- * Execute provider call with retry and circuit breaker protection
89
- * @private
90
- */
91
- private executeProviderCall;
92
- /**
93
- * Create a new monetization (purchase, subscription, or free item)
94
- *
95
- * @param params - Monetization parameters
96
- *
97
- * @example
98
- * // One-time purchase
99
- * await revenue.monetization.create({
100
- * data: {
101
- * organizationId: '...',
102
- * customerId: '...',
103
- * sourceId: order._id,
104
- * sourceModel: 'Order',
105
- * },
106
- * planKey: 'one_time',
107
- * monetizationType: 'purchase',
108
- * gateway: 'bkash',
109
- * amount: 1500,
110
- * });
111
- *
112
- * // Recurring subscription
113
- * await revenue.monetization.create({
114
- * data: {
115
- * organizationId: '...',
116
- * customerId: '...',
117
- * sourceId: subscription._id,
118
- * sourceModel: 'Subscription',
119
- * },
120
- * planKey: 'monthly',
121
- * monetizationType: 'subscription',
122
- * gateway: 'stripe',
123
- * amount: 2000,
124
- * });
125
- *
126
- * @returns Result with subscription, transaction, and paymentIntent
127
- */
128
- create(params: MonetizationCreateParams): Promise<MonetizationCreateResult>;
129
- /**
130
- * Activate subscription after payment verification
131
- *
132
- * @param subscriptionId - Subscription ID or transaction ID
133
- * @param options - Activation options
134
- * @returns Updated subscription
135
- */
136
- activate(subscriptionId: string, options?: ActivateOptions): Promise<SubscriptionDocument>;
137
- /**
138
- * Renew subscription
139
- *
140
- * @param subscriptionId - Subscription ID
141
- * @param params - Renewal parameters
142
- * @returns { subscription, transaction, paymentIntent }
143
- */
144
- renew(subscriptionId: string, params?: RenewalParams): Promise<MonetizationCreateResult>;
145
- /**
146
- * Cancel subscription
147
- *
148
- * @param subscriptionId - Subscription ID
149
- * @param options - Cancellation options
150
- * @returns Updated subscription
151
- */
152
- cancel(subscriptionId: string, options?: CancelOptions): Promise<SubscriptionDocument>;
153
- /**
154
- * Pause subscription
155
- *
156
- * @param subscriptionId - Subscription ID
157
- * @param options - Pause options
158
- * @returns Updated subscription
159
- */
160
- pause(subscriptionId: string, options?: PauseOptions): Promise<SubscriptionDocument>;
161
- /**
162
- * Resume subscription
163
- *
164
- * @param subscriptionId - Subscription ID
165
- * @param options - Resume options
166
- * @returns Updated subscription
167
- */
168
- resume(subscriptionId: string, options?: ResumeOptions): Promise<SubscriptionDocument>;
169
- /**
170
- * List subscriptions with filters
171
- *
172
- * @param filters - Query filters
173
- * @param options - Query options (limit, skip, sort)
174
- * @returns Subscriptions
175
- */
176
- list(filters?: Record<string, unknown>, options?: ListOptions): Promise<SubscriptionDocument[]>;
177
- /**
178
- * Get subscription by ID
179
- *
180
- * @param subscriptionId - Subscription ID
181
- * @returns Subscription
182
- */
183
- get(subscriptionId: string): Promise<SubscriptionDocument>;
184
- /**
185
- * Calculate period end date based on plan key
186
- * @private
187
- */
188
- private _calculatePeriodEnd;
189
- }
190
- //#endregion
191
- //#region src/application/services/payment.service.d.ts
192
- /**
193
- * Payment Service
194
- * Uses DI container for all dependencies
195
- *
196
- * Architecture:
197
- * - PluginManager: Wraps operations with lifecycle hooks (before/after)
198
- * - EventBus: Fire-and-forget notifications for completed operations
199
- */
200
- declare class PaymentService {
201
- private readonly models;
202
- private readonly providers;
203
- private readonly config;
204
- private readonly plugins;
205
- private readonly logger;
206
- private readonly events;
207
- private readonly retryConfig;
208
- private readonly circuitBreaker;
209
- constructor(container: Container);
210
- /**
211
- * Create plugin context for hook execution
212
- * @private
213
- */
214
- private getPluginContext;
215
- /**
216
- * Execute provider call with retry and circuit breaker protection
217
- * @private
218
- */
219
- private executeProviderCall;
220
- /**
221
- * Verify a payment
222
- *
223
- * @param paymentIntentId - Payment intent ID, session ID, or transaction ID
224
- * @param options - Verification options
225
- * @returns { transaction, status }
226
- */
227
- verify(paymentIntentId: string, options?: PaymentVerifyOptions): Promise<PaymentVerifyResult>;
228
- /**
229
- * Get payment status
230
- *
231
- * @param paymentIntentId - Payment intent ID, session ID, or transaction ID
232
- * @returns { transaction, status }
233
- */
234
- getStatus(paymentIntentId: string): Promise<PaymentStatusResult>;
235
- /**
236
- * Refund a payment
237
- *
238
- * @param paymentId - Payment intent ID, session ID, or transaction ID
239
- * @param amount - Amount to refund (optional, full refund if not provided)
240
- * @param options - Refund options
241
- * @returns { transaction, refundResult }
242
- */
243
- refund(paymentId: string, amount?: number | null, options?: RefundOptions): Promise<PaymentRefundResult>;
244
- /**
245
- * Handle webhook from payment provider
246
- *
247
- * @param provider - Provider name
248
- * @param payload - Webhook payload
249
- * @param headers - Request headers
250
- * @returns { event, transaction }
251
- */
252
- handleWebhook(providerName: string, payload: unknown, headers?: Record<string, string>): Promise<WebhookResult>;
253
- /**
254
- * List payments/transactions with filters
255
- *
256
- * @param filters - Query filters
257
- * @param options - Query options (limit, skip, sort)
258
- * @returns Transactions
259
- */
260
- list(filters?: Record<string, unknown>, options?: ListOptions): Promise<TransactionDocument[]>;
261
- /**
262
- * Get payment/transaction by ID
263
- *
264
- * @param transactionId - Transaction ID
265
- * @returns Transaction
266
- */
267
- get(transactionId: string): Promise<TransactionDocument>;
268
- /**
269
- * Get provider instance
270
- *
271
- * @param providerName - Provider name
272
- * @returns Provider instance
273
- */
274
- getProvider(providerName: string): PaymentProviderInterface;
275
- /**
276
- * Find transaction by sessionId, paymentIntentId, or transaction ID
277
- * @private
278
- */
279
- private _findTransaction;
280
- }
281
- //#endregion
282
- //#region src/application/services/transaction.service.d.ts
283
- /**
284
- * Transaction Service
285
- * Focused on core transaction lifecycle operations
286
- *
287
- * Architecture:
288
- * - PluginManager: Wraps operations with lifecycle hooks (before/after)
289
- * - EventBus: Fire-and-forget notifications for completed operations
290
- */
291
- declare class TransactionService {
292
- private readonly models;
293
- private readonly plugins;
294
- private readonly events;
295
- private readonly logger;
296
- constructor(container: Container);
297
- /**
298
- * Create plugin context for hook execution
299
- * @private
300
- */
301
- private getPluginContext;
302
- /**
303
- * Get transaction by ID
304
- *
305
- * @param transactionId - Transaction ID
306
- * @returns Transaction
307
- */
308
- get(transactionId: string): Promise<TransactionDocument>;
309
- /**
310
- * List transactions with filters
311
- *
312
- * @param filters - Query filters
313
- * @param options - Query options (limit, skip, sort, populate)
314
- * @returns { transactions, total, page, limit }
315
- */
316
- list(filters?: Record<string, unknown>, options?: ListOptions): Promise<TransactionListResult>;
317
- /**
318
- * Update transaction
319
- *
320
- * @param transactionId - Transaction ID
321
- * @param updates - Fields to update
322
- * @returns Updated transaction
323
- */
324
- update(transactionId: string, updates: Partial<TransactionDocument>): Promise<TransactionDocument>;
325
- }
326
- //#endregion
327
- //#region src/application/services/escrow.service.d.ts
328
- /**
329
- * Escrow Service
330
- * Uses DI container for all dependencies
331
- *
332
- * Architecture:
333
- * - PluginManager: Wraps operations with lifecycle hooks (before/after)
334
- * - EventBus: Fire-and-forget notifications for completed operations
335
- */
336
- declare class EscrowService {
337
- private readonly models;
338
- private readonly plugins;
339
- private readonly logger;
340
- private readonly events;
341
- constructor(container: Container);
342
- /**
343
- * Create plugin context for hook execution
344
- * @private
345
- */
346
- private getPluginContext;
347
- /**
348
- * Hold funds in escrow
349
- *
350
- * @param transactionId - Transaction to hold
351
- * @param options - Hold options
352
- * @returns Updated transaction
353
- */
354
- hold(transactionId: string, options?: HoldOptions): Promise<TransactionDocument>;
355
- /**
356
- * Release funds from escrow to recipient
357
- *
358
- * @param transactionId - Transaction to release
359
- * @param options - Release options
360
- * @returns { transaction, releaseTransaction }
361
- */
362
- release(transactionId: string, options: ReleaseOptions): Promise<ReleaseResult>;
363
- /**
364
- * Cancel hold and release back to customer
365
- *
366
- * @param transactionId - Transaction to cancel hold
367
- * @param options - Cancel options
368
- * @returns Updated transaction
369
- */
370
- cancel(transactionId: string, options?: CancelHoldOptions): Promise<TransactionDocument>;
371
- /**
372
- * Split payment to multiple recipients
373
- * Deducts splits from held amount and releases remainder to organization
374
- *
375
- * @param transactionId - Transaction to split
376
- * @param splitRules - Split configuration
377
- * @returns { transaction, splitTransactions, organizationTransaction }
378
- */
379
- split(transactionId: string, splitRules?: SplitRule[]): Promise<SplitResult>;
380
- /**
381
- * Get escrow status
382
- *
383
- * @param transactionId - Transaction ID
384
- * @returns Escrow status
385
- */
386
- getStatus(transactionId: string): Promise<EscrowStatusResult>;
387
- }
388
- //#endregion
389
- //#region src/application/services/settlement.service.d.ts
390
- interface CreateFromSplitsOptions {
391
- scheduledAt?: Date;
392
- payoutMethod?: 'bank_transfer' | 'mobile_wallet' | 'platform_balance' | 'crypto' | 'manual';
393
- metadata?: Record<string, unknown>;
394
- }
395
- interface ScheduleSettlementParams {
396
- organizationId: string;
397
- recipientId: string;
398
- recipientType: 'platform' | 'organization' | 'user' | 'affiliate' | 'partner';
399
- type: 'split_payout' | 'platform_withdrawal' | 'manual_payout' | 'escrow_release';
400
- amount: number;
401
- currency?: string;
402
- payoutMethod: 'bank_transfer' | 'mobile_wallet' | 'platform_balance' | 'crypto' | 'manual';
403
- sourceTransactionIds?: string[];
404
- sourceSplitIds?: string[];
405
- scheduledAt?: Date;
406
- bankTransferDetails?: {
407
- accountNumber?: string;
408
- accountName?: string;
409
- bankName?: string;
410
- routingNumber?: string;
411
- swiftCode?: string;
412
- iban?: string;
413
- };
414
- mobileWalletDetails?: {
415
- provider?: string;
416
- phoneNumber?: string;
417
- accountNumber?: string;
418
- };
419
- cryptoDetails?: {
420
- network?: string;
421
- walletAddress?: string;
422
- };
423
- notes?: string;
424
- metadata?: Record<string, unknown>;
425
- }
426
- interface ProcessOptions {
427
- limit?: number;
428
- organizationId?: string;
429
- payoutMethod?: string;
430
- dryRun?: boolean;
431
- }
432
- interface ProcessResult {
433
- processed: number;
434
- succeeded: number;
435
- failed: number;
436
- settlements: SettlementDocument[];
437
- errors: Array<{
438
- settlementId: string;
439
- error: string;
440
- }>;
441
- }
442
- interface CompletionDetails {
443
- transferReference?: string;
444
- transferredAt?: Date;
445
- transactionHash?: string;
446
- notes?: string;
447
- metadata?: Record<string, unknown>;
448
- }
449
- interface SettlementFilters {
450
- organizationId?: string;
451
- recipientId?: string;
452
- status?: string | string[];
453
- type?: string;
454
- payoutMethod?: string;
455
- scheduledAfter?: Date;
456
- scheduledBefore?: Date;
457
- limit?: number;
458
- skip?: number;
459
- sort?: Record<string, 1 | -1>;
460
- }
461
- interface SummaryOptions {
462
- organizationId?: string;
463
- startDate?: Date;
464
- endDate?: Date;
465
- }
466
- interface SettlementSummary {
467
- recipientId: string;
468
- totalPending: number;
469
- totalProcessing: number;
470
- totalCompleted: number;
471
- totalFailed: number;
472
- amountPending: number;
473
- amountCompleted: number;
474
- amountFailed: number;
475
- currency: string;
476
- lastSettlementDate?: Date;
477
- settlements: {
478
- pending: number;
479
- processing: number;
480
- completed: number;
481
- failed: number;
482
- cancelled: number;
483
- };
484
- }
485
- /**
486
- * Settlement Service
487
- *
488
- * Handles payout tracking after splits are released from escrow:
489
- *
490
- * Flow:
491
- * 1. Transaction has splits → 2. Escrow released → 3. Create settlements → 4. Process payouts → 5. Mark complete
492
- *
493
- * @example
494
- * ```typescript
495
- * // Auto-create settlements from transaction splits
496
- * await revenue.settlement.createFromSplits(transactionId);
497
- *
498
- * // Schedule a manual payout
499
- * await revenue.settlement.schedule({
500
- * recipientId: vendorId,
501
- * amount: 8500,
502
- * payoutMethod: 'bank_transfer',
503
- * });
504
- *
505
- * // Process pending payouts
506
- * const result = await revenue.settlement.processPending({ limit: 100 });
507
- *
508
- * // Mark as completed after bank confirms
509
- * await revenue.settlement.complete(settlementId, { transferReference: 'TRF123' });
510
- * ```
511
- */
512
- /**
513
- * Settlement Service
514
- * Uses DI container for all dependencies
515
- *
516
- * Architecture:
517
- * - PluginManager: Wraps operations with lifecycle hooks (before/after)
518
- * - EventBus: Fire-and-forget notifications for completed operations
519
- */
520
- declare class SettlementService {
521
- private readonly models;
522
- private readonly plugins;
523
- private readonly logger;
524
- private readonly events;
525
- constructor(container: Container);
526
- /**
527
- * Create settlements from transaction splits
528
- * Typically called after escrow is released
529
- *
530
- * @param transactionId - Transaction ID with splits
531
- * @param options - Creation options
532
- * @returns Array of created settlements
533
- */
534
- createFromSplits(transactionId: string, options?: CreateFromSplitsOptions): Promise<SettlementDocument[]>;
535
- /**
536
- * Schedule a payout
537
- *
538
- * @param params - Settlement parameters
539
- * @returns Created settlement
540
- */
541
- schedule(params: ScheduleSettlementParams): Promise<SettlementDocument>;
542
- /**
543
- * Process pending settlements
544
- * Batch process settlements that are due
545
- *
546
- * @param options - Processing options
547
- * @returns Processing result
548
- */
549
- processPending(options?: ProcessOptions): Promise<ProcessResult>;
550
- /**
551
- * Mark settlement as completed
552
- * Call this after bank confirms the transfer
553
- *
554
- * @param settlementId - Settlement ID
555
- * @param details - Completion details
556
- * @returns Updated settlement
557
- */
558
- complete(settlementId: string, details?: CompletionDetails): Promise<SettlementDocument>;
559
- /**
560
- * Mark settlement as failed
561
- *
562
- * @param settlementId - Settlement ID
563
- * @param reason - Failure reason
564
- * @returns Updated settlement
565
- */
566
- fail(settlementId: string, reason: string, options?: {
567
- code?: string;
568
- retry?: boolean;
569
- }): Promise<SettlementDocument>;
570
- /**
571
- * List settlements with filters
572
- *
573
- * @param filters - Query filters
574
- * @returns Settlements
575
- */
576
- list(filters?: SettlementFilters): Promise<SettlementDocument[]>;
577
- /**
578
- * Get payout summary for recipient
579
- *
580
- * @param recipientId - Recipient ID
581
- * @param options - Summary options
582
- * @returns Settlement summary
583
- */
584
- getSummary(recipientId: string, options?: SummaryOptions): Promise<SettlementSummary>;
585
- /**
586
- * Get settlement by ID
587
- *
588
- * @param settlementId - Settlement ID
589
- * @returns Settlement
590
- */
591
- get(settlementId: string): Promise<SettlementDocument>;
592
- }
593
- //#endregion
594
- export { MonetizationService as a, PaymentService as i, EscrowService as n, Container as o, TransactionService as r, SettlementService as t };