chore(oas): [7/n] improve oas schemas (#9162)

This commit is contained in:
Shahed Nasser
2024-09-17 19:27:20 +02:00
committed by GitHub
parent 78eaed70e5
commit b5ffed6973
20 changed files with 128 additions and 190 deletions
@@ -1,7 +1,7 @@
/** /**
* @schema AdminOrderPreviewResponse * @schema AdminOrderPreviewResponse
* type: object * type: object
* description: SUMMARY * description: The preview of an order.
* x-schemaName: AdminOrderPreviewResponse * x-schemaName: AdminOrderPreviewResponse
* required: * required:
* - order * - order
@@ -1,7 +1,7 @@
/** /**
* @schema AdminOrderResponse * @schema AdminOrderResponse
* type: object * type: object
* description: SUMMARY * description: An order's details.
* x-schemaName: AdminOrderResponse * x-schemaName: AdminOrderResponse
* required: * required:
* - order * - order
@@ -1,7 +1,7 @@
/** /**
* @schema AdminOrderReturnResponse * @schema AdminOrderReturnResponse
* type: object * type: object
* description: SUMMARY * description: The order return details.
* x-schemaName: AdminOrderReturnResponse * x-schemaName: AdminOrderReturnResponse
* required: * required:
* - order * - order
@@ -14,29 +14,13 @@
* title: id * title: id
* description: The payment's ID. * description: The payment's ID.
* amount: * amount:
* oneOf: * type: number
* - type: string * title: amount
* title: amount * description: The payment's amount.
* description: The payment's amount.
* - type: number
* title: amount
* description: The payment's amount.
* - type: string
* title: amount
* description: The payment's amount.
* - $ref: "#/components/schemas/IBigNumber"
* authorized_amount: * authorized_amount:
* oneOf: * type: number
* - type: string * title: authorized_amount
* title: authorized_amount * description: The amount authorized of the payment.
* description: The payment's authorized amount.
* - type: number
* title: authorized_amount
* description: The payment's authorized amount.
* - type: string
* title: authorized_amount
* description: The payment's authorized amount.
* - $ref: "#/components/schemas/IBigNumber"
* currency_code: * currency_code:
* type: string * type: string
* title: currency_code * title: currency_code
@@ -44,86 +28,64 @@
* provider_id: * provider_id:
* type: string * type: string
* title: provider_id * title: provider_id
* description: The payment's provider id. * description: The ID of the payment provider used to process this payment.
* cart_id: * cart_id:
* type: string * type: string
* title: cart_id * title: cart_id
* description: The payment's cart id. * description: The ID of the associated cart.
* order_id: * order_id:
* type: string * type: string
* title: order_id * title: order_id
* description: The payment's order id. * description: The ID of the associated order.
* order_edit_id: * order_edit_id:
* type: string * type: string
* title: order_edit_id * title: order_edit_id
* description: The payment's order edit id. * description: The ID of the associated order edit.
* customer_id: * customer_id:
* type: string * type: string
* title: customer_id * title: customer_id
* description: The payment's customer id. * description: ID of the associated customer.
* data: * data:
* type: object * type: object
* description: The payment's data. * description: The payment's data, useful for processing by the payment provider.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/payment/payment#whats-a-payment
* created_at: * created_at:
* type: string * type: string
* format: date-time * format: date-time
* title: created_at * title: created_at
* description: The payment's created at. * description: The date the payment was created.
* updated_at: * updated_at:
* type: string * type: string
* format: date-time * format: date-time
* title: updated_at * title: updated_at
* description: The payment's updated at. * description: The date the payment was updated.
* captured_at: * captured_at:
* oneOf: * type: string
* - type: string * format: date-time
* title: captured_at * title: captured_at
* description: The payment's captured at. * description: The date the payment was captured.
* - type: string
* title: captured_at
* description: The payment's captured at.
* format: date-time
* canceled_at: * canceled_at:
* oneOf: * type: string
* - type: string * format: date-time
* title: canceled_at * title: canceled_at
* description: The payment's canceled at. * description: The date the payment was canceled.
* - type: string
* title: canceled_at
* description: The payment's canceled at.
* format: date-time
* captured_amount: * captured_amount:
* oneOf: * type: number
* - type: string * title: captured_amount
* title: captured_amount * description: The captured amount of the payment.
* description: The payment's captured amount.
* - type: number
* title: captured_amount
* description: The payment's captured amount.
* - type: string
* title: captured_amount
* description: The payment's captured amount.
* - $ref: "#/components/schemas/IBigNumber"
* refunded_amount: * refunded_amount:
* oneOf: * type: number
* - type: string * title: captured_amount
* title: refunded_amount * description: The refunded amount of the payment.
* description: The payment's refunded amount.
* - type: number
* title: refunded_amount
* description: The payment's refunded amount.
* - type: string
* title: refunded_amount
* description: The payment's refunded amount.
* - $ref: "#/components/schemas/IBigNumber"
* captures: * captures:
* type: array * type: array
* description: The payment's captures. * description: The details of payment captures.
* items: * items:
* $ref: "#/components/schemas/BaseCapture" * $ref: "#/components/schemas/BaseCapture"
* refunds: * refunds:
* type: array * type: array
* description: The payment's refunds. * description: The details of payment refunds.
* items: * items:
* $ref: "#/components/schemas/BaseRefund" * $ref: "#/components/schemas/BaseRefund"
* payment_collection: * payment_collection:
@@ -1,7 +1,7 @@
/** /**
* @schema AdminPaymentCollection * @schema AdminPaymentCollection
* type: object * type: object
* description: The payment collection's payment collections. * description: The payment collection's details.
* x-schemaName: AdminPaymentCollection * x-schemaName: AdminPaymentCollection
* required: * required:
* - id * - id
@@ -22,77 +22,41 @@
* region_id: * region_id:
* type: string * type: string
* title: region_id * title: region_id
* description: The payment collection's region id. * description: The ID of the region this payment collection is associated with.
* amount: * amount:
* oneOf: * type: number
* - type: string * title: amount
* title: amount * description: The total amount to be paid.
* description: The payment collection's amount.
* - type: number
* title: amount
* description: The payment collection's amount.
* - type: string
* title: amount
* description: The payment collection's amount.
* - $ref: "#/components/schemas/IBigNumber"
* authorized_amount: * authorized_amount:
* oneOf: * type: number
* - type: string * title: authorized_amount
* title: authorized_amount * description: The total authorized amount of the collection's payments.
* description: The payment collection's authorized amount.
* - type: number
* title: authorized_amount
* description: The payment collection's authorized amount.
* - type: string
* title: authorized_amount
* description: The payment collection's authorized amount.
* - $ref: "#/components/schemas/IBigNumber"
* captured_amount: * captured_amount:
* oneOf: * type: number
* - type: string * title: captured_amount
* title: captured_amount * description: The total captured amount of the collection's payments.
* description: The payment collection's captured amount.
* - type: number
* title: captured_amount
* description: The payment collection's captured amount.
* - type: string
* title: captured_amount
* description: The payment collection's captured amount.
* - $ref: "#/components/schemas/IBigNumber"
* refunded_amount: * refunded_amount:
* oneOf: * type: number
* - type: string * title: refunded_amount
* title: refunded_amount * description: The total refunded amount of the collection's payments.
* description: The payment collection's refunded amount.
* - type: number
* title: refunded_amount
* description: The payment collection's refunded amount.
* - type: string
* title: refunded_amount
* description: The payment collection's refunded amount.
* - $ref: "#/components/schemas/IBigNumber"
* completed_at: * completed_at:
* oneOf: * type: string
* - type: string * format: date-time
* title: completed_at * title: completed_at
* description: The payment collection's completed at. * description: The date the payment collection was completed.
* - type: string
* title: completed_at
* description: The payment collection's completed at.
* format: date-time
* created_at: * created_at:
* type: string * type: string
* format: date-time * format: date-time
* title: created_at * title: created_at
* description: The payment collection's created at. * description: The date the payment collection was created.
* updated_at: * updated_at:
* type: string * type: string
* format: date-time * format: date-time
* title: updated_at * title: updated_at
* description: The payment collection's updated at. * description: The date the payment collection was updated.
* metadata: * metadata:
* type: object * type: object
* description: The payment collection's metadata. * description: The payment collection's metadata, can hold custom key-value pairs.
* status: * status:
* type: string * type: string
* description: The payment collection's status. * description: The payment collection's status.
@@ -104,7 +68,7 @@
* - partially_authorized * - partially_authorized
* payment_providers: * payment_providers:
* type: array * type: array
* description: The payment collection's payment providers. * description: The payment provider used to process the collection's payments and sessions.
* items: * items:
* $ref: "#/components/schemas/BasePaymentProvider" * $ref: "#/components/schemas/BasePaymentProvider"
* payment_sessions: * payment_sessions:
@@ -1,7 +1,7 @@
/** /**
* @schema AdminPaymentCollectionResponse * @schema AdminPaymentCollectionResponse
* type: object * type: object
* description: SUMMARY * description: The payment collection's details.
* x-schemaName: AdminPaymentCollectionResponse * x-schemaName: AdminPaymentCollectionResponse
* required: * required:
* - payment_collection * - payment_collection
@@ -1,8 +1,20 @@
/** /**
* @schema AdminPaymentProvider * @schema AdminPaymentProvider
* type: object * type: object
* description: The payment provider's payment providers. * description: The payment provider's details.
* x-schemaName: AdminPaymentProvider * x-schemaName: AdminPaymentProvider
* required:
* - is_enabled
* - id
* properties:
* id:
* type: string
* title: id
* description: The payment provider's ID.
* is_enabled:
* type: boolean
* title: is_enabled
* description: Whether the payment provider is enabled.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminPaymentResponse * @schema AdminPaymentResponse
* type: object * type: object
* description: SUMMARY * description: The payment's details.
* x-schemaName: AdminPaymentResponse * x-schemaName: AdminPaymentResponse
* required: * required:
* - payment * - payment
@@ -1,13 +1,13 @@
/** /**
* @schema AdminPostCancelClaimReqSchema * @schema AdminPostCancelClaimReqSchema
* type: object * type: object
* description: SUMMARY * description: The details of canceling a claim.
* x-schemaName: AdminPostCancelClaimReqSchema * x-schemaName: AdminPostCancelClaimReqSchema
* properties: * properties:
* no_notification: * no_notification:
* type: boolean * type: boolean
* title: no_notification * title: no_notification
* description: The claim's no notification. * description: Whether to send the customer a notification about the claim's cancelation.
* *
*/ */
@@ -1,13 +1,13 @@
/** /**
* @schema AdminPostCancelExchangeReqSchema * @schema AdminPostCancelExchangeReqSchema
* type: object * type: object
* description: SUMMARY * description: The details of canceling an exchange.
* x-schemaName: AdminPostCancelExchangeReqSchema * x-schemaName: AdminPostCancelExchangeReqSchema
* properties: * properties:
* no_notification: * no_notification:
* type: boolean * type: boolean
* title: no_notification * title: no_notification
* description: The exchange's no notification. * description: Whether to send a notification to the customer about the exchange's cancelation.
* *
*/ */
@@ -1,13 +1,13 @@
/** /**
* @schema AdminPostCancelReturnReqSchema * @schema AdminPostCancelReturnReqSchema
* type: object * type: object
* description: SUMMARY * description: The details of canceling a return.
* x-schemaName: AdminPostCancelReturnReqSchema * x-schemaName: AdminPostCancelReturnReqSchema
* properties: * properties:
* no_notification: * no_notification:
* type: boolean * type: boolean
* title: no_notification * title: no_notification
* description: The return's no notification. * description: Whether to send the customer a notification about the return's cancelation.
* *
*/ */
@@ -1,15 +1,15 @@
/** /**
* @schema AdminPostClaimItemsReqSchema * @schema AdminPostClaimItemsReqSchema
* type: object * type: object
* description: SUMMARY * description: The details of the order items to add to the claim.
* x-schemaName: AdminPostClaimItemsReqSchema * x-schemaName: AdminPostClaimItemsReqSchema
* properties: * properties:
* items: * items:
* type: array * type: array
* description: The claim's items. * description: The item's details.
* items: * items:
* type: object * type: object
* description: The item's items. * description: An item's details.
* required: * required:
* - id * - id
* - quantity * - quantity
@@ -17,14 +17,14 @@
* id: * id:
* type: string * type: string
* title: id * title: id
* description: The item's ID. * description: The ID of the order's item.
* quantity: * quantity:
* type: number * type: number
* title: quantity * title: quantity
* description: The item's quantity. * description: The quantity of the order's item to add to the claim.
* reason: * reason:
* type: string * type: string
* description: The item's reason. * description: The reason the item is claimed.
* enum: * enum:
* - missing_item * - missing_item
* - wrong_item * - wrong_item
@@ -37,7 +37,7 @@
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The item's internal note. * description: A note that's only viewed by admin users.
* *
*/ */
@@ -1,15 +1,15 @@
/** /**
* @schema AdminPostClaimsAddItemsReqSchema * @schema AdminPostClaimsAddItemsReqSchema
* type: object * type: object
* description: SUMMARY * description: The details of the outbound items to add to the claim.
* x-schemaName: AdminPostClaimsAddItemsReqSchema * x-schemaName: AdminPostClaimsAddItemsReqSchema
* properties: * properties:
* items: * items:
* type: array * type: array
* description: The claim's items. * description: The outbound item's details.
* items: * items:
* type: object * type: object
* description: The item's items. * description: An item's details.
* required: * required:
* - variant_id * - variant_id
* - quantity * - quantity
@@ -17,11 +17,11 @@
* variant_id: * variant_id:
* type: string * type: string
* title: variant_id * title: variant_id
* description: The item's variant id. * description: The ID of the associated product variant.
* quantity: * quantity:
* type: number * type: number
* title: quantity * title: quantity
* description: The item's quantity. * description: The quantity to send to the customer.
* unit_price: * unit_price:
* type: number * type: number
* title: unit_price * title: unit_price
@@ -29,10 +29,10 @@
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The item's internal note. * description: A note viewed only by admin users.
* metadata: * metadata:
* type: object * type: object
* description: The item's metadata. * description: The item's metadata, can hold custom key-value pairs.
* *
*/ */
@@ -1,21 +1,21 @@
/** /**
* @schema AdminPostClaimsItemsActionReqSchema * @schema AdminPostClaimsItemsActionReqSchema
* type: object * type: object
* description: SUMMARY * description: The details to update in the item.
* x-schemaName: AdminPostClaimsItemsActionReqSchema * x-schemaName: AdminPostClaimsItemsActionReqSchema
* properties: * properties:
* quantity: * quantity:
* type: number * type: number
* title: quantity * title: quantity
* description: The claim's quantity. * description: The item's quantity.
* reason_id: * reason_id:
* type: string * type: string
* title: reason_id * title: reason_id
* description: The claim's reason id. * description: The ID of the return reason associated with the item.
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The claim's internal note. * description: A note that's only viewed by admin users.
* *
*/ */
@@ -1,20 +1,20 @@
/** /**
* @schema AdminPostClaimsShippingActionReqSchema * @schema AdminPostClaimsShippingActionReqSchema
* type: object * type: object
* description: SUMMARY * description: The details to update in the shipping method.
* x-schemaName: AdminPostClaimsShippingActionReqSchema * x-schemaName: AdminPostClaimsShippingActionReqSchema
* properties: * properties:
* custom_amount: * custom_amount:
* type: number * type: number
* title: custom_amount * title: custom_amount
* description: The claim's custom amount. * description: The shipping method's custom amount.
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The claim's internal note. * description: A note only viewed by admin users.
* metadata: * metadata:
* type: object * type: object
* description: The claim's metadata. * description: The claim's metadata, can hold custom key-value pairs.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminPostClaimsShippingReqSchema * @schema AdminPostClaimsShippingReqSchema
* type: object * type: object
* description: SUMMARY * description: The details of the shipping method used to ship outbound items.
* x-schemaName: AdminPostClaimsShippingReqSchema * x-schemaName: AdminPostClaimsShippingReqSchema
* required: * required:
* - shipping_option_id * - shipping_option_id
@@ -9,22 +9,22 @@
* shipping_option_id: * shipping_option_id:
* type: string * type: string
* title: shipping_option_id * title: shipping_option_id
* description: The claim's shipping option id. * description: The ID of the associated shipping option.
* custom_amount: * custom_amount:
* type: number * type: number
* title: custom_amount * title: custom_amount
* description: The claim's custom amount. * description: Set a custom price for the shipping method.
* description: * description:
* type: string * type: string
* title: description * title: description
* description: The claim's description. * description: The shipping method's description.
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The claim's internal note. * description: A note only viewed by admin users.
* metadata: * metadata:
* type: object * type: object
* description: The claim's metadata. * description: The claim's metadata, can hold custom key-value pairs.
* *
*/ */
@@ -1,15 +1,15 @@
/** /**
* @schema AdminPostExchangesAddItemsReqSchema * @schema AdminPostExchangesAddItemsReqSchema
* type: object * type: object
* description: SUMMARY * description: The details of outbound items.
* x-schemaName: AdminPostExchangesAddItemsReqSchema * x-schemaName: AdminPostExchangesAddItemsReqSchema
* properties: * properties:
* items: * items:
* type: array * type: array
* description: The exchange's items. * description: The details of outbound items.
* items: * items:
* type: object * type: object
* description: The item's items. * description: An item's details.
* required: * required:
* - variant_id * - variant_id
* - quantity * - quantity
@@ -17,7 +17,7 @@
* variant_id: * variant_id:
* type: string * type: string
* title: variant_id * title: variant_id
* description: The item's variant id. * description: The ID of the associated product variant.
* quantity: * quantity:
* type: number * type: number
* title: quantity * title: quantity
@@ -29,14 +29,14 @@
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The item's internal note. * description: A note viewed only by admin users.
* allow_backorder: * allow_backorder:
* type: boolean * type: boolean
* title: allow_backorder * title: allow_backorder
* description: The item's allow backorder. * description: Whether the item can be added even if it's not in stock.
* metadata: * metadata:
* type: object * type: object
* description: The item's metadata. * description: The item's metadata, can hold custom key-value pairs.
* *
*/ */
@@ -1,17 +1,17 @@
/** /**
* @schema AdminPostExchangesItemsActionReqSchema * @schema AdminPostExchangesItemsActionReqSchema
* type: object * type: object
* description: SUMMARY * description: The details to update in an outbound item.
* x-schemaName: AdminPostExchangesItemsActionReqSchema * x-schemaName: AdminPostExchangesItemsActionReqSchema
* properties: * properties:
* quantity: * quantity:
* type: number * type: number
* title: quantity * title: quantity
* description: The exchange's quantity. * description: The item's quantity.
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The exchange's internal note. * description: A note only viewed by admin users.
* *
*/ */
@@ -1,24 +1,24 @@
/** /**
* @schema AdminPostExchangesRequestItemsReturnActionReqSchema * @schema AdminPostExchangesRequestItemsReturnActionReqSchema
* type: object * type: object
* description: SUMMARY * description: The details to update in an inbound (returned) item.
* x-schemaName: AdminPostExchangesRequestItemsReturnActionReqSchema * x-schemaName: AdminPostExchangesRequestItemsReturnActionReqSchema
* properties: * properties:
* quantity: * quantity:
* type: number * type: number
* title: quantity * title: quantity
* description: The exchange's quantity. * description: The item's quantity.
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The exchange's internal note. * description: A note viewed only by admin users.
* reason_id: * reason_id:
* type: string * type: string
* title: reason_id * title: reason_id
* description: The exchange's reason id. * description: The ID of the associated return reason.
* metadata: * metadata:
* type: object * type: object
* description: The exchange's metadata. * description: The exchange's metadata, can hold custom key-value pairs.
* *
*/ */
@@ -1,15 +1,15 @@
/** /**
* @schema AdminPostExchangesReturnRequestItemsReqSchema * @schema AdminPostExchangesReturnRequestItemsReqSchema
* type: object * type: object
* description: SUMMARY * description: The details of the inbound (return) items.
* x-schemaName: AdminPostExchangesReturnRequestItemsReqSchema * x-schemaName: AdminPostExchangesReturnRequestItemsReqSchema
* properties: * properties:
* items: * items:
* type: array * type: array
* description: The exchange's items. * description: The details of the inbound (return) items.
* items: * items:
* type: object * type: object
* description: The item's items. * description: An item's details.
* required: * required:
* - id * - id
* - quantity * - quantity
@@ -17,7 +17,7 @@
* id: * id:
* type: string * type: string
* title: id * title: id
* description: The item's ID. * description: The ID of the order's item.
* quantity: * quantity:
* type: number * type: number
* title: quantity * title: quantity
@@ -29,14 +29,14 @@
* internal_note: * internal_note:
* type: string * type: string
* title: internal_note * title: internal_note
* description: The item's internal note. * description: A note viewed only by admin users.
* reason_id: * reason_id:
* type: string * type: string
* title: reason_id * title: reason_id
* description: The item's reason id. * description: The ID of the return reason to associate with the item.
* metadata: * metadata:
* type: object * type: object
* description: The item's metadata. * description: The item's metadata, can hold custom key-value pairs.
* *
*/ */