@saasicat/nest 1.0.0-rc.2 → 1.0.0-rc.21
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/README.md +44 -8
- package/dist/.build-stamp +1 -1
- package/dist/_entries.cjs +10214 -4796
- package/dist/admin/index.d.cts +5 -4
- package/dist/admin/index.d.ts +5 -4
- package/dist/admin/index.js +13 -9
- package/dist/{admin-resources.module-CpvzcfCc.d.cts → admin-resources.module-B4XNvdH-.d.cts} +1 -2
- package/dist/{admin-resources.module-DF5_Q7RD.d.ts → admin-resources.module-CWqdI9BV.d.ts} +1 -2
- package/dist/{admin-stats.service-TYiSUwIR.d.ts → admin-stats.service-CsLNt19Z.d.ts} +11 -7
- package/dist/{admin-stats.service-DfKupywR.d.cts → admin-stats.service-DrZrU8IJ.d.cts} +11 -7
- package/dist/{aggregation-B3CD0v_d.d.cts → aggregation-ChpZDh0g.d.ts} +39 -6
- package/dist/{aggregation-BFzW07DE.d.ts → aggregation-OpnhwzF5.d.cts} +39 -6
- package/dist/billing/index.d.cts +448 -108
- package/dist/billing/index.d.ts +448 -108
- package/dist/billing/index.js +108 -41
- package/dist/catalog/index.d.cts +74 -45
- package/dist/catalog/index.d.ts +74 -45
- package/dist/catalog/index.js +21 -13
- package/dist/catalog.module-C9O7BxRq.d.ts +180 -0
- package/dist/catalog.module-T-I5Ricz.d.cts +180 -0
- package/dist/checkout-offer/index.d.cts +17 -22
- package/dist/checkout-offer/index.d.ts +17 -22
- package/dist/checkout-offer/index.js +21 -7
- package/dist/checkout-offer.module-DFhGy6JO.d.cts +58 -0
- package/dist/checkout-offer.module-x7SP_dX4.d.ts +58 -0
- package/dist/checkout-offer.service-BeHgYikI.d.ts +242 -0
- package/dist/checkout-offer.service-CCVxG9b2.d.cts +242 -0
- package/dist/chunk-34XVPR6P.js +222 -0
- package/dist/{chunk-AOQJEYOL.js → chunk-3QVGA6JX.js} +3 -1
- package/dist/chunk-3RLWML2S.js +896 -0
- package/dist/{chunk-TXC3LHHB.js → chunk-4SDSYV4A.js} +21 -13
- package/dist/chunk-55QEDAMX.js +946 -0
- package/dist/chunk-5CKC7O52.js +140 -0
- package/dist/chunk-6PJE7EWO.js +185 -0
- package/dist/chunk-7NJKVC5X.js +353 -0
- package/dist/{chunk-RUNZ3X4C.js → chunk-AOS2JPDD.js} +1263 -185
- package/dist/{chunk-WOVQPXV4.js → chunk-CQ2ZZMTD.js} +702 -725
- package/dist/{chunk-NA6O63B7.js → chunk-F5X66HF5.js} +5 -5
- package/dist/chunk-FEQZCWUL.js +174 -0
- package/dist/{chunk-VIJ5NJWC.js → chunk-G6EZWECL.js} +107 -31
- package/dist/chunk-G7RQO2XO.js +0 -0
- package/dist/{chunk-N3L3AICU.js → chunk-GPQWGA6B.js} +5 -6
- package/dist/chunk-GZTL64QK.js +7 -0
- package/dist/{chunk-SABTXESR.js → chunk-J7NJRK3K.js} +17 -1
- package/dist/{chunk-SEPN52AD.js → chunk-JBCC6C3M.js} +566 -307
- package/dist/{chunk-I7GTA3RX.js → chunk-JQRA724W.js} +1 -1
- package/dist/{chunk-WXYJHZCN.js → chunk-JVAEKTJ4.js} +2 -14
- package/dist/chunk-KPEMTBOP.js +26 -0
- package/dist/chunk-LF6J4YYN.js +301 -0
- package/dist/{chunk-LTT736P3.js → chunk-LLYVYRGJ.js} +228 -387
- package/dist/{chunk-6Z7JR4EW.js → chunk-M47BNEY2.js} +1897 -633
- package/dist/{chunk-KFT5AIIH.js → chunk-NDLC5GYK.js} +206 -24
- package/dist/{chunk-O2J2HDXA.js → chunk-OOTEXP47.js} +3 -8
- package/dist/chunk-QPVDCKYS.js +702 -0
- package/dist/{chunk-NHVDCYK5.js → chunk-R5YCJBHY.js} +71 -106
- package/dist/{chunk-XBYAFEOR.js → chunk-S33SO5XX.js} +1 -1
- package/dist/chunk-SZ7RFPXA.js +10 -0
- package/dist/chunk-TBBZWZQT.js +98 -0
- package/dist/chunk-TOEFN7DN.js +295 -0
- package/dist/{chunk-7ZEGFL42.js → chunk-WHJSYKNC.js} +6 -6
- package/dist/chunk-WOEJ6K7M.js +55 -0
- package/dist/{chunk-AU3OOREM.js → chunk-XSSWYPP5.js} +16 -3
- package/dist/contract-line-item-money-B0Z3Ogur.d.cts +43 -0
- package/dist/contract-line-item-money-B0Z3Ogur.d.ts +43 -0
- package/dist/discovery/index.d.cts +2 -2
- package/dist/discovery/index.d.ts +2 -2
- package/dist/discovery/index.js +6 -6
- package/dist/{discovery.scanner-9cMqF95o.d.cts → discovery.scanner-DXKc6JkV.d.cts} +1 -1
- package/dist/{discovery.scanner-9cMqF95o.d.ts → discovery.scanner-DXKc6JkV.d.ts} +1 -1
- package/dist/{enforce-quota.interceptor-Df0e3OWe.d.cts → enforce-quota.interceptor-BFyVdWe8.d.cts} +6 -6
- package/dist/{enforce-quota.interceptor-DW3etVyI.d.ts → enforce-quota.interceptor-GaBXboGx.d.ts} +6 -6
- package/dist/entitlement/index.d.cts +27 -4
- package/dist/entitlement/index.d.ts +27 -4
- package/dist/entitlement/index.js +13 -8
- package/dist/index.d.cts +209 -28
- package/dist/index.d.ts +209 -28
- package/dist/index.js +285 -163
- package/dist/issuer-identity.check-CBO0vcsq.d.cts +197 -0
- package/dist/issuer-identity.check-Cz9CEMkZ.d.ts +197 -0
- package/dist/{module-options-COSEb0VW.d.ts → module-options-DmQ3G4sZ.d.ts} +135 -41
- package/dist/{module-options-BG3MzQva.d.cts → module-options-qAOwinHR.d.cts} +135 -41
- package/dist/payment-callback.service-CR84Xw1Z.d.cts +125 -0
- package/dist/payment-callback.service-CR84Xw1Z.d.ts +125 -0
- package/dist/payments/index.cjs +4 -0
- package/dist/payments/index.d.cts +187 -0
- package/dist/payments/index.d.ts +187 -0
- package/dist/payments/index.js +141 -0
- package/dist/payments.module-BdUq9ot_.d.cts +57 -0
- package/dist/payments.module-CQGv_VG7.d.ts +57 -0
- package/dist/plan-catalog-source-DWe-BGY1.d.cts +21 -0
- package/dist/plan-catalog-source-DWe-BGY1.d.ts +21 -0
- package/dist/{plan-resolution-Cgo_TR1H.d.cts → plan-resolution-CwUy_OqC.d.cts} +14 -0
- package/dist/{plan-resolution-Cgo_TR1H.d.ts → plan-resolution-CwUy_OqC.d.ts} +14 -0
- package/dist/{plan-versions.service-DChhbK6h.d.ts → plan-versions.service-C0N-Em2W.d.ts} +38 -64
- package/dist/{plan-versions.service-TPEtbN0r.d.cts → plan-versions.service-DARLh-qI.d.cts} +38 -64
- package/dist/platform/index.d.cts +52 -23
- package/dist/platform/index.d.ts +52 -23
- package/dist/platform/index.js +57 -36
- package/dist/promo/index.d.cts +23 -8
- package/dist/promo/index.d.ts +23 -8
- package/dist/promo/index.js +15 -7
- package/dist/{promo.module-DtvIycpt.d.cts → promo.module-CKkECmU8.d.cts} +9 -3
- package/dist/{promo.module-Z8h1PNX-.d.ts → promo.module-DuIJdK3U.d.ts} +9 -3
- package/dist/promo.service-BYBu6dy3.d.cts +215 -0
- package/dist/promo.service-CFjfF0Xm.d.ts +215 -0
- package/dist/registration/index.d.cts +104 -47
- package/dist/registration/index.d.ts +104 -47
- package/dist/registration/index.js +15 -9
- package/dist/subscriber/index.cjs +4 -0
- package/dist/subscriber/index.d.cts +28 -0
- package/dist/subscriber/index.d.ts +28 -0
- package/dist/subscriber/index.js +16 -0
- package/dist/subscriber.service-5W6Gi-1B.d.cts +68 -0
- package/dist/subscriber.service-5W6Gi-1B.d.ts +68 -0
- package/dist/subscription-contract/index.d.cts +4 -2
- package/dist/subscription-contract/index.d.ts +4 -2
- package/dist/subscription-contract/index.js +13 -5
- package/dist/{subscription-contract.module-fDFdQ0jm.d.ts → subscription-contract.module-BfIRpc1o.d.ts} +8 -2
- package/dist/{subscription-contract.module-CEK8HS5-.d.cts → subscription-contract.module-DTMuUJYd.d.cts} +8 -2
- package/dist/{subscription-contract.service-hD87MKyg.d.cts → subscription-contract.service-CPZrTM9C.d.ts} +32 -3
- package/dist/{subscription-contract.service-hD87MKyg.d.ts → subscription-contract.service-CfNApLuP.d.cts} +32 -3
- package/dist/tenant-billing.controller-BLqbsONe.d.ts +812 -0
- package/dist/tenant-billing.controller-DKbAqTbM.d.cts +812 -0
- package/dist/tenant-billing.module-ClbjzocC.d.cts +364 -0
- package/dist/tenant-billing.module-DohgJJ2m.d.ts +364 -0
- package/dist/tenant-billing.tokens-G-1xOlMr.d.cts +129 -0
- package/dist/tenant-billing.tokens-G-1xOlMr.d.ts +129 -0
- package/dist/testing/index.d.cts +44 -17
- package/dist/testing/index.d.ts +44 -17
- package/dist/testing/index.js +189 -40
- package/package.json +24 -4
- package/dist/catalog.module-BDDO6iwq.d.cts +0 -103
- package/dist/catalog.module-BTnMsE6u.d.ts +0 -103
- package/dist/checkout-offer.module-CMtiQJTT.d.ts +0 -39
- package/dist/checkout-offer.module-CVpWrzbe.d.cts +0 -39
- package/dist/checkout-offer.service-BLOv2HOo.d.cts +0 -49
- package/dist/checkout-offer.service-BLOv2HOo.d.ts +0 -49
- package/dist/chunk-57V6ZTI6.js +0 -22
- package/dist/chunk-BSK6YBLI.js +0 -87
- package/dist/chunk-DQKCK7DX.js +0 -217
- package/dist/chunk-VXEYLNIB.js +0 -632
- package/dist/chunk-WUDYIPYH.js +0 -715
- package/dist/define-saasicat-DROBe-b1.d.ts +0 -69
- package/dist/define-saasicat-vGBCkFys.d.cts +0 -69
- package/dist/promo.service-BJbKAmw3.d.cts +0 -112
- package/dist/promo.service-BJbKAmw3.d.ts +0 -112
- package/dist/tenant-billing.controller-BQ67mlmI.d.ts +0 -438
- package/dist/tenant-billing.controller-DS8kB8a7.d.cts +0 -438
- package/dist/tenant-billing.module-BznC3XtW.d.cts +0 -299
- package/dist/tenant-billing.module-wUbsQSFG.d.ts +0 -299
- /package/dist/{chunk-2FR6ZL7R.js → chunk-BHZOH2DY.js} +0 -0
- /package/dist/{chunk-2SLTRKXC.js → chunk-DFOW3JVO.js} +0 -0
- /package/dist/{chunk-DBZGV3HC.js → chunk-DU56UKEH.js} +0 -0
- /package/dist/{chunk-OYNHOY45.js → chunk-GAUEVIAE.js} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SubscriberRepository, PlanCatalogSettings, NewSubscriberDetails, TransactionContext, SubscriberRecord, SubscriptionContractParties, SubscriberContactChange, SubscriberIdentityCorrection, SubscriberCorrectionRecord } from '@saasicat/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The parties contracts are concluded with.
|
|
5
|
+
*
|
|
6
|
+
* SaaSiCat creates no tenants, so it cannot create their subscribers on its
|
|
7
|
+
* own: wherever an application creates a tenant that will hold a subscription,
|
|
8
|
+
* it calls `createForTenant` in the same transaction. Every way a contract
|
|
9
|
+
* arises then finds the party it is concluded with, and refuses without one.
|
|
10
|
+
*/
|
|
11
|
+
declare class SubscriberService {
|
|
12
|
+
private readonly repo;
|
|
13
|
+
private readonly settings;
|
|
14
|
+
constructor(repo: SubscriberRepository, settings: PlanCatalogSettings);
|
|
15
|
+
/**
|
|
16
|
+
* Creates the tenant's subscriber and assigns its customer number, behind
|
|
17
|
+
* the prefix `config/saas.yaml` names. With `tx` it is written on that
|
|
18
|
+
* transaction and undone with it — pass the one the tenant is created on.
|
|
19
|
+
*
|
|
20
|
+
* Refused with `SUBSCRIBER_ALREADY_EXISTS` when the tenant has one: a second
|
|
21
|
+
* party for the same tenant is not a correction of the first.
|
|
22
|
+
*/
|
|
23
|
+
createForTenant(tenantId: string, details: NewSubscriberDetails, tx?: TransactionContext): Promise<SubscriberRecord>;
|
|
24
|
+
/** The tenant's subscriber, or `null` when it has none. */
|
|
25
|
+
findByTenantId(tenantId: string, tx?: TransactionContext): Promise<SubscriberRecord | null>;
|
|
26
|
+
/** The tenant's subscriber, refused with `SUBSCRIBER_REQUIRED` when it has none. */
|
|
27
|
+
requireForTenant(tenantId: string, tx?: TransactionContext): Promise<SubscriberRecord>;
|
|
28
|
+
/**
|
|
29
|
+
* Who a contract concluded for this tenant now is between: its subscriber
|
|
30
|
+
* as the record stands, and the issuer as the running configuration names
|
|
31
|
+
* it. Refused with `SUBSCRIBER_REQUIRED` when the tenant has no subscriber.
|
|
32
|
+
*/
|
|
33
|
+
contractPartiesFor(tenantId: string, tx?: TransactionContext): Promise<SubscriptionContractParties>;
|
|
34
|
+
getById(subscriberId: string): Promise<SubscriberRecord>;
|
|
35
|
+
/**
|
|
36
|
+
* Changes how the subscriber is reached — the address, the country, the
|
|
37
|
+
* invoice email — at any time. A contract keeps the copy it was concluded
|
|
38
|
+
* with; what comes later reads the new details. The legal name and the tax
|
|
39
|
+
* identifiers are refused here: they change by `correctIdentity`.
|
|
40
|
+
*/
|
|
41
|
+
changeContact(subscriberId: string, change: SubscriberContactChange): Promise<SubscriberRecord>;
|
|
42
|
+
/**
|
|
43
|
+
* A tenant's own change of how its subscriber is reached, from its billing
|
|
44
|
+
* area. The address and the invoice email can be changed but not cleared —
|
|
45
|
+
* `SUBSCRIBER_DETAIL_INVALID` names the field — since without them nothing
|
|
46
|
+
* can be invoiced. The legal name and the tax identifiers are refused as
|
|
47
|
+
* with `changeContact`: they are the party, and only the operator corrects
|
|
48
|
+
* them.
|
|
49
|
+
*/
|
|
50
|
+
changeContactOfTenant(tenantId: string, change: SubscriberContactChange): Promise<SubscriberRecord>;
|
|
51
|
+
/** Writes contact details already settled; settling twice would check one copy and write another. */
|
|
52
|
+
private writeContact;
|
|
53
|
+
/**
|
|
54
|
+
* Corrects the legal identity of the same legal entity — a misspelt name, a
|
|
55
|
+
* wrong tax identifier, a change of name that entity went through — and
|
|
56
|
+
* records the values it replaced, the reason and who made it. A contract
|
|
57
|
+
* keeps the copy it was concluded with.
|
|
58
|
+
*
|
|
59
|
+
* The operator declares what the change is, because nothing here can tell:
|
|
60
|
+
* another legal entity taking over is a transfer, and is refused with
|
|
61
|
+
* `SUBSCRIBER_TAKEOVER_IS_A_TRANSFER` rather than recorded as an edit.
|
|
62
|
+
*/
|
|
63
|
+
correctIdentity(subscriberId: string, correction: SubscriberIdentityCorrection): Promise<SubscriberCorrectionRecord>;
|
|
64
|
+
/** Every correction of the subscriber's legal identity, the latest first. */
|
|
65
|
+
listCorrections(subscriberId: string): Promise<SubscriberCorrectionRecord[]>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { SubscriberService as S };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SubscriberRepository, PlanCatalogSettings, NewSubscriberDetails, TransactionContext, SubscriberRecord, SubscriptionContractParties, SubscriberContactChange, SubscriberIdentityCorrection, SubscriberCorrectionRecord } from '@saasicat/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The parties contracts are concluded with.
|
|
5
|
+
*
|
|
6
|
+
* SaaSiCat creates no tenants, so it cannot create their subscribers on its
|
|
7
|
+
* own: wherever an application creates a tenant that will hold a subscription,
|
|
8
|
+
* it calls `createForTenant` in the same transaction. Every way a contract
|
|
9
|
+
* arises then finds the party it is concluded with, and refuses without one.
|
|
10
|
+
*/
|
|
11
|
+
declare class SubscriberService {
|
|
12
|
+
private readonly repo;
|
|
13
|
+
private readonly settings;
|
|
14
|
+
constructor(repo: SubscriberRepository, settings: PlanCatalogSettings);
|
|
15
|
+
/**
|
|
16
|
+
* Creates the tenant's subscriber and assigns its customer number, behind
|
|
17
|
+
* the prefix `config/saas.yaml` names. With `tx` it is written on that
|
|
18
|
+
* transaction and undone with it — pass the one the tenant is created on.
|
|
19
|
+
*
|
|
20
|
+
* Refused with `SUBSCRIBER_ALREADY_EXISTS` when the tenant has one: a second
|
|
21
|
+
* party for the same tenant is not a correction of the first.
|
|
22
|
+
*/
|
|
23
|
+
createForTenant(tenantId: string, details: NewSubscriberDetails, tx?: TransactionContext): Promise<SubscriberRecord>;
|
|
24
|
+
/** The tenant's subscriber, or `null` when it has none. */
|
|
25
|
+
findByTenantId(tenantId: string, tx?: TransactionContext): Promise<SubscriberRecord | null>;
|
|
26
|
+
/** The tenant's subscriber, refused with `SUBSCRIBER_REQUIRED` when it has none. */
|
|
27
|
+
requireForTenant(tenantId: string, tx?: TransactionContext): Promise<SubscriberRecord>;
|
|
28
|
+
/**
|
|
29
|
+
* Who a contract concluded for this tenant now is between: its subscriber
|
|
30
|
+
* as the record stands, and the issuer as the running configuration names
|
|
31
|
+
* it. Refused with `SUBSCRIBER_REQUIRED` when the tenant has no subscriber.
|
|
32
|
+
*/
|
|
33
|
+
contractPartiesFor(tenantId: string, tx?: TransactionContext): Promise<SubscriptionContractParties>;
|
|
34
|
+
getById(subscriberId: string): Promise<SubscriberRecord>;
|
|
35
|
+
/**
|
|
36
|
+
* Changes how the subscriber is reached — the address, the country, the
|
|
37
|
+
* invoice email — at any time. A contract keeps the copy it was concluded
|
|
38
|
+
* with; what comes later reads the new details. The legal name and the tax
|
|
39
|
+
* identifiers are refused here: they change by `correctIdentity`.
|
|
40
|
+
*/
|
|
41
|
+
changeContact(subscriberId: string, change: SubscriberContactChange): Promise<SubscriberRecord>;
|
|
42
|
+
/**
|
|
43
|
+
* A tenant's own change of how its subscriber is reached, from its billing
|
|
44
|
+
* area. The address and the invoice email can be changed but not cleared —
|
|
45
|
+
* `SUBSCRIBER_DETAIL_INVALID` names the field — since without them nothing
|
|
46
|
+
* can be invoiced. The legal name and the tax identifiers are refused as
|
|
47
|
+
* with `changeContact`: they are the party, and only the operator corrects
|
|
48
|
+
* them.
|
|
49
|
+
*/
|
|
50
|
+
changeContactOfTenant(tenantId: string, change: SubscriberContactChange): Promise<SubscriberRecord>;
|
|
51
|
+
/** Writes contact details already settled; settling twice would check one copy and write another. */
|
|
52
|
+
private writeContact;
|
|
53
|
+
/**
|
|
54
|
+
* Corrects the legal identity of the same legal entity — a misspelt name, a
|
|
55
|
+
* wrong tax identifier, a change of name that entity went through — and
|
|
56
|
+
* records the values it replaced, the reason and who made it. A contract
|
|
57
|
+
* keeps the copy it was concluded with.
|
|
58
|
+
*
|
|
59
|
+
* The operator declares what the change is, because nothing here can tell:
|
|
60
|
+
* another legal entity taking over is a transfer, and is refused with
|
|
61
|
+
* `SUBSCRIBER_TAKEOVER_IS_A_TRANSFER` rather than recorded as an edit.
|
|
62
|
+
*/
|
|
63
|
+
correctIdentity(subscriberId: string, correction: SubscriberIdentityCorrection): Promise<SubscriberCorrectionRecord>;
|
|
64
|
+
/** Every correction of the subscriber's legal identity, the latest first. */
|
|
65
|
+
listCorrections(subscriberId: string): Promise<SubscriberCorrectionRecord[]>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { SubscriberService as S };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { C as CreateContractFromOfferOptions, S as SubscriptionContractService, c as contractLineItemToInvoiceLineItem, s as sortContractLineItemsForInvoice, a as subscriptionContractToInvoiceSnapshot } from '../subscription-contract.service-
|
|
2
|
-
export {
|
|
1
|
+
export { C as CreateContractFromOfferOptions, S as SubscriptionContractService, c as contractLineItemToInvoiceLineItem, s as sortContractLineItemsForInvoice, a as subscriptionContractToInvoiceSnapshot } from '../subscription-contract.service-CfNApLuP.cjs';
|
|
2
|
+
export { a as SubscriptionContractModule, S as SubscriptionContractModuleOptions } from '../subscription-contract.module-DTMuUJYd.cjs';
|
|
3
|
+
export { C as ContractLineMoney, a as ContractLineTotals, P as PricedContractLineItem, c as contractTotalsOf, r as recordContractLinesMoney } from '../contract-line-item-money-B0Z3Ogur.cjs';
|
|
3
4
|
import '@saasicat/core';
|
|
5
|
+
import '../subscriber.service-5W6Gi-1B.cjs';
|
|
4
6
|
import '@nestjs/common';
|
|
5
7
|
import '../di-CcNeq9v-.cjs';
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { C as CreateContractFromOfferOptions, S as SubscriptionContractService, c as contractLineItemToInvoiceLineItem, s as sortContractLineItemsForInvoice, a as subscriptionContractToInvoiceSnapshot } from '../subscription-contract.service-
|
|
2
|
-
export {
|
|
1
|
+
export { C as CreateContractFromOfferOptions, S as SubscriptionContractService, c as contractLineItemToInvoiceLineItem, s as sortContractLineItemsForInvoice, a as subscriptionContractToInvoiceSnapshot } from '../subscription-contract.service-CPZrTM9C.js';
|
|
2
|
+
export { a as SubscriptionContractModule, S as SubscriptionContractModuleOptions } from '../subscription-contract.module-BfIRpc1o.js';
|
|
3
|
+
export { C as ContractLineMoney, a as ContractLineTotals, P as PricedContractLineItem, c as contractTotalsOf, r as recordContractLinesMoney } from '../contract-line-item-money-B0Z3Ogur.js';
|
|
3
4
|
import '@saasicat/core';
|
|
5
|
+
import '../subscriber.service-5W6Gi-1B.js';
|
|
4
6
|
import '@nestjs/common';
|
|
5
7
|
import '../di-CcNeq9v-.js';
|
|
6
8
|
|
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-BHZOH2DY.js";
|
|
2
2
|
import {
|
|
3
3
|
SubscriptionContractModule
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-XSSWYPP5.js";
|
|
5
5
|
import {
|
|
6
6
|
SubscriptionContractService,
|
|
7
7
|
contractLineItemToInvoiceLineItem,
|
|
8
8
|
sortContractLineItemsForInvoice,
|
|
9
9
|
subscriptionContractToInvoiceSnapshot
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-BSK6YBLI.js";
|
|
10
|
+
} from "../chunk-NDLC5GYK.js";
|
|
12
11
|
import {
|
|
13
12
|
SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
|
|
14
13
|
} from "../chunk-VBRYPU7V.js";
|
|
15
|
-
import
|
|
14
|
+
import {
|
|
15
|
+
contractTotalsOf,
|
|
16
|
+
recordContractLinesMoney
|
|
17
|
+
} from "../chunk-6PJE7EWO.js";
|
|
18
|
+
import "../chunk-WOEJ6K7M.js";
|
|
19
|
+
import "../chunk-LF6J4YYN.js";
|
|
20
|
+
import "../chunk-FEQZCWUL.js";
|
|
21
|
+
import "../chunk-J7NJRK3K.js";
|
|
16
22
|
import "../chunk-SHUYVCID.js";
|
|
17
23
|
export {
|
|
18
24
|
SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN,
|
|
19
25
|
SubscriptionContractModule,
|
|
20
26
|
SubscriptionContractService,
|
|
21
27
|
contractLineItemToInvoiceLineItem,
|
|
28
|
+
contractTotalsOf,
|
|
29
|
+
recordContractLinesMoney,
|
|
22
30
|
sortContractLineItemsForInvoice,
|
|
23
31
|
subscriptionContractToInvoiceSnapshot
|
|
24
32
|
};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
|
|
2
|
-
import { SubscriptionContractRepository } from '@saasicat/core';
|
|
2
|
+
import { SubscriptionContractRepository, SubscriberRepository } from '@saasicat/core';
|
|
3
3
|
import { P as ProviderSpec } from './di-CcNeq9v-.js';
|
|
4
4
|
|
|
5
5
|
interface SubscriptionContractModuleOptions {
|
|
6
6
|
subscriptionContractRepository: ProviderSpec<SubscriptionContractRepository>;
|
|
7
|
+
/**
|
|
8
|
+
* The parties contracts are concluded with. The module provides
|
|
9
|
+
* `SubscriberService` over it as well, for the application's own tenant
|
|
10
|
+
* creation to call.
|
|
11
|
+
*/
|
|
12
|
+
subscriberRepository: ProviderSpec<SubscriberRepository>;
|
|
7
13
|
/** Modules that provide dependencies used by the repository factory. */
|
|
8
14
|
imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
|
|
9
15
|
extraProviders?: Provider[];
|
|
@@ -13,4 +19,4 @@ declare class SubscriptionContractModule {
|
|
|
13
19
|
static forRoot(options: SubscriptionContractModuleOptions): DynamicModule;
|
|
14
20
|
}
|
|
15
21
|
|
|
16
|
-
export {
|
|
22
|
+
export { type SubscriptionContractModuleOptions as S, SubscriptionContractModule as a };
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
|
|
2
|
-
import { SubscriptionContractRepository } from '@saasicat/core';
|
|
2
|
+
import { SubscriptionContractRepository, SubscriberRepository } from '@saasicat/core';
|
|
3
3
|
import { P as ProviderSpec } from './di-CcNeq9v-.cjs';
|
|
4
4
|
|
|
5
5
|
interface SubscriptionContractModuleOptions {
|
|
6
6
|
subscriptionContractRepository: ProviderSpec<SubscriptionContractRepository>;
|
|
7
|
+
/**
|
|
8
|
+
* The parties contracts are concluded with. The module provides
|
|
9
|
+
* `SubscriberService` over it as well, for the application's own tenant
|
|
10
|
+
* creation to call.
|
|
11
|
+
*/
|
|
12
|
+
subscriberRepository: ProviderSpec<SubscriberRepository>;
|
|
7
13
|
/** Modules that provide dependencies used by the repository factory. */
|
|
8
14
|
imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
|
|
9
15
|
extraProviders?: Provider[];
|
|
@@ -13,4 +19,4 @@ declare class SubscriptionContractModule {
|
|
|
13
19
|
static forRoot(options: SubscriptionContractModuleOptions): DynamicModule;
|
|
14
20
|
}
|
|
15
21
|
|
|
16
|
-
export {
|
|
22
|
+
export { type SubscriptionContractModuleOptions as S, SubscriptionContractModule as a };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SubscriptionContractRepository, SubscriptionContractRecord, SubscriptionContractInvoiceSnapshot, CreateSubscriptionContractData, TerminateSubscriptionContractData, CheckoutOfferRow, ContractLineItemRecord, InvoiceLineItemSnapshot } from '@saasicat/core';
|
|
1
|
+
import { SubscriptionContractRepository, SubscriptionContractRecord, SubscriptionContractInvoiceSnapshot, CreateSubscriptionContractData, TransactionContext, TerminateSubscriptionContractData, CheckoutOfferRow, ContractLineItemRecord, InvoiceLineItemSnapshot } from '@saasicat/core';
|
|
2
|
+
import { S as SubscriberService } from './subscriber.service-5W6Gi-1B.js';
|
|
2
3
|
|
|
3
4
|
interface CreateContractFromOfferOptions {
|
|
4
5
|
tenantId: string;
|
|
@@ -10,18 +11,46 @@ interface CreateContractFromOfferOptions {
|
|
|
10
11
|
}
|
|
11
12
|
declare class SubscriptionContractService {
|
|
12
13
|
private readonly repo;
|
|
13
|
-
|
|
14
|
+
private readonly subscribers;
|
|
15
|
+
constructor(repo: SubscriptionContractRepository, subscribers: SubscriberService);
|
|
14
16
|
list(filter: Parameters<SubscriptionContractRepository['list']>[0]): Promise<SubscriptionContractRecord[]>;
|
|
15
17
|
getById(contractId: string): Promise<SubscriptionContractRecord>;
|
|
16
18
|
findActiveByTenantId(tenantId: string, asOf?: Date): Promise<SubscriptionContractRecord | null>;
|
|
17
19
|
getActiveInvoiceSnapshotForTenant(tenantId: string, asOf?: Date): Promise<SubscriptionContractInvoiceSnapshot>;
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Writes the contract between the tenant's subscriber and the issuer
|
|
22
|
+
* `config/saas.yaml` names, copying both as they stand. With `tx`, the
|
|
23
|
+
* contract is written on that transaction and undone with it, and the
|
|
24
|
+
* subscriber is read there too — so one created earlier on the same
|
|
25
|
+
* transaction is found.
|
|
26
|
+
*
|
|
27
|
+
* Refused with `SUBSCRIBER_REQUIRED` for a tenant without a subscriber:
|
|
28
|
+
* nothing is agreed without the party to it.
|
|
29
|
+
*/
|
|
30
|
+
create(data: CreateSubscriptionContractData, tx?: TransactionContext): Promise<SubscriptionContractRecord>;
|
|
31
|
+
/**
|
|
32
|
+
* Refuses, with `SUBSCRIBER_REQUIRED`, a contract this tenant could not
|
|
33
|
+
* have. For callers that change something before the contract is written —
|
|
34
|
+
* closing the one in force, changing a plan — and must refuse before that
|
|
35
|
+
* rather than after.
|
|
36
|
+
*/
|
|
37
|
+
assertPartyFor(tenantId: string, tx?: TransactionContext): Promise<void>;
|
|
38
|
+
/** The contract concluded from a checkout offer, or `null` when none was. */
|
|
39
|
+
findByOriginalOfferId(offerId: string, tx?: TransactionContext): Promise<SubscriptionContractRecord | null>;
|
|
19
40
|
terminate(contractId: string, data: TerminateSubscriptionContractData): Promise<SubscriptionContractRecord>;
|
|
20
41
|
replaceActiveContract(tenantId: string, data: CreateSubscriptionContractData, terminateAt: Date): Promise<{
|
|
21
42
|
previous: SubscriptionContractRecord | null;
|
|
22
43
|
next: SubscriptionContractRecord;
|
|
23
44
|
}>;
|
|
24
45
|
createDataFromOffer(offer: CheckoutOfferRow, options: CreateContractFromOfferOptions): CreateSubscriptionContractData;
|
|
46
|
+
/**
|
|
47
|
+
* The contract an offer becomes, checked the way `create` checks it, before
|
|
48
|
+
* anything is written. Unlike `createDataFromOffer` it takes an offer that
|
|
49
|
+
* is still open: concluding an offer refuses a contract it could not create
|
|
50
|
+
* before the offer is consumed, rather than after.
|
|
51
|
+
*/
|
|
52
|
+
prepareFromOffer(offer: CheckoutOfferRow, options: CreateContractFromOfferOptions): CreateSubscriptionContractData;
|
|
53
|
+
private dataFromOffer;
|
|
25
54
|
createFromOffer(offer: CheckoutOfferRow, options: CreateContractFromOfferOptions): Promise<SubscriptionContractRecord>;
|
|
26
55
|
private lineItemsFromOffer;
|
|
27
56
|
private offerLineItemToContractLineItem;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SubscriptionContractRepository, SubscriptionContractRecord, SubscriptionContractInvoiceSnapshot, CreateSubscriptionContractData, TerminateSubscriptionContractData, CheckoutOfferRow, ContractLineItemRecord, InvoiceLineItemSnapshot } from '@saasicat/core';
|
|
1
|
+
import { SubscriptionContractRepository, SubscriptionContractRecord, SubscriptionContractInvoiceSnapshot, CreateSubscriptionContractData, TransactionContext, TerminateSubscriptionContractData, CheckoutOfferRow, ContractLineItemRecord, InvoiceLineItemSnapshot } from '@saasicat/core';
|
|
2
|
+
import { S as SubscriberService } from './subscriber.service-5W6Gi-1B.cjs';
|
|
2
3
|
|
|
3
4
|
interface CreateContractFromOfferOptions {
|
|
4
5
|
tenantId: string;
|
|
@@ -10,18 +11,46 @@ interface CreateContractFromOfferOptions {
|
|
|
10
11
|
}
|
|
11
12
|
declare class SubscriptionContractService {
|
|
12
13
|
private readonly repo;
|
|
13
|
-
|
|
14
|
+
private readonly subscribers;
|
|
15
|
+
constructor(repo: SubscriptionContractRepository, subscribers: SubscriberService);
|
|
14
16
|
list(filter: Parameters<SubscriptionContractRepository['list']>[0]): Promise<SubscriptionContractRecord[]>;
|
|
15
17
|
getById(contractId: string): Promise<SubscriptionContractRecord>;
|
|
16
18
|
findActiveByTenantId(tenantId: string, asOf?: Date): Promise<SubscriptionContractRecord | null>;
|
|
17
19
|
getActiveInvoiceSnapshotForTenant(tenantId: string, asOf?: Date): Promise<SubscriptionContractInvoiceSnapshot>;
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Writes the contract between the tenant's subscriber and the issuer
|
|
22
|
+
* `config/saas.yaml` names, copying both as they stand. With `tx`, the
|
|
23
|
+
* contract is written on that transaction and undone with it, and the
|
|
24
|
+
* subscriber is read there too — so one created earlier on the same
|
|
25
|
+
* transaction is found.
|
|
26
|
+
*
|
|
27
|
+
* Refused with `SUBSCRIBER_REQUIRED` for a tenant without a subscriber:
|
|
28
|
+
* nothing is agreed without the party to it.
|
|
29
|
+
*/
|
|
30
|
+
create(data: CreateSubscriptionContractData, tx?: TransactionContext): Promise<SubscriptionContractRecord>;
|
|
31
|
+
/**
|
|
32
|
+
* Refuses, with `SUBSCRIBER_REQUIRED`, a contract this tenant could not
|
|
33
|
+
* have. For callers that change something before the contract is written —
|
|
34
|
+
* closing the one in force, changing a plan — and must refuse before that
|
|
35
|
+
* rather than after.
|
|
36
|
+
*/
|
|
37
|
+
assertPartyFor(tenantId: string, tx?: TransactionContext): Promise<void>;
|
|
38
|
+
/** The contract concluded from a checkout offer, or `null` when none was. */
|
|
39
|
+
findByOriginalOfferId(offerId: string, tx?: TransactionContext): Promise<SubscriptionContractRecord | null>;
|
|
19
40
|
terminate(contractId: string, data: TerminateSubscriptionContractData): Promise<SubscriptionContractRecord>;
|
|
20
41
|
replaceActiveContract(tenantId: string, data: CreateSubscriptionContractData, terminateAt: Date): Promise<{
|
|
21
42
|
previous: SubscriptionContractRecord | null;
|
|
22
43
|
next: SubscriptionContractRecord;
|
|
23
44
|
}>;
|
|
24
45
|
createDataFromOffer(offer: CheckoutOfferRow, options: CreateContractFromOfferOptions): CreateSubscriptionContractData;
|
|
46
|
+
/**
|
|
47
|
+
* The contract an offer becomes, checked the way `create` checks it, before
|
|
48
|
+
* anything is written. Unlike `createDataFromOffer` it takes an offer that
|
|
49
|
+
* is still open: concluding an offer refuses a contract it could not create
|
|
50
|
+
* before the offer is consumed, rather than after.
|
|
51
|
+
*/
|
|
52
|
+
prepareFromOffer(offer: CheckoutOfferRow, options: CreateContractFromOfferOptions): CreateSubscriptionContractData;
|
|
53
|
+
private dataFromOffer;
|
|
25
54
|
createFromOffer(offer: CheckoutOfferRow, options: CreateContractFromOfferOptions): Promise<SubscriptionContractRecord>;
|
|
26
55
|
private lineItemsFromOffer;
|
|
27
56
|
private offerLineItemToContractLineItem;
|