Skip to content

Commit 3dffa7b

Browse files
committed
Updates based on feedback
1 parent 1214968 commit 3dffa7b

15 files changed

+1351
-1319
lines changed

EditorsDraft/bookingflow.png

-25.7 KB
Loading
136 KB
Loading

EditorsDraft/customercancelled.png

-11.7 KB
Loading

EditorsDraft/edit.html

+494-411
Large diffs are not rendered by default.

EditorsDraft/examples.js

+9-27
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function dataExampleRateLimitResponse(utils, content) {
9595

9696
// Line at top of Customer cancellation diagram isn't RPDE, as it's now coming from the store based on Order response and not RPDE - it should just be "store"
9797

98-
// Create a GitHub issue for 49:00 which includes pros and cons of latestCancellationBeforeStartDate vs better errors on cancellation noting "allowSimpleCancellation"
98+
// Create a GitHub issue for 49:00 which includes pros and cons of latestCancellationBeforeStartDate vs better errors on cancellation noting "allowCustomerCancellationFullRefund"
9999

100100

101101
// Make issue about minimal personal data capture
@@ -253,27 +253,9 @@ function dataExampleOrderFeedResponse(utils, content) {
253253
});
254254
}
255255

256-
function dataExampleOrderItemCancellationQuoteRequest(utils, content) {
257-
return generateRequest("PATCH", API_PATH + "/orders/" + UUID, OPERATIONS_MEDIA_TYPE, {
258-
"@context": CONTEXT,
259-
"type": "OrderQuote",
260-
"orderedItem": [responseCancelledOrderItem]
261-
});
262-
}
263256

264-
function dataExampleOrderItemCancellationQuoteResponse(utils, content) {
265-
return generateResponse("200 OK", API_PATH + "/orders/" + UUID, OPERATIONS_MEDIA_TYPE, {
266-
"@context": CONTEXT,
267-
"type": "OrderQuote",
268-
"id": fullOrderExampleContent.id,
269-
"taxMode": fullOrderExampleContent.taxMode,
270-
"orderedItem": [responseCancelledOrderItem],
271-
"totalPaymentDue": fullOrderExampleContent.totalPaymentDue.zeroItems,
272-
"totalTaxSpecification": fullOrderExampleContent.totalTaxSpecification.zeroItems
273-
});
274-
}
275257

