Skip to content

Commit

Permalink
feat: use duration for plan phases instead of start after
Browse files Browse the repository at this point in the history
  • Loading branch information
tothandras committed Dec 10, 2024
1 parent f585e01 commit 4a1a066
Show file tree
Hide file tree
Showing 17 changed files with 1,137 additions and 887 deletions.
1,453 changes: 726 additions & 727 deletions api/api.gen.go

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13122,7 +13122,7 @@ components:
- key
- name
- rateCards
- startAfter
- duration
properties:
key:
type: string
Expand Down Expand Up @@ -13155,13 +13155,13 @@ components:
$ref: '#/components/schemas/RateCard'
description: The rate cards of the plan.
title: Rate cards
startAfter:
duration:
type: string
format: duration
nullable: true
example: P1Y1D
description: The time after which the plan starts compared to subscription start
title: Start after
description: The duration of the phase.
title: Duration
discounts:
type: array
items:
Expand All @@ -13175,7 +13175,7 @@ components:
- key
- name
- rateCards
- startAfter
- duration
properties:
key:
type: string
Expand Down Expand Up @@ -13208,13 +13208,13 @@ components:
$ref: '#/components/schemas/RateCard'
description: The rate cards of the plan.
title: Rate cards
startAfter:
duration:
type: string
format: duration
nullable: true
example: P1Y1D
description: The time after which the plan starts compared to subscription start
title: Start after
description: The duration of the phase.
title: Duration
discounts:
type: array
items:
Expand Down Expand Up @@ -13275,13 +13275,13 @@ components:
$ref: '#/components/schemas/RateCard'
description: The rate cards of the plan.
title: Rate cards
startAfter:
duration:
type: string
format: duration
nullable: true
example: P1Y1D
description: The time after which the plan starts compared to subscription start
title: Start after
description: The duration of the phase.
title: Duration
discounts:
type: array
items:
Expand Down
6 changes: 3 additions & 3 deletions api/spec/src/productcatalog/plan.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ model PlanPhase {
rateCards: RateCard[];

/**
* The time after which the plan starts compared to subscription start
* The duration of the phase.
*/
@visibility("read", "create", "update")
@summary("Start after")
@summary("Duration")
@encode(DurationKnownEncoding.ISO8601)
@example(duration.fromISO("P1Y1D"))
startAfter: duration | null;
duration: duration | null;

/**
* The discounts on the plan.
Expand Down
3 changes: 2 additions & 1 deletion openmeter/ent/db/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

143 changes: 116 additions & 27 deletions openmeter/ent/db/mutation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4a1a066

Please sign in to comment.