@happyvertical/smrt-subscriptions 0.57.35 → 0.57.37

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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-subscriptions",
5
- "packageVersion": "0.57.35",
5
+ "packageVersion": "0.57.37",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-subscriptions:SubscriptionPlanCollection": {
8
8
  "name": "subscriptionplancollection",
@@ -1115,22 +1115,38 @@
1115
1115
  "planKey": {
1116
1116
  "type": "text",
1117
1117
  "required": false,
1118
- "default": ""
1118
+ "default": "",
1119
+ "description": "A short code that identifies the plan, such as starter or pro.",
1120
+ "_meta": {
1121
+ "description": "A short code that identifies the plan, such as starter or pro."
1122
+ }
1119
1123
  },
1120
1124
  "name": {
1121
1125
  "type": "text",
1122
1126
  "required": false,
1123
- "default": ""
1127
+ "default": "",
1128
+ "description": "What the plan is called, as customers see it.",
1129
+ "_meta": {
1130
+ "description": "What the plan is called, as customers see it."
1131
+ }
1124
1132
  },
1125
1133
  "description": {
1126
1134
  "type": "text",
1127
1135
  "required": false,
1128
- "default": ""
1136
+ "default": "",
1137
+ "description": "A sentence or two about what the plan offers.",
1138
+ "_meta": {
1139
+ "description": "A sentence or two about what the plan offers."
1140
+ }
1129
1141
  },