276-
function dataExampleOrderItemCancellationRequest(utils, content) {
258+
function dataExampleOrderCancellationRequest(utils, content) {
277259
return generateRequest("PATCH", API_PATH + "/orders/" + UUID, OPERATIONS_MEDIA_TYPE, {
278260
"@context": CONTEXT,
279261
"type": "Order",
@@ -282,11 +264,11 @@ function dataExampleOrderItemCancellationRequest(utils, content) {
282264
}
283265

284266

285-
function dataExampleOrderItemCancellationSuccessResponse(utils, content) {
267+
function dataExampleOrderCancellationSuccessResponse(utils, content) {
286268
return generateResponse("204 No Content", null, OPERATIONS_MEDIA_TYPE);
287269
}
288270

289-
function dataExampleOrderItemCancellationErrorResponse(utils, content) {
271+
function dataExampleOrderCancellationErrorResponse(utils, content) {
290272
return generateResponse("400 Bad Request", null, OPERATIONS_MEDIA_TYPE, {
291273
"@context": CONTEXT,
292274
"type": "CancellationNotPermittedError",
@@ -551,7 +533,7 @@ var fullOrderItemExampleContent = { //broker
551533
SellerCancelled: "https://openactive.io/SellerCancelled",
552534
},
553535
"orderQuantity": 1,
554-
"allowSimpleCancellation": true,
536+
"allowCustomerCancellationFullRefund": true,
555537
"accessToken": [
556538
{
557539
"type": "Barcode",
@@ -674,7 +656,7 @@ var feedOrderItem = {
674656
"type": "OrderItem",
675657
"id": fullOrderItemExampleContent.id,
676658
"orderItemStatus": fullOrderItemExampleContent.orderItemStatus.OrderConfirmed,
677-
"allowSimpleCancellation": true,
659+
"allowCustomerCancellationFullRefund": true,
678660
"unitTaxSpecification": fullOrderItemExampleContent.unitTaxSpecification,
679661
"acceptedOffer": fullOrderItemExampleContent.acceptedOffer.response,
680662
"orderedItem": fullOrderItemExampleContent.orderedItem.request
@@ -691,7 +673,7 @@ var responseOrderQuoteOrderItem = {
691673
"type": "OrderItem",
692674
"orderQuantity": fullOrderItemExampleContent.orderQuantity,
693675
"orderItemStatus": fullOrderItemExampleContent.orderItemStatus.OrderConfirmed,
694-
"allowSimpleCancellation": true,
676+
"allowCustomerCancellationFullRefund": true,
695677
"unitTaxSpecification": fullOrderItemExampleContent.unitTaxSpecification,
696678
"acceptedOffer": fullOrderItemExampleContent.acceptedOffer.response,
697679
"orderedItem": fullOrderItemExampleContent.orderedItem.orderQuoteResponse
@@ -701,7 +683,7 @@ var responseOrderQuoteErrorOrderItem = {
701683
"type": "OrderItem",
702684
"orderQuantity": fullOrderItemExampleContent.orderQuantity,
703685
"orderItemStatus": fullOrderItemExampleContent.orderItemStatus.OrderConfirmed,
704-
"allowSimpleCancellation": true,
686+
"allowCustomerCancellationFullRefund": true,
705687
"unitTaxSpecification": fullOrderItemExampleContent.unitTaxSpecification,
706688
"acceptedOffer": fullOrderItemExampleContent.acceptedOffer.response,
707689
"orderedItem": fullOrderItemExampleContent.orderedItem.orderQuoteResponse,
@@ -716,7 +698,7 @@ var responseOrderItem = {
716698
"type": "OrderItem",
717699
"id": fullOrderItemExampleContent.id,
718700
"orderItemStatus": fullOrderItemExampleContent.orderItemStatus.OrderConfirmed,
719-
"allowSimpleCancellation": true,
701+
"allowCustomerCancellationFullRefund": true,
720702
"unitTaxSpecification": fullOrderItemExampleContent.unitTaxSpecification,
721703
"acceptedOffer": fullOrderItemExampleContent.acceptedOffer.response,
722704
"orderedItem": fullOrderItemExampleContent.orderedItem.orderResponse,

EditorsDraft/index.html

+797-881
Large diffs are not rendered by default.
68.1 KB
Loading

EditorsDraft/scratch.html

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Booking flow with approval (OLD)
2+
3+
4+
5+
6+
## Selection-based approval
7+
8+
The `OrderQuote` will return `approvalNote` within each `OrderItem` that requires approval which contains `name` and `description` properties.
9+
10+
<pre class="example" title="Example of OfferOverride">
11+
"orderItemIntakeForm": [
12+
[
13+
{
14+
"type": "PropertyValueSpecification",
15+
"id": "https://example.com/height",
16+
"name": "More information about you",
17+
"description": "Have you played before? Are you a complete beginner or seasoned pro?",
18+
"valueRequired": false
19+
}
20+
]
21+
],
22+
"approvalNote": {
23+
"type": "PropertyValue",
24+
"name": "More information about you",
25+
"description": "Have you played before? Are you a complete beginner or seasoned pro?",
26+
}
27+
</pre>
28+
29+
## First-come-first-served approval
30+
31+
For the case where any `OrderItem`s in an `Order` require approval (`orderItemStatus` of `https://openactive.io/OrderApprovalPending`), the whole `Order` MUST be held in a pending state by the <a>Booking System</a>, with the <a>Broker</a> storing the `Order` with an internal status of `https://openactive.io/OrderApprovalPending`.
32+
33+
An `Order` pending approval MUST be approved or rejected atomically; partial approval is not supported in this version of the specification.
34+
35+
While the `Order` is in `orderItemStatus` of `https://openactive.io/OrderApprovalPending`:
36+
- The `Order` MUST not be cancelled, and MAY only be deleted.
37+
- All `OrderItem` MUST be leased, to ensure that they are not
38+
39+
For an `Order` that requires approval, the flow differs from the above as follows:
40+
41+
- `OrderQuote` is returned at **C1** and **C2** with any `OrderItem`s that require approval having with `orderItemStatus` of `https://openactive.io/OrderApprovalPending`. The <a>Customer</a> MAY then be prompted to supply an `orderApprovalRequestNote` to display to the seller, which can be included with the `Order` at **B**.
42+
- `Order` is returned at **B** with any `OrderItem`s that require approval having an `orderItemStatus` of `https://openactive.io/OrderApprovalPending`. If this is the case, the <a>Customer</a> MUST be notified that the `Order` is awaiting approval.
43+
- If approval is given, the <a>Booking System</a> updates the `Order` in the <a>Orders feed</a> setting all `OrderItem`s to an `https://openactive.io/OrderConfirmed` state. The <a>Broker</a> receives this update from the <a>Orders feed</a> and completes the remaining steps of **Capture Payment**, **Invoice Generation** and **Customer Notification** as in the original flow above.
44+
- If approval is not given, the <a>Booking System</a> MUST make the `Order` available in an RPDE `deleted` state in the <a>Orders feed</a> and the <a>Broker</a> MUST notify the <a>Customer</a> that their booking was not approved, and any payment authorisation MUST be withdrawn.
45+
46+
A <a>Broker</a> MAY cancel an `Order` before it has been approved by using the Order Deletion endpoint.
47+
48+
<figure>
49+
<img src="sequencediagramwithapproval.png" alt="Sequence diagram with approval">
50+
<figcaption>Sequence diagram showing API interactions, with approval step</figcaption>
51+
</figure>

EditorsDraft/sellercancelled.png

-872 Bytes
Loading

EditorsDraft/sequencediagram.png

-35.5 KB
Loading
-42.9 KB
Loading

EditorsDraft/typeflow.png

13.8 KB
Loading

EditorsDraft/typeflowwithapproval.png

18.5 KB
Loading

EditorsDraft/userjourney.png

-118 Bytes
Loading
53 KB
Loading

0 commit comments

Comments
 (0)