@classytic/revenue 2.5.0 → 2.6.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.
- package/CHANGELOG.md +22 -0
- package/dist/{audit-DRKuLBFO.d.mts → audit-BkDdPSed.d.mts} +2 -1
- package/dist/{engine-types-F3f1lWNG.d.mts → engine-types-D6ijamqA.d.mts} +29 -1
- package/dist/{escrow.schema-o4qhjOca.d.mts → escrow.schema-DSx7EywJ.d.mts} +18 -18
- package/dist/events/index.d.mts +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/repositories/create-repositories.d.mts +1 -1
- package/dist/repositories/create-repositories.mjs +1 -1
- package/dist/{revenue-event-catalog-j8Fh7Yag.d.mts → revenue-event-catalog-BU_KYN2-.d.mts} +126 -126
- package/dist/{settlement.repository-BDrJQc27.mjs → settlement.repository-oypYDjKq.mjs} +97 -36
- package/dist/shared/index.d.mts +2 -2
- package/dist/shared/index.mjs +2 -2
- package/dist/{splits-CNfQj92L.mjs → splits-CEdZN6OT.mjs} +22 -7
- package/dist/validators/index.d.mts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
4
4
|
adhering to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [2.6.0]
|
|
7
|
+
|
|
8
|
+
### Added — generalized settlement rollups (`summary` + `breakdownByRecipient`)
|
|
9
|
+
|
|
10
|
+
`recipientBalance` only rolled up ONE recipient, forcing hosts to hand-roll raw
|
|
11
|
+
aggregations for platform-wide / per-recipient / cross-org views. Two reusable
|
|
12
|
+
primitives now cover all of them (the `recipientBalance` status+due bucketing,
|
|
13
|
+
generalized — one tenant-scoped `aggregatePipeline`, never a raw `Model.aggregate`):
|
|
14
|
+
|
|
15
|
+
- **`summary(filter = {}, ctx)` → `SettlementSummary`** — the money-state
|
|
16
|
+
(`held / available / processing / paidOut / pending / failed / lifetime /
|
|
17
|
+
currency`) for an ARBITRARY filter: a recipient, an org, or the whole platform
|
|
18
|
+
(pass `_bypassTenant` in ctx). Backs platform reconciliation + cross-org
|
|
19
|
+
earnings.
|
|
20
|
+
- **`breakdownByRecipient(filter = {}, ctx)` → `RecipientBreakdown[]`** — one
|
|
21
|
+
rollup per distinct `(recipientId, recipientType)` (plus first-seen `role`),
|
|
22
|
+
for a "who is owed what" platform view.
|
|
23
|
+
|
|
24
|
+
`recipientBalance` is now a thin wrapper over `summary({ recipientId, … })`.
|
|
25
|
+
Exported types: `SettlementSummary`, `RecipientBreakdown`. No migration; no
|
|
26
|
+
breaking change to `recipientBalance`'s shape.
|
|
27
|
+
|
|
6
28
|
## [2.5.0]
|
|
7
29
|
|
|
8
30
|
### Added — `SettlementRepository.recipientBalance()` (the seller/creator "wallet")
|
|
@@ -60,6 +60,7 @@ interface SplitInfo {
|
|
|
60
60
|
}
|
|
61
61
|
declare function calculateSplits(amount: number, rules: SplitRule[], gatewayFeeRate?: number): SplitInfo[];
|
|
62
62
|
declare function calculateOrganizationPayout(amount: number, splits: SplitInfo[]): number;
|
|
63
|
+
declare function reverseSplits(originalSplits: SplitInfo[], originalAmount: number, refundAmount: number): SplitInfo[];
|
|
63
64
|
//#endregion
|
|
64
65
|
//#region src/shared/formatters/money.d.ts
|
|
65
66
|
/**
|
|
@@ -86,4 +87,4 @@ declare function getLastStateChange(doc: {
|
|
|
86
87
|
metadata?: Record<string, unknown>;
|
|
87
88
|
}): StateChangeEvent | undefined;
|
|
88
89
|
//#endregion
|
|
89
|
-
export { SplitInfo as A,
|
|
90
|
+
export { SplitInfo as A, reverseTax as B, multiplyMoney as C, toCurrencyCode as D, sumMoney as E, TaxCalculation as F, CommissionInfo as H, TaxConfig as I, TaxType as L, calculateOrganizationPayout as M, calculateSplits as N, toMajor$1 as O, reverseSplits as P, calculateTax as R, money$1 as S, subtractMoney as T, calculateCommission as U, validateTaxCalculation as V, reverseCommission as W, isMoney as _, CurrencyCode as a, isZeroMoney as b, Money as c, addMoney as d, compareMoney as f, isCurrencyCode as g, fromSmallestUnit as h, CURRENCIES as i, SplitRule as j, toSmallestUnit as k, MoneyValue as l, fromMajor$1 as m, getAuditTrail as n, CurrencyMismatchError as o, equalsMoney as p, getLastStateChange as r, MINOR_UNIT_FACTOR as s, appendAuditEvent as t, absMoney as u, isNegativeMoney as v, negateMoney as w, minorUnitFactor as x, isPositiveMoney as y, getTaxType as z };
|
|
@@ -946,6 +946,18 @@ interface RecipientBalance {
|
|
|
946
946
|
/** pending + processing + paidOut — the total the platform has committed to this recipient. */
|
|
947
947
|
lifetime: number;
|
|
948
948
|
}
|
|
949
|
+
/**
|
|
950
|
+
* Settlement money-state for an arbitrary filter (a recipient, an org, or the
|
|
951
|
+
* whole platform) — the same status+due rollup as {@link RecipientBalance} but
|
|
952
|
+
* not tied to a single recipient. The reusable shape behind `summary`.
|
|
953
|
+
*/
|
|
954
|
+
type SettlementSummary = Omit<RecipientBalance, 'recipientId'>;
|
|
955
|
+
/** One row of {@link SettlementRepository.breakdownByRecipient}. */
|
|
956
|
+
interface RecipientBreakdown extends RecipientBalance {
|
|
957
|
+
recipientType: string;
|
|
958
|
+
/** First-seen settlement role (creator_earning | co_instructor | referrer | …). */
|
|
959
|
+
role: string | null;
|
|
960
|
+
}
|
|
949
961
|
/**
|
|
950
962
|
* SettlementRepository — payouts to recipients (organizations, vendors,
|
|
951
963
|
* affiliates).
|
|
@@ -1007,6 +1019,22 @@ declare class SettlementRepository extends RevenueRepositoryBase<SettlementDocum
|
|
|
1007
1019
|
code?: string;
|
|
1008
1020
|
retry?: boolean;
|
|
1009
1021
|
}, ctx?: RevenueContext): Promise<SettlementDocument>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Settlement money-state for an ARBITRARY filter — a recipient, an org, or
|
|
1024
|
+
* the whole platform (pass `_bypassTenant` in ctx to span every org). One
|
|
1025
|
+
* tenant-scoped `aggregatePipeline` (the `{ recipientId, status }` index backs
|
|
1026
|
+
* the `$match`), never a raw `Model.aggregate`. The reusable rollup behind
|
|
1027
|
+
* `recipientBalance`, platform reconciliation, and cross-org earnings.
|
|
1028
|
+
*/
|
|
1029
|
+
summary(filter?: Record<string, unknown>, ctx?: RevenueContext): Promise<SettlementSummary>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Per-recipient settlement rollup — one {@link RecipientBreakdown} per
|
|
1032
|
+
* distinct (recipientId, recipientType) matching `filter`. The reusable list
|
|
1033
|
+
* behind a platform "who is owed what" view; pass `_bypassTenant` to span all
|
|
1034
|
+
* orgs.
|
|
1035
|
+
*/
|
|
1036
|
+
breakdownByRecipient(filter?: Record<string, unknown>, ctx?: RevenueContext): Promise<RecipientBreakdown[]>;
|
|
1037
|
+
/** One recipient's wallet — a thin `summary` over `{ recipientId, … }`. */
|
|
1010
1038
|
recipientBalance(recipientId: string, options?: {
|
|
1011
1039
|
recipientType?: string;
|
|
1012
1040
|
currency?: string;
|
|
@@ -1265,4 +1293,4 @@ interface RevenueEngine {
|
|
|
1265
1293
|
destroy(): Promise<void>;
|
|
1266
1294
|
}
|
|
1267
1295
|
//#endregion
|
|
1268
|
-
export { RevenueConfig as a,
|
|
1296
|
+
export { TransactionDocument as _, RevenueConfig as a, RecipientBreakdown as c, SubscriptionRepository as d, TransactionRepository as f, SubscriptionDocument as g, SettlementDocument as h, RetryConfig as i, SettlementRepository as l, RevenueSchemaOptions as m, BankFeedModuleConfig as n, RevenueEngine as o, RevenueModels as p, CommissionConfig as r, RecipientBalance as s, BankFeedIndexConfig as t, SettlementSummary as u };
|
|
@@ -27,8 +27,10 @@ declare const transactionBaseSchema: z.ZodObject<{
|
|
|
27
27
|
}, z.core.$strip>>;
|
|
28
28
|
method: z.ZodString;
|
|
29
29
|
methodKind: z.ZodEnum<{
|
|
30
|
-
|
|
30
|
+
manual: "manual";
|
|
31
31
|
bank_transfer: "bank_transfer";
|
|
32
|
+
cryptocurrency: "cryptocurrency";
|
|
33
|
+
card: "card";
|
|
32
34
|
instant_bank_transfer: "instant_bank_transfer";
|
|
33
35
|
direct_debit: "direct_debit";
|
|
34
36
|
wallet: "wallet";
|
|
@@ -37,8 +39,6 @@ declare const transactionBaseSchema: z.ZodObject<{
|
|
|
37
39
|
gift_card: "gift_card";
|
|
38
40
|
cash: "cash";
|
|
39
41
|
cheque: "cheque";
|
|
40
|
-
cryptocurrency: "cryptocurrency";
|
|
41
|
-
manual: "manual";
|
|
42
42
|
other: "other";
|
|
43
43
|
}>;
|
|
44
44
|
status: z.ZodDefault<z.ZodString>;
|
|
@@ -115,8 +115,10 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
115
115
|
amount: z.ZodNumber;
|
|
116
116
|
currency: z.ZodString;
|
|
117
117
|
methodKind: z.ZodEnum<{
|
|
118
|
-
|
|
118
|
+
manual: "manual";
|
|
119
119
|
bank_transfer: "bank_transfer";
|
|
120
|
+
cryptocurrency: "cryptocurrency";
|
|
121
|
+
card: "card";
|
|
120
122
|
instant_bank_transfer: "instant_bank_transfer";
|
|
121
123
|
direct_debit: "direct_debit";
|
|
122
124
|
wallet: "wallet";
|
|
@@ -125,8 +127,6 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
125
127
|
gift_card: "gift_card";
|
|
126
128
|
cash: "cash";
|
|
127
129
|
cheque: "cheque";
|
|
128
|
-
cryptocurrency: "cryptocurrency";
|
|
129
|
-
manual: "manual";
|
|
130
130
|
other: "other";
|
|
131
131
|
}>;
|
|
132
132
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -229,8 +229,10 @@ declare const transactionUpdateSchema: z.ZodObject<{
|
|
|
229
229
|
}, z.core.$strip>>>;
|
|
230
230
|
method: z.ZodOptional<z.ZodString>;
|
|
231
231
|
methodKind: z.ZodOptional<z.ZodEnum<{
|
|
232
|
-
|
|
232
|
+
manual: "manual";
|
|
233
233
|
bank_transfer: "bank_transfer";
|
|
234
|
+
cryptocurrency: "cryptocurrency";
|
|
235
|
+
card: "card";
|
|
234
236
|
instant_bank_transfer: "instant_bank_transfer";
|
|
235
237
|
direct_debit: "direct_debit";
|
|
236
238
|
wallet: "wallet";
|
|
@@ -239,8 +241,6 @@ declare const transactionUpdateSchema: z.ZodObject<{
|
|
|
239
241
|
gift_card: "gift_card";
|
|
240
242
|
cash: "cash";
|
|
241
243
|
cheque: "cheque";
|
|
242
|
-
cryptocurrency: "cryptocurrency";
|
|
243
|
-
manual: "manual";
|
|
244
244
|
other: "other";
|
|
245
245
|
}>>;
|
|
246
246
|
status: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
@@ -432,12 +432,12 @@ declare const settlementBaseSchema: z.ZodObject<{
|
|
|
432
432
|
}>;
|
|
433
433
|
status: z.ZodDefault<z.ZodString>;
|
|
434
434
|
payoutMethod: z.ZodEnum<{
|
|
435
|
-
check: "check";
|
|
436
|
-
bank_transfer: "bank_transfer";
|
|
437
435
|
manual: "manual";
|
|
436
|
+
bank_transfer: "bank_transfer";
|
|
438
437
|
mobile_wallet: "mobile_wallet";
|
|
439
438
|
platform_balance: "platform_balance";
|
|
440
439
|
crypto: "crypto";
|
|
440
|
+
check: "check";
|
|
441
441
|
}>;
|
|
442
442
|
amount: z.ZodNumber;
|
|
443
443
|
currency: z.ZodString;
|
|
@@ -496,12 +496,12 @@ declare const settlementCreateSchema: z.ZodObject<{
|
|
|
496
496
|
partner: "partner";
|
|
497
497
|
}>;
|
|
498
498
|
payoutMethod: z.ZodEnum<{
|
|
499
|
-
check: "check";
|
|
500
|
-
bank_transfer: "bank_transfer";
|
|
501
499
|
manual: "manual";
|
|
500
|
+
bank_transfer: "bank_transfer";
|
|
502
501
|
mobile_wallet: "mobile_wallet";
|
|
503
502
|
platform_balance: "platform_balance";
|
|
504
503
|
crypto: "crypto";
|
|
504
|
+
check: "check";
|
|
505
505
|
}>;
|
|
506
506
|
scheduledAt: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
507
507
|
notes: z.ZodOptional<z.ZodString>;
|
|
@@ -551,12 +551,12 @@ declare const settlementUpdateSchema: z.ZodObject<{
|
|
|
551
551
|
}>>;
|
|
552
552
|
status: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
553
553
|
payoutMethod: z.ZodOptional<z.ZodEnum<{
|
|
554
|
-
check: "check";
|
|
555
|
-
bank_transfer: "bank_transfer";
|
|
556
554
|
manual: "manual";
|
|
555
|
+
bank_transfer: "bank_transfer";
|
|
557
556
|
mobile_wallet: "mobile_wallet";
|
|
558
557
|
platform_balance: "platform_balance";
|
|
559
558
|
crypto: "crypto";
|
|
559
|
+
check: "check";
|
|
560
560
|
}>>;
|
|
561
561
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
562
562
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -618,8 +618,10 @@ declare const paymentIntentSchema: z.ZodObject<{
|
|
|
618
618
|
currency: z.ZodString;
|
|
619
619
|
gateway: z.ZodString;
|
|
620
620
|
methodKind: z.ZodEnum<{
|
|
621
|
-
|
|
621
|
+
manual: "manual";
|
|
622
622
|
bank_transfer: "bank_transfer";
|
|
623
|
+
cryptocurrency: "cryptocurrency";
|
|
624
|
+
card: "card";
|
|
623
625
|
instant_bank_transfer: "instant_bank_transfer";
|
|
624
626
|
direct_debit: "direct_debit";
|
|
625
627
|
wallet: "wallet";
|
|
@@ -628,8 +630,6 @@ declare const paymentIntentSchema: z.ZodObject<{
|
|
|
628
630
|
gift_card: "gift_card";
|
|
629
631
|
cash: "cash";
|
|
630
632
|
cheque: "cheque";
|
|
631
|
-
cryptocurrency: "cryptocurrency";
|
|
632
|
-
manual: "manual";
|
|
633
633
|
other: "other";
|
|
634
634
|
}>;
|
|
635
635
|
customerId: z.ZodOptional<z.ZodString>;
|
package/dist/events/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as TransactionJournalizedPayload, A as SettlementCreated, B as SubscriptionCancelled, C as PurchaseCreated, D as RevenueEventSchema, E as RevenueEventPayloadOf, F as SettlementProcessingPayload, G as SubscriptionPausedPayload, H as SubscriptionCreated, I as SettlementScheduled, J as SubscriptionResumed, K as SubscriptionRenewed, L as SettlementScheduledPayload, M as SettlementFailed, N as SettlementFailedPayload, O as SettlementCompleted, P as SettlementProcessing, Q as TransactionJournalized, R as SubscriptionActivated, S as PaymentVerifiedPayload, T as RevenueEventDefinition, U as SubscriptionCreatedPayload, V as SubscriptionCancelledPayload, W as SubscriptionPaused, X as TransactionImported, Y as SubscriptionResumedPayload, Z as TransactionImportedPayload, _ as PaymentRefunded, _t as InProcessRevenueBusOptions, a as EscrowReleased, at as TransactionRemovedByFeedPayload, b as PaymentRequiresActionPayload, c as EscrowSplitPayload, ct as TransactionUpdated, d as MonetizationCreated, dt as WebhookProcessedPayload, et as TransactionMatched, f as MonetizationCreatedPayload, ft as revenueEventDefinitions, g as PaymentProcessingPayload, gt as InProcessRevenueBus, h as PaymentProcessing, ht as createEvent, i as EscrowHeldPayload, it as TransactionRemovedByFeed, j as SettlementCreatedPayload, k as SettlementCompletedPayload, l as FreeCreated, lt as TransactionUpdatedPayload, m as PaymentFailedPayload, mt as RevenueEventName, n as EscrowCancelledPayload, nt as TransactionRejected, o as EscrowReleasedPayload, ot as TransactionUnmatched, p as PaymentFailed, pt as REVENUE_EVENTS, q as SubscriptionRenewedPayload, r as EscrowHeld, rt as TransactionRejectedPayload, s as EscrowSplit, st as TransactionUnmatchedPayload, t as EscrowCancelled, tt as TransactionMatchedPayload, u as FreeCreatedPayload, ut as WebhookProcessed, v as PaymentRefundedPayload, w as PurchaseCreatedPayload, x as PaymentVerified, y as PaymentRequiresAction, z as SubscriptionActivatedPayload } from "../revenue-event-catalog-
|
|
1
|
+
import { $ as TransactionJournalizedPayload, A as SettlementCreated, B as SubscriptionCancelled, C as PurchaseCreated, D as RevenueEventSchema, E as RevenueEventPayloadOf, F as SettlementProcessingPayload, G as SubscriptionPausedPayload, H as SubscriptionCreated, I as SettlementScheduled, J as SubscriptionResumed, K as SubscriptionRenewed, L as SettlementScheduledPayload, M as SettlementFailed, N as SettlementFailedPayload, O as SettlementCompleted, P as SettlementProcessing, Q as TransactionJournalized, R as SubscriptionActivated, S as PaymentVerifiedPayload, T as RevenueEventDefinition, U as SubscriptionCreatedPayload, V as SubscriptionCancelledPayload, W as SubscriptionPaused, X as TransactionImported, Y as SubscriptionResumedPayload, Z as TransactionImportedPayload, _ as PaymentRefunded, _t as InProcessRevenueBusOptions, a as EscrowReleased, at as TransactionRemovedByFeedPayload, b as PaymentRequiresActionPayload, c as EscrowSplitPayload, ct as TransactionUpdated, d as MonetizationCreated, dt as WebhookProcessedPayload, et as TransactionMatched, f as MonetizationCreatedPayload, ft as revenueEventDefinitions, g as PaymentProcessingPayload, gt as InProcessRevenueBus, h as PaymentProcessing, ht as createEvent, i as EscrowHeldPayload, it as TransactionRemovedByFeed, j as SettlementCreatedPayload, k as SettlementCompletedPayload, l as FreeCreated, lt as TransactionUpdatedPayload, m as PaymentFailedPayload, mt as RevenueEventName, n as EscrowCancelledPayload, nt as TransactionRejected, o as EscrowReleasedPayload, ot as TransactionUnmatched, p as PaymentFailed, pt as REVENUE_EVENTS, q as SubscriptionRenewedPayload, r as EscrowHeld, rt as TransactionRejectedPayload, s as EscrowSplit, st as TransactionUnmatchedPayload, t as EscrowCancelled, tt as TransactionMatchedPayload, u as FreeCreatedPayload, ut as WebhookProcessed, v as PaymentRefundedPayload, w as PurchaseCreatedPayload, x as PaymentVerified, y as PaymentRequiresAction, z as SubscriptionActivatedPayload } from "../revenue-event-catalog-BU_KYN2-.mjs";
|
|
2
2
|
import { DomainEvent, EventHandler, EventTransport } from "@classytic/primitives/events";
|
|
3
3
|
export { type DomainEvent, EscrowCancelled, type EscrowCancelledPayload, EscrowHeld, type EscrowHeldPayload, EscrowReleased, type EscrowReleasedPayload, EscrowSplit, type EscrowSplitPayload, type EventHandler, type EventTransport, FreeCreated, type FreeCreatedPayload, InProcessRevenueBus, type InProcessRevenueBusOptions, MonetizationCreated, type MonetizationCreatedPayload, PaymentFailed, type PaymentFailedPayload, PaymentProcessing, type PaymentProcessingPayload, PaymentRefunded, type PaymentRefundedPayload, PaymentRequiresAction, type PaymentRequiresActionPayload, PaymentVerified, type PaymentVerifiedPayload, PurchaseCreated, type PurchaseCreatedPayload, REVENUE_EVENTS, type RevenueEventDefinition, type RevenueEventName, type RevenueEventPayloadOf, type RevenueEventSchema, SettlementCompleted, type SettlementCompletedPayload, SettlementCreated, type SettlementCreatedPayload, SettlementFailed, type SettlementFailedPayload, SettlementProcessing, type SettlementProcessingPayload, SettlementScheduled, type SettlementScheduledPayload, SubscriptionActivated, type SubscriptionActivatedPayload, SubscriptionCancelled, type SubscriptionCancelledPayload, SubscriptionCreated, type SubscriptionCreatedPayload, SubscriptionPaused, type SubscriptionPausedPayload, SubscriptionRenewed, type SubscriptionRenewedPayload, SubscriptionResumed, type SubscriptionResumedPayload, TransactionImported, type TransactionImportedPayload, TransactionJournalized, type TransactionJournalizedPayload, TransactionMatched, type TransactionMatchedPayload, TransactionRejected, type TransactionRejectedPayload, TransactionRemovedByFeed, type TransactionRemovedByFeedPayload, TransactionUnmatched, type TransactionUnmatchedPayload, TransactionUpdated, type TransactionUpdatedPayload, WebhookProcessed, type WebhookProcessedPayload, createEvent, revenueEventDefinitions };
|
package/dist/index.d.mts
CHANGED
|
@@ -4,12 +4,12 @@ import { A as SettlementStatus, B as HoldReason, C as isPayoutMethod, D as SETTL
|
|
|
4
4
|
import { A as isTransactionFlow, C as TRANSACTION_STATUS, D as TransactionStatus, E as TransactionFlowValue, O as TransactionStatusValue, S as TRANSACTION_FLOW_VALUES, T as TransactionFlow, _ as LIBRARY_CATEGORIES, a as BankFeedSourceValue, b as LibraryCategoryValue, c as TRANSACTION_KIND_VALUES, d as initialStatusFor, f as isBankFeedSource, g as statusesForKind, h as isTransactionKind, i as BANK_FEED_STATUS_VALUES, j as isTransactionStatus, k as isLibraryCategory, l as TransactionKind, m as isStatusValidForKind, n as BANK_FEED_SOURCE_VALUES, o as BankFeedStatusValue, p as isBankFeedStatus, r as BANK_FEED_STATUS, s as TRANSACTION_KIND, t as BANK_FEED_SOURCE, u as TransactionKindValue, v as LIBRARY_CATEGORY_VALUES, w as TRANSACTION_STATUS_VALUES, x as TRANSACTION_FLOW, y as LibraryCategories } from "./bank-feed.enums-CqTW2Blz.mjs";
|
|
5
5
|
import { BANK_FEED_STATE_MACHINE, HOLD_STATE_MACHINE, MANUAL_STATE_MACHINE, PAYMENT_FLOW_STATE_MACHINE, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, StateChangeEvent, StateMachine, TRANSACTION_STATE_MACHINE, smFor } from "./core/state-machines.mjs";
|
|
6
6
|
import { a as isMonetizationType, c as PAYMENT_STATUS, d as PaymentGatewayTypeValue, f as PaymentStatus, h as isPaymentStatus, i as MonetizationTypes, l as PAYMENT_STATUS_VALUES, m as isPaymentGatewayType, n as MONETIZATION_TYPE_VALUES, o as PAYMENT_GATEWAY_TYPE, p as PaymentStatusValue, r as MonetizationTypeValue, s as PAYMENT_GATEWAY_TYPE_VALUES, t as MONETIZATION_TYPES, u as PaymentGatewayType } from "./monetization.enums-DzAI4sT7.mjs";
|
|
7
|
-
import { D as RevenueEventSchema, E as RevenueEventPayloadOf, T as RevenueEventDefinition, _t as InProcessRevenueBusOptions, ft as revenueEventDefinitions, gt as InProcessRevenueBus, ht as createEvent, mt as RevenueEventName, pt as REVENUE_EVENTS } from "./revenue-event-catalog-
|
|
7
|
+
import { D as RevenueEventSchema, E as RevenueEventPayloadOf, T as RevenueEventDefinition, _t as InProcessRevenueBusOptions, ft as revenueEventDefinitions, gt as InProcessRevenueBus, ht as createEvent, mt as RevenueEventName, pt as REVENUE_EVENTS } from "./revenue-event-catalog-BU_KYN2-.mjs";
|
|
8
8
|
import { a as BankFeedProviderRegistry, c as ParseUploadParams, d as PaymentProvider, i as BankFeedProviderCapabilities, l as ParseUploadResult, n as createProviderRegistry, o as FetchTransactionsParams, r as BankFeedProvider, s as FetchTransactionsResult, t as ProviderRegistry, u as createBankFeedProviderRegistry } from "./registry-DSG7x-Cl.mjs";
|
|
9
|
-
import { a as RevenueConfig, c as
|
|
9
|
+
import { _ as TransactionDocument, a as RevenueConfig, c as RecipientBreakdown, d as SubscriptionRepository, f as TransactionRepository, g as SubscriptionDocument, h as SettlementDocument, i as RetryConfig, l as SettlementRepository, m as RevenueSchemaOptions, n as BankFeedModuleConfig, o as RevenueEngine, p as RevenueModels, r as CommissionConfig, s as RecipientBalance, t as BankFeedIndexConfig, u as SettlementSummary } from "./engine-types-D6ijamqA.mjs";
|
|
10
10
|
import { RepositoryPluginBundle, RevenueRepositories } from "./repositories/create-repositories.mjs";
|
|
11
|
-
import { A as transactionBaseSchema, C as subscriptionBaseSchema, D as TransactionCreateInput, E as subscriptionUpdateSchema, M as transactionListFilterSchema, N as transactionUpdateSchema, O as TransactionListFilter, S as SubscriptionUpdateInput, T as subscriptionListFilterSchema, _ as settlementCreateSchema, a as escrowReleaseSchema, b as SubscriptionCreateInput, c as PaymentVerifyInput, d as paymentVerifySchema, f as refundSchema, g as settlementBaseSchema, h as SettlementUpdateInput, i as escrowHoldSchema, j as transactionCreateSchema, k as TransactionUpdateInput, l as RefundInput, m as SettlementListFilter, n as EscrowReleaseInput, o as splitRuleSchema, p as SettlementCreateInput, r as SplitRuleInput, s as PaymentIntentInput, t as EscrowHoldInput, u as paymentIntentSchema, v as settlementListFilterSchema, w as subscriptionCreateSchema, x as SubscriptionListFilter, y as settlementUpdateSchema } from "./escrow.schema-
|
|
12
|
-
import { A as SplitInfo, B as
|
|
11
|
+
import { A as transactionBaseSchema, C as subscriptionBaseSchema, D as TransactionCreateInput, E as subscriptionUpdateSchema, M as transactionListFilterSchema, N as transactionUpdateSchema, O as TransactionListFilter, S as SubscriptionUpdateInput, T as subscriptionListFilterSchema, _ as settlementCreateSchema, a as escrowReleaseSchema, b as SubscriptionCreateInput, c as PaymentVerifyInput, d as paymentVerifySchema, f as refundSchema, g as settlementBaseSchema, h as SettlementUpdateInput, i as escrowHoldSchema, j as transactionCreateSchema, k as TransactionUpdateInput, l as RefundInput, m as SettlementListFilter, n as EscrowReleaseInput, o as splitRuleSchema, p as SettlementCreateInput, r as SplitRuleInput, s as PaymentIntentInput, t as EscrowHoldInput, u as paymentIntentSchema, v as settlementListFilterSchema, w as subscriptionCreateSchema, x as SubscriptionListFilter, y as settlementUpdateSchema } from "./escrow.schema-DSx7EywJ.mjs";
|
|
12
|
+
import { A as SplitInfo, B as reverseTax, C as multiplyMoney, D as toCurrencyCode, E as sumMoney, F as TaxCalculation, H as CommissionInfo, I as TaxConfig, L as TaxType, M as calculateOrganizationPayout, N as calculateSplits, O as toMajor, R as calculateTax, S as money, T as subtractMoney, U as calculateCommission, V as validateTaxCalculation, W as reverseCommission, _ as isMoney, a as CurrencyCode, b as isZeroMoney, c as Money, d as addMoney, f as compareMoney, g as isCurrencyCode, h as fromSmallestUnit, i as CURRENCIES, j as SplitRule, k as toSmallestUnit, l as MoneyValue, m as fromMajor, n as getAuditTrail, o as CurrencyMismatchError, p as equalsMoney, r as getLastStateChange, s as MINOR_UNIT_FACTOR, t as appendAuditEvent, u as absMoney, v as isNegativeMoney, w as negateMoney, x as minorUnitFactor, y as isPositiveMoney, z as getTaxType } from "./audit-BkDdPSed.mjs";
|
|
13
13
|
import { HookHandler, PluginContext, PluginManager, RevenuePluginDefinition } from "./plugins/plugin.interface.mjs";
|
|
14
14
|
import { DomainEvent, DomainEvent as DomainEvent$1, EventHandler, EventTransport } from "@classytic/primitives/events";
|
|
15
15
|
import { InvalidOutboxEventError, OutboxAcknowledgeOptions, OutboxAcknowledgeOptions as OutboxAcknowledgeOptions$1, OutboxClaimOptions, OutboxErrorInfo, OutboxFailOptions, OutboxFailureContext, OutboxFailureDecision, OutboxFailurePolicy, OutboxOwnershipError, OutboxStore, OutboxStore as OutboxStore$1, OutboxWriteOptions, OutboxWriteOptions as OutboxWriteOptions$1 } from "@classytic/primitives/outbox";
|
|
@@ -115,4 +115,4 @@ declare class BankFeedProviderNotFoundError extends RevenueError {
|
|
|
115
115
|
constructor(providerName: string);
|
|
116
116
|
}
|
|
117
117
|
//#endregion
|
|
118
|
-
export { AlreadyVerifiedError, type AnalyticsBridge, BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATE_MACHINE, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, BankFeedImportError, type BankFeedIndexConfig, type BankFeedModuleConfig, BankFeedProvider, type BankFeedProviderCapabilities, BankFeedProviderNotFoundError, BankFeedProviderRegistry, BankFeedSourceValue, BankFeedStatusValue, CURRENCIES, type CommissionConfig, type CommissionInfo, ConfigurationError, type CurrencyBridge, type CurrencyCode, CurrencyMismatchError, type CustomerBridge, type DomainEvent, EscrowHoldInput, EscrowReleaseInput, type EventHandler, type EventTransport, type FetchTransactionsParams, type FetchTransactionsResult, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATE_MACHINE, HOLD_STATUS, HOLD_STATUS_VALUES, HoldReason, HoldReasonValue, HoldStatus, HoldStatusValue, type HookHandler, InProcessRevenueBus, type InProcessRevenueBusOptions, InvalidOutboxEventError, InvalidStateTransitionError, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, type LedgerBridge, LibraryCategories, LibraryCategoryValue, MANUAL_STATE_MACHINE, MINOR_UNIT_FACTOR, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, MemoryOutboxStore, MethodKindLockedError, MonetizationTypeValue, MonetizationTypes, type Money, type MoneyValue, type NotificationBridge, type OutboxAcknowledgeOptions, type OutboxClaimOptions, type OutboxErrorInfo, type OutboxFailOptions, type OutboxFailureContext, type OutboxFailureDecision, type OutboxFailurePolicy, OutboxOwnershipError, type OutboxStore, type OutboxWriteOptions, PAYMENT_FLOW_STATE_MACHINE, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, type ParseUploadParams, type ParseUploadResult, PaymentGatewayType, PaymentGatewayTypeValue, PaymentIntentCreationError, PaymentIntentInput, PaymentProvider, PaymentStatus, PaymentStatusValue, PaymentVerificationError, PaymentVerifyInput, PayoutMethod, PayoutMethodValue, PlanKeyValue, PlanKeys, type PluginContext, PluginManager, ProviderCapabilityError, ProviderNotFoundError, ProviderRegistry, RELEASE_REASON, RELEASE_REASON_VALUES, REVENUE_EVENTS, type RecipientBalance, RefundInput, RefundNotSupportedError, ReleaseReason, ReleaseReasonValue, type RepositoryPluginBundle, type Result, type RetryConfig, type RevenueBridges, type RevenueConfig, type RevenueContext, type RevenueEngine, RevenueError, type RevenueEventDefinition, type RevenueEventName, type RevenueEventPayloadOf, type RevenueEventSchema, type RevenueModels, type RevenuePluginDefinition, type RevenueRepositories, type RevenueSchemaOptions, SETTLEMENT_STATE_MACHINE, SETTLEMENT_STATUS, SETTLEMENT_STATUS_VALUES, SETTLEMENT_TYPE, SETTLEMENT_TYPE_VALUES, SPLIT_STATE_MACHINE, SPLIT_STATUS, SPLIT_STATUS_VALUES, SPLIT_TYPE, SPLIT_TYPE_VALUES, SUBSCRIPTION_STATE_MACHINE, SUBSCRIPTION_STATUS, SUBSCRIPTION_STATUS_VALUES, SettlementCreateInput, type SettlementDocument, SettlementListFilter, SettlementNotFoundError, SettlementRepository, SettlementStatus, SettlementStatusValue, SettlementType, SettlementTypeValue, SettlementUpdateInput, type SplitInfo, type SplitRule, SplitRuleInput, SplitStatus, SplitStatusValue, SplitType, SplitTypeValue, type StateChangeEvent, StateMachine, SubscriptionCreateInput, type SubscriptionDocument, SubscriptionListFilter, SubscriptionNotFoundError, SubscriptionRepository, SubscriptionStatus, SubscriptionStatusValue, SubscriptionUpdateInput, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATE_MACHINE, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, type TaxBridge, type TaxCalculation, type TaxConfig, type TaxType, TransactionCreateInput, type TransactionDocument, TransactionFlow, TransactionFlowValue, TransactionKind, TransactionKindValue, TransactionListFilter, TransactionNotFoundError, TransactionRepository, TransactionStatus, TransactionStatusValue, TransactionUpdateInput, ValidationError, WrongTransactionKindError, absMoney, addMoney, appendAuditEvent, calculateCommission, calculateOrganizationPayout, calculateSplits, calculateTax, compareMoney, createBankFeedProviderRegistry, createEvent, createProviderRegistry, createRevenue, equalsMoney, err, escrowHoldSchema, escrowReleaseSchema, fromMajor, fromSmallestUnit, getAuditTrail, getLastStateChange, getTaxType, initialStatusFor, isBankFeedSource, isBankFeedStatus, isCurrencyCode, isErr, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isMoney, isNegativeMoney, isOk, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isPositiveMoney, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, isZeroMoney, minorUnitFactor, money, multiplyMoney, negateMoney, ok, paymentIntentSchema, paymentVerifySchema, refundSchema, revenueEventDefinitions, reverseCommission, reverseTax, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, smFor, splitRuleSchema, statusesForKind, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, subtractMoney, sumMoney, toCurrencyCode, toMajor, toSmallestUnit, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema, validateTaxCalculation };
|
|
118
|
+
export { AlreadyVerifiedError, type AnalyticsBridge, BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATE_MACHINE, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, BankFeedImportError, type BankFeedIndexConfig, type BankFeedModuleConfig, BankFeedProvider, type BankFeedProviderCapabilities, BankFeedProviderNotFoundError, BankFeedProviderRegistry, BankFeedSourceValue, BankFeedStatusValue, CURRENCIES, type CommissionConfig, type CommissionInfo, ConfigurationError, type CurrencyBridge, type CurrencyCode, CurrencyMismatchError, type CustomerBridge, type DomainEvent, EscrowHoldInput, EscrowReleaseInput, type EventHandler, type EventTransport, type FetchTransactionsParams, type FetchTransactionsResult, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATE_MACHINE, HOLD_STATUS, HOLD_STATUS_VALUES, HoldReason, HoldReasonValue, HoldStatus, HoldStatusValue, type HookHandler, InProcessRevenueBus, type InProcessRevenueBusOptions, InvalidOutboxEventError, InvalidStateTransitionError, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, type LedgerBridge, LibraryCategories, LibraryCategoryValue, MANUAL_STATE_MACHINE, MINOR_UNIT_FACTOR, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, MemoryOutboxStore, MethodKindLockedError, MonetizationTypeValue, MonetizationTypes, type Money, type MoneyValue, type NotificationBridge, type OutboxAcknowledgeOptions, type OutboxClaimOptions, type OutboxErrorInfo, type OutboxFailOptions, type OutboxFailureContext, type OutboxFailureDecision, type OutboxFailurePolicy, OutboxOwnershipError, type OutboxStore, type OutboxWriteOptions, PAYMENT_FLOW_STATE_MACHINE, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, type ParseUploadParams, type ParseUploadResult, PaymentGatewayType, PaymentGatewayTypeValue, PaymentIntentCreationError, PaymentIntentInput, PaymentProvider, PaymentStatus, PaymentStatusValue, PaymentVerificationError, PaymentVerifyInput, PayoutMethod, PayoutMethodValue, PlanKeyValue, PlanKeys, type PluginContext, PluginManager, ProviderCapabilityError, ProviderNotFoundError, ProviderRegistry, RELEASE_REASON, RELEASE_REASON_VALUES, REVENUE_EVENTS, type RecipientBalance, type RecipientBreakdown, RefundInput, RefundNotSupportedError, ReleaseReason, ReleaseReasonValue, type RepositoryPluginBundle, type Result, type RetryConfig, type RevenueBridges, type RevenueConfig, type RevenueContext, type RevenueEngine, RevenueError, type RevenueEventDefinition, type RevenueEventName, type RevenueEventPayloadOf, type RevenueEventSchema, type RevenueModels, type RevenuePluginDefinition, type RevenueRepositories, type RevenueSchemaOptions, SETTLEMENT_STATE_MACHINE, SETTLEMENT_STATUS, SETTLEMENT_STATUS_VALUES, SETTLEMENT_TYPE, SETTLEMENT_TYPE_VALUES, SPLIT_STATE_MACHINE, SPLIT_STATUS, SPLIT_STATUS_VALUES, SPLIT_TYPE, SPLIT_TYPE_VALUES, SUBSCRIPTION_STATE_MACHINE, SUBSCRIPTION_STATUS, SUBSCRIPTION_STATUS_VALUES, SettlementCreateInput, type SettlementDocument, SettlementListFilter, SettlementNotFoundError, SettlementRepository, SettlementStatus, SettlementStatusValue, type SettlementSummary, SettlementType, SettlementTypeValue, SettlementUpdateInput, type SplitInfo, type SplitRule, SplitRuleInput, SplitStatus, SplitStatusValue, SplitType, SplitTypeValue, type StateChangeEvent, StateMachine, SubscriptionCreateInput, type SubscriptionDocument, SubscriptionListFilter, SubscriptionNotFoundError, SubscriptionRepository, SubscriptionStatus, SubscriptionStatusValue, SubscriptionUpdateInput, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATE_MACHINE, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, type TaxBridge, type TaxCalculation, type TaxConfig, type TaxType, TransactionCreateInput, type TransactionDocument, TransactionFlow, TransactionFlowValue, TransactionKind, TransactionKindValue, TransactionListFilter, TransactionNotFoundError, TransactionRepository, TransactionStatus, TransactionStatusValue, TransactionUpdateInput, ValidationError, WrongTransactionKindError, absMoney, addMoney, appendAuditEvent, calculateCommission, calculateOrganizationPayout, calculateSplits, calculateTax, compareMoney, createBankFeedProviderRegistry, createEvent, createProviderRegistry, createRevenue, equalsMoney, err, escrowHoldSchema, escrowReleaseSchema, fromMajor, fromSmallestUnit, getAuditTrail, getLastStateChange, getTaxType, initialStatusFor, isBankFeedSource, isBankFeedStatus, isCurrencyCode, isErr, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isMoney, isNegativeMoney, isOk, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isPositiveMoney, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, isZeroMoney, minorUnitFactor, money, multiplyMoney, negateMoney, ok, paymentIntentSchema, paymentVerifySchema, refundSchema, revenueEventDefinitions, reverseCommission, reverseTax, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, smFor, splitRuleSchema, statusesForKind, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, subtractMoney, sumMoney, toCurrencyCode, toMajor, toSmallestUnit, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema, validateTaxCalculation };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as TRANSACTION_STATUS, a as TRANSACTION_KIND, b as isTransactionFlow, c as isBankFeedSource, d as isTransactionKind, f as statusesForKind, g as TRANSACTION_FLOW_VALUES, h as TRANSACTION_FLOW, i as BANK_FEED_STATUS_VALUES, l as isBankFeedStatus, m as LIBRARY_CATEGORY_VALUES, n as BANK_FEED_SOURCE_VALUES, o as TRANSACTION_KIND_VALUES, p as LIBRARY_CATEGORIES, r as BANK_FEED_STATUS, s as initialStatusFor, t as BANK_FEED_SOURCE, u as isStatusValidForKind, v as TRANSACTION_STATUS_VALUES, x as isTransactionStatus, y as isLibraryCategory } from "./bank-feed.enums-ByS3mjX0.mjs";
|
|
2
|
-
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "./settlement.repository-
|
|
2
|
+
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "./settlement.repository-oypYDjKq.mjs";
|
|
3
3
|
import { n as createEvent, t as REVENUE_EVENTS } from "./event-constants-DM_-A57b.mjs";
|
|
4
4
|
import { A as isReleaseReason, C as HOLD_REASON_VALUES, D as RELEASE_REASON_VALUES, E as RELEASE_REASON, O as isHoldReason, S as HOLD_REASON, T as HOLD_STATUS_VALUES, _ as SETTLEMENT_STATUS_VALUES, a as isPlanKey, b as isSettlementStatus, c as PAYOUT_METHOD_VALUES, d as SPLIT_TYPE, f as SPLIT_TYPE_VALUES, g as SETTLEMENT_STATUS, h as isSplitType, i as SUBSCRIPTION_STATUS_VALUES, k as isHoldStatus, l as SPLIT_STATUS, m as isSplitStatus, n as PLAN_KEY_VALUES, o as isSubscriptionStatus, p as isPayoutMethod, r as SUBSCRIPTION_STATUS, s as PAYOUT_METHOD, t as PLAN_KEYS, u as SPLIT_STATUS_VALUES, v as SETTLEMENT_TYPE, w as HOLD_STATUS, x as isSettlementType, y as SETTLEMENT_TYPE_VALUES } from "./subscription.enums-95othr0i.mjs";
|
|
5
5
|
import { _ as WrongTransactionKindError, a as InvalidStateTransitionError, c as PaymentVerificationError, d as RefundNotSupportedError, f as RevenueError, g as ValidationError, h as TransactionNotFoundError, i as ConfigurationError, l as ProviderCapabilityError, m as SubscriptionNotFoundError, n as BankFeedImportError, o as MethodKindLockedError, p as SettlementNotFoundError, r as BankFeedProviderNotFoundError, s as PaymentIntentCreationError, t as AlreadyVerifiedError, u as ProviderNotFoundError } from "./errors-Bt5NRVMq.mjs";
|
|
6
6
|
import { BANK_FEED_STATE_MACHINE, HOLD_STATE_MACHINE, MANUAL_STATE_MACHINE, PAYMENT_FLOW_STATE_MACHINE, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, StateMachine, TRANSACTION_STATE_MACHINE, smFor } from "./core/state-machines.mjs";
|
|
7
|
-
import { a as
|
|
7
|
+
import { a as getTaxType, c as calculateCommission, i as calculateTax, l as reverseCommission, n as calculateSplits, o as reverseTax, s as validateTaxCalculation, t as calculateOrganizationPayout } from "./splits-CEdZN6OT.mjs";
|
|
8
8
|
import { createRevenueRepositories } from "./repositories/create-repositories.mjs";
|
|
9
9
|
import { a as createProviderRegistry, i as ProviderRegistry, n as BankFeedProviderRegistry, o as PaymentProvider, r as createBankFeedProviderRegistry, t as BankFeedProvider } from "./bank-feed-ClxNob_I.mjs";
|
|
10
10
|
import { M as revenueEventDefinitions, N as InProcessRevenueBus } from "./revenue-event-catalog-B9aZmNpL.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as SubscriptionRepository, f as TransactionRepository, l as SettlementRepository, p as RevenueModels } from "../engine-types-D6ijamqA.mjs";
|
|
2
2
|
import { PluginType } from "@classytic/mongokit";
|
|
3
3
|
|
|
4
4
|
//#region src/repositories/create-repositories.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "../settlement.repository-
|
|
1
|
+
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "../settlement.repository-oypYDjKq.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/repositories/create-repositories.ts
|
|
4
4
|
function createRevenueRepositories(models, builtInPlugins, hostPlugins = {}) {
|