Merge branch 'v11-connector-2.0' into 'release/2.0'
v11-connector-2.0 See merge request r-d-technique/tiers/tdi-connector!17
This commit is contained in:
commit
6961ad4fe0
21
LICENCE
Normal file
21
LICENCE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 Hardis Supply Chain
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
95
TDItoRP.ftl
95
TDItoRP.ftl
@ -5,68 +5,33 @@
|
|||||||
<#assign tdiEvent64b = JsonUtil.decodeBase64(tdiEventMsg.data) />
|
<#assign tdiEvent64b = JsonUtil.decodeBase64(tdiEventMsg.data) />
|
||||||
<#assign tdiEvent = JsonUtil.jsonToMap(tdiEvent64b)>
|
<#assign tdiEvent = JsonUtil.jsonToMap(tdiEvent64b)>
|
||||||
<#assign senderTag = tdiEventMsg.senderTag>
|
<#assign senderTag = tdiEventMsg.senderTag>
|
||||||
|
<#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "")>
|
||||||
<#-- Target = 0 : Expedition , Target = 1 : Colis -->
|
<#stop>
|
||||||
<#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "")>
|
<#else>
|
||||||
<#stop >
|
[
|
||||||
<#else>
|
{
|
||||||
{"Header":
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingNotified>
|
||||||
{
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
"ProjectID": "${projectRP}"
|
"datas" :
|
||||||
},
|
<#include "TDItoRP_TrackingNotified.ftl">
|
||||||
"ID":
|
}
|
||||||
{
|
<#if tdiEvent.EstimatedDeliveryDate?? && tdiEvent.EstimatedDeliveryDate!="">
|
||||||
"RefID": "${tdiEvent.ParcelNumber}"
|
,
|
||||||
},
|
{
|
||||||
"Payload":
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingETAUpdated>
|
||||||
{"Events": [
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
<#-- {"Date": {"DateTime": "${tdiEvent.EventDate?datetime.iso?iso_utc}", -->
|
"datas" :
|
||||||
{"Date": {"DateTime": "${tdiEvent.EventDate}",
|
<#include "TDItoRP_TrackingETAUpdated.ftl">
|
||||||
"AuthorTimeZone": "UTC"
|
}
|
||||||
},
|
</#if>
|
||||||
<#if tdiEvent.EventCode == "OK-COLLECTED" ||
|
<#if tdiEvent.TrackingUrl?? && tdiEvent.TrackingUrl!="">
|
||||||
tdiEvent.EventCode == "OK-EDI" ||
|
,
|
||||||
tdiEvent.EventCode == "OK-APPT-DATE" ||
|
{
|
||||||
tdiEvent.EventCode == "OK-APPT-NOTI" ||
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingURLUpdated>
|
||||||
tdiEvent.EventCode == "OK-APPT-NEED" ||
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
tdiEvent.EventCode == "ADM" ||
|
"datas" :
|
||||||
tdiEvent.EventCode == "RGP" >
|
<#include "TDItoRP_TrackingURLUpdated.ftl">
|
||||||
"Code": "TRACKING_EVENT_IFTSTA_349", <#-- Handled by carrier -->
|
}
|
||||||
<#else>
|
</#if>
|
||||||
<#if tdiEvent.EventCode?starts_with("TA") >
|
]
|
||||||
"Code": "TRACKING_EVENT_IFTSTA_56", <#-- Incomplete delivery -->
|
</#if>
|
||||||
<#else>
|
|
||||||
<#if tdiEvent.EventCode?starts_with("T-") == true ||
|
|
||||||
tdiEvent.EventCode?starts_with("TD") == true ||
|
|
||||||
tdiEvent.EventCode == "OK-OUT-FOR-D" ||
|
|
||||||
tdiEvent.EventCode == "OK-IN-TRANST" >
|
|
||||||
"Code": "TRACKING_EVENT_IFTSTA_113",<#-- Delivery in progress -->
|
|
||||||
<#else>
|
|
||||||
<#if tdiEvent.EventCode?starts_with("D-") == true ||
|
|
||||||
tdiEvent.EventCode == "OK-DELIVERED" ||
|
|
||||||
tdiEvent.EventCode == "POD" ||
|
|
||||||
tdiEvent.EventCode == "FAC" ||
|
|
||||||
tdiEvent.EventCode == "OK-WITHDRAWA" >
|
|
||||||
"Code": "TRACKING_EVENT_IFTSTA_21",<#-- Process Completed -->
|
|
||||||
<#else>
|
|
||||||
<#if tdiEvent.EventCode?starts_with("DC") == true ||
|
|
||||||
tdiEvent.EventCode?starts_with("DN") == true ||
|
|
||||||
tdiEvent.EventCode?starts_with("DR") == true ||
|
|
||||||
tdiEvent.EventCode?starts_with("C-") == true ||
|
|
||||||
tdiEvent.EventCode == "SUP" ||
|
|
||||||
tdiEvent.EventCode == "NEX" >
|
|
||||||
"Code": "TRACKING_EVENT_IFTSTA_14",<#-- Delivery completed -->
|
|
||||||
<#else>
|
|
||||||
"Code": "TRACKING_EVENT_UNKNOWN",
|
|
||||||
</#if>
|
|
||||||
</#if>
|
|
||||||
</#if>
|
|
||||||
</#if>
|
|
||||||
</#if>
|
|
||||||
"Reason": "${tdiEvent.EventLabel}"
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</#if>
|
|
||||||
|
|||||||
22
TDItoRP_TrackingETAUpdated.ftl
Normal file
22
TDItoRP_TrackingETAUpdated.ftl
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"Header": {
|
||||||
|
"ProjectID": "${projectRP}"
|
||||||
|
},
|
||||||
|
"ID": {
|
||||||
|
"RefID": "${tdiEvent.ParcelNumber}"
|
||||||
|
},
|
||||||
|
"Payload": {
|
||||||
|
"TrackingETA": {
|
||||||
|
"EndETA": {
|
||||||
|
"AuthorTimeZone": "UTC",
|
||||||
|
"DateTime": "${tdiEvent.EstimatedDeliveryDate}"
|
||||||
|
},
|
||||||
|
"StartETA": {
|
||||||
|
"AuthorTimeZone": "UTC",
|
||||||
|
"DateTime": "${tdiEvent.EstimatedDeliveryDate}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
64
TDItoRP_TrackingNotified.ftl
Normal file
64
TDItoRP_TrackingNotified.ftl
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"Header":
|
||||||
|
{
|
||||||
|
"ProjectID": "${projectRP}"
|
||||||
|
},
|
||||||
|
"ID":
|
||||||
|
{
|
||||||
|
"RefID": "${tdiEvent.ParcelNumber}"
|
||||||
|
},
|
||||||
|
"Payload":
|
||||||
|
{
|
||||||
|
"Events": [
|
||||||
|
<#-- {"Date": {"DateTime": "${tdiEvent.EventDate?datetime.iso?iso_utc}", -->
|
||||||
|
{
|
||||||
|
"Date": {
|
||||||
|
"DateTime": "${tdiEvent.EventDate}",
|
||||||
|
"AuthorTimeZone": "UTC"
|
||||||
|
},
|
||||||
|
<#if tdiEvent.EventCode == "OK-COLLECTED" ||
|
||||||
|
tdiEvent.EventCode == "OK-EDI" ||
|
||||||
|
tdiEvent.EventCode == "OK-APPT-DATE" ||
|
||||||
|
tdiEvent.EventCode == "OK-APPT-NOTI" ||
|
||||||
|
tdiEvent.EventCode == "OK-APPT-NEED" ||
|
||||||
|
tdiEvent.EventCode == "ADM" ||
|
||||||
|
tdiEvent.EventCode == "RGP" >
|
||||||
|
"Code": "TRACKING_EVENT_IFTSTA_349", <#-- Handled by carrier -->
|
||||||
|
<#else>
|
||||||
|
<#if tdiEvent.EventCode?starts_with("TA") >
|
||||||
|
"Code": "TRACKING_EVENT_IFTSTA_56", <#-- Incomplete delivery -->
|
||||||
|
<#else>
|
||||||
|
<#if tdiEvent.EventCode?starts_with("T-") == true ||
|
||||||
|
tdiEvent.EventCode?starts_with("TD") == true ||
|
||||||
|
tdiEvent.EventCode == "OK-OUT-FOR-D" ||
|
||||||
|
tdiEvent.EventCode == "OK-IN-TRANST" >
|
||||||
|
"Code": "TRACKING_EVENT_IFTSTA_113",<#-- Delivery in progress -->
|
||||||
|
<#else>
|
||||||
|
<#if tdiEvent.EventCode?starts_with("D-") == true ||
|
||||||
|
tdiEvent.EventCode == "OK-DELIVERED" ||
|
||||||
|
tdiEvent.EventCode == "POD" ||
|
||||||
|
tdiEvent.EventCode == "FAC" ||
|
||||||
|
tdiEvent.EventCode == "OK-WITHDRAWA" >
|
||||||
|
"Code": "TRACKING_EVENT_IFTSTA_21",<#-- Process Completed -->
|
||||||
|
<#else>
|
||||||
|
<#if tdiEvent.EventCode?starts_with("DC") == true ||
|
||||||
|
tdiEvent.EventCode?starts_with("DN") == true ||
|
||||||
|
tdiEvent.EventCode?starts_with("DR") == true ||
|
||||||
|
tdiEvent.EventCode?starts_with("C-") == true ||
|
||||||
|
tdiEvent.EventCode == "SUP" ||
|
||||||
|
tdiEvent.EventCode == "NEX" >
|
||||||
|
"Code": "TRACKING_EVENT_IFTSTA_14",<#-- Delivery completed -->
|
||||||
|
<#else>
|
||||||
|
"Code": "TRACKING_EVENT_UNKNOWN",
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
"Reason": "${tdiEvent.EventLabel}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
13
TDItoRP_TrackingURLUpdated.ftl
Normal file
13
TDItoRP_TrackingURLUpdated.ftl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"Header": {
|
||||||
|
"ProjectID": "${projectRP}"
|
||||||
|
},
|
||||||
|
"ID": {
|
||||||
|
"RefID": "${tdiEvent.ParcelNumber}"
|
||||||
|
},
|
||||||
|
"Payload": {
|
||||||
|
"TrackingURL": "${tdiEvent.TrackingUrl}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
Loading…
x
Reference in New Issue
Block a user