@antelopejs/interface-dms-saas 0.2.4 → 0.2.5
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
CHANGED
|
@@ -51,6 +51,15 @@ package is released. The runtime implements this interface, so it caps the range
|
|
|
51
51
|
below the next minor: a breaking minor of this package never reaches an older
|
|
52
52
|
dms-saas.
|
|
53
53
|
|
|
54
|
+
## Writing plans
|
|
55
|
+
|
|
56
|
+
A module may seed plans straight into the `db` plan table. It leaves
|
|
57
|
+
`Plan.paymentProviderRefs` empty on creation and never rewrites it: dms-saas
|
|
58
|
+
links every plan billed through Stripe to a matching Stripe product and price,
|
|
59
|
+
at startup and whenever the plan is offered or billed, and records what it
|
|
60
|
+
synced in `paymentProviderRefs.stripeSyncedTerms`. See
|
|
61
|
+
[Plans and Stripe](../dms-saas/README.md#plans-and-stripe).
|
|
62
|
+
|
|
54
63
|
## Upgrading
|
|
55
64
|
|
|
56
65
|
### Rows written by earlier builds
|
|
@@ -10,9 +10,25 @@ export interface PlanFeatureValue {
|
|
|
10
10
|
featureId: string;
|
|
11
11
|
value: unknown;
|
|
12
12
|
}
|
|
13
|
+
export interface PlanStripeProductTerms {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
taxCode: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PlanStripePriceTerms {
|
|
19
|
+
unitAmount: number;
|
|
20
|
+
currency: string;
|
|
21
|
+
interval: PlanInterval;
|
|
22
|
+
billingMode: PlanBillingMode;
|
|
23
|
+
}
|
|
24
|
+
export interface PlanStripeSyncedTerms {
|
|
25
|
+
product: PlanStripeProductTerms;
|
|
26
|
+
price: PlanStripePriceTerms;
|
|
27
|
+
}
|
|
13
28
|
export interface PlanProviderRefs {
|
|
14
29
|
stripeProductId?: string;
|
|
15
30
|
stripePriceId?: string;
|
|
31
|
+
stripeSyncedTerms?: PlanStripeSyncedTerms;
|
|
16
32
|
}
|
|
17
33
|
export declare class Plan extends Table {
|
|
18
34
|
_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.table.js","sourceRoot":"","sources":["../../../src/db/tables/plans.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAQmD;AACnD,mEAAuE;AAE1D,QAAA,cAAc,GAAG,OAAO,CAAC;AAEzB,QAAA,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,CAAU,CAAC;AAG5D,QAAA,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,CAAU,CAAC;AAG5C,QAAA,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"plans.table.js","sourceRoot":"","sources":["../../../src/db/tables/plans.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAQmD;AACnD,mEAAuE;AAE1D,QAAA,cAAc,GAAG,OAAO,CAAC;AAEzB,QAAA,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,CAAU,CAAC;AAG5D,QAAA,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,CAAU,CAAC;AAG5C,QAAA,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AA6CrD,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qCAAK;CA8E9B,CAAA;AA9EY,oBAAI;AAEP;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iCACI;AAGZ;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;kCACK;AAIb;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;kCACK;AAGb;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACY;AAIpB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sCACe;AAGvB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;mCACM;AAGd;IADP,IAA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