Skip to content

Commit facf3b0

Browse files
turipGAlexIHU
andauthored
feat(billing): add subscription end proration mode (#4553)
Co-authored-by: Alex Goth <64845621+GAlexIHU@users.noreply.github.com>
1 parent faa46da commit facf3b0

52 files changed

Lines changed: 3958 additions & 2935 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/api.gen.go

Lines changed: 1299 additions & 1269 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: 1125 additions & 1096 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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3395,6 +3395,11 @@ export interface components {
33953395
* @default true
33963396
*/
33973397
progressiveBilling?: boolean
3398+
/**
3399+
* @description Controls how subscription-ending shortened service periods are billed.
3400+
* @default bill_actual_period
3401+
*/
3402+
subscriptionEndProrationMode?: components['schemas']['BillingWorkflowInvoicingSubscriptionEndProrationMode']
33983403
/**
33993404
* @description Default tax configuration to apply to the invoices.
34003405
*
@@ -3405,6 +3410,13 @@ export interface components {
34053410
*/
34063411
defaultTaxConfig?: components['schemas']['TaxConfig']
34073412
}
3413+
/**
3414+
* @description Billing workflow subscription end proration mode.
3415+
* @enum {string}
3416+
*/
3417+
BillingWorkflowInvoicingSubscriptionEndProrationMode:
3418+
| 'bill_full_period'
3419+
| 'bill_actual_period'
34083420
/**
34093421
* Workflow payment settings
34103422
* @description BillingWorkflowPaymentSettings represents the payment settings for a billing workflow
@@ -7738,6 +7750,11 @@ export interface components {
77387750
* @example P30D
77397751
*/
77407752
dueAfter?: string
7753+
/**
7754+
* @description Controls how subscription-ending shortened service periods are billed.
7755+
* @default bill_actual_period
7756+
*/
7757+
subscriptionEndProrationMode?: components['schemas']['BillingWorkflowInvoicingSubscriptionEndProrationMode']
77417758
/**
77427759
* @description Default tax configuration to apply to the invoices.
77437760
*
@@ -12499,6 +12516,8 @@ export type BillingWorkflowCreate =
1249912516
components['schemas']['BillingWorkflowCreate']
1250012517
export type BillingWorkflowInvoicingSettings =
1250112518
components['schemas']['BillingWorkflowInvoicingSettings']
12519+
export type BillingWorkflowInvoicingSubscriptionEndProrationMode =
12520+
components['schemas']['BillingWorkflowInvoicingSubscriptionEndProrationMode']
1250212521
export type BillingWorkflowPaymentSettings =
1250312522
components['schemas']['BillingWorkflowPaymentSettings']
1250412523
export type BillingWorkflowTaxSettings =

api/client/javascript/src/zod/index.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4851,6 +4851,8 @@ export const updateInvoiceBodyWorkflowOneWorkflowOneInvoicingOneDraftPeriodDefau
48514851
'P0D'
48524852
export const updateInvoiceBodyWorkflowOneWorkflowOneInvoicingOneDueAfterDefault =
48534853
'P30D'
4854+
export const updateInvoiceBodyWorkflowOneWorkflowOneInvoicingOneSubscriptionEndProrationModeDefault =
4855+
'bill_actual_period'
48544856
export const updateInvoiceBodyWorkflowOneWorkflowOneInvoicingOneDefaultTaxConfigOneStripeOneCodeRegExp =
48554857
/^txcd_\d{8}$/
48564858
export const updateInvoiceBodyWorkflowOneWorkflowOneInvoicingOneDefaultTaxConfigOneTaxCodeIdRegExp =
@@ -5890,6 +5892,15 @@ export const UpdateInvoiceBody = zod
58905892
.describe(
58915893
"The period after which the invoice is due.\nWith some payment solutions it's only applicable for manual collection method.",
58925894
),
5895+
subscriptionEndProrationMode: zod
5896+
.enum(['bill_full_period', 'bill_actual_period'])
5897+
.describe('Billing workflow subscription end proration mode.')
5898+
.default(
5899+
updateInvoiceBodyWorkflowOneWorkflowOneInvoicingOneSubscriptionEndProrationModeDefault,
5900+
)
5901+
.describe(
5902+
'Controls how subscription-ending shortened service periods are billed.',
5903+
),
58935904
})
58945905
.describe(
58955906
'InvoiceWorkflowInvoicingSettingsReplaceUpdate represents the update model for the invoicing settings of an invoice workflow.',
@@ -6218,6 +6229,8 @@ export const createBillingProfileBodyWorkflowOneInvoicingOneDraftPeriodDefault =
62186229
export const createBillingProfileBodyWorkflowOneInvoicingOneDueAfterDefault =
62196230
'P30D'
62206231
export const createBillingProfileBodyWorkflowOneInvoicingOneProgressiveBillingDefault = true
6232+
export const createBillingProfileBodyWorkflowOneInvoicingOneSubscriptionEndProrationModeDefault =
6233+
'bill_actual_period'
62216234
export const createBillingProfileBodyWorkflowOneInvoicingOneDefaultTaxConfigOneStripeOneCodeRegExp =
62226235
/^txcd_\d{8}$/
62236236
export const createBillingProfileBodyWorkflowOneInvoicingOneDefaultTaxConfigOneTaxCodeIdRegExp =
@@ -6531,6 +6544,15 @@ export const CreateBillingProfileBody = zod
65316544
.describe(
65326545
'Should progressive billing be allowed for this workflow?',
65336546
),
6547+
subscriptionEndProrationMode: zod
6548+
.enum(['bill_full_period', 'bill_actual_period'])
6549+
.describe('Billing workflow subscription end proration mode.')
6550+
.default(
6551+
createBillingProfileBodyWorkflowOneInvoicingOneSubscriptionEndProrationModeDefault,
6552+
)
6553+
.describe(
6554+
'Controls how subscription-ending shortened service periods are billed.',
6555+
),
65346556
})
65356557
.describe(
65366558
'BillingWorkflowInvoicingSettings represents the invoice settings for a billing workflow',
@@ -6664,6 +6686,8 @@ export const updateBillingProfileBodyWorkflowOneInvoicingOneDraftPeriodDefault =
66646686
export const updateBillingProfileBodyWorkflowOneInvoicingOneDueAfterDefault =
66656687
'P30D'
66666688
export const updateBillingProfileBodyWorkflowOneInvoicingOneProgressiveBillingDefault = true
6689+
export const updateBillingProfileBodyWorkflowOneInvoicingOneSubscriptionEndProrationModeDefault =
6690+
'bill_actual_period'
66676691
export const updateBillingProfileBodyWorkflowOneInvoicingOneDefaultTaxConfigOneStripeOneCodeRegExp =
66686692
/^txcd_\d{8}$/
66696693
export const updateBillingProfileBodyWorkflowOneInvoicingOneDefaultTaxConfigOneTaxCodeIdRegExp =
@@ -6952,6 +6976,15 @@ export const UpdateBillingProfileBody = zod
69526976
.describe(
69536977
'Should progressive billing be allowed for this workflow?',
69546978
),
6979+
subscriptionEndProrationMode: zod
6980+
.enum(['bill_full_period', 'bill_actual_period'])
6981+
.describe('Billing workflow subscription end proration mode.')
6982+
.default(
6983+
updateBillingProfileBodyWorkflowOneInvoicingOneSubscriptionEndProrationModeDefault,
6984+
)
6985+
.describe(
6986+
'Controls how subscription-ending shortened service periods are billed.',
6987+
),
69556988
})
69566989
.describe(
69576990
'BillingWorkflowInvoicingSettings represents the invoice settings for a billing workflow',

api/client/python/openmeter/_generated/models/__init__.py

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

api/client/python/openmeter/_generated/models/_enums.py

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

api/client/python/openmeter/_generated/models/_models.py

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

api/openapi.cloud.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14167,6 +14167,11 @@ components:
1416714167
type: boolean
1416814168
description: Should progressive billing be allowed for this workflow?
1416914169
default: true
14170+
subscriptionEndProrationMode:
14171+
allOf:
14172+
- $ref: '#/components/schemas/BillingWorkflowInvoicingSubscriptionEndProrationMode'
14173+
description: Controls how subscription-ending shortened service periods are billed.
14174+
default: bill_actual_period
1417014175
defaultTaxConfig:
1417114176
allOf:
1417214177
- $ref: '#/components/schemas/TaxConfig'
@@ -14179,6 +14184,12 @@ components:
1417914184
fully supported.
1418014185
description: BillingWorkflowInvoicingSettings represents the invoice settings for a billing workflow
1418114186
title: Workflow invoice settings
14187+
BillingWorkflowInvoicingSubscriptionEndProrationMode:
14188+
type: string
14189+
enum:
14190+
- bill_full_period
14191+
- bill_actual_period
14192+
description: Billing workflow subscription end proration mode.
1418214193
BillingWorkflowPaymentSettings:
1418314194
type: object
1418414195
properties:
@@ -19784,6 +19795,11 @@ components:
1978419795
With some payment solutions it's only applicable for manual collection method.
1978519796
example: P30D
1978619797
default: P30D
19798+
subscriptionEndProrationMode:
19799+
allOf:
19800+
- $ref: '#/components/schemas/BillingWorkflowInvoicingSubscriptionEndProrationMode'
19801+
description: Controls how subscription-ending shortened service periods are billed.
19802+
default: bill_actual_period
1978719803
defaultTaxConfig:
1978819804
allOf:
1978919805
- $ref: '#/components/schemas/TaxConfig'

api/openapi.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14318,6 +14318,11 @@ components:
1431814318
type: boolean
1431914319
description: Should progressive billing be allowed for this workflow?
1432014320
default: true
14321+
subscriptionEndProrationMode:
14322+
allOf:
14323+
- $ref: '#/components/schemas/BillingWorkflowInvoicingSubscriptionEndProrationMode'
14324+
description: Controls how subscription-ending shortened service periods are billed.
14325+
default: bill_actual_period
1432114326
defaultTaxConfig:
1432214327
allOf:
1432314328
- $ref: '#/components/schemas/TaxConfig'
@@ -14330,6 +14335,12 @@ components:
1433014335
fully supported.
1433114336
description: BillingWorkflowInvoicingSettings represents the invoice settings for a billing workflow
1433214337
title: Workflow invoice settings
14338+
BillingWorkflowInvoicingSubscriptionEndProrationMode:
14339+
type: string
14340+
enum:
14341+
- bill_full_period
14342+
- bill_actual_period
14343+
description: Billing workflow subscription end proration mode.
1433314344
BillingWorkflowLineResolution:
1433414345
type: string
1433514346
enum:
@@ -20482,6 +20493,11 @@ components:
2048220493
With some payment solutions it's only applicable for manual collection method.
2048320494
example: P30D
2048420495
default: P30D
20496+
subscriptionEndProrationMode:
20497+
allOf:
20498+
- $ref: '#/components/schemas/BillingWorkflowInvoicingSubscriptionEndProrationMode'
20499+
description: Controls how subscription-ending shortened service periods are billed.
20500+
default: bill_actual_period
2048520501
defaultTaxConfig:
2048620502
allOf:
2048720503
- $ref: '#/components/schemas/TaxConfig'

api/spec/packages/aip-client-javascript/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export type {
6565
FlatFeeDiscounts,
6666
PriceFree,
6767
WorkflowCollectionAlignmentSubscription,
68-
WorkflowInvoicingSettings,
6968
WorkflowPaymentChargeAutomaticallySettings,
7069
WorkflowPaymentSendInvoiceSettings,
7170
LlmCostProvider,
@@ -173,6 +172,7 @@ export type {
173172
AppCatalogItem,
174173
TaxCodeAppMapping,
175174
PartyTaxIdentity,
175+
WorkflowInvoicingSettings,
176176
ListCurrenciesParamsFilter,
177177
CurrencyCustom,
178178
CreateCurrencyCustomRequest,
@@ -289,7 +289,6 @@ export type {
289289
PlanPagePaginatedResponse,
290290
SortQueryInput,
291291
BaseErrorInput,
292-
WorkflowInvoicingSettingsInput,
293292
WorkflowPaymentSendInvoiceSettingsInput,
294293
EventInput,
295294
UnauthorizedInput,
@@ -309,6 +308,7 @@ export type {
309308
CreateCreditGrantPurchaseInput,
310309
RateCardMeteredEntitlementInput,
311310
CreditGrantPurchaseInput,
311+
WorkflowInvoicingSettingsInput,
312312
UnitConfigInput,
313313
GovernanceQueryRequestInput,
314314
IngestedEventInput,

0 commit comments

Comments
 (0)