Skip to content

Commit

Permalink
Refactor subscriptions related files (#1734)
Browse files Browse the repository at this point in the history
* Rename Subscription.yaml to SubscriptionOrOneTimeSale.yaml

* Rename OneTimeOrder.yaml to OneTimeSale.yaml

* Rename StorefrontOneTimeOrder.yaml to StorefrontOneTimeSale.yaml

* Rename SubscriptionOrder.yaml to Subscription.yaml

* Rename StorefrontSubscriptionOrder.yaml to StorefrontSubscription.yaml

* Add Orders API related files

* Apply suggestions from code review

Co-authored-by: Chris  <[email protected]>

* Introduce LegacySubscription && LegacyOneTimeSale yaml files

	LegacySubscription.yaml && LegacyOneTimeSale.yaml files contain
		billing related properties.

	Subscription.yaml && OneTimeSale.yaml files contain non billing
		related properties.

* Rename discriminator property to orderType

* Update openapi/components/schemas/SubscriptionOrOneTimeSale.yaml

Co-authored-by: Arif Kurkchi <[email protected]>

* Rename Subscription.yaml to BaseSubscription.yaml

* Introduce BaseSubscription.yaml for orderType/type properties

	BaseSubscription.yaml base file without orderType/type props
	Subscription.yaml extends BaseSubscription.yaml and adds type prop
	LegacySubscription.yaml extends BaseSubscription.yaml and adds orderType prop

* Update orderExpand.yaml

* Update orderExpand.yaml

* Update Order.yaml

* Move initialInvoiceId && recentInvoiceId to LegacySubscription.yaml

* Remove duplicated properties from BaseSubscription.yaml

* Add OneTimeSale type to Order

* Remove not needed required properties

* Move invoiceTimeShift to Order level

* Introduce BaseOneTimeSale.yaml

* Fix after resolving PR conflicts

* Remove BaseSubscription.yaml && BaseOneTimeSale.yaml files

* Add missing delinquencyPeriod property

* Add revision to Order

* Add createdTime && updatedTime properties

* Reorder order properties

* Update descriptions

* Add required properties

* Reorder Order recentInvoiceId property

* Update openapi/components/schemas/LegacyOneTimeSale.yaml

Co-authored-by: Chris  <[email protected]>

* Reorder poNumber property

* Add missing delinquencyPeriod property

* Reorder poNumber property

* Replace invoiceTimeShift by invoiceIssueTimeShift property

* Add invoiceIssueTimeShift and invoiceDueTimeShift properties

* Update descriptions

* Update descriptions

* Update billingStatus description

* Add SelfLink to Order

* Apply suggestions from code review

Co-authored-by: Chris  <[email protected]>

* Apply suggestions from code review

Co-authored-by: Chris  <[email protected]>

* Apply suggestions from code review

Co-authored-by: Chris  <[email protected]>

* Remove spaces

* Fix indentations

* Move startTime and activationTime to Order level

* Update startTime description

* Update startTime and activationTime as non nullable fields

* Rename billingStatus property to status

* Update status type

* Remove _links and _embedded from Subscription and OneTimeSale

* Update delinquencyPeriod description

* Revert "Update status type"

This reverts commit fd572c8.

* Add delinquencyPeriod field to Order

* Add richBillingPortalId field to Order

* Update order items description

* Update order items description

* Update invoiceIssueTimeShift description

* Rename activationTime field to processTime

* Rename startTime field to scheduledProcessTime

* Add orderId to storefront invoice

* Revert "Rename activationTime field to processTime"

This reverts commit eea5a0a.

* Revert "Rename startTime field to scheduledProcessTime"

This reverts commit 30d1364.

* Update example of delinquencyPeriod field

* Update openapi/components/schemas/Order.yaml

Co-authored-by: Adam Altman <[email protected]>

* Update richBillingPortalId type

* Update description of the id

* Remove items from {Subscription|OneTimeSale}.yaml files

* Rename OrderItem.yaml to LegacySubscriprionOrOneTimeSaleItem.yaml

* Fix the file name

* Add plan object to Subscription and OneTimeSale

* Remove orderExpand.yaml

* Rename inner plan field to planDetails

* Remove plan.id field and deprecated true from planId

* Add isTrialConverted field

* Update isTrialConverted field description in Subscription.yaml

* Revert "Update isTrialConverted field description in Subscription.yaml"

This reverts commit 0880ea2.

* Rename plan fields

* Move plan fields to upper level

* Revert "Remove orderExpand.yaml"

This reverts commit cd4e362.

* Remove orderExpand for GetOrderCollection

* Move trial fields to upper level

* Add quantityFilled to Subscription

* Rename field to billingPortalId

* Rename initialInvoice field to activationInvoice

* Add billingPortalId to LegacySubscription.yaml

* Update billingPortalId example

* Rename field to isTrialEnabled

* Update required fields for Subscription and OneTimeSale

* Remove orderId from Invoice and StorefrontInvoice yaml files

* Restore space

* Remove Order related changes

* Rollback text updates

* Rename UpcomingInvoiceItem to LegacyUpcomingInvoiceItem

* Rename UpcomingInvoice to LegacyUpcomingInvoice

* Rename LegacyUpcomingInvoice to StorefrontLegacyUpcomingInvoice

* Rename LegacySubscriptionOrOneTimeSaleItem to SubscriptionOrOneTimeSaleItem

* Rename LegacyUpcomingInvoiceItem.yaml to UpcomingInvoiceItem.yaml

* Rename StorefrontLegacyUpcomingInvoice to StorefrontUpcomingInvoice

* Rename LegacyUpcomingInvoice.yaml to UpcomingInvoice.yaml

* Rename LegacySubscription.yaml to Subscription.yaml

* Rename LegacyOneTimeSale.yaml to OneTimeSale.yaml

* Rename SubscriptionOrderPlan.yaml to SubscriptionPlan.yaml

---------

Co-authored-by: Chris <[email protected]>
Co-authored-by: Arif Kurkchi <[email protected]>
Co-authored-by: Weetbix <[email protected]>
Co-authored-by: Adam Altman <[email protected]>
  • Loading branch information
5 people authored Mar 8, 2024
1 parent b023314 commit ca6fbbf
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion openapi/components/schemas/FlexiblePlan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ allOf:
example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X
- anyOf:
- $ref: ./OneTimeSalePlan.yaml
- $ref: ./SubscriptionOrderPlan.yaml
- $ref: ./SubscriptionPlan.yaml
- $ref: ./TrialOnlyPlan.yaml
2 changes: 1 addition & 1 deletion openapi/components/schemas/OneTimeSale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ properties:
type: array
minItems: 1
items:
$ref: ./OrderItem.yaml
$ref: ./SubscriptionOrOneTimeSaleItem.yaml
deliveryAddress:
description: Delivery address of the order.
oneOf:
Expand Down
2 changes: 1 addition & 1 deletion openapi/components/schemas/Plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ allOf:
readOnly: true
- anyOf:
- $ref: ./OneTimeSalePlan.yaml
- $ref: ./SubscriptionOrderPlan.yaml
- $ref: ./SubscriptionPlan.yaml
- $ref: ./TrialOnlyPlan.yaml

2 changes: 1 addition & 1 deletion openapi/components/schemas/StorefrontOneTimeSale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ properties:
type: array
minItems: 1
items:
$ref: ./OrderItem.yaml
$ref: ./SubscriptionOrOneTimeSaleItem.yaml
deliveryAddress:
description: Delivery address of the order.
oneOf:
Expand Down
2 changes: 1 addition & 1 deletion openapi/components/schemas/StorefrontSubscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ properties:
type: array
minItems: 1
items:
$ref: ./OrderItem.yaml
$ref: ./SubscriptionOrOneTimeSaleItem.yaml
deliveryAddress:
description: Delivery address of the order.
oneOf:
Expand Down
2 changes: 1 addition & 1 deletion openapi/components/schemas/Subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ properties:
type: array
minItems: 1
items:
$ref: ./OrderItem.yaml
$ref: ./SubscriptionOrOneTimeSaleItem.yaml
deliveryAddress:
description: Delivery address of the order.
oneOf:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion openapi/paths/subscriptions@{id}@items@{itemId}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ patch:
content:
application/json:
schema:
$ref: ../components/schemas/OrderItem.yaml
$ref: ../components/schemas/SubscriptionOrOneTimeSaleItem.yaml
'401':
$ref: ../components/responses/Unauthorized.yaml
'403':
Expand Down

0 comments on commit ca6fbbf

Please sign in to comment.