Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional endpoint for get order and by group #107

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 42 additions & 30 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,37 +95,45 @@ components:
CustomerScheduleSlotsUpdateBody:
$ref: paths/customer/schedule/slots/update/body.yaml

# Base Order
CustomerBaseOrder:
$ref: paths/customer/order/_types/order.yaml
CustomerBaseOrderMoney:
$ref: paths/customer/_types/order/money.yaml
CustomerBaseOrderAddress:
$ref: paths/customer/_types/order/address.yaml
CustomerBaseOrderClient:
$ref: paths/customer/_types/order/client.yaml
CustomerBaseOrderLineItemProperties:
$ref: paths/customer/_types/order/properties.yaml
CustomerBaseOrderSimpleLineItem:
$ref: paths/customer/_types/order/simple-line-item.yaml
CustomerBaseOrderCustomer:
$ref: paths/customer/_types/order/customer.yaml
CustomeBaserOrderLineItem:
$ref: paths/customer/_types/order/line-item.yaml
CustomerBaseOrderRefund:
$ref: paths/customer/_types/order/refund.yaml
CustomerBaseOrderShippingLines:
$ref: paths/customer/_types/order//shipping_lines.yaml
CustomerBaseOrderFulfillment:
$ref: paths/customer/_types/order/fulfillment.yaml

# Order
CustomerOrder:
CustomerOrderResponse:
$ref: paths/customer/order/_types/order.yaml
CustomerOrderMoney:
$ref: paths/customer/order/_types/money.yaml
CustomerOrderAddress:
$ref: paths/customer/order/_types/address.yaml
CustomerOrderClient:
$ref: paths/customer/order/_types/client.yaml
CustomerOrderLineItemProperties:
$ref: paths/customer/order/_types/properties.yaml
CustomerOrderSimpleLineItem:
$ref: paths/customer/order/_types/simple-line-item.yaml
CustomerOrderCustomer:
$ref: paths/customer/order/_types/customer.yaml
CustomerOrderLineItem:
CustomerOrderLineItemResponse:
$ref: paths/customer/order/_types/line-item.yaml
CustomerOrderRefund:
$ref: paths/customer/order/_types/refund.yaml
CustomerOrderShippingLines:
$ref: paths/customer/order/_types/shipping_lines.yaml
CustomerOrderFulfillment:
$ref: paths/customer/order/_types/fulfillment.yaml
CustomerOrderWithLookup:
$ref: paths/customer/order/_types/order-with-lookup.yaml
CustomerOrderGetResponse:
$ref: paths/customer/order/get/response.yaml
CustomerOrderGetByGroupIdResponse:
$ref: paths/customer/order/get-by-group/response.yaml
CustomerOrderRangeResponse:
$ref: paths/customer/order/range/response.yaml

# Booking
CustomerBooking:
$ref: paths/customer/booking/_types/booking.yaml
CustomerBookingGetByGroupIdResponse:
$ref: paths/customer/booking/get-by-group/response.yaml
CustomerBookingRangeResponse:
$ref: paths/customer/booking/range/response.yaml

# Customer
CustomerProductList:
Expand Down Expand Up @@ -326,12 +334,16 @@ paths:
$ref: "./paths/customer/product/list-ids/index.yaml"
/customer/{customerId}/product/{productId}:
$ref: "paths/customer/product/product.yaml"
/customer/{customerId}/orders/{orderId}/group/{groupId}:
$ref: "paths/customer/order/get-by-group/index.yaml"

# Orders
/customer/{customerId}/bookings/{orderId}/group/{groupId}:
$ref: "paths/customer/booking/get-by-group/index.yaml"
/customer/{customerId}/bookings/range:
$ref: "paths/customer/booking/range/index.yaml"

# Booking
/customer/{customerId}/orders/{orderId}:
$ref: "paths/customer/order/get/index.yaml"
/customer/{customerId}/orders-range:
$ref: "paths/customer/order/range/index.yaml"

