Skip to content

Commit

Permalink
Merge pull request #98 from jamalsoueidan/include-user-inside-line-items
Browse files Browse the repository at this point in the history
fix(get-lineitem.spec.ts): fix typo in import statement
  • Loading branch information
jamalsoueidan authored Dec 15, 2023
2 parents bbcff4b + be93d45 commit 9d3c1de
Show file tree
Hide file tree
Showing 25 changed files with 550 additions and 258 deletions.
16 changes: 10 additions & 6 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,12 @@ components:
# Order
CustomerOrder:
$ref: paths/customer/order/_types/order.yaml
CustomerOrderArrayLineItems:
$ref: paths/customer/order/_types/order-array-line-items.yaml
CustomerOrderSingleLineItem:
$ref: paths/customer/order/_types/order-single-line-item.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
CustomerOrderDiscount:
$ref: paths/customer/order/_types/discount.yaml
CustomerOrderLineItemProperties:
$ref: paths/customer/order/_types/properties.yaml
CustomerOrderSimpleLineItem:
Expand All @@ -126,6 +120,8 @@ components:
$ref: paths/customer/order/_types/customer.yaml
CustomerOrderLineItem:
$ref: paths/customer/order/_types/line-item.yaml
CustomerOrderLineItemLookup:
$ref: paths/customer/order/_types/line-item-with-lookup.yaml
CustomerOrderRefund:
$ref: paths/customer/order/_types/refund.yaml
CustomerOrderShipping:
Expand All @@ -136,8 +132,12 @@ components:
$ref: paths/customer/order/get-line-item/get-line-item.yaml
CustomerOrderGetLineItemResponse:
$ref: paths/customer/order/get-line-item/response.yaml
CustomerOrderGet:
$ref: paths/customer/order/get/get.yaml
CustomerOrderGetResponse:
$ref: paths/customer/order/get/response.yaml
CustomerOrderList:
$ref: paths/customer/order/list/list.yaml
CustomerOrderListResponse:
$ref: paths/customer/order/list/response.yaml

Expand Down Expand Up @@ -165,6 +165,8 @@ components:
CustomerProductListResponse:
$ref: paths/customer/product/list/response.yaml

CustomerLocationBase:
$ref: paths/customer/location/_types/base-location.yaml
CustomerLocation:
$ref: paths/customer/location/_types/location.yaml
CustomerLocationIsDefault:
Expand Down Expand Up @@ -255,6 +257,8 @@ components:
# Shipping
Shipping:
$ref: paths/shipping/_types/shipping.yaml
ShippingCostDestination:
$ref: paths/shipping/_types/cost-destination.yaml
ShippingBody:
$ref: paths/shipping/_types/body.yaml
ShippingCreateResponse:
Expand Down
22 changes: 22 additions & 0 deletions openapi/paths/customer/location/_types/base-location.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
type: object
properties:
locationType:
type: string
enum: [origin, destination]
customerId:
type: string
format: gid
originType:
type: string
enum: [home, commercial]
name:
type: string
fullAddress:
type: string

required:
- locationType
- originType
- customerId
- name
- fullAddress
91 changes: 38 additions & 53 deletions openapi/paths/customer/location/_types/location.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,42 @@
type: object
properties:
_id:
type: string
locationType:
type: string
enum: [origin, destination]
customerId:
type: string
format: gid
originType:
type: string
enum: [home, commercial]
name:
type: string
fullAddress:
type: string
geoLocation:
type: object
required:
- type
- coordinates
allOf:
- $ref: ./location.yaml
- type: object
properties:
type:
_id:
type: string
enum: ["Point"]
coordinates:
type: array
items:
type: number
distanceForFree:
type: number
distanceHourlyRate:
type: number
fixedRatePerKm:
type: number
minDriveDistance:
type: number
maxDriveDistance:
type: number
startFee:
type: number
geoLocation:
type: object
required:
- type
- coordinates
properties:
type:
type: string
enum: ["Point"]
coordinates:
type: array
items:
type: number
distanceForFree:
type: number
distanceHourlyRate:
type: number
fixedRatePerKm:
type: number
minDriveDistance:
type: number
maxDriveDistance:
type: number
startFee:
type: number

