@classytic/revenue 2.3.0 → 2.4.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 +24 -0
- package/dist/{bank-feed.enums-CU38W8dv.mjs → bank-feed.enums-ByS3mjX0.mjs} +8 -4
- package/dist/{bank-feed.enums-BwJbImM6.d.mts → bank-feed.enums-CqTW2Blz.d.mts} +2 -0
- package/dist/core/state-machines.d.mts +1 -1
- package/dist/core/state-machines.mjs +13 -3
- package/dist/{engine-types-34VmC7t6.d.mts → engine-types-BU8kkttr.d.mts} +34 -2
- package/dist/enums/index.d.mts +1 -1
- package/dist/enums/index.mjs +1 -1
- package/dist/{escrow.schema-C_UeLtsC.d.mts → escrow.schema-Cklvlywy.d.mts} +19 -19
- package/dist/events/index.d.mts +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/providers/index.d.mts +1 -1
- package/dist/{registry-BpEeN8eW.d.mts → registry-DSG7x-Cl.d.mts} +1 -1
- 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-CdM3myTI.mjs → settlement.repository-DtLSBDIk.mjs} +64 -1
- package/dist/validators/index.d.mts +1 -1
- package/dist/validators/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.4.0] - 2026-06-14
|
|
7
|
+
|
|
8
|
+
### Added — `settled` bank-feed/manual status + `settle()` / `unsettle()` verbs
|
|
9
|
+
|
|
10
|
+
New `BANK_FEED_STATUS.SETTLED` (`'settled'`) for a bank line that was reconciled
|
|
11
|
+
by a **linked document** (an invoice/bill whose payment already posted the cash
|
|
12
|
+
JE, `Dr Bank / Cr AR`). The line itself posts **no second journal entry**.
|
|
13
|
+
|
|
14
|
+
- `transaction.settle(id, { settledBy?, metadata? })` — `imported → settled`
|
|
15
|
+
(bank_feed) / `pending → settled` (manual). Does **not** call the ledger
|
|
16
|
+
bridge (no JE). Idempotent (re-running on a `settled` row is a no-op).
|
|
17
|
+
`metadata` is shallow-merged (dotted `$set`) so the host can stamp the link
|
|
18
|
+
back to the settling document.
|
|
19
|
+
- `transaction.unsettle(id, { unsettledBy?, clearMetadata? })` — reverses to the
|
|
20
|
+
birth status (`settled → imported` bank_feed / `settled → pending` manual) and
|
|
21
|
+
clears the named metadata keys.
|
|
22
|
+
|
|
23
|
+
Unlike `reconciled_external` (vendor-owned, born terminal, no edges), `settled`
|
|
24
|
+
is **reachable and reversible** but never enters the JE bridge. This replaces the
|
|
25
|
+
host-side pattern of a raw `updateOne` parking invoice-settled rows at `matched`
|
|
26
|
+
(which overloaded `matched` and forced every consumer to sniff
|
|
27
|
+
`metadata.matchedVia` to tell "done" from "needs a JE"). `status` is now the
|
|
28
|
+
single source of truth.
|
|
29
|
+
|
|
6
30
|
## [2.3.0] - 2026-06-02
|
|
7
31
|
|
|
8
32
|
### Added — `reconciled_external` terminal bank-feed status
|
|
@@ -20,7 +20,8 @@ const TRANSACTION_STATUS = {
|
|
|
20
20
|
MATCHED: "matched",
|
|
21
21
|
JOURNALIZED: "journalized",
|
|
22
22
|
REJECTED: "rejected",
|
|
23
|
-
RECONCILED_EXTERNAL: "reconciled_external"
|
|
23
|
+
RECONCILED_EXTERNAL: "reconciled_external",
|
|
24
|
+
SETTLED: "settled"
|
|
24
25
|
};
|
|
25
26
|
const TRANSACTION_STATUS_VALUES = Object.values(TRANSACTION_STATUS);
|
|
26
27
|
const LIBRARY_CATEGORIES = {
|
|
@@ -73,7 +74,8 @@ const BANK_FEED_STATUS = {
|
|
|
73
74
|
MATCHED: "matched",
|
|
74
75
|
JOURNALIZED: "journalized",
|
|
75
76
|
REJECTED: "rejected",
|
|
76
|
-
RECONCILED_EXTERNAL: "reconciled_external"
|
|
77
|
+
RECONCILED_EXTERNAL: "reconciled_external",
|
|
78
|
+
SETTLED: "settled"
|
|
77
79
|
};
|
|
78
80
|
const BANK_FEED_STATUS_VALUES = Object.values(BANK_FEED_STATUS);
|
|
79
81
|
const bankFeedStatusSet = new Set(BANK_FEED_STATUS_VALUES);
|
|
@@ -132,13 +134,15 @@ const STATUSES_BY_KIND = {
|
|
|
132
134
|
TRANSACTION_STATUS.MATCHED,
|
|
133
135
|
TRANSACTION_STATUS.JOURNALIZED,
|
|
134
136
|
TRANSACTION_STATUS.REJECTED,
|
|
135
|
-
TRANSACTION_STATUS.RECONCILED_EXTERNAL
|
|
137
|
+
TRANSACTION_STATUS.RECONCILED_EXTERNAL,
|
|
138
|
+
TRANSACTION_STATUS.SETTLED
|
|
136
139
|
]),
|
|
137
140
|
[TRANSACTION_KIND.MANUAL]: new Set([
|
|
138
141
|
TRANSACTION_STATUS.PENDING,
|
|
139
142
|
TRANSACTION_STATUS.MATCHED,
|
|
140
143
|
TRANSACTION_STATUS.JOURNALIZED,
|
|
141
|
-
TRANSACTION_STATUS.REJECTED
|
|
144
|
+
TRANSACTION_STATUS.REJECTED,
|
|
145
|
+
TRANSACTION_STATUS.SETTLED
|
|
142
146
|
])
|
|
143
147
|
};
|
|
144
148
|
/**
|
|
@@ -23,6 +23,7 @@ declare const TRANSACTION_STATUS: {
|
|
|
23
23
|
readonly JOURNALIZED: "journalized";
|
|
24
24
|
readonly REJECTED: "rejected";
|
|
25
25
|
readonly RECONCILED_EXTERNAL: "reconciled_external";
|
|
26
|
+
readonly SETTLED: "settled";
|
|
26
27
|
};
|
|
27
28
|
type TransactionStatus = typeof TRANSACTION_STATUS;
|
|
28
29
|
type TransactionStatusValue = TransactionStatus[keyof TransactionStatus];
|
|
@@ -71,6 +72,7 @@ declare const BANK_FEED_STATUS: {
|
|
|
71
72
|
readonly JOURNALIZED: "journalized";
|
|
72
73
|
readonly REJECTED: "rejected";
|
|
73
74
|
readonly RECONCILED_EXTERNAL: "reconciled_external";
|
|
75
|
+
readonly SETTLED: "settled";
|
|
74
76
|
};
|
|
75
77
|
type BankFeedStatusValue = (typeof BANK_FEED_STATUS)[keyof typeof BANK_FEED_STATUS];
|
|
76
78
|
declare const BANK_FEED_STATUS_VALUES: BankFeedStatusValue[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { U as HoldStatusValue, b as SplitStatusValue, c as SubscriptionStatusValue, j as SettlementStatusValue } from "../subscription.enums-k24kLpF7.mjs";
|
|
2
|
-
import { O as TransactionStatusValue, u as TransactionKindValue } from "../bank-feed.enums-
|
|
2
|
+
import { O as TransactionStatusValue, u as TransactionKindValue } from "../bank-feed.enums-CqTW2Blz.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/core/state-machines.d.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as TRANSACTION_STATUS, a as TRANSACTION_KIND } from "../bank-feed.enums-
|
|
1
|
+
import { _ as TRANSACTION_STATUS, a as TRANSACTION_KIND } from "../bank-feed.enums-ByS3mjX0.mjs";
|
|
2
2
|
import { g as SETTLEMENT_STATUS, l as SPLIT_STATUS, r as SUBSCRIPTION_STATUS, w as HOLD_STATUS } from "../subscription.enums-95othr0i.mjs";
|
|
3
3
|
import { a as InvalidStateTransitionError } from "../errors-Bt5NRVMq.mjs";
|
|
4
4
|
import { defineStateMachine } from "@classytic/primitives/state-machine";
|
|
@@ -151,15 +151,25 @@ const SPLIT_STATE_MACHINE = new StateMachine(new Map([
|
|
|
151
151
|
]), "split");
|
|
152
152
|
const PAYMENT_FLOW_STATE_MACHINE = TRANSACTION_STATE_MACHINE;
|
|
153
153
|
const BANK_FEED_STATE_MACHINE = new StateMachine(new Map([
|
|
154
|
-
[TRANSACTION_STATUS.IMPORTED, new Set([
|
|
154
|
+
[TRANSACTION_STATUS.IMPORTED, new Set([
|
|
155
|
+
TRANSACTION_STATUS.MATCHED,
|
|
156
|
+
TRANSACTION_STATUS.REJECTED,
|
|
157
|
+
TRANSACTION_STATUS.SETTLED
|
|
158
|
+
])],
|
|
155
159
|
[TRANSACTION_STATUS.MATCHED, new Set([TRANSACTION_STATUS.IMPORTED, TRANSACTION_STATUS.JOURNALIZED])],
|
|
160
|
+
[TRANSACTION_STATUS.SETTLED, new Set([TRANSACTION_STATUS.IMPORTED])],
|
|
156
161
|
[TRANSACTION_STATUS.JOURNALIZED, /* @__PURE__ */ new Set([])],
|
|
157
162
|
[TRANSACTION_STATUS.REJECTED, /* @__PURE__ */ new Set([])],
|
|
158
163
|
[TRANSACTION_STATUS.RECONCILED_EXTERNAL, /* @__PURE__ */ new Set([])]
|
|
159
164
|
]), "transaction.bank_feed");
|
|
160
165
|
const MANUAL_STATE_MACHINE = new StateMachine(new Map([
|
|
161
|
-
[TRANSACTION_STATUS.PENDING, new Set([
|
|
166
|
+
[TRANSACTION_STATUS.PENDING, new Set([
|
|
167
|
+
TRANSACTION_STATUS.MATCHED,
|
|
168
|
+
TRANSACTION_STATUS.REJECTED,
|
|
169
|
+
TRANSACTION_STATUS.SETTLED
|
|
170
|
+
])],
|
|
162
171
|
[TRANSACTION_STATUS.MATCHED, new Set([TRANSACTION_STATUS.JOURNALIZED])],
|
|
172
|
+
[TRANSACTION_STATUS.SETTLED, new Set([TRANSACTION_STATUS.PENDING])],
|
|
163
173
|
[TRANSACTION_STATUS.JOURNALIZED, /* @__PURE__ */ new Set([])],
|
|
164
174
|
[TRANSACTION_STATUS.REJECTED, /* @__PURE__ */ new Set([])]
|
|
165
175
|
]), "transaction.manual");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as RevenueContext } from "./context-pjP1QeE3.mjs";
|
|
2
2
|
import { t as RevenueBridges } from "./revenue-bridges-BtkWFsJu.mjs";
|
|
3
|
-
import { O as TransactionStatusValue, u as TransactionKindValue } from "./bank-feed.enums-
|
|
4
|
-
import { a as BankFeedProviderRegistry, d as PaymentProvider, o as FetchTransactionsParams, r as BankFeedProvider, t as ProviderRegistry } from "./registry-
|
|
3
|
+
import { O as TransactionStatusValue, u as TransactionKindValue } from "./bank-feed.enums-CqTW2Blz.mjs";
|
|
4
|
+
import { a as BankFeedProviderRegistry, d as PaymentProvider, o as FetchTransactionsParams, r as BankFeedProvider, t as ProviderRegistry } from "./registry-DSG7x-Cl.mjs";
|
|
5
5
|
import { RepositoryPluginBundle, RevenueRepositories } from "./repositories/create-repositories.mjs";
|
|
6
6
|
import { PluginType, Repository } from "@classytic/mongokit";
|
|
7
7
|
import { TenantConfig } from "@classytic/repo-core/tenant";
|
|
@@ -724,6 +724,38 @@ declare class TransactionRepository extends RevenueRepositoryBase<TransactionDoc
|
|
|
724
724
|
unmatch(id: string, options?: {
|
|
725
725
|
unmatchedBy?: string;
|
|
726
726
|
}, ctx?: RevenueContext): Promise<TransactionDocument>;
|
|
727
|
+
/**
|
|
728
|
+
* Reconcile a bank-feed / manual row that settled a linked document
|
|
729
|
+
* (invoice/bill) WITHOUT posting a journal entry. The document's payment
|
|
730
|
+
* already owns the cash JE (`Dr Bank / Cr AR`), so the bank line only needs
|
|
731
|
+
* its status moved to `settled` — calling `match()` here would fire
|
|
732
|
+
* `LedgerBridge.onTransactionMatched` and double-count the cash. This is the
|
|
733
|
+
* package's intended path when the JE lives elsewhere (the reachable sibling
|
|
734
|
+
* of the born-`reconciled_external` import).
|
|
735
|
+
*
|
|
736
|
+
* `imported → settled` (bank_feed) / `pending → settled` (manual). Idempotent:
|
|
737
|
+
* a row already `settled` is returned unchanged, so a best-effort caller can
|
|
738
|
+
* safely re-run. The optional `metadata` is shallow-merged onto the document's
|
|
739
|
+
* `metadata` (dotted `$set`, so sibling keys survive) — hosts stamp the link
|
|
740
|
+
* back to the settling document there. No JE bridge call, no domain event:
|
|
741
|
+
* settlement is host-initiated and the host owns the reconcile audit trail.
|
|
742
|
+
*/
|
|
743
|
+
settle(id: string, data?: {
|
|
744
|
+
settledBy?: string;
|
|
745
|
+
metadata?: Record<string, unknown>;
|
|
746
|
+
}, ctx?: RevenueContext): Promise<TransactionDocument>;
|
|
747
|
+
/**
|
|
748
|
+
* Reverse a `settle()` — the linked document's payment was undone, so the
|
|
749
|
+
* bank line returns to its birth status to re-enter the reconcile queue.
|
|
750
|
+
* `settled → imported` (bank_feed) / `settled → pending` (manual). Clears
|
|
751
|
+
* `verifiedAt`/`verifiedBy` plus any metadata keys named in `clearMetadata`
|
|
752
|
+
* (the host-stamped link back to the now-reversed document). Idempotent: a
|
|
753
|
+
* row not currently `settled` is returned unchanged.
|
|
754
|
+
*/
|
|
755
|
+
unsettle(id: string, data?: {
|
|
756
|
+
unsettledBy?: string;
|
|
757
|
+
clearMetadata?: string[];
|
|
758
|
+
}, ctx?: RevenueContext): Promise<TransactionDocument>;
|
|
727
759
|
/**
|
|
728
760
|
* Stamp the journal entry reference and transition `matched →
|
|
729
761
|
* journalized`. Typical caller is the `LedgerBridge.onTransactionMatched`
|
package/dist/enums/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { A as SettlementStatus, B as HoldReason, C as isPayoutMethod, D as SETTLEMENT_STATUS_VALUES, E as SETTLEMENT_STATUS, F as isSettlementType, G as RELEASE_REASON_VALUES, H as HoldStatus, I as HOLD_REASON, J as isHoldReason, K as ReleaseReason, L as HOLD_REASON_VALUES, M as SettlementType, N as SettlementTypeValue, O as SETTLEMENT_TYPE, P as isSettlementStatus, R as HOLD_STATUS, S as SplitTypeValue, T as isSplitType, U as HoldStatusValue, V as HoldReasonValue, W as RELEASE_REASON, X as isReleaseReason, Y as isHoldStatus, _ as SPLIT_TYPE, a as SUBSCRIPTION_STATUS, b as SplitStatusValue, c as SubscriptionStatusValue, d as PAYOUT_METHOD, f as PAYOUT_METHOD_VALUES, g as SPLIT_STATUS_VALUES, h as SPLIT_STATUS, i as PlanKeys, j as SettlementStatusValue, k as SETTLEMENT_TYPE_VALUES, l as isPlanKey, m as PayoutMethodValue, n as PLAN_KEY_VALUES, o as SUBSCRIPTION_STATUS_VALUES, p as PayoutMethod, q as ReleaseReasonValue, r as PlanKeyValue, s as SubscriptionStatus, t as PLAN_KEYS, u as isSubscriptionStatus, v as SPLIT_TYPE_VALUES, w as isSplitStatus, x as SplitType, y as SplitStatus, z as HOLD_STATUS_VALUES } from "../subscription.enums-k24kLpF7.mjs";
|
|
2
|
-
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-
|
|
2
|
+
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";
|
|
3
3
|
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";
|
|
4
4
|
export { BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, BankFeedSourceValue, BankFeedStatusValue, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATUS, HOLD_STATUS_VALUES, HoldReason, HoldReasonValue, HoldStatus, HoldStatusValue, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, LibraryCategories, LibraryCategoryValue, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, MonetizationTypeValue, MonetizationTypes, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, PaymentGatewayType, PaymentGatewayTypeValue, PaymentStatus, PaymentStatusValue, PayoutMethod, PayoutMethodValue, PlanKeyValue, PlanKeys, RELEASE_REASON, RELEASE_REASON_VALUES, ReleaseReason, ReleaseReasonValue, SETTLEMENT_STATUS, SETTLEMENT_STATUS_VALUES, SETTLEMENT_TYPE, SETTLEMENT_TYPE_VALUES, SPLIT_STATUS, SPLIT_STATUS_VALUES, SPLIT_TYPE, SPLIT_TYPE_VALUES, SUBSCRIPTION_STATUS, SUBSCRIPTION_STATUS_VALUES, SettlementStatus, SettlementStatusValue, SettlementType, SettlementTypeValue, SplitStatus, SplitStatusValue, SplitType, SplitTypeValue, SubscriptionStatus, SubscriptionStatusValue, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, TransactionFlow, TransactionFlowValue, TransactionKind, TransactionKindValue, TransactionStatus, TransactionStatusValue, initialStatusFor, isBankFeedSource, isBankFeedStatus, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, statusesForKind };
|
package/dist/enums/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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
2
|
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";
|
|
3
3
|
import { a as PAYMENT_GATEWAY_TYPE_VALUES, c as isPaymentGatewayType, i as PAYMENT_GATEWAY_TYPE, l as isPaymentStatus, n as MONETIZATION_TYPE_VALUES, o as PAYMENT_STATUS, r as isMonetizationType, s as PAYMENT_STATUS_VALUES, t as MONETIZATION_TYPES } from "../monetization.enums-B9HBOecd.mjs";
|
|
4
4
|
|
|
@@ -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>;
|
|
@@ -134,8 +134,10 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
134
134
|
}, z.core.$strip>>;
|
|
135
135
|
method: z.ZodString;
|
|
136
136
|
methodKind: z.ZodEnum<{
|
|
137
|
-
|
|
137
|
+
manual: "manual";
|
|
138
138
|
bank_transfer: "bank_transfer";
|
|
139
|
+
cryptocurrency: "cryptocurrency";
|
|
140
|
+
card: "card";
|
|
139
141
|
instant_bank_transfer: "instant_bank_transfer";
|
|
140
142
|
direct_debit: "direct_debit";
|
|
141
143
|
wallet: "wallet";
|
|
@@ -144,8 +146,6 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
144
146
|
gift_card: "gift_card";
|
|
145
147
|
cash: "cash";
|
|
146
148
|
cheque: "cheque";
|
|
147
|
-
cryptocurrency: "cryptocurrency";
|
|
148
|
-
manual: "manual";
|
|
149
149
|
other: "other";
|
|
150
150
|
}>;
|
|
151
151
|
status: z.ZodDefault<z.ZodString>;
|
|
@@ -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>>;
|
|
@@ -366,8 +366,8 @@ declare const subscriptionCreateSchema: z.ZodObject<{
|
|
|
366
366
|
currency: z.ZodOptional<z.ZodString>;
|
|
367
367
|
paymentIntentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
368
368
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
369
|
-
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
370
369
|
planKey: z.ZodString;
|
|
370
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
371
371
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
372
372
|
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
373
373
|
pauseReason: z.ZodOptional<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;
|
|
@@ -497,12 +497,12 @@ declare const settlementCreateSchema: z.ZodObject<{
|
|
|
497
497
|
partner: "partner";
|
|
498
498
|
}>;
|
|
499
499
|
payoutMethod: z.ZodEnum<{
|
|
500
|
-
check: "check";
|
|
501
|
-
bank_transfer: "bank_transfer";
|
|
502
500
|
manual: "manual";
|
|
501
|
+
bank_transfer: "bank_transfer";
|
|
503
502
|
mobile_wallet: "mobile_wallet";
|
|
504
503
|
platform_balance: "platform_balance";
|
|
505
504
|
crypto: "crypto";
|
|
505
|
+
check: "check";
|
|
506
506
|
}>;
|
|
507
507
|
sourceTransactionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
508
508
|
sourceSplitIds: z.ZodDefault<z.ZodArray<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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as RevenueContext } from "./context-pjP1QeE3.mjs";
|
|
2
2
|
import { a as CurrencyBridge, c as LedgerBridge, i as CustomerBridge, o as NotificationBridge, r as AnalyticsBridge, s as TaxBridge, t as RevenueBridges } from "./revenue-bridges-BtkWFsJu.mjs";
|
|
3
3
|
import { A as SettlementStatus, B as HoldReason, C as isPayoutMethod, D as SETTLEMENT_STATUS_VALUES, E as SETTLEMENT_STATUS, F as isSettlementType, G as RELEASE_REASON_VALUES, H as HoldStatus, I as HOLD_REASON, J as isHoldReason, K as ReleaseReason, L as HOLD_REASON_VALUES, M as SettlementType, N as SettlementTypeValue, O as SETTLEMENT_TYPE, P as isSettlementStatus, R as HOLD_STATUS, S as SplitTypeValue, T as isSplitType, U as HoldStatusValue, V as HoldReasonValue, W as RELEASE_REASON, X as isReleaseReason, Y as isHoldStatus, _ as SPLIT_TYPE, a as SUBSCRIPTION_STATUS, b as SplitStatusValue, c as SubscriptionStatusValue, d as PAYOUT_METHOD, f as PAYOUT_METHOD_VALUES, g as SPLIT_STATUS_VALUES, h as SPLIT_STATUS, i as PlanKeys, j as SettlementStatusValue, k as SETTLEMENT_TYPE_VALUES, l as isPlanKey, m as PayoutMethodValue, n as PLAN_KEY_VALUES, o as SUBSCRIPTION_STATUS_VALUES, p as PayoutMethod, q as ReleaseReasonValue, r as PlanKeyValue, s as SubscriptionStatus, t as PLAN_KEYS, u as isSubscriptionStatus, v as SPLIT_TYPE_VALUES, w as isSplitStatus, x as SplitType, y as SplitStatus, z as HOLD_STATUS_VALUES } from "./subscription.enums-k24kLpF7.mjs";
|
|
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-
|
|
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-
|
|
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-
|
|
9
|
-
import { a as RevenueConfig, c as SubscriptionRepository, d as RevenueSchemaOptions, f as SettlementDocument, i as RetryConfig, l as TransactionRepository, m as TransactionDocument, n as BankFeedModuleConfig, o as RevenueEngine, p as SubscriptionDocument, r as CommissionConfig, s as SettlementRepository, t as BankFeedIndexConfig, u as RevenueModels } from "./engine-types-
|
|
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
|
+
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 SubscriptionRepository, d as RevenueSchemaOptions, f as SettlementDocument, i as RetryConfig, l as TransactionRepository, m as TransactionDocument, n as BankFeedModuleConfig, o as RevenueEngine, p as SubscriptionDocument, r as CommissionConfig, s as SettlementRepository, t as BankFeedIndexConfig, u as RevenueModels } from "./engine-types-BU8kkttr.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-
|
|
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-Cklvlywy.mjs";
|
|
12
12
|
import { A as SplitInfo, B as validateTaxCalculation, C as multiplyMoney, D as toCurrencyCode, E as sumMoney, F as TaxConfig, H as calculateCommission, I as TaxType, L as calculateTax, M as calculateOrganizationPayout, N as calculateSplits, O as toMajor, P as TaxCalculation, R as getTaxType, S as money, T as subtractMoney, U as reverseCommission, V as CommissionInfo, _ 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 reverseTax } from "./audit-DRKuLBFO.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";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "./settlement.repository-
|
|
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-DtLSBDIk.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";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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";
|
|
2
2
|
export { BankFeedProvider, type BankFeedProviderCapabilities, BankFeedProviderRegistry, type FetchTransactionsParams, type FetchTransactionsResult, type ParseUploadParams, type ParseUploadResult, PaymentProvider, ProviderRegistry, createBankFeedProviderRegistry, createProviderRegistry };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as BankFeedSourceValue } from "./bank-feed.enums-
|
|
1
|
+
import { a as BankFeedSourceValue } from "./bank-feed.enums-CqTW2Blz.mjs";
|
|
2
2
|
import { CreateIntentParams, PaymentIntent, PaymentResult, ProviderCapabilities, RefundResult, WebhookEvent } from "@classytic/primitives/payment-gateway";
|
|
3
3
|
import { BankStatement, BankTransaction } from "@classytic/primitives/bank-transaction";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as SubscriptionRepository, l as TransactionRepository, s as SettlementRepository, u as RevenueModels } from "../engine-types-
|
|
1
|
+
import { c as SubscriptionRepository, l as TransactionRepository, s as SettlementRepository, u as RevenueModels } from "../engine-types-BU8kkttr.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-DtLSBDIk.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/repositories/create-repositories.ts
|
|
4
4
|
function createRevenueRepositories(models, builtInPlugins, hostPlugins = {}) {
|