@saasicat/adapter-prisma 0.4.0 → 0.6.0
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 +19 -23
- package/dist/index.cjs +2271 -3
- package/dist/index.d.cts +287 -11
- package/dist/index.d.ts +287 -11
- package/dist/index.js +2262 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @saasicat/adapter-prisma
|
|
2
2
|
|
|
3
|
-
The Prisma + PostgreSQL persistence adapter for
|
|
3
|
+
The Prisma + PostgreSQL persistence adapter for SaaSiCat. Targets the
|
|
4
4
|
canonical schema from `@saasicat/spec` (`prisma-fragments/` +
|
|
5
5
|
`sql/constraints.postgres.sql`) and passes the executable persistence
|
|
6
6
|
contract (`@saasicat/persistence-testing`) against a real PostgreSQL — locks,
|
|
@@ -56,34 +56,30 @@ PromoCodesModule.forRoot({
|
|
|
56
56
|
|
|
57
57
|
## Shipped adapters
|
|
58
58
|
|
|
59
|
-
| Class
|
|
60
|
-
|
|
|
61
|
-
| `PrismaTransactionRunner`
|
|
62
|
-
| `PrismaMfaAdapter`
|
|
63
|
-
| `PrismaAuditAdapter`
|
|
64
|
-
| `PrismaAuditQueryAdapter`
|
|
65
|
-
| `PrismaAuditStatsAdapter`
|
|
66
|
-
| `AsyncLocalRlsBypassAdapter`
|
|
67
|
-
| `PrismaSubscriptionRepository`
|
|
68
|
-
| `PrismaPlanVersionRepository`
|
|
69
|
-
| `PrismaPromoCodeRepository`
|
|
70
|
-
| `PrismaPromoCodeRedemptionRepository`
|
|
71
|
-
| `PrismaPromoCodeValidationLogRepository` | `PromoCodeValidationLogRepository` | `promo_code_validation_logs`
|
|
72
|
-
| `PrismaPromoSubscriptionLookup`
|
|
73
|
-
| `ZeroPromoRevenueDeductionAggregator`
|
|
74
|
-
| `PrismaSuperAdminBootstrapAdapter`
|
|
75
|
-
| `PrismaPlanCatalogReadSink`
|
|
76
|
-
| `PrismaPlanCatalogImportSink`
|
|
59
|
+
| Class | Implements port | Tables |
|
|
60
|
+
| ---------------------------------------- | ---------------------------------- | --------------------------------------------------- |
|
|
61
|
+
| `PrismaTransactionRunner` | `TransactionRunner` | — (`$transaction`) |
|
|
62
|
+
| `PrismaMfaAdapter` | `MfaPort` | `super_admin_mfa` |
|
|
63
|
+
| `PrismaAuditAdapter` | `AuditPort` | `audit_logs` |
|
|
64
|
+
| `PrismaAuditQueryAdapter` | `AuditQueryPort` | `audit_logs` |
|
|
65
|
+
| `PrismaAuditStatsAdapter` | `AuditStatsPort` | `audit_logs` |
|
|
66
|
+
| `AsyncLocalRlsBypassAdapter` | `RlsBypassPort` | (no DB access) |
|
|
67
|
+
| `PrismaSubscriptionRepository` | `SubscriptionRepository` | `subscriptions`, `plan_versions` |
|
|
68
|
+
| `PrismaPlanVersionRepository` | `PlanVersionRepository` | `plan_versions` |
|
|
69
|
+
| `PrismaPromoCodeRepository` | `PromoCodeRepository` | `promo_codes` |
|
|
70
|
+
| `PrismaPromoCodeRedemptionRepository` | `PromoCodeRedemptionRepository` | `promo_code_redemptions` |
|
|
71
|
+
| `PrismaPromoCodeValidationLogRepository` | `PromoCodeValidationLogRepository` | `promo_code_validation_logs` |
|
|
72
|
+
| `PrismaPromoSubscriptionLookup` | `PromoSubscriptionLookup` | `subscriptions` |
|
|
73
|
+
| `ZeroPromoRevenueDeductionAggregator` | `PromoRevenueDeductionAggregator` | — (constant `'0.00'`) |
|
|
74
|
+
| `PrismaSuperAdminBootstrapAdapter` | `SuperAdminProvisioningPort` | `super_admin_users` |
|
|
75
|
+
| `PrismaPlanCatalogReadSink` | `PlanCatalogReadSink` | `plans`, `plan_versions`, `feature_catalog_entries` |
|
|
76
|
+
| `PrismaPlanCatalogImportSink` | `PlanCatalogImportSink` | same |
|
|
77
77
|
|
|
78
78
|
Not shipped (custom adapters stay yours): subscription contracts, bundle
|
|
79
79
|
bookings, registration, tenant-billing write ports, `FirstTimeCustomerCheck`.
|
|
80
80
|
Absent optional repository methods degrade fail-closed as documented on the
|
|
81
81
|
ports (e.g. `countByBundleVersionId`).
|
|
82
82
|
|
|
83
|
-
Known limitation: subscriptions binding ONLY a `businessTypeVersionId` (no
|
|
84
|
-
`planVersionId`) raise a descriptive error — BusinessType aggregation needs a
|
|
85
|
-
custom `SubscriptionRepository`.
|
|
86
|
-
|
|
87
83
|
## Manual wiring (custom setups)
|
|
88
84
|
|
|
89
85
|
All classes inject the Prisma client via `PRISMA_CLIENT_TOKEN`:
|