Skip to content

Commit 91fc667

Browse files
committed
Updated examples
1 parent edd49a9 commit 91fc667

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

EditorsDraft/edit.html

+14-21
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@
512512
The `leaseExpires` MAY be used to inform the `Customer` of the time they have remaining.
513513

514514

515-
516515
## Step-by-step process description
517516

518517
<figure>
@@ -856,6 +855,8 @@
856855

857856
- The `validFromBeforeStartDate` duration (if provided) subtracted from the `startDate` in the past. This allows for a "bookahead" window to be specified.
858857

858+
- The `taxMode` (`https://openactive/TaxNet` or `https://openactive/TaxGross`) is specified within the `Organization` that is included in the REQUIRED `organizer` or `provider` properties.
859+
859860
- The <a>Broker</a> has machine readable permission to access the relevant instance of a compliant Open Booking API provided by the <a>Booking System</a> via an API key or similar token.
860861

861862
The <a>Broker</a> MUST NOT attempt to book an opportunity that is not <a>bookable</a> by the above criteria. The <a>Booking System</a> MUST return an error if an `Order` is submitted that contains activities that are not <a>bookable</a>, and include an `error` against each `OrderItem` in the `OrderQuote` that is not <a>bookable</a>.
@@ -1164,8 +1165,10 @@
11641165
<pre class="example" title="Order Creation: OrderQuote example failure response" data-transform="dataExampleOrderQuoteCreationErrorResponse">
11651166
</pre>
11661167

1167-
If there are issues with other properties of the `OrderQuote` outside of `orderedItem`, the <a>Booking System</a> MUST respond with a `400 Bad Request` response, which includes only the appropriate `Error`.
1168+
If there are issues with other properties of the `OrderQuote` outside of `orderedItem`, the <a>Booking System</a> MUST respond with a JSON-LD response which includes only the appropriate `OpenBookingError` and the appropriate status code.
11681169

1170+
<pre class="example" title="Order Creation: OrderQuote example failure response" data-transform="dataExampleOrderQuoteCreationGenericErrorResponse">
1171+
</pre>
11691172

11701173

11711174
#### `Order`
@@ -1573,13 +1576,6 @@
15731576

15741577
## Error Model
15751578

1576-
### `oa:Error`
1577-
1578-
| Property | Status | Type | Notes |
1579-
|--------------------------------------------------------------------|-------------|-|------|
1580-
| `@type` | REQUIRED | [`schema:Text`](https://schema.org/Text) | `Error` |
1581-
| [`oa:error`](https://openactive.io/error) | REQUIRED | Array of [`oa:OpenBookingError`](https://openactive.io/OpenBookingError) | An array of errors related to the request. |
1582-
15831579

15841580
### `oa:OpenBookingError`
15851581

@@ -1614,13 +1610,13 @@
16141610

16151611
| Error Type | Status Code | Use Case |
16161612
|---------------------------------------------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1617-
| `IncompleteOrderItemError` | 400 | If there is a missing `acceptedOffer` or `orderedItem` property on the `schema:OrderItem`. |
1618-
| `UnacceptableOfferError` | 400 | If the `acceptedOffer` is not a URL which corresponds to an <a>Applicable `Offer`</a> for the opportunity. |
1619-
| `UnknownOfferError` | 404 | If the `acceptedOffer` is not a URL which corresponds to an `Offer` within the <a>Booking System</a>. |
1620-
| `UnknownOpportunityDetailsError` | 404 | If the `orderedItem` is not a URL which corresponds to an opportunity on the <a>Booking System</a>. |
1621-
| `UnavailableOpportunityError` | 400 | If the `Offer` contained in the `acceptedOffer` property is not bookable |
1622-
| `OpportunityIsFullError` | 400 | If there are no available spaces for the opportunity contained in the `orderedItem` property |
1623-
| `OpportunityHasInsufficientCapacityError` | 400 | If there are not enough available spaces in the opportunity contained in the `orderedItem` property to fulfil the number requested by the `orderQuantity` property. |
1613+
| `IncompleteOrderItemError` | 409 | If there is a missing `acceptedOffer` or `orderedItem` property on the `schema:OrderItem`. |
1614+
| `UnacceptableOfferError` | 409 | If the `acceptedOffer` is not a URL which corresponds to an <a>Applicable `Offer`</a> for the opportunity. |
1615+
| `UnknownOfferError` | 409 | If the `acceptedOffer` is not a URL which corresponds to an `Offer` within the <a>Booking System</a>. |
1616+
| `UnknownOpportunityDetailsError` | 409 | If the `orderedItem` is not a URL which corresponds to an opportunity on the <a>Booking System</a>. |
1617+
| `UnavailableOpportunityError` | 409 | If the `Offer` contained in the `acceptedOffer` property is not bookable |
1618+
| `OpportunityIsFullError` | 409 | If there are no available spaces for the opportunity contained in the `orderedItem` property |
1619+
| `OpportunityHasInsufficientCapacityError` | 409 | If there are not enough available spaces in the opportunity contained in the `orderedItem` property to fulfil the number requested by the `orderQuantity` property. |
16241620

16251621

16261622
#### API authentication
@@ -1732,11 +1728,8 @@
17321728
<pre class="example" title="Error response format">
17331729
{
17341730
"@context": "https://openactive.io/",
1735-
"type": "Error",
1736-
"error": [
1737-
"type": "IncompleteCustomerDetailsError",
1738-
"description": "No customer details supplied"
1739-
]
1731+
"type": "IncompleteCustomerDetailsError",
1732+
"description": "No customer details supplied"
17401733
}
17411734
</pre>
17421735

EditorsDraft/examples.js

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ function dataExampleOrderQuoteCreationErrorResponse(utils, content) {
4545
});
4646
}
4747

48+
function dataExampleOrderQuoteCreationGenericErrorResponse(utils, content) {
49+
return generateResponse("400 Bad Request", null, OPERATIONS_MEDIA_TYPE, {
50+
"@context": CONTEXT,
51+
"type": "IncompleteCustomerDetailsError",
52+
"description": "No customer details supplied"
53+
});
54+
}
55+
4856
//TODO: Allow multiple errors only for order creation
4957

5058
//TODO: Should we have a separate type for OrderRequest to better define the required params?
@@ -146,6 +154,8 @@ function dataExampleOrderCreationFullResponse(utils, content) {
146154
});
147155
}
148156

157+
158+
149159
function dataExampleOrderDeletionRequest(utils, content) {
150160
return generateRequest("DELETE", API_PATH + "/orders/" + UUID, OPERATIONS_MEDIA_TYPE);
151161
}

0 commit comments

Comments
 (0)