-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathon_confirm.jsonata
More file actions
82 lines (82 loc) · 3.84 KB
/
on_confirm.jsonata
File metadata and controls
82 lines (82 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
"data":$.responses.{
"context":context,
"message":{
"orderId":message.order.id,
"provider":{
"id":message.order.provider.id,
"name":message.order.provider.descriptor.name,
"short_desc":message.order.provider.descriptor.short_desc,
"long_desc":message.order.provider.descriptor.long_desc,
"rating":message.order.provider.rating,
"images":message.order.provider.descriptor.images.{
"url":url,
"size_type":size_type
}[],
"fulfillments":message.order.provider.fulfillments
},
"items":message.order.items.{
"id":id,
"code":descriptor.code,
"name":descriptor.name,
"code":descriptor.code,
"short_desc":descriptor.short_desc,
"long_desc":descriptor.long_desc,
"images": descriptor.images.{"url": url, "size_type": size_type, "width": width, "height": height}[],
"price": price,
"rating": rating,
"rateable": rateable,
"time": time,
"quantity": quantity,
"categories": $map(
$filter(%.provider.categories, function($category) { $boolean($category.id in category_ids)}),
function($category) {
{ "id": $category.id, "name": $category.descriptor.name, "code": $category.descriptor.code }
}
)[],
"locations": $map(
$filter(%.provider.locations, function($location) { $boolean($location.id in location_ids)}),
function($location) {
{
"id": $location.id,
"city": $location.city.name,
"state": $location.state.name,
"country": $location.country.name
}
}
)[],
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value, "display": display }[]
}[],
"fulfillments":$map(
$filter(%.provider.fulfillments, function($fulfillment) { $boolean($fulfillment.id in fulfillment_ids)}),
function($fulfillment) {
{
"id": $fulfillment.id,
"type": $fulfillment.type,
"rating": $fulfillment.rating,
"tags": $fulfillment.tags
}
}
)[]
}[],
"fulfillments": message.order.fulfillments,
"quote": message.order.quote,
"billing": message.order.billing,
"payments": message.order.payments,
"cancellation_terms": message.order.cancellation_terms,
"tags": message.order.tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value, "display": display }[]
}[]
},
"rawResponse": $includeRawResponse ? $ :{}
}[]
}