@antelopejs/interface-dms-saas 0.2.3 → 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
@@ -46,8 +46,19 @@ Subpaths resolve through the `exports` map only, so consumers must compile with
46
46
 
47
47
  This package is released on its own workflow and must be published before the
48
48
  runtime module: `@antelopejs/dms-saas` depends on it through
49
- `>=<interface version> <1.0.0`, a range that only resolves once this package is
50
- released.
49
+ `>=<interface version> <0.<minor + 1>.0`, a range that only resolves once this
50
+ package is released. The runtime implements this interface, so it caps the range
51
+ below the next minor: a breaking minor of this package never reaches an older
52
+ dms-saas.
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).
51
62
 
52
63
  ## Upgrading
53
64
 
@@ -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"],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IACd,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;uCAAC;AAIhB;IAFP,IAAA,0CAAU,GAAE;IACZ,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;uCAAC;eA7Eb,IAAI;IADhB,IAAA,6CAAa,EAAC,sBAAc,EAAE,4BAAgB,CAAC;GACnC,IAAI,CA8EhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/interface-dms-saas",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Public interfaces for the DMS SaaS module",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@antelopejs/interface-data-api": ">=0.1.9 <1.0.0",
61
- "@antelopejs/interface-dms": ">=0.2.7 <1.0.0"
61
+ "@antelopejs/interface-dms": ">=0.3.1 <1.0.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@antelopejs/interface-core": ">=0.1.1 <1.0.0",