@saasicat/adapter-prisma 1.0.0-rc.14 → 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/dist/.build-stamp +1 -1
- package/dist/index.cjs +21 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +21 -2
- package/package.json +4 -4
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1c3406c038f7f0bf30672636da44d77d6ee53e13adb79419c7ab479ff25ac3a8
|
package/dist/index.cjs
CHANGED
|
@@ -3995,8 +3995,27 @@ var PrismaSubscriptionContractRepository = class {
|
|
|
3995
3995
|
});
|
|
3996
3996
|
return row ? (0, import_core7.toSubscriptionContractRecord)(row, row.lineItems) : null;
|
|
3997
3997
|
}
|
|
3998
|
-
async
|
|
3999
|
-
const row = await this.db().subscriptionContract.
|
|
3998
|
+
async findByOriginalOfferId(offerId, tx) {
|
|
3999
|
+
const row = await this.db(tx).subscriptionContract.findFirst({
|
|
4000
|
+
where: {
|
|
4001
|
+
originalOfferId: offerId
|
|
4002
|
+
},
|
|
4003
|
+
include: {
|
|
4004
|
+
lineItems: true
|
|
4005
|
+
},
|
|
4006
|
+
orderBy: [
|
|
4007
|
+
{
|
|
4008
|
+
createdAt: "asc"
|
|
4009
|
+
},
|
|
4010
|
+
{
|
|
4011
|
+
id: "asc"
|
|
4012
|
+
}
|
|
4013
|
+
]
|
|
4014
|
+
});
|
|
4015
|
+
return row ? (0, import_core7.toSubscriptionContractRecord)(row, row.lineItems) : null;
|
|
4016
|
+
}
|
|
4017
|
+
async create(data, tx) {
|
|
4018
|
+
const row = await this.db(tx).subscriptionContract.create({
|
|
4000
4019
|
data: {
|
|
4001
4020
|
tenantId: data.tenantId,
|
|
4002
4021
|
status: data.status ?? "active",
|
package/dist/index.d.cts
CHANGED
|
@@ -1602,7 +1602,8 @@ declare class PrismaSubscriptionContractRepository implements SubscriptionContra
|
|
|
1602
1602
|
list(filter: SubscriptionContractFilter): Promise<SubscriptionContractRecord[]>;
|
|
1603
1603
|
findById(contractId: string): Promise<SubscriptionContractRecord | null>;
|
|
1604
1604
|
findActiveByTenantId(tenantId: string, asOf?: Date, tx?: TransactionContext): Promise<SubscriptionContractRecord | null>;
|
|
1605
|
-
|
|
1605
|
+
findByOriginalOfferId(offerId: string, tx?: TransactionContext): Promise<SubscriptionContractRecord | null>;
|
|
1606
|
+
create(data: CreateSubscriptionContractData, tx?: TransactionContext): Promise<SubscriptionContractRecord>;
|
|
1606
1607
|
terminate(contractId: string, data: TerminateSubscriptionContractData): Promise<SubscriptionContractRecord>;
|
|
1607
1608
|
}
|
|
1608
1609
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1602,7 +1602,8 @@ declare class PrismaSubscriptionContractRepository implements SubscriptionContra
|
|
|
1602
1602
|
list(filter: SubscriptionContractFilter): Promise<SubscriptionContractRecord[]>;
|
|
1603
1603
|
findById(contractId: string): Promise<SubscriptionContractRecord | null>;
|
|
1604
1604
|
findActiveByTenantId(tenantId: string, asOf?: Date, tx?: TransactionContext): Promise<SubscriptionContractRecord | null>;
|
|
1605
|
-
|
|
1605
|
+
findByOriginalOfferId(offerId: string, tx?: TransactionContext): Promise<SubscriptionContractRecord | null>;
|
|
1606
|
+
create(data: CreateSubscriptionContractData, tx?: TransactionContext): Promise<SubscriptionContractRecord>;
|
|
1606
1607
|
terminate(contractId: string, data: TerminateSubscriptionContractData): Promise<SubscriptionContractRecord>;
|
|
1607
1608
|
}
|
|
1608
1609
|
|
package/dist/index.js
CHANGED
|
@@ -3933,8 +3933,27 @@ var PrismaSubscriptionContractRepository = class {
|
|
|
3933
3933
|
});
|
|
3934
3934
|
return row ? toSubscriptionContractRecord(row, row.lineItems) : null;
|
|
3935
3935
|
}
|
|
3936
|
-
async
|
|
3937
|
-
const row = await this.db().subscriptionContract.
|
|
3936
|
+
async findByOriginalOfferId(offerId, tx) {
|
|
3937
|
+
const row = await this.db(tx).subscriptionContract.findFirst({
|
|
3938
|
+
where: {
|
|
3939
|
+
originalOfferId: offerId
|
|
3940
|
+
},
|
|
3941
|
+
include: {
|
|
3942
|
+
lineItems: true
|
|
3943
|
+
},
|
|
3944
|
+
orderBy: [
|
|
3945
|
+
{
|
|
3946
|
+
createdAt: "asc"
|
|
3947
|
+
},
|
|
3948
|
+
{
|
|
3949
|
+
id: "asc"
|
|
3950
|
+
}
|
|
3951
|
+
]
|
|
3952
|
+
});
|
|
3953
|
+
return row ? toSubscriptionContractRecord(row, row.lineItems) : null;
|
|
3954
|
+
}
|
|
3955
|
+
async create(data, tx) {
|
|
3956
|
+
const row = await this.db(tx).subscriptionContract.create({
|
|
3938
3957
|
data: {
|
|
3939
3958
|
tenantId: data.tenantId,
|
|
3940
3959
|
status: data.status ?? "active",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasicat/adapter-prisma",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.15",
|
|
4
4
|
"description": "Prisma + PostgreSQL persistence for SaaSiCat: one standard bundle for core, catalog, entitlement, tenant billing, Admin resources and promo, plus individual adapters for custom compositions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@saasicat/core": "^1.0.0-rc.
|
|
26
|
+
"@saasicat/core": "^1.0.0-rc.15"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@nestjs/common": "^11.0.0"
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@prisma/client": "^6.19.0",
|
|
36
36
|
"tsup": "^8.0.0",
|
|
37
37
|
"typescript": "^6.0.0",
|
|
38
|
-
"@saasicat/persistence-testing": "^1.0.0-rc.
|
|
39
|
-
"@saasicat/spec": "^1.0.0-rc.
|
|
38
|
+
"@saasicat/persistence-testing": "^1.0.0-rc.15",
|
|
39
|
+
"@saasicat/spec": "^1.0.0-rc.15"
|
|
40
40
|
},
|
|
41
41
|
"license": "PolyForm-Shield-1.0.0",
|
|
42
42
|
"author": "Taci Uelker",
|