From 274056a38d5d820220b11c4a0d1ebab8ae3798e4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 17:10:23 +0300 Subject: [PATCH] chore(docs): Generated API Reference (#4205) Co-authored-by: olivermrbl Co-authored-by: Shahed Nasser --- docs/api/admin.oas.json | 163 ++++++++++++++---- ...sListWithVariantsAndLocationLevelsRes.yaml | 15 +- .../schemas/AdminReservationsListRes.yaml | 2 +- .../schemas/DecoratedInventoryItemDTO.yaml | 22 +++ .../schemas/ExtendedReservationItem.yaml | 11 ++ ..._inventory-items_{id}_location-levels.yaml | 9 + docs/api/admin/paths/admin_reservations.yaml | 39 +++++ 7 files changed, 215 insertions(+), 46 deletions(-) create mode 100644 docs/api/admin/components/schemas/DecoratedInventoryItemDTO.yaml create mode 100644 docs/api/admin/components/schemas/ExtendedReservationItem.yaml diff --git a/docs/api/admin.oas.json b/docs/api/admin.oas.json index 351603077c..4c8f5e3fa2 100644 --- a/docs/api/admin.oas.json +++ b/docs/api/admin.oas.json @@ -6353,6 +6353,19 @@ "type": "string" } }, + { + "in": "query", + "name": "location_id", + "style": "form", + "explode": false, + "description": "Locations ids to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "in": "query", "name": "expand", @@ -17748,6 +17761,65 @@ } } }, + { + "in": "query", + "name": "description", + "description": "A param for search reservation descriptions", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "contains": { + "type": "string", + "description": "filter by reservation description containing search string." + }, + "starts_with": { + "type": "string", + "description": "filter by reservation description starting with search string." + }, + "ends_with": { + "type": "string", + "description": "filter by reservation description ending with search string." + } + } + } + ] + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting reservations were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, { "in": "query", "name": "offset", @@ -25509,36 +25581,7 @@ "inventory_items": { "type": "array", "items": { - "allOf": [ - { - "$ref": "#/components/schemas/InventoryItemDTO" - }, - { - "type": "object", - "properties": { - "location_levels": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/InventoryLevelDTO" - } - ] - } - }, - "variants": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/ProductVariant" - } - ] - } - } - } - } - ] + "$ref": "#/components/schemas/DecoratedInventoryItemDTO" } }, "count": { @@ -31178,7 +31221,7 @@ "reservations": { "type": "array", "items": { - "$ref": "#/components/schemas/ReservationItemDTO" + "$ref": "#/components/schemas/ExtendedReservationItem" } }, "count": { @@ -33281,6 +33324,43 @@ } } }, + "DecoratedInventoryItemDTO": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/InventoryItemDTO" + }, + { + "type": "object", + "required": [ + "stocked_quantity", + "reserved_quantity" + ], + "properties": { + "location_levels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryLevelDTO" + } + }, + "variants": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductVariant" + } + }, + "stocked_quantity": { + "type": "number", + "description": "The total quantity of the item in stock across levels" + }, + "reserved_quantity": { + "type": "number", + "description": "The total quantity of the item available across levels" + } + } + } + ] + }, "Discount": { "title": "Discount", "description": "Represents a discount that can be applied to a cart for promotional purposes.", @@ -33987,6 +34067,27 @@ } } }, + "ExtendedReservationItem": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/ReservationItemDTO" + }, + { + "type": "object", + "properties": { + "line_item": { + "description": "optional line item", + "$ref": "#/components/schemas/LineItem" + }, + "inventory_item": { + "description": "inventory item from inventory module", + "$ref": "#/components/schemas/InventoryItemDTO" + } + } + } + ] + }, "ExtendedStoreDTO": { "allOf": [ { diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml index fc2767763d..366aa8b84d 100644 --- a/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml +++ b/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml @@ -8,20 +8,7 @@ properties: inventory_items: type: array items: - allOf: - - $ref: ./InventoryItemDTO.yaml - - type: object - properties: - location_levels: - type: array - items: - allOf: - - $ref: ./InventoryLevelDTO.yaml - variants: - type: array - items: - allOf: - - $ref: ./ProductVariant.yaml + $ref: ./DecoratedInventoryItemDTO.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/components/schemas/AdminReservationsListRes.yaml b/docs/api/admin/components/schemas/AdminReservationsListRes.yaml index 7f2e521066..d5b8dc1ad3 100644 --- a/docs/api/admin/components/schemas/AdminReservationsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminReservationsListRes.yaml @@ -8,7 +8,7 @@ properties: reservations: type: array items: - $ref: ./ReservationItemDTO.yaml + $ref: ./ExtendedReservationItem.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/components/schemas/DecoratedInventoryItemDTO.yaml b/docs/api/admin/components/schemas/DecoratedInventoryItemDTO.yaml new file mode 100644 index 0000000000..0f1c82fa99 --- /dev/null +++ b/docs/api/admin/components/schemas/DecoratedInventoryItemDTO.yaml @@ -0,0 +1,22 @@ +type: object +allOf: + - $ref: ./InventoryItemDTO.yaml + - type: object + required: + - stocked_quantity + - reserved_quantity + properties: + location_levels: + type: array + items: + $ref: ./InventoryLevelDTO.yaml + variants: + type: array + items: + $ref: ./ProductVariant.yaml + stocked_quantity: + type: number + description: The total quantity of the item in stock across levels + reserved_quantity: + type: number + description: The total quantity of the item available across levels diff --git a/docs/api/admin/components/schemas/ExtendedReservationItem.yaml b/docs/api/admin/components/schemas/ExtendedReservationItem.yaml new file mode 100644 index 0000000000..59f1150f2a --- /dev/null +++ b/docs/api/admin/components/schemas/ExtendedReservationItem.yaml @@ -0,0 +1,11 @@ +type: object +allOf: + - $ref: ./ReservationItemDTO.yaml + - type: object + properties: + line_item: + description: optional line item + $ref: ./LineItem.yaml + inventory_item: + description: inventory item from inventory module + $ref: ./InventoryItemDTO.yaml diff --git a/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml index 212ef052bf..a1d9035735 100644 --- a/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml +++ b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml @@ -10,6 +10,15 @@ get: description: The ID of the Inventory Item. schema: type: string + - in: query + name: location_id + style: form + explode: false + description: Locations ids to search for. + schema: + type: array + items: + type: string - in: query name: expand description: Comma separated list of relations to include in the results. diff --git a/docs/api/admin/paths/admin_reservations.yaml b/docs/api/admin/paths/admin_reservations.yaml index 631eedd313..88cd069e28 100644 --- a/docs/api/admin/paths/admin_reservations.yaml +++ b/docs/api/admin/paths/admin_reservations.yaml @@ -51,6 +51,45 @@ get: description: >- filter by reservation quantity greater than or equal to this number + - in: query + name: description + description: A param for search reservation descriptions + schema: + oneOf: + - type: string + - type: object + properties: + contains: + type: string + description: filter by reservation description containing search string. + starts_with: + type: string + description: filter by reservation description starting with search string. + ends_with: + type: string + description: filter by reservation description ending with search string. + - in: query + name: created_at + description: Date comparison for when resulting reservations were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date - in: query name: offset description: How many Reservations to skip in the result.