Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #96

Merged
merged 8 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ PS_CITY_NAME=Bangalore
PS_CITY_CODE=std:080
PS_COUNTRY_NAME=India
PS_COUNTRY_CODE=IND
BAP_WEBHOOK_URI=https://bap-backend-dev.becknprotocol.io/api/webhook
4 changes: 4 additions & 0 deletions mappings/cred.jsonata
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"context": $context(context, $action),
"message": message
}
5 changes: 3 additions & 2 deletions mappings/on_cancel.jsonata
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
"rateable": rateable,
"time": time,
"quantity": quantity,
"tags": tags.{
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[],
"fulfillments":$map(
$filter(%.provider.fulfillments, function($fulfillment) { $boolean($fulfillment.id in fulfillment_ids)}),
Expand Down
35 changes: 18 additions & 17 deletions mappings/on_confirm.jsonata
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@
}
)[],
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
}[],
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[],
"fulfillments":$map(
$filter(%.provider.fulfillments, function($fulfillment) { $boolean($fulfillment.id in fulfillment_ids)}),
function($fulfillment) {
Expand All @@ -62,18 +63,18 @@
}
)[]
}[],
"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,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
}[]
"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": code, "name": name, "value": value }[]
}[]
},
"rawResponse": $includeRawResponse ? $ :{}
}[]
Expand Down
7 changes: 7 additions & 0 deletions mappings/on_cred.jsonata
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"data":$.responses.{
"context": context,
"message": message,
"rawResponse": $includeRawResponse ? $ : {}
}[]
}
14 changes: 8 additions & 6 deletions mappings/on_init.jsonata
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[],
"xinput":$xInput(xinput, $action),
"fulfillments":$map(
Expand All @@ -74,11 +75,12 @@
"cancellation_terms": message.order.cancellation_terms,

"tags": message.order.tags.{
"code": descriptor.code,
"name": descriptor.name,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
}[]
"code": descriptor.code,
"name": descriptor.name,
"display": display,
"description": descriptor.description,
"list": list.{ "code": code, "name": name, "value": value }[]
}[]
}
},
"rawResponse": $includeRawResponse ? $ :{}
Expand Down
9 changes: 6 additions & 3 deletions mappings/on_search.jsonata
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[]
}
}
Expand All @@ -80,8 +81,9 @@
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[],
"time": {
"duration": time.duration,
Expand All @@ -91,7 +93,8 @@
"quantity": quantity
}[],
"images": descriptor.images.{"url": url}[],
"media": descriptor.media.{"url": url, "mimetype": mimetype}[]
"media": descriptor.media.{"url": url, "mimetype": mimetype}[],
"tags": tags
}[]
},
"rawResponse": $includeRawResponse ? $ :{}
Expand Down
15 changes: 8 additions & 7 deletions mappings/on_select.jsonata
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[],
"fulfillments":$map(
$filter(%.provider.fulfillments, function($fulfillment) { $boolean($fulfillment.id in fulfillment_ids)}),
Expand All @@ -71,13 +72,13 @@
"billing": message.order.billing,
"payments": message.order.payments,
"cancellation_terms": message.order.cancellation_terms,

"tags": message.order.tags.{
"code": descriptor.code,
"name": descriptor.name,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
}[]
"code": descriptor.code,
"name": descriptor.name,
"display": display,
"description": descriptor.description,
"list": list.{ "code": code, "name": name, "value": value }[]
}[]
}
},
"rawResponse": $includeRawResponse ? $ :{}
Expand Down
18 changes: 10 additions & 8 deletions mappings/on_status.jsonata
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,25 @@
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[]
}[],
}[],
"fulfillments": message.order.fulfillments,
"quote": message.order.quote,
"billing": message.order.billing,
"payments": message.order.payments,
"cancellation_terms": message.order.cancellation_terms,
"type": message.order.type,

"tags": message.order.tags.{
"code": descriptor.code,
"name": descriptor.name,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]
}[]
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[]
}
},
"rawResponse": $includeRawResponse ? $ :{}
Expand Down
4 changes: 2 additions & 2 deletions mappings/on_support.jsonata
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"data": $.responses.{
"context":context,
"context": context,
"message": message,
"rawResponse": $includeRawResponse ? $ :{}
"rawResponse": $includeRawResponse ? $ : {}
}[]
}
12 changes: 6 additions & 6 deletions mappings/on_update.jsonata
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
}
)[],
"tags": tags.{
"code": descriptor.code,
"name": descriptor.name,
"display": display,
"list": list.{ "code": descriptor.code, "name": descriptor.name, "value": value }[]

}[]
"code": descriptor.code,
"name": descriptor.name,
"description": descriptor.description,
"display": display,
"list": list.{ "code": code, "name": name, "value": value, "display": display }[]
}[]
},
"fulfillments": message.order.fulfillments,
"quote": message.order.quote,
Expand Down
31 changes: 17 additions & 14 deletions mappings/search.jsonata
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
{
"context": $context(context, $action),
"message":{
"intent":{
"item":{
"descriptor":{
"name":searchString
"intent": {
"item": {
"descriptor": {
"name": searchString
},
"id":itemId
"id": itemId,
"quantity": quantity
},
"fulfillment":{
"fulfillment": {
"type": fulfillment.type,
"stops": $map( fulfillment.stops, function($gps) {
"stops": $map(fulfillment.stops, function($gps) {
{
"type": $gps.type,
"location": {
"gps":$gps.location
}
},
"time": $gps.time
}
})[],
"agent":{
"person":{
"name":fulfillment.agentName
"name": fulfillment.agentName
}

},
"customer":{
"person":{
"gender":fulfillment.customerGender
"gender": fulfillment.customerGender
}
}
},
"provider":{
"descriptor":{
"name":provider.providerName
"name": provider.providerName
},
"locations":$map( provider.providerCity, function($location) {
{
"city":{
"name":$location
}}
"city": {
"name": $location
}
}
})[],
"id":provider.providerId
},
Expand Down
2 changes: 1 addition & 1 deletion mappings/track.jsonata
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$.data.{
"context":$context(context, $action),
"message":{
"message": {
"order_id":orderId,
"callback_url":callbackUrl
}
Expand Down
Loading