Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce pending status for Subscriptions #2143

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,052 changes: 537 additions & 515 deletions api/api.gen.go

Large diffs are not rendered by default.

1,088 changes: 555 additions & 533 deletions api/client/go/client.gen.go

Large diffs are not rendered by default.

33 changes: 31 additions & 2 deletions api/openapi.cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11341,7 +11341,7 @@ components:
managedBy:
allOf:
- $ref: '#/components/schemas/InvoiceLineManagedBy'
description: Who manages the line?
description: managedBy specifies if the line is manually added via the api or managed by OpenMeter.
readOnly: true
status:
allOf:
Expand Down Expand Up @@ -12356,7 +12356,7 @@ components:
managedBy:
allOf:
- $ref: '#/components/schemas/InvoiceLineManagedBy'
description: Who manages the line?
description: managedBy specifies if the line is manually added via the api or managed by OpenMeter.
readOnly: true
status:
allOf:
Expand Down Expand Up @@ -15175,6 +15175,7 @@ components:
- activeFrom
- status
- customerId
- verifications
- currency
properties:
id:
Expand Down Expand Up @@ -15247,6 +15248,12 @@ components:
allOf:
- $ref: '#/components/schemas/PlanReference'
description: The plan of the subscription.
verifications:
allOf:
- $ref: '#/components/schemas/SubscriptionVerifications'
description: |-
Verifications required for the subscription.
While a verification is pending, the entitlements belonging to the subscription are not issued.
currency:
allOf:
- $ref: '#/components/schemas/CurrencyCode'
Expand Down Expand Up @@ -15320,6 +15327,7 @@ components:
- activeFrom
- status
- customerId
- verifications
- currency
- phases
properties:
Expand Down Expand Up @@ -15393,6 +15401,12 @@ components:
allOf:
- $ref: '#/components/schemas/PlanReference'
description: The plan of the subscription.
verifications:
allOf:
- $ref: '#/components/schemas/SubscriptionVerifications'
description: |-
Verifications required for the subscription.
While a verification is pending, the entitlements belonging to the subscription are not issued.
currency:
allOf:
- $ref: '#/components/schemas/CurrencyCode'
Expand Down Expand Up @@ -15682,10 +15696,25 @@ components:
SubscriptionStatus:
type: string
enum:
- pending
- active
- inactive
- canceled
description: Subscription status.
SubscriptionVerifications:
type: object
required:
- PaymentVerificationNeeded
properties:
PaymentVerificationNeeded:
type: boolean
description: Whether the subscription needs payment verification.
PaymentVerificationReceived:
type: boolean
description: |-
Whether the payment verification was received.
Only has a value if Payment Verification is needed.
description: Subscription verification status.
SvixOperationalWebhookRequest:
type: object
required:
Expand Down
33 changes: 31 additions & 2 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11107,7 +11107,7 @@ components:
managedBy:
allOf:
- $ref: '#/components/schemas/InvoiceLineManagedBy'
description: Who manages the line?
description: managedBy specifies if the line is manually added via the api or managed by OpenMeter.
readOnly: true
status:
allOf:
Expand Down Expand Up @@ -12122,7 +12122,7 @@ components:
managedBy:
allOf:
- $ref: '#/components/schemas/InvoiceLineManagedBy'
description: Who manages the line?
description: managedBy specifies if the line is manually added via the api or managed by OpenMeter.
readOnly: true
status:
allOf:
Expand Down Expand Up @@ -15012,6 +15012,7 @@ components:
- activeFrom
- status
- customerId
- verifications
- currency
properties:
id:
Expand Down Expand Up @@ -15084,6 +15085,12 @@ components:
allOf:
- $ref: '#/components/schemas/PlanReference'
description: The plan of the subscription.
verifications:
allOf:
- $ref: '#/components/schemas/SubscriptionVerifications'
description: |-
Verifications required for the subscription.
While a verification is pending, the entitlements belonging to the subscription are not issued.
currency:
allOf:
- $ref: '#/components/schemas/CurrencyCode'
Expand Down Expand Up @@ -15157,6 +15164,7 @@ components:
- activeFrom
- status
- customerId
- verifications
- currency
- phases
properties:
Expand Down Expand Up @@ -15230,6 +15238,12 @@ components:
allOf:
- $ref: '#/components/schemas/PlanReference'
description: The plan of the subscription.
verifications:
allOf:
- $ref: '#/components/schemas/SubscriptionVerifications'
description: |-
Verifications required for the subscription.
While a verification is pending, the entitlements belonging to the subscription are not issued.
currency:
allOf:
- $ref: '#/components/schemas/CurrencyCode'
Expand Down Expand Up @@ -15598,10 +15612,25 @@ components:
SubscriptionStatus:
type: string
enum:
- pending
- active
- inactive
- canceled
description: Subscription status.
SubscriptionVerifications:
type: object
required:
- PaymentVerificationNeeded
properties:
PaymentVerificationNeeded:
type: boolean
description: Whether the subscription needs payment verification.
PaymentVerificationReceived:
type: boolean
description: |-
Whether the payment verification was received.
Only has a value if Payment Verification is needed.
description: Subscription verification status.
SvixOperationalWebhookRequest:
type: object
required:
Expand Down
24 changes: 24 additions & 0 deletions api/spec/src/productcatalog/subscription.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,29 @@ model SubscriptionExpanded {
*/
@friendlyName("SubscriptionStatus")
enum SubscriptionStatus {
Pending: "pending",
Active: "active",
Inactive: "inactive",
Canceled: "canceled",
}

/**
* Subscription verification status.
*/
@friendlyName("SubscriptionVerifications")
model SubscriptionVerifications {
/**
* Whether the subscription needs payment verification.
*/
PaymentVerificationNeeded: boolean;

/**
* Whether the payment verification was received.
* Only has a value if Payment Verification is needed.
*/
PaymentVerificationReceived?: boolean;
}

/**
* Subscription is an exact subscription instance.
*/
Expand All @@ -61,6 +79,12 @@ model Subscription {
*/
plan?: PlanReference;

/**
* Verifications required for the subscription.
* While a verification is pending, the entitlements belonging to the subscription are not issued.
*/
verifications: SubscriptionVerifications;

/**
* The currency code of the subscription.
* Will be revised once we add multi currency support.
Expand Down
8 changes: 5 additions & 3 deletions openmeter/ent/db/migrate/schema.go

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

Loading
Loading