Skip to content

Commit c95aa7e

Browse files
committed
feat(subs): is custom logic
1 parent c425d7b commit c95aa7e

26 files changed

+1102
-697
lines changed

api/api.gen.go

Lines changed: 378 additions & 366 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/go/client.gen.go

Lines changed: 325 additions & 314 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/javascript/src/client/schemas.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7107,6 +7107,10 @@ export interface components {
71077107
customerId: string
71087108
/** @description The plan of the subscription. */
71097109
plan?: components['schemas']['PlanReference']
7110+
/** @description Whether the subscription is custom. A subscription is custom if
7111+
* - it was customized at creation (not based on a plan, has no PlanReference)
7112+
* - or if it has been edited (even if eventually edited back to it's original form) */
7113+
isCustom: boolean
71107114
/**
71117115
* Currency
71127116
* @description The currency code of the subscription.
@@ -7225,6 +7229,10 @@ export interface components {
72257229
customerId: string
72267230
/** @description The plan of the subscription. */
72277231
plan?: components['schemas']['PlanReference']
7232+
/** @description Whether the subscription is custom. A subscription is custom if
7233+
* - it was customized at creation (not based on a plan, has no PlanReference)
7234+
* - or if it has been edited (even if eventually edited back to it's original form) */
7235+
isCustom: boolean
72287236
/**
72297237
* Currency
72307238
* @description The currency code of the subscription.

api/openapi.cloud.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15473,6 +15473,7 @@ components:
1547315473
- activeFrom
1547415474
- status
1547515475
- customerId
15476+
- isCustom
1547615477
- currency
1547715478
properties:
1547815479
id:
@@ -15549,6 +15550,12 @@ components:
1554915550
allOf:
1555015551
- $ref: '#/components/schemas/PlanReference'
1555115552
description: The plan of the subscription.
15553+
isCustom:
15554+
type: boolean
15555+
description: |-
15556+
Whether the subscription is custom. A subscription is custom if
15557+
- it was customized at creation (not based on a plan, has no PlanReference)
15558+
- or if it has been edited (even if eventually edited back to it's original form)
1555215559
currency:
1555315560
allOf:
1555415561
- $ref: '#/components/schemas/CurrencyCode'
@@ -15644,6 +15651,7 @@ components:
1564415651
- activeFrom
1564515652
- status
1564615653
- customerId
15654+
- isCustom
1564715655
- currency
1564815656
- phases
1564915657
properties:
@@ -15717,6 +15725,12 @@ components:
1571715725
allOf:
1571815726
- $ref: '#/components/schemas/PlanReference'
1571915727
description: The plan of the subscription.
15728+
isCustom:
15729+
type: boolean
15730+
description: |-
15731+
Whether the subscription is custom. A subscription is custom if
15732+
- it was customized at creation (not based on a plan, has no PlanReference)
15733+
- or if it has been edited (even if eventually edited back to it's original form)
1572015734
currency:
1572115735
allOf:
1572215736
- $ref: '#/components/schemas/CurrencyCode'

api/openapi.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15753,6 +15753,7 @@ components:
1575315753
- activeFrom
1575415754
- status
1575515755
- customerId
15756+
- isCustom
1575615757
- currency
1575715758
properties:
1575815759
id:
@@ -15829,6 +15830,12 @@ components:
1582915830
allOf:
1583015831
- $ref: '#/components/schemas/PlanReference'
1583115832
description: The plan of the subscription.
15833+
isCustom:
15834+
type: boolean
15835+
description: |-
15836+
Whether the subscription is custom. A subscription is custom if
15837+
- it was customized at creation (not based on a plan, has no PlanReference)
15838+
- or if it has been edited (even if eventually edited back to it's original form)
1583215839
currency:
1583315840
allOf:
1583415841
- $ref: '#/components/schemas/CurrencyCode'
@@ -15924,6 +15931,7 @@ components:
1592415931
- activeFrom
1592515932
- status
1592615933
- customerId
15934+
- isCustom
1592715935
- currency
1592815936
- phases
1592915937
properties:
@@ -15997,6 +16005,12 @@ components:
1599716005
allOf:
1599816006
- $ref: '#/components/schemas/PlanReference'
1599916007
description: The plan of the subscription.
16008+
isCustom:
16009+
type: boolean
16010+
description: |-
16011+
Whether the subscription is custom. A subscription is custom if
16012+
- it was customized at creation (not based on a plan, has no PlanReference)
16013+
- or if it has been edited (even if eventually edited back to it's original form)
1600016014
currency:
1600116015
allOf:
1600216016
- $ref: '#/components/schemas/CurrencyCode'

api/spec/src/productcatalog/subscription.tsp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ model Subscription {
9696
*/
9797
plan?: PlanReference;
9898

99+
/**
100+
* Whether the subscription is custom. A subscription is custom if
101+
* - it was customized at creation (not based on a plan, has no PlanReference)
102+
* - or if it has been edited (even if eventually edited back to it's original form)
103+
*/
104+
isCustom: boolean;
105+
99106
/**
100107
* The currency code of the subscription.
101108
* Will be revised once we add multi currency support.

openmeter/ent/db/migrate/schema.go

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openmeter/ent/db/mutation.go

Lines changed: 74 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openmeter/ent/db/setorclear.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openmeter/ent/db/subscription.go

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openmeter/ent/db/subscription/subscription.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)