@saasicat/persistence-testing 1.0.0-rc.13 → 1.0.0-rc.15
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 +36 -10
- package/dist/.build-stamp +1 -1
- package/dist/index.cjs +391 -44
- package/dist/index.d.cts +26 -4
- package/dist/index.d.ts +26 -4
- package/dist/index.js +391 -44
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,6 +16,9 @@ Verified scenarios:
|
|
|
16
16
|
- PlanVersion and BundleVersion validity windows with auto-succession
|
|
17
17
|
- `countByPlanVersionId` counts current AND pending bindings in one query
|
|
18
18
|
- transaction rollback discards writes
|
|
19
|
+
- a contract written on a transaction is undone with it, and found by the offer it came from
|
|
20
|
+
- a checkout offer is consumed once, whoever asks first, and a consume on a rolled-back transaction
|
|
21
|
+
leaves it open
|
|
19
22
|
- `findByTenantIdLocked` serializes concurrent transactions (row lock)
|
|
20
23
|
- concurrent `claimSlot` grants exactly `maxRedemptions` slots
|
|
21
24
|
- claim / exhaust / release lifecycle
|
|
@@ -27,10 +30,20 @@ Verified scenarios:
|
|
|
27
30
|
concurrently — with the change and the record it supersedes landing together;
|
|
28
31
|
changes listed in the order they were recorded, acknowledged once
|
|
29
32
|
|
|
30
|
-
Scenario groups gate on declared capabilities and provided slices
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
Scenario groups gate on declared capabilities and provided slices. A group the
|
|
34
|
+
capabilities rule out, such as the lock scenarios with `pessimisticLocking:
|
|
35
|
+
false`, reports as **skipped with reason**. A group whose port or seed writer
|
|
36
|
+
the harness does not provide **fails**, unless the adapter names it in `gaps` —
|
|
37
|
+
then it reports as skipped. A gap named there that the harness does provide
|
|
38
|
+
fails the suite, so the list stays true. A skipped scenario is easy to read
|
|
39
|
+
past in a green run; a harness that forgot to wire a port would otherwise pass
|
|
40
|
+
without checking it.
|
|
41
|
+
|
|
42
|
+
The list describes the harness as it is built, not the adapter package. Where a
|
|
43
|
+
port adds a member only under an option — `@saasicat/adapter-prisma`'s
|
|
44
|
+
`validityWindows` and `atomicOnboardingSelection`, off by default for a 0.6
|
|
45
|
+
schema — compute `gaps` from the same option rather than writing a constant, so
|
|
46
|
+
the declaration moves when the schema does.
|
|
34
47
|
|
|
35
48
|
## What this is not
|
|
36
49
|
|
|
@@ -49,26 +62,39 @@ find one.
|
|
|
49
62
|
import { persistenceAdapterContract } from '@saasicat/persistence-testing';
|
|
50
63
|
|
|
51
64
|
persistenceAdapterContract({
|
|
52
|
-
name: 'adapter
|
|
65
|
+
name: 'my-adapter @ postgres',
|
|
53
66
|
create: async () => ({
|
|
54
67
|
adapter: {
|
|
55
68
|
capabilities: { transactions: true, pessimisticLocking: true /* … */ },
|
|
56
69
|
transactionRunner,
|
|
57
70
|
subscriptionRepository,
|
|
58
71
|
planVersionRepository,
|
|
59
|
-
|
|
72
|
+
planRepository,
|
|
73
|
+
bundleRepository,
|
|
74
|
+
subscriptionBundleRepository,
|
|
75
|
+
tenantSubscriptionWrite,
|
|
76
|
+
promoCodeRepository,
|
|
60
77
|
promoCodeRedemptionRepository,
|
|
78
|
+
promoSubscriptionLookup,
|
|
61
79
|
mfa,
|
|
62
80
|
audit,
|
|
63
81
|
auditQuery,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
82
|
+
// Leave a part out and name it in `gaps` below; left out and not
|
|
83
|
+
// named, its scenarios fail.
|
|
84
|
+
},
|
|
85
|
+
seed: {
|
|
86
|
+
createPlanVersion,
|
|
87
|
+
createSubscription,
|
|
88
|
+
createBundleVersion,
|
|
89
|
+
clearBookingRequestDate,
|
|
90
|
+
createPromoCode,
|
|
67
91
|
},
|
|
68
|
-
seed: { createPlanVersion, createSubscription, createPromoCode },
|
|
69
92
|
reset: () => truncatePlatformTables(),
|
|
70
93
|
close: () => pool.end(),
|
|
71
94
|
}),
|
|
95
|
+
// The parts this adapter deliberately does not provide. A part named here
|
|
96
|
+
// that the harness does provide fails the suite as well.
|
|
97
|
+
gaps: ['subscriptionContracts', 'checkoutOffers', 'appliedSettings'],
|
|
72
98
|
});
|
|
73
99
|
```
|
|
74
100
|
|
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8fdc45ae34c5869710281576820410215b122b89385485ab7973ebfc8359157b
|