1130
1142
  "status": {
1131
1143
  "type": "text",
1132
1144
  "required": false,
1133
1145
  "default": "active",
1146
+ "description": "Whether the plan is a draft, on sale (active) or archived.",
1147
+ "_meta": {
1148
+ "description": "Whether the plan is a draft, on sale (active) or archived."
1149
+ },
1134
1150
  "enum": [
1135
1151
  "active",
1136
1152
  "archived",
@@ -1140,22 +1156,38 @@
1140
1156
  "sortOrder": {
1141
1157
  "type": "integer",
1142
1158
  "required": false,
1143
- "default": 0
1159
+ "default": 0,
1160
+ "description": "Where the plan sits when plans are listed; lower numbers come first.",
1161
+ "_meta": {
1162
+ "description": "Where the plan sits when plans are listed; lower numbers come first."
1163
+ }
1144
1164
  },
1145
1165
  "priceAmount": {
1146
1166
  "type": "integer",
1147
1167
  "required": false,
1148
- "default": 0
1168
+ "default": 0,
1169
+ "description": "What the plan costs each billing period, in cents, as a whole number.",
1170
+ "_meta": {
1171
+ "description": "What the plan costs each billing period, in cents, as a whole number."
1172
+ }
1149
1173
  },
1150
1174
  "currency": {
1151
1175
  "type": "text",
1152
1176
  "required": false,
1153
- "default": "USD"
1177
+ "default": "USD",
1178
+ "description": "The currency the price is in, such as USD.",
1179
+ "_meta": {
1180
+ "description": "The currency the price is in, such as USD."
1181
+ }
1154
1182
  },
1155
1183
  "billingInterval": {
1156
1184
  "type": "text",
1157
1185
  "required": false,
1158
1186
  "default": "month",
1187
+ "description": "How often the subscriber is billed: every day, week, month or year.",
1188
+ "_meta": {
1189
+ "description": "How often the subscriber is billed: every day, week, month or year."
1190
+ },
1159
1191
  "enum": [
1160
1192
  "day",
1161
1193
  "week",
@@ -1167,6 +1199,10 @@
1167
1199
  "type": "text",
1168
1200
  "required": false,
1169
1201
  "default": "fixed",
1202
+ "description": "Whether the plan is free, has a fixed price, or lets the subscriber choose what to pay. It cannot change once the plan is saved.",
1203
+ "_meta": {
1204
+ "description": "Whether the plan is free, has a fixed price, or lets the subscriber choose what to pay. It cannot change once the plan is saved."
1205
+ },
1170
1206
  "enum": [
1171
1207
  "free",
1172
1208
  "fixed",
@@ -1176,12 +1212,20 @@
1176
1212
  "minimumAmount": {
1177
1213
  "type": "integer",
1178
1214
  "required": false,
1179
- "default": 0
1215
+ "default": 0,
1216
+ "description": "For a pay-what-you-can plan, the least a subscriber may pay, in cents.",
1217
+ "_meta": {
1218
+ "description": "For a pay-what-you-can plan, the least a subscriber may pay, in cents."
1219
+ }
1180
1220
  },
1181
1221
  "suggestedAmount": {
1182
1222
  "type": "integer",
1183
1223
  "required": false,
1184
- "default": 0
1224
+ "default": 0,
1225
+ "description": "For a pay-what-you-can plan, the amount suggested to the subscriber, in cents.",
1226
+ "_meta": {
1227
+ "description": "For a pay-what-you-can plan, the amount suggested to the subscriber, in cents."
1228
+ }
1185
1229
  },
1186
1230
  "externalProvider": {
1187
1231
  "type": "text",
@@ -1591,31 +1635,55 @@
1591
1635
  "planId": {
1592
1636
  "type": "foreignKey",
1593
1637
  "required": false,
1594
- "related": "SubscriptionPlan"
1638
+ "related": "SubscriptionPlan",
1639
+ "description": "The plan this version belongs to.",
1640
+ "_meta": {
1641
+ "description": "The plan this version belongs to."
1642
+ }
1595
1643
  },
1596
1644
  "planKey": {
1597
1645
  "type": "text",
1598
1646
  "required": false,
1599
- "default": ""
1647
+ "default": "",
1648
+ "description": "The plan code at the time this version was published.",
1649
+ "_meta": {
1650
+ "description": "The plan code at the time this version was published."
1651
+ }
1600
1652
  },
1601
1653
  "version": {
1602
1654
  "type": "integer",
1603
1655
  "required": false,
1604
- "default": 0
1656
+ "default": 0,
1657
+ "description": "Which version of the plan this is, counting from 1.",
1658
+ "_meta": {
1659
+ "description": "Which version of the plan this is, counting from 1."
1660
+ }
1605
1661
  },
1606
1662
  "effectiveFrom": {
1607
1663
  "type": "datetime",
1608
- "required": false
1664
+ "required": false,
1665
+ "description": "The date and time from which these terms apply.",
1666
+ "_meta": {
1667
+ "description": "The date and time from which these terms apply."
1668
+ }
1609
1669
  },
1610
1670
  "name": {
1611
1671
  "type": "text",
1612
1672
  "required": false,
1613
- "default": ""
1673
+ "default": "",
1674
+ "description": "What the plan was called when this version was published.",
1675
+ "_meta": {
1676
+ "description": "What the plan was called when this version was published."
1677
+ }
1614
1678
  },
1615
1679
  "status": {
1616
1680
  "type": "text",
1617
1681
  "required": false,
1618
1682
  "default": "active",
1683
+ "description": "Whether the plan was a draft, on sale (active) or archived under this version.",
1684
+ "_meta": {
1685
+ "description": "Whether the plan was a draft, on sale (active) or archived under this version."
1686
+ },
1619
1687
  "enum": [
1620
1688
  "active",
1621
1689
  "archived",
@@ -1625,17 +1693,29 @@
1625
1693
  "priceAmount": {
1626
1694
  "type": "integer",
1627
1695
  "required": false,
1628
- "default": 0
1696
+ "default": 0,
1697
+ "description": "What the plan cost each billing period under this version, in cents.",
1698
+ "_meta": {
1699
+ "description": "What the plan cost each billing period under this version, in cents."
1700
+ }
1629
1701
  },
1630
1702
  "currency": {
1631
1703
  "type": "text",
1632
1704
  "required": false,
1633
- "default": "USD"
1705
+ "default": "USD",
1706
+ "description": "The currency the price is in, such as USD.",
1707
+ "_meta": {
1708
+ "description": "The currency the price is in, such as USD."
1709
+ }
1634
1710
  },
1635
1711
  "billingInterval": {
1636
1712
  "type": "text",
1637
1713
  "required": false,
1638
1714
  "default": "month",
1715
+ "description": "How often the subscriber was billed: every day, week, month or year.",
1716
+ "_meta": {
1717
+ "description": "How often the subscriber was billed: every day, week, month or year."
1718
+ },
1639
1719
  "enum": [
1640
1720
  "day",
1641
1721
  "week",
@@ -1647,6 +1727,10 @@
1647
1727
  "type": "text",
1648
1728
  "required": false,
1649
1729
  "default": "fixed",
1730
+ "description": "Whether the plan was free, had a fixed price, or let the subscriber choose what to pay.",
1731
+ "_meta": {
1732
+ "description": "Whether the plan was free, had a fixed price, or let the subscriber choose what to pay."
1733
+ },
1650
1734
  "enum": [
1651
1735
  "free",
1652
1736
  "fixed",
@@ -1656,12 +1740,20 @@
1656
1740
  "minimumAmount": {
1657
1741
  "type": "integer",
1658
1742
  "required": false,
1659
- "default": 0
1743
+ "default": 0,
1744
+ "description": "For a pay-what-you-can plan, the least a subscriber could pay, in cents.",
1745
+ "_meta": {
1746
+ "description": "For a pay-what-you-can plan, the least a subscriber could pay, in cents."
1747
+ }
1660
1748
  },
1661
1749
  "suggestedAmount": {
1662
1750
  "type": "integer",
1663
1751
  "required": false,
1664
- "default": 0
1752
+ "default": 0,
1753
+ "description": "For a pay-what-you-can plan, the amount suggested to the subscriber, in cents.",
1754
+ "_meta": {
1755
+ "description": "For a pay-what-you-can plan, the amount suggested to the subscriber, in cents."
1756
+ }
1665
1757
  },
1666
1758
  "features": {
1667
1759
  "type": "text",
@@ -1934,6 +2026,10 @@
1934
2026
  "type": "text",
1935
2027
  "required": false,
1936
2028
  "default": "tenant",
2029
+ "description": "Whether the subscriber is your own workspace (tenant) or an outside customer (external).",
2030
+ "_meta": {
2031
+ "description": "Whether the subscriber is your own workspace (tenant) or an outside customer (external)."
2032
+ },
1937
2033
  "enum": [
1938
2034
  "tenant",
1939
2035
  "external"
@@ -1942,17 +2038,29 @@
1942
2038
  "subscriberExternalId": {
1943
2039
  "type": "text",
1944
2040
  "required": false,
1945
- "default": ""
2041
+ "default": "",
2042
+ "description": "Who the outside subscriber is, when the subscriber type is external.",
2043
+ "_meta": {
2044
+ "description": "Who the outside subscriber is, when the subscriber type is external."
2045
+ }
1946
2046
  },
1947
2047
  "planId": {
1948
2048
  "type": "foreignKey",
1949
2049
  "required": false,
1950
- "related": "SubscriptionPlan"
2050
+ "related": "SubscriptionPlan",
2051
+ "description": "The plan this subscription is for.",
2052
+ "_meta": {
2053
+ "description": "The plan this subscription is for."
2054
+ }
1951
2055
  },
1952
2056
  "status": {
1953
2057
  "type": "text",
1954
2058
  "required": false,
1955
2059
  "default": "incomplete",
2060
+ "description": "Where the subscription stands: incomplete, trialing, active, past due, unpaid or cancelled.",
2061
+ "_meta": {
2062
+ "description": "Where the subscription stands: incomplete, trialing, active, past due, unpaid or cancelled."
2063
+ },
1956
2064
  "enum": [
1957
2065
  "active",
1958
2066
  "canceled",
@@ -1964,37 +2072,69 @@
1964
2072
  },
1965
2073
  "startedAt": {
1966
2074
  "type": "datetime",
1967
- "required": false
2075
+ "required": false,
2076
+ "description": "The day the subscription began.",
2077
+ "_meta": {
2078
+ "description": "The day the subscription began."
2079
+ }
1968
2080
  },
1969
2081
  "currentPeriodStart": {
1970
2082
  "type": "datetime",
1971
- "required": false
2083
+ "required": false,
2084
+ "description": "When the current billing period began.",
2085
+ "_meta": {
2086
+ "description": "When the current billing period began."
2087
+ }
1972
2088
  },
1973
2089
  "currentPeriodEnd": {
1974
2090
  "type": "datetime",
1975
- "required": false
2091
+ "required": false,
2092
+ "description": "When the current billing period ends and the next one is due.",
2093
+ "_meta": {
2094
+ "description": "When the current billing period ends and the next one is due."
2095
+ }
1976
2096
  },
1977
2097
  "trialEndsAt": {
1978
2098
  "type": "datetime",
1979
- "required": false
2099
+ "required": false,
2100
+ "description": "When the free trial ends, if there is one.",
2101
+ "_meta": {
2102
+ "description": "When the free trial ends, if there is one."
2103
+ }
1980
2104
  },
1981
2105
  "cancelAtPeriodEnd": {
1982
2106
  "type": "boolean",
1983
2107
  "required": false,
1984
- "default": false
2108
+ "default": false,
2109
+ "description": "Tick to let the subscription run out at the end of the current period instead of renewing.",
2110
+ "_meta": {
2111
+ "description": "Tick to let the subscription run out at the end of the current period instead of renewing."
2112
+ }
1985
2113
  },
1986
2114
  "canceledAt": {
1987
2115
  "type": "datetime",
1988
- "required": false
2116
+ "required": false,
2117
+ "description": "When the subscription was cancelled.",
2118
+ "_meta": {
2119
+ "description": "When the subscription was cancelled."
2120
+ }
1989
2121
  },
1990
2122
  "agreedAmount": {
1991
2123
  "type": "integer",
1992
- "required": false
2124
+ "required": false,
2125
+ "description": "For a pay-what-you-can plan, the amount the subscriber chose to pay, in cents.",
2126
+ "_meta": {
2127
+ "description": "For a pay-what-you-can plan, the amount the subscriber chose to pay, in cents."
2128
+ }
1993
2129
  },
1994
2130
  "planVersionId": {
1995
2131
  "type": "foreignKey",
1996
2132
  "required": false,
1997
- "related": "SubscriptionPlanVersion"
2133
+ "related": "SubscriptionPlanVersion",
2134
+ "description": "The version of the plan terms this subscription is held to for the current period. It is kept up to date automatically.",
2135
+ "_meta": {
2136
+ "description": "The version of the plan terms this subscription is held to for the current period. It is kept up to date automatically."
2137
+ }
1998
2138
  },
1999
2139
  "planVersionPinnedAt": {
2000
2140
  "type": "datetime",
@@ -2967,32 +3107,56 @@
2967
3107
  "provider": {
2968
3108
  "type": "text",
2969
3109
  "required": false,
2970
- "default": ""
3110
+ "default": "",
3111
+ "description": "Who supplied the service that was used.",
3112
+ "_meta": {
3113
+ "description": "Who supplied the service that was used."
3114
+ }
2971
3115
  },
2972
3116
  "serviceKey": {
2973
3117
  "type": "text",
2974
3118
  "required": false,
2975
- "default": ""
3119
+ "default": "",
3120
+ "description": "The service that was used.",
3121
+ "_meta": {
3122
+ "description": "The service that was used."
3123
+ }
2976
3124
  },
2977
3125
  "metricKey": {
2978
3126
  "type": "text",
2979
3127
  "required": false,
2980
- "default": ""
3128
+ "default": "",
3129
+ "description": "What was used, such as messages sent or minutes of audio.",
3130
+ "_meta": {
3131
+ "description": "What was used, such as messages sent or minutes of audio."
3132
+ }
2981
3133
  },
2982
3134
  "quantity": {
2983
3135
  "type": "decimal",
2984
3136
  "required": false,
2985
- "default": 0
3137
+ "default": 0,
3138
+ "description": "How much of it was used.",
3139
+ "_meta": {
3140
+ "description": "How much of it was used."
3141
+ }
2986
3142
  },
2987
3143
  "amount": {
2988
3144
  "type": "integer",
2989
3145
  "required": false,
2990
- "default": 0
3146
+ "default": 0,
3147
+ "description": "What it cost, in cents.",
3148
+ "_meta": {
3149
+ "description": "What it cost, in cents."
3150
+ }
2991
3151
  },
2992
3152
  "currency": {
2993
3153
  "type": "text",
2994
3154
  "required": false,
2995
- "default": "USD"
3155
+ "default": "USD",
3156
+ "description": "The currency the amount is in, such as USD.",
3157
+ "_meta": {
3158
+ "description": "The currency the amount is in, such as USD."
3159
+ }
2996
3160
  },
2997
3161
  "pricingRuleId": {
2998
3162
  "type": "foreignKey",
@@ -3013,6 +3177,10 @@
3013
3177
  "type": "text",
3014
3178
  "required": false,
3015
3179
  "default": "draft",
3180
+ "description": "Where the charge stands: draft, approved or adjusted.",
3181
+ "_meta": {
3182
+ "description": "Where the charge stands: draft, approved or adjusted."
3183
+ },
3016
3184
  "enum": [
3017
3185
  "draft",
3018
3186
  "approved",
@@ -3021,7 +3189,11 @@
3021
3189
  },
3022
3190
  "approvedAt": {
3023
3191
  "type": "datetime",
3024
- "required": false
3192
+ "required": false,
3193
+ "description": "When the charge was approved.",
3194
+ "_meta": {
3195
+ "description": "When the charge was approved."
3196
+ }
3025
3197
  }
3026
3198
  },
3027
3199
  "methods": {
@@ -6150,6 +6322,379 @@
6150
6322
  }
6151
6323
  },
6152
6324
  "moduleType": "smrt",
6325
+ "recipes": [
6326
+ {
6327
+ "id": "subscriptions.plans",
6328
+ "className": "SubscriptionPlansRecipe",
6329
+ "label": "Subscriptions",
6330
+ "summary": "Sell plans that renew, see who is subscribed to which, and what their usage cost.",
6331
+ "synonyms": [
6332
+ "subscriptions",
6333
+ "subscription plans",
6334
+ "plans",
6335
+ "memberships",
6336
+ "recurring billing",
6337
+ "pricing tiers"
6338
+ ],
6339
+ "models": [
6340
+ "@happyvertical/smrt-subscriptions:SubscriptionPlan",
6341
+ "@happyvertical/smrt-subscriptions:SubscriptionPlanVersion",
6342
+ "@happyvertical/smrt-subscriptions:TenantSubscription",
6343
+ "@happyvertical/smrt-subscriptions:ClientCharge"
6344
+ ],
6345
+ "nav": [
6346
+ {
6347
+ "label": "Plans",
6348
+ "model": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
6349
+ "icon": "tag",
6350
+ "description": "The plans you sell, with their price and how often they bill.",
6351
+ "noun": "plan"
6352
+ },
6353
+ {
6354
+ "label": "Subscriptions",
6355
+ "model": "@happyvertical/smrt-subscriptions:TenantSubscription",
6356
+ "icon": "repeat",
6357
+ "description": "Who is subscribed to which plan, and where each one stands.",
6358
+ "noun": "subscription"
6359
+ },
6360
+ {
6361
+ "label": "Plan versions",
6362
+ "model": "@happyvertical/smrt-subscriptions:SubscriptionPlanVersion",
6363
+ "icon": "fileText",
6364
+ "description": "Every set of terms a plan has had, and from when each applied.",
6365
+ "noun": "plan version"
6366
+ },
6367
+ {
6368
+ "label": "Charges",
6369
+ "model": "@happyvertical/smrt-subscriptions:ClientCharge",
6370
+ "icon": "receipt",
6371
+ "description": "What each subscriber used and what it cost them.",
6372
+ "noun": "charge"
6373
+ }
6374
+ ],
6375
+ "requires": [],
6376
+ "section": {
6377
+ "id": "sales",
6378
+ "label": "Sales",
6379
+ "icon": "shoppingBag",
6380
+ "description": "Customers, orders and quotes: everything you sell."
6381
+ },
6382
+ "options": {
6383
+ "@happyvertical/smrt-subscriptions:SubscriptionPlan": {
6384
+ "fields": {
6385
+ "name": {
6386
+ "order": 1
6387
+ },
6388
+ "planKey": {
6389
+ "label": "Plan code",
6390
+ "order": 2
6391
+ },
6392
+ "description": {
6393
+ "order": 3
6394
+ },
6395
+ "status": {
6396
+ "order": 4
6397
+ },
6398
+ "priceAmount": {
6399
+ "label": "Price (in cents)",
6400
+ "order": 5
6401
+ },
6402
+ "currency": {
6403
+ "order": 6
6404
+ },
6405
+ "billingInterval": {
6406
+ "label": "Billed every",
6407
+ "order": 7
6408
+ },
6409
+ "pricingMode": {
6410
+ "label": "How it is priced",
6411
+ "order": 8
6412
+ },
6413
+ "minimumAmount": {
6414
+ "label": "Minimum (in cents)",
6415
+ "visibility": "advanced"
6416
+ },
6417
+ "suggestedAmount": {
6418
+ "label": "Suggested (in cents)",
6419
+ "visibility": "advanced"
6420
+ },
6421
+ "sortOrder": {
6422
+ "label": "Position in list",
6423
+ "visibility": "advanced"
6424
+ },
6425
+ "tenantId": {
6426
+ "visibility": "hidden"
6427
+ },
6428
+ "features": {
6429
+ "visibility": "hidden"
6430
+ },
6431
+ "thresholds": {
6432
+ "visibility": "hidden"
6433
+ },
6434
+ "externalProvider": {
6435
+ "visibility": "hidden"
6436
+ },
6437
+ "providerProductId": {
6438
+ "visibility": "hidden"
6439
+ },
6440
+ "providerPriceId": {
6441
+ "visibility": "hidden"
6442
+ },
6443
+ "stripeProductId": {
6444
+ "visibility": "hidden"
6445
+ },
6446
+ "stripePriceId": {
6447
+ "visibility": "hidden"
6448
+ },
6449
+ "metadata": {
6450
+ "visibility": "hidden"
6451
+ }
6452
+ }
6453
+ },
6454
+ "@happyvertical/smrt-subscriptions:SubscriptionPlanVersion": {
6455
+ "fields": {
6456
+ "planId": {
6457
+ "label": "Plan",
6458
+ "order": 1
6459
+ },
6460
+ "version": {
6461
+ "label": "Version number",
6462
+ "order": 2
6463
+ },
6464
+ "effectiveFrom": {
6465
+ "label": "In force from",
6466
+ "order": 3
6467
+ },
6468
+ "name": {
6469
+ "order": 4
6470
+ },
6471
+ "status": {
6472
+ "order": 5
6473
+ },
6474
+ "priceAmount": {
6475
+ "label": "Price (in cents)",
6476
+ "order": 6
6477
+ },
6478
+ "currency": {
6479
+ "order": 7
6480
+ },
6481
+ "billingInterval": {
6482
+ "label": "Billed every",
6483
+ "order": 8
6484
+ },
6485
+ "planKey": {
6486
+ "label": "Plan code",
6487
+ "visibility": "advanced"
6488
+ },
6489
+ "pricingMode": {
6490
+ "label": "How it is priced",
6491
+ "visibility": "advanced"
6492
+ },
6493
+ "minimumAmount": {
6494
+ "label": "Minimum (in cents)",
6495
+ "visibility": "advanced"
6496
+ },
6497
+ "suggestedAmount": {
6498
+ "label": "Suggested (in cents)",
6499
+ "visibility": "advanced"
6500
+ },
6501
+ "tenantId": {
6502
+ "visibility": "hidden"
6503
+ },
6504
+ "features": {
6505
+ "visibility": "hidden"
6506
+ },
6507
+ "thresholds": {
6508
+ "visibility": "hidden"
6509
+ }
6510
+ }
6511
+ },
6512
+ "@happyvertical/smrt-subscriptions:TenantSubscription": {
6513
+ "fields": {
6514
+ "planId": {
6515
+ "label": "Plan",
6516
+ "order": 1
6517
+ },
6518
+ "status": {
6519
+ "order": 2
6520
+ },
6521
+ "startedAt": {
6522
+ "label": "Started on",
6523
+ "order": 3
6524
+ },
6525
+ "currentPeriodStart": {
6526
+ "label": "Current period starts",
6527
+ "order": 4
6528
+ },
6529
+ "currentPeriodEnd": {
6530
+ "label": "Current period ends",
6531
+ "order": 5
6532
+ },
6533
+ "trialEndsAt": {
6534
+ "label": "Trial ends",
6535
+ "order": 6
6536
+ },
6537
+ "cancelAtPeriodEnd": {
6538
+ "label": "Cancel at end of period",
6539
+ "order": 7
6540
+ },
6541
+ "canceledAt": {
6542
+ "label": "Cancelled on",
6543
+ "visibility": "advanced"
6544
+ },
6545
+ "agreedAmount": {
6546
+ "label": "Agreed amount (in cents)",
6547
+ "visibility": "advanced"
6548
+ },
6549
+ "subscriberKind": {
6550
+ "label": "Subscriber type",
6551
+ "visibility": "advanced"
6552
+ },
6553
+ "subscriberExternalId": {
6554
+ "label": "Outside subscriber",
6555
+ "visibility": "advanced"
6556
+ },
6557
+ "planVersionId": {
6558
+ "label": "Plan version",
6559
+ "visibility": "advanced",
6560
+ "locked": true
6561
+ },
6562
+ "tenantId": {
6563
+ "visibility": "hidden"
6564
+ },
6565
+ "planVersionPinnedAt": {
6566
+ "visibility": "hidden"
6567
+ },
6568
+ "planVersionPinReason": {
6569
+ "visibility": "hidden"
6570
+ },
6571
+ "planVersionPinNote": {
6572
+ "visibility": "hidden"
6573
+ },
6574
+ "retainsPaidPeriod": {
6575
+ "visibility": "hidden"
6576
+ },
6577
+ "externalProvider": {
6578
+ "visibility": "hidden"
6579
+ },
6580
+ "stripeCustomerId": {
6581
+ "visibility": "hidden"
6582
+ },
6583
+ "stripeSubscriptionId": {
6584
+ "visibility": "hidden"
6585
+ },
6586
+ "stripeCheckoutSessionId": {
6587
+ "visibility": "hidden"
6588
+ },
6589
+ "metadata": {
6590
+ "visibility": "hidden"
6591
+ }
6592
+ }
6593
+ },
6594
+ "@happyvertical/smrt-subscriptions:ClientCharge": {
6595
+ "fields": {
6596
+ "metricKey": {
6597
+ "label": "What was used",
6598
+ "order": 1
6599
+ },
6600
+ "quantity": {
6601
+ "label": "How much",
6602
+ "order": 2
6603
+ },
6604
+ "amount": {
6605
+ "label": "Amount (in cents)",
6606
+ "order": 3
6607
+ },
6608
+ "currency": {
6609
+ "order": 4
6610
+ },
6611
+ "status": {
6612
+ "order": 5
6613
+ },
6614
+ "approvedAt": {
6615
+ "label": "Approved on",
6616
+ "order": 6
6617
+ },
6618
+ "serviceKey": {
6619
+ "label": "Service",
6620
+ "visibility": "advanced"
6621
+ },
6622
+ "provider": {
6623
+ "visibility": "advanced"
6624
+ },
6625
+ "tenantId": {
6626
+ "visibility": "hidden"
6627
+ },
6628
+ "usageEventId": {
6629
+ "visibility": "hidden"
6630
+ },
6631
+ "usageTenantId": {
6632
+ "visibility": "hidden"
6633
+ },
6634
+ "subscriberKind": {
6635
+ "visibility": "hidden"
6636
+ },
6637
+ "subscriberExternalId": {
6638
+ "visibility": "hidden"
6639
+ },
6640
+ "projectId": {
6641
+ "visibility": "hidden"
6642
+ },
6643
+ "workRefType": {
6644
+ "visibility": "hidden"
6645
+ },
6646
+ "workRefId": {
6647
+ "visibility": "hidden"
6648
+ },
6649
+ "pricingRuleId": {
6650
+ "visibility": "hidden"
6651
+ },
6652
+ "priceBookId": {
6653
+ "visibility": "hidden"
6654
+ },
6655
+ "pricingSnapshot": {
6656
+ "visibility": "hidden"
6657
+ }
6658
+ }
6659
+ }
6660
+ },
6661
+ "help": {
6662
+ "markdown": "## Overview\n\nSubscriptions is where you sell plans that renew. A plan says what it costs,\nhow often it bills and whether it is free, a fixed price or pay what you can.\nA subscription joins a subscriber to a plan and shows where it stands, from\ntrial to active to cancelled. Every time you change a plan's terms, the\nearlier terms are kept as a plan version, so a subscriber who already paid for\na period keeps what they paid for until it renews. Charges show what each\nsubscriber used and what it cost them.\n\nAll amounts are whole numbers of cents, with no decimal point.\n\n## Tasks\n\n### Set up a plan\n\n1. Open the plans and choose **New**.\n2. Type the **{field:SubscriptionPlan.name}** customers will see and a short **{field:SubscriptionPlan.planKey}** such as \"starter\".\n3. Choose **{field:SubscriptionPlan.pricingMode}**: free, a fixed price, or pay what you can. This cannot change once the plan is saved; make a new plan instead.\n4. For a fixed price, enter the **{field:SubscriptionPlan.priceAmount}** in cents and the **{field:SubscriptionPlan.currency}**.\n5. Set how often it bills in **{field:SubscriptionPlan.billingInterval}**.\n6. Set the **{field:SubscriptionPlan.status}** to active when it is ready to sell.\n7. Save.\n\n### Change a plan's price or terms\n\n1. Open the plan and edit the **{field:SubscriptionPlan.priceAmount}**, **{field:SubscriptionPlan.billingInterval}** or **{field:SubscriptionPlan.status}**.\n2. Save. The new terms apply to new subscribers and to existing ones from their next renewal; a period already paid for keeps its old terms.\n\n### Retire a plan\n\n1. Open the plan and set its **{field:SubscriptionPlan.status}** to archived.\n2. Save. No one new can subscribe to it; existing subscribers keep going until they cancel.\n\n### Subscribe someone to a plan\n\n1. Open the subscriptions and choose **New**.\n2. Pick the **{field:TenantSubscription.planId}**.\n3. Enter the day it **{field:TenantSubscription.startedAt}** and, if there is a free trial, when the **{field:TenantSubscription.trialEndsAt}**.\n4. Save. The **{field:TenantSubscription.status}** shows where the subscription stands once it has been paid for.\n\n### See where a subscription stands\n\n1. Open the subscriptions and find the one you want.\n2. The **{field:TenantSubscription.status}** shows whether it is still incomplete, on trial, active, past due, unpaid or cancelled.\n3. **{field:TenantSubscription.currentPeriodStart}** and **{field:TenantSubscription.currentPeriodEnd}** show the period that has been paid for.\n\n### Cancel a subscription\n\n1. Open the subscription.\n2. Tick **{field:TenantSubscription.cancelAtPeriodEnd}** so it runs out when the current period ends instead of renewing.\n3. Save.\n\n### Look up the terms a subscriber was sold\n\nPlan versions are written automatically whenever a plan is saved with changed\nterms; you cannot add or edit them here.\n\n1. Open the plan versions and find the **{field:SubscriptionPlanVersion.planId}** you are interested in.\n2. Each row shows the **{field:SubscriptionPlanVersion.version}** and the date it was **{field:SubscriptionPlanVersion.effectiveFrom}**.\n3. Read the **{field:SubscriptionPlanVersion.priceAmount}**, **{field:SubscriptionPlanVersion.currency}** and **{field:SubscriptionPlanVersion.billingInterval}** that applied under it.\n\n### See what a subscriber was charged\n\nCharges are created by the usage and billing service as usage is recorded;\nyou cannot add or edit them here.\n\n1. Open the charges.\n2. Each row shows **{field:ClientCharge.metricKey}**, **{field:ClientCharge.quantity}** and the **{field:ClientCharge.amount}** in cents.\n3. The **{field:ClientCharge.status}** shows whether the charge is still a draft, approved or adjusted.\n",
6663
+ "fieldRefs": [
6664
+ "ClientCharge.amount",
6665
+ "ClientCharge.metricKey",
6666
+ "ClientCharge.quantity",
6667
+ "ClientCharge.status",
6668
+ "SubscriptionPlan.billingInterval",
6669
+ "SubscriptionPlan.currency",
6670
+ "SubscriptionPlan.name",
6671
+ "SubscriptionPlan.planKey",
6672
+ "SubscriptionPlan.priceAmount",
6673
+ "SubscriptionPlan.pricingMode",
6674
+ "SubscriptionPlan.status",
6675
+ "SubscriptionPlanVersion.billingInterval",
6676
+ "SubscriptionPlanVersion.currency",
6677
+ "SubscriptionPlanVersion.effectiveFrom",
6678
+ "SubscriptionPlanVersion.planId",
6679
+ "SubscriptionPlanVersion.priceAmount",
6680
+ "SubscriptionPlanVersion.version",
6681
+ "TenantSubscription.cancelAtPeriodEnd",
6682
+ "TenantSubscription.currentPeriodEnd",
6683
+ "TenantSubscription.currentPeriodStart",
6684
+ "TenantSubscription.planId",
6685
+ "TenantSubscription.startedAt",
6686
+ "TenantSubscription.status",
6687
+ "TenantSubscription.trialEndsAt"
6688
+ ]
6689
+ },
6690
+ "demo": {
6691
+ "mode": "server",
6692
+ "reasons": [
6693
+ "Needs a server because its package does not build for a browser: core migrations (node:crypto, node:os); and its package depends on @happyvertical/smrt-tenancy, which do not build for a browser (#3624, #3626)."
6694
+ ]
6695
+ }
6696
+ }
6697
+ ],
6153
6698
  "smrtDependencies": [
6154
6699
  "@happyvertical/smrt-core",
6155
6700
  "@happyvertical/smrt-tenancy"