Added OrderLines & bulk GET Orders
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
# Spectral docs
|
||||||
|
*spectral*
|
||||||
@@ -704,20 +704,15 @@ paths:
|
|||||||
dfc-b:hasNutrientCharacteristic: []
|
dfc-b:hasNutrientCharacteristic: []
|
||||||
dfc-b:hasAllergenCharacteristic: []
|
dfc-b:hasAllergenCharacteristic: []
|
||||||
|
|
||||||
"/api/dfc/enterprises/{enterprise_id}/orders/{id}":
|
"/api/dfc/enterprises/{enterprise_id}/orders":
|
||||||
parameters:
|
parameters:
|
||||||
- name: enterprise_id
|
- name: enterprise_id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
- name: id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
get:
|
get:
|
||||||
summary: Show Orders
|
summary: Show all Orders for an Enterprise
|
||||||
tags:
|
tags:
|
||||||
- Orders
|
- Orders
|
||||||
responses:
|
responses:
|
||||||
@@ -756,7 +751,7 @@ paths:
|
|||||||
dfc-b:pickedUpAt: Our Fantastic Farm Gate
|
dfc-b:pickedUpAt: Our Fantastic Farm Gate
|
||||||
dfc-b:soldBy: http://test.host/api/dfc/enterprises/10000
|
dfc-b:soldBy: http://test.host/api/dfc/enterprises/10000
|
||||||
dfc-b:hasPart:
|
dfc-b:hasPart:
|
||||||
- "@id": http://test.host/api/dfc/enterprises/{enterprise_id}/orderlines/10001-01
|
- "@id": http://test.host/api/dfc/enterprises/10000/orders/10001/orderlines/10001-01
|
||||||
"@type": dfc-b:OrderLine
|
"@type": dfc-b:OrderLine
|
||||||
dfc-b:concerns: http://test.host/api/dfc/enterprises/10000/suppliedproducts/10001
|
dfc-b:concerns: http://test.host/api/dfc/enterprises/10000/suppliedproducts/10001
|
||||||
dfc-b:hasQuantity:
|
dfc-b:hasQuantity:
|
||||||
@@ -769,9 +764,10 @@ paths:
|
|||||||
dfc-b:value: 19.95
|
dfc-b:value: 19.95
|
||||||
dfc-b:VATrate: 0.0
|
dfc-b:VATrate: 0.0
|
||||||
dfc-b:discount: []
|
dfc-b:discount: []
|
||||||
dfc-b:hasPart: http://test.host/api/dfc/enterprises/{enterprise_id}/orderlines/10001-02
|
dfc-b:hasPart: http://test.host/api/dfc/enterprises/10000/orders/10001/orderlines/10001-012
|
||||||
post:
|
post:
|
||||||
Summary: Create an Order
|
Summary: Create an Order
|
||||||
|
parameters: []
|
||||||
tags:
|
tags:
|
||||||
- Orders
|
- Orders
|
||||||
responses:
|
responses:
|
||||||
@@ -785,9 +781,135 @@ paths:
|
|||||||
test_example:
|
test_example:
|
||||||
value:
|
value:
|
||||||
"@context": https://www.datafoodconsortium.org
|
"@context": https://www.datafoodconsortium.org
|
||||||
"@id": http://test.host/api/dfc/enterprises/{enterprise_id}/orderlines/10001-01
|
"@id": http://test.host/api/dfc/enterprises/10000/orders/10001
|
||||||
|
"@type": dfc-b:Order
|
||||||
|
dfc-b:belongsTo: http://test.host/api/dfc/enterprises/10000/salessessions/10002
|
||||||
|
dfc-b:orderNumber: "MYORDERNUM:12345"
|
||||||
|
dfc-b:hasOrderStatus: dfc-v:Draft
|
||||||
|
dfc-b:hasFulfilmentStatus: dfc-v:Held
|
||||||
|
dfc-b:hasPaymentState: dfc-v:Unpaid
|
||||||
|
dfc-b:hasPaymentMethod:
|
||||||
|
"@type": dfc-b:PaymentMethod
|
||||||
|
dfc-b:paymentMethodType: Example Card PaymentMethod
|
||||||
|
dfc-b:paymentMethodProvider: Stripe
|
||||||
|
dfc-b:hasPrice:
|
||||||
|
"@type": dfc-b:QuantitativeValue
|
||||||
|
dfc-b:hasUnit: GBP
|
||||||
|
dfc-b:value: £0.27
|
||||||
|
dfc-b:VATrate: 0.00
|
||||||
|
dfc-b:discount: 1.55
|
||||||
|
dfc-b:OrderedBy: http://test.host/api/dfc/persons/10000
|
||||||
|
dfc-b:selects:
|
||||||
|
"@type": dfc-b:ShippingOption
|
||||||
|
dfc-b:optionOf: http://test.host/api/dfc/enterprises/10000/salessessions/10002
|
||||||
|
dfc-b:fee: 1.50
|
||||||
|
dfc-b:uses:
|
||||||
|
"@type": dfc-b:PickupOption
|
||||||
|
dfc-b:pickedUpAt: Our Fantastic Farm Gate
|
||||||
|
dfc-b:soldBy: http://test.host/api/dfc/enterprises/10000
|
||||||
|
dfc-b:hasPart: http://test.host/api/dfc/enterprises/10000/orders/10001/orderlines/10001-01
|
||||||
|
'404':
|
||||||
|
description: not found
|
||||||
|
|
||||||
|
"/api/dfc/enterprises/{enterprise_id}/orders/{id}":
|
||||||
|
parameters:
|
||||||
|
- name: enterprise_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
get:
|
||||||
|
summary: Show an Order
|
||||||
|
tags:
|
||||||
|
- Orders
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: success
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
examples:
|
||||||
|
test_example:
|
||||||
|
value:
|
||||||
|
"@context": https://www.datafoodconsortium.org
|
||||||
|
"@id": http://test.host/api/dfc/enterprises/10000/orders/10001
|
||||||
|
"@type": dfc-b:Order
|
||||||
|
dfc-b:belongsTo: http://test.host/api/dfc/enterprises/10000/salessessions/10002
|
||||||
|
dfc-b:orderNumber: "MYORDERNUM:12345"
|
||||||
|
dfc-b:hasOrderStatus: dfc-v:Draft
|
||||||
|
dfc-b:hasFulfilmentStatus: dfc-v:Held
|
||||||
|
dfc-b:hasPaymentState: dfc-v:Unpaid
|
||||||
|
dfc-b:hasPaymentMethod:
|
||||||
|
"@type": dfc-b:PaymentMethod
|
||||||
|
dfc-b:paymentMethodType: Example Card PaymentMethod
|
||||||
|
dfc-b:paymentMethodProvider: Stripe
|
||||||
|
dfc-b:hasPrice:
|
||||||
|
"@type": dfc-b:QuantitativeValue
|
||||||
|
dfc-b:hasUnit: GBP
|
||||||
|
dfc-b:value: £0.27
|
||||||
|
dfc-b:VATrate: 0.00
|
||||||
|
dfc-b:discount: 1.55
|
||||||
|
dfc-b:OrderedBy: http://test.host/api/dfc/persons/10000
|
||||||
|
dfc-b:selects:
|
||||||
|
"@type": dfc-b:ShippingOption
|
||||||
|
dfc-b:optionOf: http://test.host/api/dfc/enterprises/10000/salessessions/10002
|
||||||
|
dfc-b:fee: 1.50
|
||||||
|
dfc-b:uses:
|
||||||
|
"@type": dfc-b:PickupOption
|
||||||
|
dfc-b:pickedUpAt: Our Fantastic Farm Gate
|
||||||
|
dfc-b:soldBy: http://test.host/api/dfc/enterprises/10000
|
||||||
|
dfc-b:hasPart:
|
||||||
|
- "@id": http://test.host/api/dfc/enterprises/10000/orders/10001/orderlines/10001-01
|
||||||
|
"@type": dfc-b:OrderLine
|
||||||
|
dfc-b:concerns: http://test.host/api/dfc/enterprises/10000/suppliedproducts/10001
|
||||||
|
dfc-b:hasQuantity:
|
||||||
|
"@type": dfc-b:QuantitativeValue
|
||||||
|
dfc-b:hasUnit: Packet
|
||||||
|
dfc-b:hasValue: 5.0
|
||||||
|
dfc-b:Price:
|
||||||
|
"@type": dfc-b:QuantitativeValue
|
||||||
|
dfc-b:hasUnit: GBP
|
||||||
|
dfc-b:value: 19.95
|
||||||
|
dfc-b:VATrate: 0.0
|
||||||
|
dfc-b:discount: []
|
||||||
|
dfc-b:hasPart: http://test.host/api/dfc/enterprises/10000/orders/10001/orderlines/10001-012
|
||||||
|
'404':
|
||||||
|
description: not found
|
||||||
|
|
||||||
|
|
||||||
|
"/api/dfc/enterprises/{enterprise_id}/orders/{order_id}/orderlines":
|
||||||
|
parameters:
|
||||||
|
- name: enterprise_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: order_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
get:
|
||||||
|
summary: Show all Order Lines for an Order
|
||||||
|
tags:
|
||||||
|
- Orders
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: success
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
examples:
|
||||||
|
test_example:
|
||||||
|
value:
|
||||||
|
"@context": https://www.datafoodconsortium.org
|
||||||
|
"@id": http://test.host/api/dfc/enterprises/10000/orders/10001/orderlines/10001-01
|
||||||
"@type": dfc-b:OrderLine
|
"@type": dfc-b:OrderLine
|
||||||
dfc-b:concerns: http://test.host/api/dfc/enterprises/10000/suppliedproducts/10001
|
dfc-b:concerns: http://test.host/api/dfc/enterprises/10000/suppliedproducts/10001
|
||||||
|
dfc-b:partOf: http://test.host/api/dfc/enterprises/10000/orders/10001
|
||||||
dfc-b:hasQuantity:
|
dfc-b:hasQuantity:
|
||||||
"@type": dfc-b:QuantitativeValue
|
"@type": dfc-b:QuantitativeValue
|
||||||
dfc-b:hasUnit: Packet
|
dfc-b:hasUnit: Packet
|
||||||
@@ -797,8 +919,86 @@ paths:
|
|||||||
dfc-b:hasUnit: GBP
|
dfc-b:hasUnit: GBP
|
||||||
dfc-b:value: 19.95
|
dfc-b:value: 19.95
|
||||||
dfc-b:VATrate: 0.0
|
dfc-b:VATrate: 0.0
|
||||||
dfc-b:discount: []
|
dfc-b:discount: 2.95
|
||||||
|
'404':
|
||||||
|
description: not found
|
||||||
|
post:
|
||||||
|
summary: Create Order Line
|
||||||
|
parameters: []
|
||||||
|
tags:
|
||||||
|
- Orders
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: bad request
|
||||||
|
'200':
|
||||||
|
description: success
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
examples:
|
||||||
|
test_example:
|
||||||
|
value:
|
||||||
|
"@context": https://www.datafoodconsortium.org
|
||||||
|
"@id": http://test.host/api/dfc/enterprises/10000/orders/10001/orderlines/10001-01
|
||||||
|
"@type": dfc-b:OrderLine
|
||||||
|
dfc-b:concerns: http://test.host/api/dfc/enterprises/10000/suppliedproducts/10001
|
||||||
|
dfc-b:partOf: http://test.host/api/dfc/enterprises/10000/orders/10001
|
||||||
|
dfc-b:hasQuantity:
|
||||||
|
"@type": dfc-b:QuantitativeValue
|
||||||
|
dfc-b:hasUnit: Packet
|
||||||
|
dfc-b:hasValue: 5.0
|
||||||
|
dfc-b:Price:
|
||||||
|
"@type": dfc-b:QuantitativeValue
|
||||||
|
dfc-b:hasUnit: GBP
|
||||||
|
dfc-b:value: 19.95
|
||||||
|
dfc-b:VATrate: 0.0
|
||||||
|
dfc-b:discount: 2.95
|
||||||
|
'404':
|
||||||
|
description: not found
|
||||||
|
|
||||||
|
"/api/dfc/enterprises/{enterprise_id}/orders/{order_id}/orderlines/{id}":
|
||||||
|
parameters:
|
||||||
|
- name: enterprise_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: order_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
get:
|
||||||
|
summary: Retrieve a single Order Line
|
||||||
|
tags:
|
||||||
|
- Orders
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: success
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
examples:
|
||||||
|
test_example:
|
||||||
|
value:
|
||||||
|
"@context": https://www.datafoodconsortium.org
|
||||||
|
"@id": http://test.host/api/dfc/enterprises/10000/orders/10001/orderlines/10001-01
|
||||||
|
"@type": dfc-b:OrderLine
|
||||||
|
dfc-b:concerns: http://test.host/api/dfc/enterprises/10000/suppliedproducts/10001
|
||||||
|
dfc-b:partOf: http://test.host/api/dfc/enterprises/10000/orders/10001
|
||||||
|
dfc-b:hasQuantity:
|
||||||
|
"@type": dfc-b:QuantitativeValue
|
||||||
|
dfc-b:hasUnit: Packet
|
||||||
|
dfc-b:hasValue: 5.0
|
||||||
|
dfc-b:Price:
|
||||||
|
"@type": dfc-b:QuantitativeValue
|
||||||
|
dfc-b:hasUnit: GBP
|
||||||
|
dfc-b:value: 19.95
|
||||||
|
dfc-b:VATrate: 0.0
|
||||||
|
dfc-b:discount: 2.95
|
||||||
'404':
|
'404':
|
||||||
description: not found
|
description: not found
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user