You've already forked tdi-connector
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f87049a8c2 | |||
| f200f2541c | |||
| bf4f470038 | |||
| d3c8f8d143 | |||
| abb26db4ec | |||
| 50e1d27af5 | |||
| a17961ce5a | |||
| f2e599bfba | |||
| 80bf92b631 | |||
| 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 | |||
| 188e2e289d |
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.
|
||||
@@ -1,4 +1,4 @@
|
||||
# tdi-connector
|
||||
|
||||
You can find more info about tdi-connector in the Reflex platform documentation center : https://docs.viz.reflex-platform.com/connectivity/partnerapp/tdi-connector/
|
||||
You can find more info about tdi-connector in the HARDIS SC NETWORK documentation center : https://docs.viz.reflex-platform.com/connectivity/partnerapp/tdi-connector/
|
||||
|
||||
|
||||
85
TDItoRP.ftl
85
TDItoRP.ftl
@@ -5,70 +5,33 @@
|
||||
<#assign tdiEvent64b = JsonUtil.decodeBase64(tdiEventMsg.data) />
|
||||
<#assign tdiEvent = JsonUtil.jsonToMap(tdiEvent64b)>
|
||||
<#assign senderTag = tdiEventMsg.senderTag>
|
||||
|
||||
<#-- Target = 0 : Expedition , Target = 1 : Colis -->
|
||||
<#if tdiEvent.Target == 0 >
|
||||
<#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "")>
|
||||
<#stop>
|
||||
<#else>
|
||||
{"Header":
|
||||
[
|
||||
{
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID":
|
||||
{
|
||||
"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}"
|
||||
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingNotified>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "TDItoRP_TrackingNotified.ftl">
|
||||
}
|
||||
<#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>
|
||||
|
||||
|
||||
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