required:
- _id
- locationType
- originType
- customerId
- name
- fullAddress
- geoLocation
- distanceForFree
- distanceHourlyRate
- fixedRatePerKm
- minDriveDistance
- maxDriveDistance
- startFee
required:
- _id
- geoLocation
- distanceForFree
- distanceHourlyRate
- fixedRatePerKm
- minDriveDistance
- maxDriveDistance
- startFee
12 changes: 0 additions & 12 deletions openapi/paths/customer/order/_types/discount.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions openapi/paths/customer/order/_types/line-item-with-lookup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
allOf:
- $ref: line-item.yaml
- type: object
properties:
user:
$ref: ../_types/user.yaml
location:
$ref: ../../location/_types/base-location.yaml
shipping:
allOf:
- $ref: ../../../location/_types/travel-time.yaml
- $ref: ../../../shipping/_types/cost-destination.yaml
required:
- user
- location
2 changes: 1 addition & 1 deletion openapi/paths/customer/order/_types/line-item.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ properties:
$ref: money.yaml
variant_id:
type: number
nullable: true
variant_inventory_management:
type: string
nullable: true
Expand All @@ -67,6 +66,7 @@ required:
- price_set
- product_exists
- product_id
- variant_id
- quantity
- requires_shipping
- taxable
Expand Down
29 changes: 29 additions & 0 deletions openapi/paths/customer/order/_types/user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
type: object
properties:
customerId:
type: number
fullname:
type: string
username:
type: string
shortDescription:
type: string
images:
type: object
properties:
profile:
type: object
properties:
url:
type: string
format: uri
width:
type: integer
height:
type: integer
required:
- customerId
- fullname
- username
- shortDescription
- images
30 changes: 13 additions & 17 deletions openapi/paths/customer/order/get-line-item/get-line-item.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
type: object
properties:
order:
$ref: "../_types/order-single-line-item.yaml"
product:
type: object
allOf:
- $ref: "../_types/order.yaml"
- type: object
properties:
selectedOptions:
$ref: ../../schedule/_types/product-selected-options.yaml
line_items:
allOf:
- $ref: ../_types/line-item-with-lookup.yaml
- type: object
properties:
selectedOptions:
$ref: ../_types/user.yaml
required:
- selectedOptions
required:
- selectedOptions
location:
$ref: ../../location/_types/location-is-default.yaml
shipping:
$ref: ../../../shipping/_types/shipping.yaml
required:
- order
- product
- location
- line_items
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
allOf:
- $ref: "./order.yaml"
- $ref: "../_types/order.yaml"
- type: object
properties:
line_items:
type: array
items:
$ref: ../_types/line-item.yaml
$ref: ../_types/line-item-with-lookup.yaml

required:
- line_items
2 changes: 1 addition & 1 deletion openapi/paths/customer/order/get/response.yaml
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-array-line-items.yaml"
$ref: get.yaml
required:
- success
- payload
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
allOf:
- $ref: "./order.yaml"
- $ref: "../_types/order.yaml"
- type: object
properties:
line_items:
Expand Down
2 changes: 1 addition & 1 deletion openapi/paths/customer/order/list/response.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ properties:
payload:
type: array
items:
$ref: "../_types/order-single-line-item.yaml"
$ref: list.yaml
required:
- success
- payload
25 changes: 25 additions & 0 deletions openapi/paths/shipping/_types/cost-destination.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
type: object
properties:
destination:
type: object
properties:
name:
type: string
fullAddress:
type: string
required:
- name
- fullAddress
cost:
type: object
properties:
currency:
type: string
value:
type: integer
required:
- currency
- value
required:
- destination
- cost
23 changes: 1 addition & 22 deletions openapi/paths/shipping/_types/shipping.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
type: object
allOf:
- $ref: ../../location/_types/travel-time.yaml
- $ref: cost-destination.yaml
- type: object
properties:
_id:
Expand All @@ -9,29 +10,7 @@ allOf:
type: string
origin:
$ref: ../../customer/location/_types/location.yaml
destination:
type: object
properties:
name:
type: string
fullAddress:
type: string
required:
- name
- fullAddress
cost:
type: object
properties:
currency:
type: string
value:
type: integer
required:
- currency
- value
required:
- _id
- location
- origin
- destination
- cost
Loading

0 comments on commit 9d3c1de

Please sign in to comment.