chore(oas): [13/n] improve oas schemas (#9201)

* chore(oas): [13/n] improve oas schemas

* remove tax region name
This commit is contained in:
Shahed Nasser
2024-09-22 15:50:26 +03:00
committed by GitHub
parent c790af7834
commit cebffc7a11
20 changed files with 164 additions and 100 deletions

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminFulfillmentProvider
* type: object
* description: The shipping option's provider.
* description: The fulfillment provider's details.
* x-schemaName: AdminFulfillmentProvider
* required:
* - id

View File

@@ -1,8 +1,47 @@
/**
* @schema AdminShippingProfile
* type: object
* description: The shipping option's shipping profile.
* description: The shipping profile's details..
* x-schemaName: AdminShippingProfile
* properties:
* id:
* type: string
* title: id
* description: The shipping profile's ID.
* name:
* type: string
* title: name
* description: The shipping profile's name.
* type:
* type: string
* title: type
* description: The shipping profile's type.
* metadata:
* type: object
* description: The shipping profile's metadata, holds custom key-value pairs.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The date the shipping profile was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The date the shipping profile was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The date the shipping profile was deleted.
* required:
* - id
* - name
* - type
* - metadata
* - created_at
* - updated_at
* - deleted_at
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminShippingProfileDeleteResponse
* type: object
* description: SUMMARY
* description: The details of the shipping profile's deletion.
* x-schemaName: AdminShippingProfileDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Shipping Profile was deleted.
* description: Whether the shipping profile was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminShippingProfileResponse
* type: object
* description: SUMMARY
* description: The shipping profile's details.
* x-schemaName: AdminShippingProfileResponse
* required:
* - shipping_profile

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminStockLocation
* type: object
* description: The parent's location.
* description: The stock location's details.
* x-schemaName: AdminStockLocation
* required:
* - id
@@ -19,22 +19,22 @@
* address_id:
* type: string
* title: address_id
* description: The location's address id.
* description: The ID of the associated address.
* address:
* $ref: "#/components/schemas/AdminStockLocationAddress"
* sales_channels:
* type: array
* description: The location's sales channels.
* description: The sales channels associated with the location.
* items:
* $ref: "#/components/schemas/AdminSalesChannel"
* fulfillment_providers:
* type: array
* description: The location's fulfillment providers.
* description: The fulfillment providers associated with the location.
* items:
* $ref: "#/components/schemas/AdminFulfillmentProvider"
* fulfillment_sets:
* type: array
* description: The location's fulfillment sets.
* description: The fulfillment sets associated with the location.
* items:
* $ref: "#/components/schemas/AdminFulfillmentSet"
*

View File

@@ -1,8 +1,56 @@
/**
* @schema AdminStockLocationAddress
* type: object
* description: The location's address.
* description: The details of the stock location address.
* x-schemaName: AdminStockLocationAddress
* properties:
* id:
* type: string
* title: id
* description: The address's ID.
* address_1:
* type: string
* title: address_1
* description: The address's first line.
* address_2:
* type: string
* title: address_2
* description: The address's second line.
* company:
* type: string
* title: company
* description: The address's company.
* country_code:
* type: string
* title: country_code
* description: The address's country code.
* example: us
* city:
* type: string
* title: city
* description: The address's city.
* phone:
* type: string
* title: phone
* description: The address's phone.
* postal_code:
* type: string
* title: postal_code
* description: The address's postal code.
* province:
* type: string
* title: province
* description: The address's province.
* required:
* - id
* - address_1
* - address_2
* - company
* - country_code
* - city
* - phone
* - postal_code
* - province
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminStockLocationDeleteResponse
* type: object
* description: SUMMARY
* description: The details of the stock location's deletion.
* x-schemaName: AdminStockLocationDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Stock Location was deleted.
* description: Whether the stock location was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminStockLocationListResponse
* type: object
* description: SUMMARY
* description: The paginated list of stock locations.
* x-schemaName: AdminStockLocationListResponse
* required:
* - limit
@@ -12,18 +12,18 @@
* limit:
* type: number
* title: limit
* description: The stock location's limit.
* description: The maximum number of items returned.
* offset:
* type: number
* title: offset
* description: The stock location's offset.
* description: The number of items skipped before retrieving the returned items.
* count:
* type: number
* title: count
* description: The stock location's count.
* description: The total number of items.
* stock_locations:
* type: array
* description: The stock location's stock locations.
* description: The list of stock locations.
* items:
* $ref: "#/components/schemas/AdminStockLocation"
*

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminStockLocationResponse
* type: object
* description: SUMMARY
* description: The stock location's details.
* x-schemaName: AdminStockLocationResponse
* required:
* - stock_location

View File

@@ -30,28 +30,28 @@
* default_sales_channel_id:
* type: string
* title: default_sales_channel_id
* description: The store's default sales channel id.
* description: The ID of the sales channel used by default in the store.
* default_region_id:
* type: string
* title: default_region_id
* description: The store's default region id.
* description: The ID of the region used by default in the store.
* default_location_id:
* type: string
* title: default_location_id
* description: The store's default location id.
* description: The ID of the stock location used by default in the store.
* metadata:
* type: object
* description: The store's metadata.
* description: The store's metadata, can hold custom key-value pairs.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The store's created at.
* description: The date the store was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The store's updated at.
* description: The date the store was updated.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminStoreCurrency
* type: object
* description: The supported currency's supported currencies.
* description: The details of a store's currency.
* x-schemaName: AdminStoreCurrency
* required:
* - id
@@ -16,36 +16,37 @@
* id:
* type: string
* title: id
* description: The supported currency's ID.
* description: The currency's ID.
* currency_code:
* type: string
* title: currency_code
* description: The supported currency's currency code.
* description: The currency's code.
* example: usd
* store_id:
* type: string
* title: store_id
* description: The supported currency's store id.
* description: The ID of the store this currency belongs to.
* is_default:
* type: boolean
* title: is_default
* description: The supported currency's is default.
* description: Whether this currency is the default in the store.
* currency:
* $ref: "#/components/schemas/AdminCurrency"
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The supported currency's created at.
* description: The date the currency was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The supported currency's updated at.
* description: The date the currency was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The supported currency's deleted at.
* description: The date the currency was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminStoreListResponse
* type: object
* description: SUMMARY
* description: The paginated list of stores.
* x-schemaName: AdminStoreListResponse
* required:
* - limit
@@ -12,18 +12,18 @@
* limit:
* type: number
* title: limit
* description: The store's limit.
* description: The maximum number of items returned.
* offset:
* type: number
* title: offset
* description: The store's offset.
* description: The number of items skipped before retrieving the returned items.
* count:
* type: number
* title: count
* description: The store's count.
* description: The total number of items.
* stores:
* type: array
* description: The store's stores.
* description: The list of stores.
* items:
* $ref: "#/components/schemas/AdminStore"
*

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminStoreResponse
* type: object
* description: SUMMARY
* description: The store's details.
* x-schemaName: AdminStoreResponse
* required:
* - store

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminTaxRate
* type: object
* description: The tax rate's parent.
* description: The tax rate's details.
* x-schemaName: AdminTaxRate
* required:
* - id
@@ -22,58 +22,61 @@
* id:
* type: string
* title: id
* description: The parent's ID.
* description: The tax rate's ID.
* rate:
* type: number
* title: rate
* description: The parent's rate.
* description: The rate to charge.
* example: 10
* code:
* type: string
* title: code
* description: The parent's code.
* description: The code the tax rate is identified by.
* name:
* type: string
* title: name
* description: The parent's name.
* description: The tax rate's name.
* metadata:
* type: object
* description: The parent's metadata.
* description: The tax rate's metadata, can hold custom key-value pairs.
* tax_region_id:
* type: string
* title: tax_region_id
* description: The parent's tax region id.
* description: The ID of the tax region this rate belongs to.
* is_combinable:
* type: boolean
* title: is_combinable
* description: The parent's is combinable.
* description: Whether the tax rate should be combined with parent rates.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/tax/tax-rates-and-rules#combinable-tax-rates
* is_default:
* type: boolean
* title: is_default
* description: The parent's is default.
* description: Whether this tax rate is the default in the tax region.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The parent's created at.
* description: The date the tax rate was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The parent's updated at.
* description: The date the tax rate was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The parent's deleted at.
* description: The date the tax rate was deleted.
* created_by:
* type: string
* title: created_by
* description: The parent's created by.
* description: The ID of the user that created the tax rate.
* tax_region:
* $ref: "#/components/schemas/AdminTaxRegion"
* rules:
* type: array
* description: The parent's rules.
* description: The tax rate's rules.
* items:
* $ref: "#/components/schemas/AdminTaxRateRule"
*

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminTaxRateDeleteResponse
* type: object
* description: SUMMARY
* description: The details of the tax rate deletion.
* x-schemaName: AdminTaxRateDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Tax Rate was deleted.
* description: Whether the tax rate was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminTaxRateResponse
* type: object
* description: SUMMARY
* description: The tax rate's details.
* x-schemaName: AdminTaxRateResponse
* required:
* - tax_rate

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminTaxRateRule
* type: object
* description: The rule's rules.
* description: The tax rate rule's details.
* x-schemaName: AdminTaxRateRule
* required:
* - reference
@@ -10,11 +10,13 @@
* reference:
* type: string
* title: reference
* description: The rule's reference.
* description: The name of the table this rule references.
* example: product_type
* reference_id:
* type: string
* title: reference_id
* description: The rule's reference id.
* description: The ID of a record in the table that this rule references.
* example: ptyp_1
*
*/

View File

@@ -1,19 +1,13 @@
/**
* @schema AdminTaxRegion
* type: object
* description: The parent's tax region.
* description: The tax region's details.
* x-schemaName: AdminTaxRegion
* required:
* - id
* - rate
* - code
* - country_code
* - province_code
* - name
* - metadata
* - tax_region_id
* - is_combinable
* - is_default
* - parent_id
* - created_at
* - updated_at
@@ -27,67 +21,44 @@
* type: string
* title: id
* description: The tax region's ID.
* rate:
* type: number
* title: rate
* description: The tax region's rate.
* code:
* type: string
* title: code
* description: The tax region's code.
* country_code:
* type: string
* title: country_code
* description: The tax region's country code.
* example: us
* province_code:
* type: string
* title: province_code
* description: The tax region's province code.
* name:
* type: string
* title: name
* description: The tax region's name.
* metadata:
* type: object
* description: The tax region's metadata.
* tax_region_id:
* type: string
* title: tax_region_id
* description: The tax region's tax region id.
* is_combinable:
* type: boolean
* title: is_combinable
* description: The tax region's is combinable.
* is_default:
* type: boolean
* title: is_default
* description: The tax region's is default.
* description: The tax region's metadata, can hold custom key-value pairs.
* parent_id:
* type: string
* title: parent_id
* description: The tax region's parent id.
* description: The ID of the parent tax region.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The tax region's created at.
* description: The date the tax region was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The tax region's updated at.
* description: The date the tax region was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The tax region's deleted at.
* description: The date the tax region was deleted.
* created_by:
* type: string
* title: created_by
* description: The tax region's created by.
* description: The ID of the user that created the tax region.
* tax_rates:
* type: array
* description: The tax region's tax rates.
* description: The tax region's rates.
* items:
* $ref: "#/components/schemas/AdminTaxRate"
* parent:

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminTaxRegionDeleteResponse
* type: object
* description: SUMMARY
* description: The details of the tax region deletion.
* x-schemaName: AdminTaxRegionDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Tax Region was deleted.
* description: Whether the tax region was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminTaxRegionResponse
* type: object
* description: SUMMARY
* description: The tax region's details.
* x-schemaName: AdminTaxRegionResponse
* required:
* - tax_region