You've already forked tdi-connector
Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 50e1d27af5 | |||
| a121b9badb | |||
| 6961ad4fe0 | |||
| 4b26006fe0 | |||
| 69a841f77b | |||
| cbf41cd4e0 | |||
|
|
95675b3f30 | ||
|
|
b86280b4f8 | ||
| a6a004545f | |||
| 1e77bbdaf6 | |||
| 95f67c4c0c | |||
| 4d5c2be5f2 | |||
| 987892baae | |||
| 948fa7178d | |||
| 5f41403857 | |||
| 1a84e1ae5f | |||
| 249a81ce7b | |||
| c19f414cc5 | |||
| d9a3666dde | |||
| dfe1b74ab2 | |||
| 9dfe72ee02 | |||
| ff72d30b18 | |||
| 6a9caba0e9 | |||
| 9d16833c49 | |||
| 02e5b9af0e | |||
| c108498368 | |||
| c779c182a2 | |||
| 7ca12ebd36 | |||
| 2f24b0328d | |||
| b60c69e148 | |||
| 0e271167b7 | |||
| 9462439713 | |||
| dddee7e7b7 | |||
| 01914593ab | |||
| 545f8002b5 | |||
| cef7c9aeda | |||
| 547ba029c8 | |||
| 969d42ac4a | |||
| 3be6f84bbb | |||
| a7b7decf78 | |||
| ac66ef14f8 | |||
| 00cda1dcd8 | |||
| 79f199e0b1 | |||
| 6f9c7aa8f0 | |||
| b2c45ae6c0 | |||
| 28399a41f0 | |||
| 92bd1de865 | |||
| c34985ceaa | |||
| 3126008799 | |||
| 7846d535fc | |||
| 79c996263e | |||
| 774abde62d | |||
| f9c5e87f0b | |||
| 0d1bc817d9 | |||
| 0a39df863a | |||
| 441fc482be | |||
| d301169ca7 | |||
| d2b6ee1477 | |||
| 63643cdca8 | |||
| 08e59cd777 | |||
| a1dde83a3f | |||
| 587d6b0af9 | |||
| 62262de63e |
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.
|
||||||
83
TDItoRP.ftl
83
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 -->
|
|
||||||
<#if tdiEvent.Target == 0 >
|
|
||||||
<#stop>
|
<#stop>
|
||||||
<#else>
|
<#else>
|
||||||
{"Header":
|
[
|
||||||
{
|
{
|
||||||
"ProjectID": "${projectRP}"
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingNotified>
|
||||||
},
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
"ID":
|
"datas" :
|
||||||
{
|
<#include "TDItoRP_TrackingNotified.ftl">
|
||||||
"RefID": "${tdiEvent.ParcelNumber!tdiEvent.HUReference1}"
|
|
||||||
},
|
|
||||||
"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}"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
<#if tdiEvent.EstimatedDeliveryDate?? && tdiEvent.EstimatedDeliveryDate!="">
|
||||||
|
,
|
||||||
|
{
|
||||||
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingETAUpdated>
|
||||||
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
|
"datas" :
|
||||||
|
<#include "TDItoRP_TrackingETAUpdated.ftl">
|
||||||
|
}
|
||||||
|
</#if>
|
||||||
|
<#if tdiEvent.TrackingUrl?? && tdiEvent.TrackingUrl!="">
|
||||||
|
,
|
||||||
|
{
|
||||||
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingURLUpdated>
|
||||||
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
|
"datas" :
|
||||||
|
<#include "TDItoRP_TrackingURLUpdated.ftl">
|
||||||
|
}
|
||||||
|
</#if>
|
||||||
]
|
]
|
||||||
}
|
|
||||||
}
|
|
||||||
</#if>
|
</#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}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user