From a5ed061d6cf11bbb2e173898191d3950d0377a8d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:57:32 +0100 Subject: [PATCH] chore(docs): Updated API Reference (automated) (#10531) * chore(docs): Generated API Reference (automated) * fixes --------- Co-authored-by: olivermrbl Co-authored-by: Shahed Nasser --- .../admin/components/schemas/AdminInvite.yaml | 3 + .../schemas/AdminShippingOptionPriceRule.yaml | 46 ++++ .../admin/components/schemas/OrderClaim.yaml | 15 +- .../schemas/StoreCalculatedPrice.yaml | 122 +++++++++ .../schemas/StoreCartShippingOption.yaml | 9 + .../admin/components/schemas/StorePrice.yaml | 36 +++ .../components/schemas/StorePriceRule.yaml | 30 +++ .../specs/admin/openapi.full.yaml | 255 +++++++++++++++++- .../store/components/schemas/AdminInvite.yaml | 3 + .../schemas/AdminShippingOptionPriceRule.yaml | 46 ++++ .../store/components/schemas/OrderClaim.yaml | 15 +- .../schemas/StoreCalculatedPrice.yaml | 122 +++++++++ .../schemas/StoreCartShippingOption.yaml | 9 + .../store/components/schemas/StorePrice.yaml | 36 +++ .../components/schemas/StorePriceRule.yaml | 30 +++ .../specs/store/openapi.full.yaml | 255 +++++++++++++++++- .../oas-output/schemas/AdminInvite.ts | 3 + .../schemas/AdminShippingOptionPriceRule.ts | 46 ++++ .../oas-output/schemas/OrderClaim.ts | 15 +- .../schemas/StoreAddCartLineItem.ts | 1 + .../schemas/StoreCalculatedPrice.ts | 118 ++++++++ .../schemas/StoreCartShippingOption.ts | 9 + .../oas-output/schemas/StorePrice.ts | 41 +++ .../oas-output/schemas/StorePriceRule.ts | 35 +++ 24 files changed, 1235 insertions(+), 65 deletions(-) create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StoreCalculatedPrice.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StorePrice.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StorePriceRule.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StoreCalculatedPrice.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StorePrice.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StorePriceRule.yaml create mode 100644 www/utils/generated/oas-output/schemas/StoreCalculatedPrice.ts create mode 100644 www/utils/generated/oas-output/schemas/StorePrice.ts create mode 100644 www/utils/generated/oas-output/schemas/StorePriceRule.ts diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminInvite.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminInvite.yaml index d9928379cde37..566d068b14a79 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminInvite.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminInvite.yaml @@ -6,6 +6,9 @@ required: - email - accepted - token + - expires_at + - created_at + - updated_at properties: id: type: string diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionPriceRule.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionPriceRule.yaml index a705731a4197d..c0525130ff5dd 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionPriceRule.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionPriceRule.yaml @@ -4,6 +4,13 @@ x-schemaName: AdminShippingOptionPriceRule required: - id - value + - operator + - attribute + - price_id + - priority + - created_at + - updated_at + - deleted_at properties: id: type: string @@ -13,3 +20,42 @@ properties: type: string title: value description: The price rule's value. + operator: + type: string + description: The price rule's operator. + enum: + - gt + - lt + - eq + - ne + - in + - lte + - gte + - nin + attribute: + type: string + title: attribute + description: The price rule's attribute. + price_id: + type: string + title: price_id + description: The ID of the price this rule applies to. + priority: + type: number + title: priority + description: The price rule's priority. + created_at: + type: string + format: date-time + title: created_at + description: The date the price rule was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the price rule was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the price rule was deleted. diff --git a/www/apps/api-reference/specs/admin/components/schemas/OrderClaim.yaml b/www/apps/api-reference/specs/admin/components/schemas/OrderClaim.yaml index 4739eb812ce21..a68218b780718 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/OrderClaim.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/OrderClaim.yaml @@ -40,19 +40,8 @@ properties: title: no_notification description: Whether the customer should be notified about changes in the claim. refund_amount: - oneOf: - - type: string - title: refund_amount - description: The claim's refund amount. - - type: number - title: refund_amount - description: The claim's refund amount. - - type: string - title: refund_amount - description: The claim's refund amount. - - type: number - title: refund_amount - description: The claim's refund amount. + type: number + title: refund_amount description: The amount to be refunded. display_id: type: number diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCalculatedPrice.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCalculatedPrice.yaml new file mode 100644 index 0000000000000..295219e59ea4b --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCalculatedPrice.yaml @@ -0,0 +1,122 @@ +type: object +description: The shipping option's calculated price. +x-schemaName: StoreCalculatedPrice +required: + - id + - calculated_amount + - original_amount + - currency_code +properties: + id: + type: string + title: id + description: The ID of the price set from which the price was selected. + is_calculated_price_price_list: + type: boolean + title: is_calculated_price_price_list + description: Whether the calculated price belongs to a price list. + is_calculated_price_tax_inclusive: + type: boolean + title: is_calculated_price_tax_inclusive + description: Whether the calculated price is tax inclusive. + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + calculated_amount: + type: number + title: calculated_amount + description: >- + The amount of the calculated price, or `null` if there isn't a calculated + price. This is the amount shown to the customer. + calculated_amount_with_tax: + type: number + title: calculated_amount_with_tax + description: The `calculated_amount` with taxes applied. + calculated_amount_without_tax: + type: number + title: calculated_amount_without_tax + description: The `calculated_amount` without taxes applied. + is_original_price_price_list: + type: boolean + title: is_original_price_price_list + description: Whether the original price belongs to a price list. + is_original_price_tax_inclusive: + type: boolean + title: is_original_price_tax_inclusive + description: Whether the original price is tax inclusive. + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + original_amount: + type: number + title: original_amount + description: >- + The amount of the original price, or `null` if there isn't an original + price. This amount is useful to compare with the `calculated_amount`, such + as to check for discounted value. + currency_code: + type: string + title: currency_code + description: >- + The currency code of the calculated price, or `null` if there isn't a + calculated price. + calculated_price: + type: object + description: The calculated price's details. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, `sale` or `override`. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. + original_price: + type: object + description: The origin price's details. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, `sale` or `override`. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCartShippingOption.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCartShippingOption.yaml index b2b55020de8ec..77bd8ba167edc 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/StoreCartShippingOption.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCartShippingOption.yaml @@ -12,6 +12,8 @@ required: - type - provider - amount + - prices + - calculated_price properties: id: type: string @@ -92,3 +94,10 @@ properties: externalDocs: url: >- https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property + prices: + type: array + description: The shipping option's prices. + items: + $ref: ./StorePrice.yaml + calculated_price: + $ref: ./StoreCalculatedPrice.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StorePrice.yaml b/www/apps/api-reference/specs/admin/components/schemas/StorePrice.yaml new file mode 100644 index 0000000000000..4de4b4e3215ac --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StorePrice.yaml @@ -0,0 +1,36 @@ +type: object +description: The price's details. +x-schemaName: StorePrice +required: + - id + - currency_code + - amount + - min_quantity + - max_quantity +properties: + id: + type: string + title: id + description: The price's ID. + currency_code: + type: string + title: currency_code + description: The price's ISO 2 currency code. + example: usd + amount: + type: number + title: amount + description: The price's amount. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. + price_rules: + type: array + description: The price's rules. + items: + $ref: ./StorePriceRule.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StorePriceRule.yaml b/www/apps/api-reference/specs/admin/components/schemas/StorePriceRule.yaml new file mode 100644 index 0000000000000..1f14ae54783f4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StorePriceRule.yaml @@ -0,0 +1,30 @@ +type: object +description: The price rule's details. +x-schemaName: StorePriceRule +required: + - id + - attribute + - operator + - value +properties: + id: + type: string + title: id + description: The price rule's ID. + attribute: + type: string + title: attribute + description: The price rule's attribute. + operator: + type: string + description: The price rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: string + title: value + description: The price rule's value. diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index cb63c52362d79..c4ecd80919fb5 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -47651,6 +47651,9 @@ components: - email - accepted - token + - expires_at + - created_at + - updated_at properties: id: type: string @@ -52943,6 +52946,13 @@ components: required: - id - value + - operator + - attribute + - price_id + - priority + - created_at + - updated_at + - deleted_at properties: id: type: string @@ -52952,6 +52962,45 @@ components: type: string title: value description: The price rule's value. + operator: + type: string + description: The price rule's operator. + enum: + - gt + - lt + - eq + - ne + - in + - lte + - gte + - nin + attribute: + type: string + title: attribute + description: The price rule's attribute. + price_id: + type: string + title: price_id + description: The ID of the price this rule applies to. + priority: + type: number + title: priority + description: The price rule's priority. + created_at: + type: string + format: date-time + title: created_at + description: The date the price rule was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the price rule was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the price rule was deleted. AdminShippingOptionResponse: type: object description: The shipping option's details. @@ -59212,19 +59261,8 @@ components: title: no_notification description: Whether the customer should be notified about changes in the claim. refund_amount: - oneOf: - - type: string - title: refund_amount - description: The claim's refund amount. - - type: number - title: refund_amount - description: The claim's refund amount. - - type: string - title: refund_amount - description: The claim's refund amount. - - type: number - title: refund_amount - description: The claim's refund amount. + type: number + title: refund_amount description: The amount to be refunded. display_id: type: number @@ -60335,6 +60373,120 @@ components: metadata: type: object description: The item's metadata, can hold custom key-value pairs. + StoreCalculatedPrice: + type: object + description: The shipping option's calculated price. + x-schemaName: StoreCalculatedPrice + required: + - id + - calculated_amount + - original_amount + - currency_code + properties: + id: + type: string + title: id + description: The ID of the price set from which the price was selected. + is_calculated_price_price_list: + type: boolean + title: is_calculated_price_price_list + description: Whether the calculated price belongs to a price list. + is_calculated_price_tax_inclusive: + type: boolean + title: is_calculated_price_tax_inclusive + description: Whether the calculated price is tax inclusive. + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + calculated_amount: + type: number + title: calculated_amount + description: The amount of the calculated price, or `null` if there isn't a calculated price. This is the amount shown to the customer. + calculated_amount_with_tax: + type: number + title: calculated_amount_with_tax + description: The `calculated_amount` with taxes applied. + calculated_amount_without_tax: + type: number + title: calculated_amount_without_tax + description: The `calculated_amount` without taxes applied. + is_original_price_price_list: + type: boolean + title: is_original_price_price_list + description: Whether the original price belongs to a price list. + is_original_price_tax_inclusive: + type: boolean + title: is_original_price_tax_inclusive + description: Whether the original price is tax inclusive. + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + original_amount: + type: number + title: original_amount + description: The amount of the original price, or `null` if there isn't an original price. This amount is useful to compare with the `calculated_amount`, such as to check for discounted value. + currency_code: + type: string + title: currency_code + description: The currency code of the calculated price, or `null` if there isn't a calculated price. + calculated_price: + type: object + description: The calculated price's details. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, `sale` or `override`. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. + original_price: + type: object + description: The origin price's details. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, `sale` or `override`. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. StoreCart: type: object description: The cart's details. @@ -61191,6 +61343,8 @@ components: - type - provider - amount + - prices + - calculated_price properties: id: type: string @@ -61267,6 +61421,13 @@ components: description: The shipping option's data, useful for the provider handling fulfillment. externalDocs: url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property + prices: + type: array + description: The shipping option's prices. + items: + $ref: '#/components/schemas/StorePrice' + calculated_price: + $ref: '#/components/schemas/StoreCalculatedPrice' StoreCollection: type: object description: The collection's details. @@ -68089,6 +68250,74 @@ components: - provider_id - data - status + StorePrice: + type: object + description: The price's details. + x-schemaName: StorePrice + required: + - id + - currency_code + - amount + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The price's ID. + currency_code: + type: string + title: currency_code + description: The price's ISO 2 currency code. + example: usd + amount: + type: number + title: amount + description: The price's amount. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. + price_rules: + type: array + description: The price's rules. + items: + $ref: '#/components/schemas/StorePriceRule' + StorePriceRule: + type: object + description: The price rule's details. + x-schemaName: StorePriceRule + required: + - id + - attribute + - operator + - value + properties: + id: + type: string + title: id + description: The price rule's ID. + attribute: + type: string + title: attribute + description: The price rule's attribute. + operator: + type: string + description: The price rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: string + title: value + description: The price rule's value. StoreProduct: type: object description: The product's details. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminInvite.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminInvite.yaml index d9928379cde37..566d068b14a79 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminInvite.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminInvite.yaml @@ -6,6 +6,9 @@ required: - email - accepted - token + - expires_at + - created_at + - updated_at properties: id: type: string diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionPriceRule.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionPriceRule.yaml index a705731a4197d..c0525130ff5dd 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionPriceRule.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionPriceRule.yaml @@ -4,6 +4,13 @@ x-schemaName: AdminShippingOptionPriceRule required: - id - value + - operator + - attribute + - price_id + - priority + - created_at + - updated_at + - deleted_at properties: id: type: string @@ -13,3 +20,42 @@ properties: type: string title: value description: The price rule's value. + operator: + type: string + description: The price rule's operator. + enum: + - gt + - lt + - eq + - ne + - in + - lte + - gte + - nin + attribute: + type: string + title: attribute + description: The price rule's attribute. + price_id: + type: string + title: price_id + description: The ID of the price this rule applies to. + priority: + type: number + title: priority + description: The price rule's priority. + created_at: + type: string + format: date-time + title: created_at + description: The date the price rule was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the price rule was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the price rule was deleted. diff --git a/www/apps/api-reference/specs/store/components/schemas/OrderClaim.yaml b/www/apps/api-reference/specs/store/components/schemas/OrderClaim.yaml index 4739eb812ce21..a68218b780718 100644 --- a/www/apps/api-reference/specs/store/components/schemas/OrderClaim.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/OrderClaim.yaml @@ -40,19 +40,8 @@ properties: title: no_notification description: Whether the customer should be notified about changes in the claim. refund_amount: - oneOf: - - type: string - title: refund_amount - description: The claim's refund amount. - - type: number - title: refund_amount - description: The claim's refund amount. - - type: string - title: refund_amount - description: The claim's refund amount. - - type: number - title: refund_amount - description: The claim's refund amount. + type: number + title: refund_amount description: The amount to be refunded. display_id: type: number diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCalculatedPrice.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCalculatedPrice.yaml new file mode 100644 index 0000000000000..295219e59ea4b --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCalculatedPrice.yaml @@ -0,0 +1,122 @@ +type: object +description: The shipping option's calculated price. +x-schemaName: StoreCalculatedPrice +required: + - id + - calculated_amount + - original_amount + - currency_code +properties: + id: + type: string + title: id + description: The ID of the price set from which the price was selected. + is_calculated_price_price_list: + type: boolean + title: is_calculated_price_price_list + description: Whether the calculated price belongs to a price list. + is_calculated_price_tax_inclusive: + type: boolean + title: is_calculated_price_tax_inclusive + description: Whether the calculated price is tax inclusive. + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + calculated_amount: + type: number + title: calculated_amount + description: >- + The amount of the calculated price, or `null` if there isn't a calculated + price. This is the amount shown to the customer. + calculated_amount_with_tax: + type: number + title: calculated_amount_with_tax + description: The `calculated_amount` with taxes applied. + calculated_amount_without_tax: + type: number + title: calculated_amount_without_tax + description: The `calculated_amount` without taxes applied. + is_original_price_price_list: + type: boolean + title: is_original_price_price_list + description: Whether the original price belongs to a price list. + is_original_price_tax_inclusive: + type: boolean + title: is_original_price_tax_inclusive + description: Whether the original price is tax inclusive. + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + original_amount: + type: number + title: original_amount + description: >- + The amount of the original price, or `null` if there isn't an original + price. This amount is useful to compare with the `calculated_amount`, such + as to check for discounted value. + currency_code: + type: string + title: currency_code + description: >- + The currency code of the calculated price, or `null` if there isn't a + calculated price. + calculated_price: + type: object + description: The calculated price's details. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, `sale` or `override`. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. + original_price: + type: object + description: The origin price's details. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, `sale` or `override`. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCartShippingOption.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCartShippingOption.yaml index b2b55020de8ec..77bd8ba167edc 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreCartShippingOption.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCartShippingOption.yaml @@ -12,6 +12,8 @@ required: - type - provider - amount + - prices + - calculated_price properties: id: type: string @@ -92,3 +94,10 @@ properties: externalDocs: url: >- https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property + prices: + type: array + description: The shipping option's prices. + items: + $ref: ./StorePrice.yaml + calculated_price: + $ref: ./StoreCalculatedPrice.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StorePrice.yaml b/www/apps/api-reference/specs/store/components/schemas/StorePrice.yaml new file mode 100644 index 0000000000000..4de4b4e3215ac --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StorePrice.yaml @@ -0,0 +1,36 @@ +type: object +description: The price's details. +x-schemaName: StorePrice +required: + - id + - currency_code + - amount + - min_quantity + - max_quantity +properties: + id: + type: string + title: id + description: The price's ID. + currency_code: + type: string + title: currency_code + description: The price's ISO 2 currency code. + example: usd + amount: + type: number + title: amount + description: The price's amount. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. + price_rules: + type: array + description: The price's rules. + items: + $ref: ./StorePriceRule.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StorePriceRule.yaml b/www/apps/api-reference/specs/store/components/schemas/StorePriceRule.yaml new file mode 100644 index 0000000000000..1f14ae54783f4 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StorePriceRule.yaml @@ -0,0 +1,30 @@ +type: object +description: The price rule's details. +x-schemaName: StorePriceRule +required: + - id + - attribute + - operator + - value +properties: + id: + type: string + title: id + description: The price rule's ID. + attribute: + type: string + title: attribute + description: The price rule's attribute. + operator: + type: string + description: The price rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: string + title: value + description: The price rule's value. diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index ec1bffb47e83f..2fb0296649f24 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -9849,6 +9849,9 @@ components: - email - accepted - token + - expires_at + - created_at + - updated_at properties: id: type: string @@ -15141,6 +15144,13 @@ components: required: - id - value + - operator + - attribute + - price_id + - priority + - created_at + - updated_at + - deleted_at properties: id: type: string @@ -15150,6 +15160,45 @@ components: type: string title: value description: The price rule's value. + operator: + type: string + description: The price rule's operator. + enum: + - gt + - lt + - eq + - ne + - in + - lte + - gte + - nin + attribute: + type: string + title: attribute + description: The price rule's attribute. + price_id: + type: string + title: price_id + description: The ID of the price this rule applies to. + priority: + type: number + title: priority + description: The price rule's priority. + created_at: + type: string + format: date-time + title: created_at + description: The date the price rule was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the price rule was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the price rule was deleted. AdminShippingOptionResponse: type: object description: The shipping option's details. @@ -21410,19 +21459,8 @@ components: title: no_notification description: Whether the customer should be notified about changes in the claim. refund_amount: - oneOf: - - type: string - title: refund_amount - description: The claim's refund amount. - - type: number - title: refund_amount - description: The claim's refund amount. - - type: string - title: refund_amount - description: The claim's refund amount. - - type: number - title: refund_amount - description: The claim's refund amount. + type: number + title: refund_amount description: The amount to be refunded. display_id: type: number @@ -22533,6 +22571,120 @@ components: metadata: type: object description: The item's metadata, can hold custom key-value pairs. + StoreCalculatedPrice: + type: object + description: The shipping option's calculated price. + x-schemaName: StoreCalculatedPrice + required: + - id + - calculated_amount + - original_amount + - currency_code + properties: + id: + type: string + title: id + description: The ID of the price set from which the price was selected. + is_calculated_price_price_list: + type: boolean + title: is_calculated_price_price_list + description: Whether the calculated price belongs to a price list. + is_calculated_price_tax_inclusive: + type: boolean + title: is_calculated_price_tax_inclusive + description: Whether the calculated price is tax inclusive. + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + calculated_amount: + type: number + title: calculated_amount + description: The amount of the calculated price, or `null` if there isn't a calculated price. This is the amount shown to the customer. + calculated_amount_with_tax: + type: number + title: calculated_amount_with_tax + description: The `calculated_amount` with taxes applied. + calculated_amount_without_tax: + type: number + title: calculated_amount_without_tax + description: The `calculated_amount` without taxes applied. + is_original_price_price_list: + type: boolean + title: is_original_price_price_list + description: Whether the original price belongs to a price list. + is_original_price_tax_inclusive: + type: boolean + title: is_original_price_tax_inclusive + description: Whether the original price is tax inclusive. + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + original_amount: + type: number + title: original_amount + description: The amount of the original price, or `null` if there isn't an original price. This amount is useful to compare with the `calculated_amount`, such as to check for discounted value. + currency_code: + type: string + title: currency_code + description: The currency code of the calculated price, or `null` if there isn't a calculated price. + calculated_price: + type: object + description: The calculated price's details. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, `sale` or `override`. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. + original_price: + type: object + description: The origin price's details. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, `sale` or `override`. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. StoreCart: type: object description: The cart's details. @@ -23389,6 +23541,8 @@ components: - type - provider - amount + - prices + - calculated_price properties: id: type: string @@ -23465,6 +23619,13 @@ components: description: The shipping option's data, useful for the provider handling fulfillment. externalDocs: url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property + prices: + type: array + description: The shipping option's prices. + items: + $ref: '#/components/schemas/StorePrice' + calculated_price: + $ref: '#/components/schemas/StoreCalculatedPrice' StoreCollection: type: object description: The collection's details. @@ -30287,6 +30448,74 @@ components: - provider_id - data - status + StorePrice: + type: object + description: The price's details. + x-schemaName: StorePrice + required: + - id + - currency_code + - amount + - min_quantity + - max_quantity + properties: + id: + type: string + title: id + description: The price's ID. + currency_code: + type: string + title: currency_code + description: The price's ISO 2 currency code. + example: usd + amount: + type: number + title: amount + description: The price's amount. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for the price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity required in the cart for the price to apply. + price_rules: + type: array + description: The price's rules. + items: + $ref: '#/components/schemas/StorePriceRule' + StorePriceRule: + type: object + description: The price rule's details. + x-schemaName: StorePriceRule + required: + - id + - attribute + - operator + - value + properties: + id: + type: string + title: id + description: The price rule's ID. + attribute: + type: string + title: attribute + description: The price rule's attribute. + operator: + type: string + description: The price rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: string + title: value + description: The price rule's value. StoreProduct: type: object description: The product's details. diff --git a/www/utils/generated/oas-output/schemas/AdminInvite.ts b/www/utils/generated/oas-output/schemas/AdminInvite.ts index e2b97e5bdf61b..125892f42855a 100644 --- a/www/utils/generated/oas-output/schemas/AdminInvite.ts +++ b/www/utils/generated/oas-output/schemas/AdminInvite.ts @@ -8,6 +8,9 @@ * - email * - accepted * - token + * - expires_at + * - created_at + * - updated_at * properties: * id: * type: string diff --git a/www/utils/generated/oas-output/schemas/AdminShippingOptionPriceRule.ts b/www/utils/generated/oas-output/schemas/AdminShippingOptionPriceRule.ts index 5d8e7116f75e3..dcc60a8540727 100644 --- a/www/utils/generated/oas-output/schemas/AdminShippingOptionPriceRule.ts +++ b/www/utils/generated/oas-output/schemas/AdminShippingOptionPriceRule.ts @@ -6,6 +6,13 @@ * required: * - id * - value + * - operator + * - attribute + * - price_id + * - priority + * - created_at + * - updated_at + * - deleted_at * properties: * id: * type: string @@ -15,6 +22,45 @@ * type: string * title: value * description: The price rule's value. + * operator: + * type: string + * description: The price rule's operator. + * enum: + * - gt + * - lt + * - eq + * - ne + * - in + * - lte + * - gte + * - nin + * attribute: + * type: string + * title: attribute + * description: The price rule's attribute. + * price_id: + * type: string + * title: price_id + * description: The ID of the price this rule applies to. + * priority: + * type: number + * title: priority + * description: The price rule's priority. + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the price rule was created. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the price rule was updated. + * deleted_at: + * type: string + * format: date-time + * title: deleted_at + * description: The date the price rule was deleted. * */ diff --git a/www/utils/generated/oas-output/schemas/OrderClaim.ts b/www/utils/generated/oas-output/schemas/OrderClaim.ts index 447b2c3e5b2d6..d430fff94d938 100644 --- a/www/utils/generated/oas-output/schemas/OrderClaim.ts +++ b/www/utils/generated/oas-output/schemas/OrderClaim.ts @@ -42,19 +42,8 @@ * title: no_notification * description: Whether the customer should be notified about changes in the claim. * refund_amount: - * oneOf: - * - type: string - * title: refund_amount - * description: The claim's refund amount. - * - type: number - * title: refund_amount - * description: The claim's refund amount. - * - type: string - * title: refund_amount - * description: The claim's refund amount. - * - type: number - * title: refund_amount - * description: The claim's refund amount. + * type: number + * title: refund_amount * description: The amount to be refunded. * display_id: * type: number diff --git a/www/utils/generated/oas-output/schemas/StoreAddCartLineItem.ts b/www/utils/generated/oas-output/schemas/StoreAddCartLineItem.ts index 6d12167efef14..fbef5c7a826b5 100644 --- a/www/utils/generated/oas-output/schemas/StoreAddCartLineItem.ts +++ b/www/utils/generated/oas-output/schemas/StoreAddCartLineItem.ts @@ -20,3 +20,4 @@ * description: The item's metadata, can hold custom key-value pairs. * */ + diff --git a/www/utils/generated/oas-output/schemas/StoreCalculatedPrice.ts b/www/utils/generated/oas-output/schemas/StoreCalculatedPrice.ts new file mode 100644 index 0000000000000..56e3305093dd1 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreCalculatedPrice.ts @@ -0,0 +1,118 @@ +/** + * @schema StoreCalculatedPrice + * type: object + * description: The shipping option's calculated price. + * x-schemaName: StoreCalculatedPrice + * required: + * - id + * - calculated_amount + * - original_amount + * - currency_code + * properties: + * id: + * type: string + * title: id + * description: The ID of the price set from which the price was selected. + * is_calculated_price_price_list: + * type: boolean + * title: is_calculated_price_price_list + * description: Whether the calculated price belongs to a price list. + * is_calculated_price_tax_inclusive: + * type: boolean + * title: is_calculated_price_tax_inclusive + * description: Whether the calculated price is tax inclusive. + * externalDocs: + * url: https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + * calculated_amount: + * type: number + * title: calculated_amount + * description: The amount of the calculated price, or `null` if there isn't a calculated price. This is the amount shown to the customer. + * calculated_amount_with_tax: + * type: number + * title: calculated_amount_with_tax + * description: The `calculated_amount` with taxes applied. + * calculated_amount_without_tax: + * type: number + * title: calculated_amount_without_tax + * description: The `calculated_amount` without taxes applied. + * is_original_price_price_list: + * type: boolean + * title: is_original_price_price_list + * description: Whether the original price belongs to a price list. + * is_original_price_tax_inclusive: + * type: boolean + * title: is_original_price_tax_inclusive + * description: Whether the original price is tax inclusive. + * externalDocs: + * url: https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing + * original_amount: + * type: number + * title: original_amount + * description: The amount of the original price, or `null` if there isn't an original price. This amount is useful to compare with the `calculated_amount`, such as to check for discounted value. + * currency_code: + * type: string + * title: currency_code + * description: The currency code of the calculated price, or `null` if there isn't a calculated price. + * calculated_price: + * type: object + * description: The calculated price's details. + * required: + * - id + * - price_list_id + * - price_list_type + * - min_quantity + * - max_quantity + * properties: + * id: + * type: string + * title: id + * description: The ID of the price. + * price_list_id: + * type: string + * title: price_list_id + * description: The ID of the associated price list. + * price_list_type: + * type: string + * title: price_list_type + * description: The price list's type. For example, `sale` or `override`. + * min_quantity: + * type: number + * title: min_quantity + * description: The minimum quantity required in the cart for the price to apply. + * max_quantity: + * type: number + * title: max_quantity + * description: The maximum quantity required in the cart for the price to apply. + * original_price: + * type: object + * description: The origin price's details. + * required: + * - id + * - price_list_id + * - price_list_type + * - min_quantity + * - max_quantity + * properties: + * id: + * type: string + * title: id + * description: The ID of the price. + * price_list_id: + * type: string + * title: price_list_id + * description: The ID of the associated price list. + * price_list_type: + * type: string + * title: price_list_type + * description: The price list's type. For example, `sale` or `override`. + * min_quantity: + * type: number + * title: min_quantity + * description: The minimum quantity required in the cart for the price to apply. + * max_quantity: + * type: number + * title: max_quantity + * description: The maximum quantity required in the cart for the price to apply. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreCartShippingOption.ts b/www/utils/generated/oas-output/schemas/StoreCartShippingOption.ts index f6fb768204974..02e4f5a611505 100644 --- a/www/utils/generated/oas-output/schemas/StoreCartShippingOption.ts +++ b/www/utils/generated/oas-output/schemas/StoreCartShippingOption.ts @@ -14,6 +14,8 @@ * - type * - provider * - amount + * - prices + * - calculated_price * properties: * id: * type: string @@ -91,6 +93,13 @@ * description: The shipping option's data, useful for the provider handling fulfillment. * externalDocs: * url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property + * prices: + * type: array + * description: The shipping option's prices. + * items: + * $ref: "#/components/schemas/StorePrice" + * calculated_price: + * $ref: "#/components/schemas/StoreCalculatedPrice" * */ diff --git a/www/utils/generated/oas-output/schemas/StorePrice.ts b/www/utils/generated/oas-output/schemas/StorePrice.ts new file mode 100644 index 0000000000000..d5e099fcffa54 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StorePrice.ts @@ -0,0 +1,41 @@ +/** + * @schema StorePrice + * type: object + * description: The price's details. + * x-schemaName: StorePrice + * required: + * - id + * - currency_code + * - amount + * - min_quantity + * - max_quantity + * properties: + * id: + * type: string + * title: id + * description: The price's ID. + * currency_code: + * type: string + * title: currency_code + * description: The price's ISO 2 currency code. + * example: usd + * amount: + * type: number + * title: amount + * description: The price's amount. + * min_quantity: + * type: number + * title: min_quantity + * description: The minimum quantity required in the cart for the price to apply. + * max_quantity: + * type: number + * title: max_quantity + * description: The maximum quantity required in the cart for the price to apply. + * price_rules: + * type: array + * description: The price's rules. + * items: + * $ref: "#/components/schemas/StorePriceRule" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StorePriceRule.ts b/www/utils/generated/oas-output/schemas/StorePriceRule.ts new file mode 100644 index 0000000000000..e0f0321529c19 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StorePriceRule.ts @@ -0,0 +1,35 @@ +/** + * @schema StorePriceRule + * type: object + * description: The price rule's details. + * x-schemaName: StorePriceRule + * required: + * - id + * - attribute + * - operator + * - value + * properties: + * id: + * type: string + * title: id + * description: The price rule's ID. + * attribute: + * type: string + * title: attribute + * description: The price rule's attribute. + * operator: + * type: string + * description: The price rule's operator. + * enum: + * - gt + * - lt + * - eq + * - lte + * - gte + * value: + * type: string + * title: value + * description: The price rule's value. + * +*/ +