You've already forked tdi-connector
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 731f77cdb5 |
21
LICENCE
21
LICENCE
@@ -1,21 +0,0 @@
|
|||||||
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.
|
|
||||||
79
TDItoRP.ftl
79
TDItoRP.ftl
@@ -5,33 +5,68 @@
|
|||||||
<#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 -->
|
||||||
|
<#if tdiEvent.Target == 0 >
|
||||||
<#stop >
|
<#stop >
|
||||||
<#else>
|
<#else>
|
||||||
[
|
{"Header":
|
||||||
{
|
{
|
||||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingNotified>
|
"ProjectID": "${projectRP}"
|
||||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
},
|
||||||
"datas" :
|
"ID":
|
||||||
<#include "TDItoRP_TrackingNotified.ftl">
|
|
||||||
}
|
|
||||||
<#if tdiEvent.EstimatedDeliveryDate?? && tdiEvent.EstimatedDeliveryDate!="">
|
|
||||||
,
|
|
||||||
{
|
{
|
||||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingETAUpdated>
|
"RefID": "${tdiEvent.ParcelNumber!tdiEvent.HUReference1}"
|
||||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
},
|
||||||
"datas" :
|
"Payload":
|
||||||
<#include "TDItoRP_TrackingETAUpdated.ftl">
|
{"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 tdiEvent.TrackingUrl?? && tdiEvent.TrackingUrl!="">
|
|
||||||
,
|
|
||||||
{
|
|
||||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingURLUpdated>
|
|
||||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
||||||
"datas" :
|
|
||||||
<#include "TDItoRP_TrackingURLUpdated.ftl">
|
|
||||||
}
|
|
||||||
</#if>
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
"Reason": "${tdiEvent.EventLabel}"
|
||||||
|
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
</#if>
|
</#if>
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"Header": {
|
|
||||||
"ProjectID": "${projectRP}"
|
|
||||||
},
|
|
||||||
"ID": {
|
|
||||||
"RefID": "${tdiEvent.ParcelNumber}"
|
|
||||||
},
|
|
||||||
"Payload": {
|
|
||||||
"TrackingETA": {
|
|
||||||
"EndETA": {
|
|
||||||
"AuthorTimeZone": "UTC",
|
|
||||||
"DateTime": "${tdiEvent.EstimatedDeliveryDate}"
|
|
||||||
},
|
|
||||||
"StartETA": {
|
|
||||||
"AuthorTimeZone": "UTC",
|
|
||||||
"DateTime": "${tdiEvent.EstimatedDeliveryDate}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"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}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"Header": {
|
|
||||||
"ProjectID": "${projectRP}"
|
|
||||||
},
|
|
||||||
"ID": {
|
|
||||||
"RefID": "${tdiEvent.ParcelNumber}"
|
|
||||||
},
|
|
||||||
"Payload": {
|
|
||||||
"TrackingURL": "${tdiEvent.TrackingUrl}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
Reference in New Issue
Block a user