# schedule
/customer/{customerId}/schedule:
Expand Down
88 changes: 88 additions & 0 deletions openapi/paths/customer/_types/order/base-order.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
type: object
properties:
id:
type: number
order_number:
type: number
admin_graphql_api_id:
type: string
buyer_accepts_marketing:
type: boolean
cancel_reason:
type: string
nullable: true
cancelled_at:
type: string
client_details:
$ref: client.yaml
closed_at:
type: string
nullable: true
confirmed:
type: boolean
contact_email:
type: string
nullable: true
created_at:
type: string
currency:
type: string
current_subtotal_price:
type: string
current_subtotal_price_set:
$ref: money.yaml
current_total_additional_fees_set:
$ref: money.yaml
nullable: true
current_total_discounts:
type: string
current_total_discounts_set:
$ref: money.yaml
current_total_duties_set:
$ref: money.yaml
nullable: true
current_total_price:
type: string
current_total_price_set:
$ref: money.yaml
current_total_tax:
type: string
current_total_tax_set:
$ref: money.yaml
customer:
$ref: customer.yaml
fulfillments:
type: array
items:
$ref: fulfillment.yaml
refunds:
type: array
items:
$ref: refund.yaml
shipping_address:
$ref: address.yaml
nullable: true
shipping_lines:
type: array
items:
$ref: shipping_lines.yaml
required:
- id
- admin_graphql_api_id
- buyer_accepts_marketing
- confirmed
- created_at
- currency
- customer
- current_subtotal_price
- current_subtotal_price_set
- current_total_discounts
- current_total_discounts_set
- current_total_price
- current_total_price_set
- current_total_tax
- current_total_tax_set
- fulfillments
- refunds
- shipping_lines
- order_number
75 changes: 75 additions & 0 deletions openapi/paths/customer/_types/order/line-item.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
type: object
properties:
id:
type: number
admin_graphql_api_id:
type: string
fulfillable_quantity:
type: number
fulfillment_service:
type: string
fulfillment_status:
type: string
nullable: true
gift_card:
type: boolean
grams:
type: number
name:
type: string
price:
type: string
price_set:
$ref: money.yaml
product_exists:
type: boolean
product_id:
type: number
properties:
$ref: properties.yaml
quantity:
type: number
requires_shipping:
type: boolean
sku:
type: string
nullable: true
taxable:
type: boolean
title:
type: string
total_discount:
type: string
total_discount_set:
$ref: money.yaml
variant_id:
type: number
variant_inventory_management:
type: string
nullable: true
variant_title:
type: string
nullable: true
vendor:
type: string
nullable: true
required:
- id
- admin_graphql_api_id
- fulfillable_quantity
- fulfillment_service
- gift_card
- grams
- name
- price
- properties
- price_set
- product_exists
- product_id
- variant_id
- quantity
- requires_shipping
- taxable
- title
- total_discount
- total_discount_set
30 changes: 30 additions & 0 deletions openapi/paths/customer/booking/_types/booking.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
allOf:
- $ref: "../../_types/order/base-order.yaml"
- type: object
properties:
start:
type: string
end:
type: string
title:
type: string
groupId:
type: string
shipping:
$ref: ../../../shipping/_types/shipping.yaml
user:
$ref: ../../_types/order/user.yaml
location:
$ref: ../../location/_types/base-location.yaml
line_items:
type: array
items:
$ref: ../../_types/order/line-item.yaml
required:
- user
- location
- groupId
- start
- end
- title
- line_items
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ get:
schema:
type: string
tags:
- CustomerOrder
operationId: customerOrderGetByGroup
- CustomerBooking
operationId: customerBookingGetByGroup
summary: GET Get order with lineItems array for specific groupId
description: This endpoint gets order with lineItems array of objects specific for groupId
responses:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ properties:
type: boolean
example: true
payload:
$ref: ../_types/order-with-lookup.yaml
$ref: ../_types/booking.yaml
required:
- success
- payload
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ get:
schema:
type: string
tags:
- CustomerOrder
operationId: customerOrderRange
- CustomerBooking
operationId: customerBookingRange
summary: GET Get all bookings for customer from orders
description: This endpoint get all bookings from orders
responses:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ properties:
payload:
type: array
items:
$ref: "../_types/order.yaml"
$ref: ../_types/booking.yaml
required:
- success
- payload
Loading
Loading