oas: [13/n] improve admin oas (#8971)

Improve the OAS of admin API routes [13/n]
This commit is contained in:
Shahed Nasser
2024-09-03 16:59:37 +00:00
committed by GitHub
parent ff623f8b00
commit f47f1aff49
20 changed files with 144 additions and 93 deletions
@@ -4,7 +4,7 @@
* summary: Remove a Received Item from Return
* x-sidebar-summary: Remove Received Item
* description: |
* Remove an item marked as received in the return by the ID of the item's `RECEIVE_RETURN_ITEM` action.
* Remove a received item in the return by the ID of the item's `RECEIVE_RETURN_ITEM` action.
*
* Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. return.
* x-authenticated: true
@@ -4,7 +4,7 @@
* summary: Remove Item from Return
* x-sidebar-summary: Remove Item
* description: |
* Remove an item in the return by the ID of the item's `RETURN_ITEM` action.
* Remove a requested item to be returned by the ID of the item's `RETURN_ITEM` action.
*
* Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. return.
* x-authenticated: true
@@ -2,7 +2,7 @@
* @oas [post] /admin/returns
* operationId: PostReturns
* summary: Create Return
* description: Create a return.
* description: Create a return. The return can later be requested or confirmed.
* x-authenticated: true
* parameters:
* - name: expand
@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/returns/{id}/dismiss-items
* operationId: PostReturnsIdDismissItems
* summary: Add Dismiss Items to Return
* description: Add a list of dismiss items to a return.
* summary: Add Damaged Items to Return
* x-sidebar-summary: Add Damaged Items
* description: Add damaged items, whose quantity is to be dismissed, to a return. These items will have the action `RECEIVE_DAMAGED_RETURN_ITEM`.
* x-authenticated: true
* parameters:
* - name: id
@@ -1,8 +1,12 @@
/**
* @oas [post] /admin/returns/{id}/dismiss-items/{action_id}
* operationId: PostReturnsIdDismissItemsAction_id
* summary: Add Dismiss Items to Return
* description: Add a list of dismiss items to a return.
* summary: Update Damaged Item of Return
* x-sidebar-summary: Update Damaged Item
* description: |
* Update a damaged item, whose quantity is to be dismissed, in the return by the ID of the item's `RECEIVE_DAMAGED_RETURN_ITEM` action.
*
* Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. return.
* x-authenticated: true
* parameters:
* - name: id
@@ -13,7 +17,7 @@
* type: string
* - name: action_id
* in: path
* description: The return's action id.
* description: The ID of the damaged item's `RECEIVE_DAMAGED_RETURN_ITEM` action.
* required: true
* schema:
* type: string
@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/returns/{id}/receive-items
* operationId: PostReturnsIdReceiveItems
* summary: Add Receive Items to Return
* description: Add a list of receive items to a return.
* summary: Add Received Items to Return
* x-sidebar-summary: Add Received Items
* description: Add received items in a return. These items will have the action `RECEIVE_RETURN_ITEM`.
* x-authenticated: true
* parameters:
* - name: id
@@ -1,8 +1,12 @@
/**
* @oas [post] /admin/returns/{id}/receive-items/{action_id}
* operationId: PostReturnsIdReceiveItemsAction_id
* summary: Add Receive Items to Return
* description: Add a list of receive items to a return.
* summary: Update a Received Item in a Return
* x-sidebar-summary: Update Received Item
* description: |
* Update a received item in the return by the ID of the item's `RECEIVE_RETURN_ITEM` action.
*
* Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. return.
* x-authenticated: true
* parameters:
* - name: id
@@ -13,7 +17,7 @@
* type: string
* - name: action_id
* in: path
* description: The return's action id.
* description: The ID of the received item's `RECEIVE_RETURN_ITEM` action.
* required: true
* schema:
* type: string
@@ -1,8 +1,8 @@
/**
* @oas [post] /admin/returns/{id}/receive
* operationId: PostReturnsIdReceive
* summary: Add Receives to Return
* description: Add a list of receives to a return.
* summary: Start Return Receival
* description: Start a return receival process to be later confirmed using the `/admin/returns/:id/receive/confirm` API route.
* x-authenticated: true
* parameters:
* - name: id
@@ -1,8 +1,10 @@
/**
* @oas [post] /admin/returns/{id}/receive/confirm
* operationId: PostReturnsIdReceiveConfirm
* summary: Add Confirms to Return
* description: Add a list of confirms to a return.
* summary: Confirm Return Receival
* description: >
* Confirm that a return has been received. This updates the quantity of the items received, if not damaged, and
* reflects the changes on the order.
* x-authenticated: true
* parameters:
* - name: id
@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/returns/{id}/request-items
* operationId: PostReturnsIdRequestItems
* summary: Add Request Items to Return
* description: Add a list of request items to a return.
* summary: Add Requested Items to Return
* x-sidebar-summary: Add Items
* description: Add items that are requested to be returned. These items will have the action `RETURN_ITEM`.
* x-authenticated: true
* parameters:
* - name: id
@@ -1,8 +1,12 @@
/**
* @oas [post] /admin/returns/{id}/request-items/{action_id}
* operationId: PostReturnsIdRequestItemsAction_id
* summary: Add Request Items to Return
* description: Add a list of request items to a return.
* summary: Update Requested Item in Return
* x-sidebar-summary: Update Requested Item
* description: |
* Update a requested item to be returned by the ID of the item's `RETURN_ITEM` action.
*
* Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. return.
* x-authenticated: true
* parameters:
* - name: id
@@ -13,7 +17,7 @@
* type: string
* - name: action_id
* in: path
* description: The return's action id.
* description: The ID of the item's `RETURN_ITEM` action.
* required: true
* schema:
* type: string
@@ -1,8 +1,10 @@
/**
* @oas [post] /admin/returns/{id}/request
* operationId: PostReturnsIdRequest
* summary: Add Requests to Return
* description: Add a list of requests to a return.
* summary: Confirm Return Request
* description: >
* Confirm a requested return. The changes are applied on the inventory quantity and the order only after the
* return has been confirmed as received using the `/admin/returns/:id/received/confirm`.
* x-authenticated: true
* parameters:
* - name: id
@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/returns/{id}/shipping-method
* operationId: PostReturnsIdShippingMethod
* summary: Add Shipping Methods to Return
* description: Add a list of shipping methods to a return.
* summary: Add a Shipping Method to a Return
* x-sidebar-summary: Add Shipping Method
* description: Add a shipping method to a return. The shipping method will have a `SHIPPING_ADD` action.
* x-authenticated: true
* parameters:
* - name: id
@@ -1,8 +1,12 @@
/**
* @oas [post] /admin/returns/{id}/shipping-method/{action_id}
* operationId: PostReturnsIdShippingMethodAction_id
* summary: Add Shipping Methods to Return
* description: Add a list of shipping methods to a return.
* summary: Update a Shipping Method of a Return
* x-sidebar-summary: Update Shipping Method
* description: |
* Update a shipping method of the return by the ID of the item's `SHIPPING_ADD` action.
*
* Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property.
* x-authenticated: true
* parameters:
* - name: id
@@ -13,7 +17,7 @@
* type: string
* - name: action_id
* in: path
* description: The return's action id.
* description: The ID of the shipping method's `SHIPPING_ADD` action.
* required: true
* schema:
* type: string
@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/sales-channels/{id}/products
* operationId: PostSalesChannelsIdProducts
* summary: Add Products to Sales Channel
* description: Add a list of products to a sales channel.
* summary: Manage Products in Sales Channel
* x-sidebar-summary: Manage Products
* description: Manage products in a sales channel to add or remove them from the channel.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,22 +63,22 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The products to add or remove from the channel.
* properties:
* add:
* type: array
* description: The sales channel's add.
* description: The products to add to the sales channel.
* items:
* type: string
* title: add
* description: The add's details.
* description: A product's ID.
* remove:
* type: array
* description: The sales channel's remove.
* description: The products to remove from the sales channel.
* items:
* type: string
* title: remove
* description: The remove's details.
* description: A product's ID.
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -62,7 +62,7 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The properties to update in the shipping option.
* properties:
* name:
* type: string
@@ -70,20 +70,25 @@
* description: The shipping option's name.
* data:
* type: object
* description: The shipping option's data.
* description: The shipping option's data that is useful for third-party providers.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property
* price_type:
* type: string
* description: >
* The type of the shipping option's price. If `calculated`, its price is retrieved by the
* associated fulfillment provider during checkout. If `flat`, its price is set in the `prices` property.
* enum:
* - calculated
* - flat
* provider_id:
* type: string
* title: provider_id
* description: The shipping option's provider id.
* description: The ID of the associated fulfillment provider that is used to process the option.
* shipping_profile_id:
* type: string
* title: shipping_profile_id
* description: The shipping option's shipping profile id.
* description: The ID of the shipping profile this shipping option belongs to.
* type:
* type: object
* description: The shipping option's type.
@@ -106,16 +111,16 @@
* description: The type's code.
* prices:
* type: array
* description: The shipping option's prices.
* description: The shipping option's prices. If the `price_type` is `calculated`, pass an empty array.
* items:
* oneOf:
* - type: object
* description: The price's prices.
* description: The shipping option's price for a currency code.
* properties:
* id:
* type: string
* title: id
* description: The price's ID.
* description: The ID of an existing price.
* currency_code:
* type: string
* title: currency_code
@@ -125,16 +130,16 @@
* title: amount
* description: The price's amount.
* - type: object
* description: The price's prices.
* description: The shipping option's price for a region.
* properties:
* id:
* type: string
* title: id
* description: The price's ID.
* description: The ID of an existing price.
* region_id:
* type: string
* title: region_id
* description: The price's region id.
* description: The ID of the associated region.
* amount:
* type: number
* title: amount
@@ -145,7 +150,7 @@
* items:
* oneOf:
* - type: object
* description: The rule's rules.
* description: The details of a new shipping option rule.
* required:
* - operator
* - attribute
@@ -153,6 +158,7 @@
* properties:
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
@@ -165,20 +171,23 @@
* attribute:
* type: string
* title: attribute
* description: The rule's attribute.
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: The rule's value.
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: The rule's value.
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: The value's details.
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: object
* description: The rule's rules.
* description: Update the properties of an existing rule.
* required:
* - id
* - operator
@@ -191,6 +200,7 @@
* description: The rule's ID.
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
@@ -204,17 +214,21 @@
* type: string
* title: attribute
* description: The rule's attribute.
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: The rule's value.
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: The rule's value.
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: The value's details.
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/shipping-options/{id}/rules/batch
* operationId: PostShippingOptionsIdRulesBatch
* summary: Add Rules to Shipping Option
* description: Add a list of rules to a shipping option.
* summary: Manage the Rules of a Shipping Option
* x-sidebar-summary: Manage Rules
* description: Manage the rules of a shipping option to create, update, or delete them.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,14 +63,14 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The rules to create, update, or delete.
* properties:
* create:
* type: array
* description: The shipping option's create.
* description: The shipping option rules to create.
* items:
* type: object
* description: The create's details.
* description: A shipping option's details.
* required:
* - operator
* - attribute
@@ -77,6 +78,7 @@
* properties:
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
@@ -89,24 +91,27 @@
* attribute:
* type: string
* title: attribute
* description: The create's attribute.
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: The create's value.
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: The create's value.
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: The value's details.
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* update:
* type: array
* description: The shipping option's update.
* description: The shipping option rules to update.
* items:
* type: object
* description: The update's details.
* description: The properties to update in the shipping option rule.
* required:
* - id
* - operator
@@ -116,9 +121,10 @@
* id:
* type: string
* title: id
* description: The update's ID.
* description: The rule's ID.
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
@@ -131,25 +137,28 @@
* attribute:
* type: string
* title: attribute
* description: The update's attribute.
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: The update's value.
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: The update's value.
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: The value's details.
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* delete:
* type: array
* description: The shipping option's delete.
* description: The shipping option rules to delete.
* items:
* type: string
* title: delete
* description: The delete's details.
* description: A rule's ID.
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -165,7 +174,7 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The batch operation's result.
* required:
* - created
* - updated
@@ -173,17 +182,17 @@
* properties:
* created:
* type: array
* description: The shipping option's created.
* description: The created shipping option rules.
* items:
* $ref: "#/components/schemas/AdminShippingOptionRule"
* updated:
* type: array
* description: The shipping option's updated.
* description: The updated shipping option rules.
* items:
* $ref: "#/components/schemas/AdminShippingOptionRule"
* deleted:
* type: object
* description: The shipping option's deleted.
* description: The details of the deleted shipping option rules.
* required:
* - ids
* - object
@@ -191,15 +200,16 @@
* properties:
* ids:
* type: array
* description: The deleted's ids.
* description: The IDs of the deleted shipping option rules.
* items:
* type: string
* title: ids
* description: The id's ids.
* description: A shipping option rule's ID.
* object:
* type: string
* title: object
* description: The deleted's object.
* description: The name of the deleted object.
* default: shipping_option_rule
* deleted:
* type: boolean
* title: deleted
@@ -62,7 +62,7 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The properties to update in the shipping profile.
* required:
* - metadata
* properties:
@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/stock-locations/{id}/fulfillment-providers
* operationId: PostStockLocationsIdFulfillmentProviders
* summary: Add Fulfillment Providers to Stock Location
* description: Add a list of fulfillment providers to a stock location.
* summary: Manage Fulfillment Providers of a Stock Location
* x-sidebar-summary: Manage Fulfillment Providers
* description: Manage the fulfillment providers to add or remove them from a stock location.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,22 +63,22 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The fulfillment providers to add or remove from the stock location.
* properties:
* add:
* type: array
* description: The stock location's add.
* description: The fulfillment providers to add to the stock location.
* items:
* type: string
* title: add
* description: The add's details.
* description: A fulfillment provider's ID.
* remove:
* type: array
* description: The stock location's remove.
* description: The fulfillment providers to remove from the stock location.
* items:
* type: string
* title: remove
* description: The remove's details.
* description: A fulfillment provider's ID.
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/stock-locations/{id}/fulfillment-sets
* operationId: PostStockLocationsIdFulfillmentSets
* summary: Add Fulfillment Sets to Stock Location
* description: Add a list of fulfillment sets to a stock location.
* summary: Add Fulfillment Set to Stock Location
* x-sidebar-summary: Add Fulfillment Set
* description: Create and add a fulfillment set to a stock location.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,7 +63,7 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The fulfillment set to create.
* required:
* - name
* - type
@@ -70,11 +71,11 @@
* name:
* type: string
* title: name
* description: The stock location's name.
* description: The fulfillment set's name.
* type:
* type: string
* title: type
* description: The stock location's type.
* description: The fulfillment set's type.
* x-codeSamples:
* - lang: Shell
* label: cURL