Skip to content

Commit

Permalink
Flatten plan related schemas (#1838)
Browse files Browse the repository at this point in the history
  • Loading branch information
justnero authored Mar 21, 2024
1 parent 3a8351c commit e1ad0e6
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 119 deletions.
15 changes: 1 addition & 14 deletions openapi/components/schemas/OneTimeSalePlan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,7 @@ properties:
pricing:
$ref: ./PlanPriceFormula.yaml
setup:
type:
- 'object'
- 'null'
description: Set up information of the plan.
required:
- price
properties:
price:
description: |-
Price of setting up the plan.
If your service charges a set up fee, specify it here.
To charge no set up fee, set this value to `0`.
type: number
format: double
$ref: ./PlanSetup.yaml
customFields:
$ref: ./ResourceCustomFields.yaml
isActive:
Expand Down
14 changes: 14 additions & 0 deletions openapi/components/schemas/PlanSetup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type:
- 'object'
- 'null'
description: Set up information of the plan.
required:
- price
properties:
price:
description: |-
Price of setting up the plan.
If your service charges a set up fee, specify it here.
To charge no set up fee, set this value to `0`.
type: number
format: double
32 changes: 32 additions & 0 deletions openapi/components/schemas/PlanTrial.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
type:
- 'object'
required:
- price
- period
properties:
price:
description: |-
Price of setting up a trial.
If your service charges a fee for a trial, specify it here.
To charge no trial fee, set this value to `0`.
type: number
format: double
period:
type: object
description: Period information.
required:
- unit
- length
properties:
unit:
description: Unit of time.
type: string
enum:
- day
- week
- month
- year
length:
description: Length of time.
type: integer
minimum: 1
15 changes: 1 addition & 14 deletions openapi/components/schemas/StorefrontPlan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,7 @@ properties:
pricing:
$ref: ./PlanPriceFormula.yaml
setup:
type:
- 'object'
- 'null'
description: Set up information of the plan.
required:
- price
properties:
price:
description: |-
Price of setting up the plan.
If your service charges a set up fee, specify it here.
To charge no set up fee, set this value to `0`.
type: number
format: double
$ref: ./PlanSetup.yaml
customFields:
$ref: ./ResourceCustomFields.yaml
isActive:
Expand Down
50 changes: 4 additions & 46 deletions openapi/components/schemas/SubscriptionPlan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,7 @@ properties:
pricing:
$ref: ./PlanPriceFormula.yaml
setup:
type:
- 'object'
- 'null'
description: Set up information of the plan.
required:
- price
properties:
price:
description: |-
Price of setting up the plan.
If your service charges a set up fee, specify it here.
To charge no set up fee, set this value to `0`.
type: number
format: double
$ref: ./PlanSetup.yaml
customFields:
$ref: ./ResourceCustomFields.yaml
isActive:
Expand Down Expand Up @@ -123,41 +110,12 @@ properties:
- prepaid
- postpaid
trial:
type:
- 'object'
- 'null'
description: |-
Trial configuration setting.
If you do not want to offer a trial, set this value to `null`.
required:
- price
- period
properties:
price:
description: |-
Price of the trial.
For a free trial, set this value to `0`.
type: number
format: double
period:
type: object
description: Period information.
required:
- unit
- length
properties:
unit:
description: Unit of time.
type: string
enum:
- day
- week
- month
- year
length:
description: Length of time.
type: integer
minimum: 1
oneOf:
- $ref: ./PlanTrial.yaml
- type: 'null'
meteredBilling:
type:
- 'object'
Expand Down
47 changes: 2 additions & 45 deletions openapi/components/schemas/TrialOnlyPlan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,7 @@ properties:
pricing:
$ref: ./PlanPriceFormula.yaml
setup:
type:
- 'object'
- 'null'
description: Set up information of the plan.
required:
- price
properties:
price:
description: |-
Price of setting up the plan.
If your service charges a set up fee, specify it here.
To charge no set up fee, set this value to `0`.
type: number
format: double
$ref: ./PlanSetup.yaml
customFields:
$ref: ./ResourceCustomFields.yaml
isActive:
Expand All @@ -83,38 +70,8 @@ properties:
description: Specifies if a plan is a trial that does not have recurring instructions.
readOnly: true
trial:
type: object
description: Trial configuration settings.
required:
- price
- period
properties:
price:
description: |-
Price of setting up a trial.
If your service charges a fee for a trial, specify it here.
To charge no trial fee, set this value to `0`.
type: number
format: double
period:
type: object
description: Period information.
required:
- unit
- length
properties:
unit:
description: Unit of time.
type: string
enum:
- day
- week
- month
- year
length:
description: Length of time.
type: integer
minimum: 1
$ref: ./PlanTrial.yaml
invoiceTimeShift:
description: |-
Use invoice time shift to adjust the invoice issue and due date when billing must occur before the service period changes.
Expand Down

0 comments on commit e1ad0e6

Please sign in to comment.