Skip to content

Commit a208fb5

Browse files
committed
feat(subs): is custom logic
1 parent d6771cb commit a208fb5

26 files changed

+1051
-645
lines changed

api/api.gen.go

Lines changed: 323 additions & 311 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: 329 additions & 317 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
@@ -7163,6 +7163,10 @@ export interface components {
71637163
customerId: string
71647164
/** @description The plan of the subscription. */
71657165
plan?: components['schemas']['PlanReference']
7166+
/** @description Whether the subscription is custom. A subscription is custom if
7167+
* - it was customized at creation (not based on a plan, has no PlanReference)
7168+
* - or if it has been edited (even if eventually edited back to it's original form) */
7169+
isCustom: boolean
71667170
/**
71677171
* Currency
71687172
* @description The currency code of the subscription.
@@ -7281,6 +7285,10 @@ export interface components {
72817285
customerId: string
72827286
/** @description The plan of the subscription. */
72837287
plan?: components['schemas']['PlanReference']
7288+
/** @description Whether the subscription is custom. A subscription is custom if
7289+
* - it was customized at creation (not based on a plan, has no PlanReference)
7290+
* - or if it has been edited (even if eventually edited back to it's original form) */
7291+
isCustom: boolean
72847292
/**
72857293
* Currency
72867294
* @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
@@ -15656,6 +15656,7 @@ components:
1565615656
- activeFrom
1565715657
- status
1565815658
- customerId
15659+
- isCustom
1565915660
- currency
1566015661
properties:
1566115662
id:
@@ -15732,6 +15733,12 @@ components:
1573215733
allOf:
1573315734
- $ref: '#/components/schemas/PlanReference'
1573415735
description: The plan of the subscription.
15736+
isCustom:
15737+
type: boolean
15738+
description: |-
15739+
Whether the subscription is custom. A subscription is custom if
15740+
- it was customized at creation (not based on a plan, has no PlanReference)
15741+
- or if it has been edited (even if eventually edited back to it's original form)
1573515742
currency:
1573615743
allOf:
1573715744
- $ref: '#/components/schemas/CurrencyCode'
@@ -15827,6 +15834,7 @@ components:
1582715834
- activeFrom
1582815835
- status
1582915836
- customerId
15837+
- isCustom
1583015838
- currency
1583115839
- phases
1583215840
properties:
@@ -15900,6 +15908,12 @@ components:
1590015908
allOf:
1590115909
- $ref: '#/components/schemas/PlanReference'
1590215910
description: The plan of the subscription.
15911+
isCustom:
15912+
type: boolean
15913+
description: |-
15914+
Whether the subscription is custom. A subscription is custom if
15915+
- it was customized at creation (not based on a plan, has no PlanReference)
15916+
- or if it has been edited (even if eventually edited back to it's original form)
1590315917
currency:
1590415918
allOf:
1590515919
- $ref: '#/components/schemas/CurrencyCode'

api/openapi.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15971,6 +15971,7 @@ components:
1597115971
- activeFrom
1597215972
- status
1597315973
- customerId
15974+
- isCustom
1597415975
- currency
1597515976
properties:
1597615977
id:
@@ -16047,6 +16048,12 @@ components:
1604716048
allOf:
1604816049
- $ref: '#/components/schemas/PlanReference'
1604916050
description: The plan of the subscription.
16051+
isCustom:
16052+
type: boolean
16053+
description: |-
16054+
Whether the subscription is custom. A subscription is custom if
16055+
- it was customized at creation (not based on a plan, has no PlanReference)
16056+
- or if it has been edited (even if eventually edited back to it's original form)
1605016057
currency:
1605116058
allOf:
1605216059
- $ref: '#/components/schemas/CurrencyCode'
@@ -16142,6 +16149,7 @@ components:
1614216149
- activeFrom
1614316150
- status
1614416151
- customerId
16152+
- isCustom
1614516153
- currency
1614616154
- phases
1614716155
properties:
@@ -16215,6 +16223,12 @@ components:
1621516223
allOf:
1621616224
- $ref: '#/components/schemas/PlanReference'
1621716225
description: The plan of the subscription.
16226+
isCustom:
16227+
type: boolean
16228+
description: |-
16229+
Whether the subscription is custom. A subscription is custom if
16230+
- it was customized at creation (not based on a plan, has no PlanReference)
16231+
- or if it has been edited (even if eventually edited back to it's original form)
1621816232
currency:
1621916233
allOf:
1622016234
- $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)