@saasicat/spec 1.0.0-rc.23 → 1.0.0-rc.25

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.
Files changed (32) hide show
  1. package/acceptance/README.md +1 -2
  2. package/acceptance/plan-version/publish-does-not-touch-existing-contracts.yaml +2 -9
  3. package/admin-api.openapi.yaml +764 -11
  4. package/package.json +1 -1
  5. package/prisma-fragments/01-subscription.prisma +10 -17
  6. package/prisma-fragments/03-plan-versions.prisma +1 -1
  7. package/prisma-fragments/04-audit-log.prisma +2 -1
  8. package/prisma-fragments/05-bundle.prisma +4 -3
  9. package/prisma-fragments/08-subscription-contract.prisma +7 -0
  10. package/prisma-fragments/09-pending-registration.prisma +6 -0
  11. package/prisma-fragments/10-super-admin.prisma +1 -1
  12. package/prisma-fragments/11-subscription-bundle.prisma +12 -2
  13. package/prisma-fragments/13-subscriber.prisma +81 -8
  14. package/prisma-fragments/15-subscriber-ledger.prisma +1 -1
  15. package/prisma-fragments/17-subscription-notice.prisma +58 -0
  16. package/prisma-fragments/18-version-retirement.prisma +44 -0
  17. package/prisma-fragments/19-bundle-version-retirement.prisma +44 -0
  18. package/prisma-fragments/README.md +23 -19
  19. package/schemas/audit-event.schema.json +2 -2
  20. package/schemas/plan-catalog.schema.json +40 -4
  21. package/schemas/subscriber-ledger.schema.json +2 -1
  22. package/sql/1.0-a-correction-carries-its-order.postgres.sql +78 -0
  23. package/sql/1.0-a-newer-version-is-only-offered.postgres.sql +33 -0
  24. package/sql/1.0-a-retirement-is-announced.postgres.sql +43 -0
  25. package/sql/1.0-a-scheduled-change-keeps-its-quoted-version.postgres.sql +129 -0
  26. package/sql/1.0-a-sign-up-keeps-its-vat-id-check.postgres.sql +38 -0
  27. package/sql/1.0-a-subscriber-has-a-tax-origin.postgres.sql +113 -0
  28. package/sql/1.0-a-subscriber-is-told-once.postgres.sql +48 -0
  29. package/sql/1.0-an-add-on-retirement-is-announced.postgres.sql +44 -0
  30. package/sql/1.0-an-add-on-switch-waits-for-its-term.postgres.sql +52 -0
  31. package/sql/constraints.postgres.sql +10 -0
  32. package/sql/reference-schema.postgres.sql +137 -10
@@ -45,8 +45,7 @@ server, and verifies `setup` → `when` → `then` sequentially.
45
45
  | `promo/` | Allow-zero-invoice false blocks a 100% discount | 🔴 |
46
46
  | `promo/` | Code with `valueType=PERCENT, value>100` is rejected | 🔴 |
47
47
  | `plan-version/` | Publish does not touch `Subscription.planVersionId` of existing tenants (P1 guarantee from SPEC §6) | 🟡 stub |
48
- | `plan-version/` | Regressive version requires tenant opt-in | 🔴 |
49
- | `plan-version/` | 6-week notification cron sends mail to affected subscriptions | 🔴 |
48
+ | `plan-version/` | A newer version reaches an existing subscription only as an offer it takes | 🔴 |
50
49
  | `tenant/` | Suspend → 403 for tenant login + audit entry with reason | 🟡 stub |
51
50
  | `tenant/` | Suspend without MFA header → 401 MFA_REQUIRED | 🔴 |
52
51
  | `mfa/` | TOTP verify with a good code → 200, with a bad one → 401 | 🟡 stub |
@@ -3,8 +3,8 @@ description: |
3
3
  P1 guarantee from SPEC §6: When a new plan version is published,
4
4
  `Subscription.planVersionId` of the existing tenants is NOT touched.
5
5
  Only publishedAt of the new version + supersededAt of the old version
6
- are written. Migration runs exclusively through the
7
- notification + renewal cron with a 6-week lead time.
6
+ are written. A subscription moves to the new version only when the
7
+ subscriber takes it as an offer (SC-SUB-021); no renewal moves it.
8
8
 
9
9
  This is the core guarantee for grandfathering protection. If this
10
10
  test goes red, the implementation violates that contract protection.
@@ -43,13 +43,6 @@ then:
43
43
  - assertSubscriptionPriceMonthlyNet:
44
44
  tenantSlug: 'test-existing-contracts'
45
45
  value: 24.90
46
- # pendingPlanVersion fields are not yet set (the notification cron
47
- # has not run yet).
48
- - assertSubscription:
49
- tenantSlug: 'test-existing-contracts'
50
- pendingPlanVersionId: null
51
- pendingPlanVersionEffectiveAt: null
52
-
53
46
  # Catalog: the old version has supersededAt, the new one has publishedAt.
54
47
  - assertPlanVersion:
55
48
  planId: 'STANDARD'