Merge branch 'release/2.0' into 'main'
Release/2.0 -> Main-2.0 See merge request r-d-technique/tiers/tdi-connector!18
This commit is contained in:
commit
d77f0e8ff6
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 tdiEvent = JsonUtil.jsonToMap(tdiEvent64b)>
|
||||
<#assign senderTag = tdiEventMsg.senderTag>
|
||||
|
||||
<#-- Target = 0 : Expedition , Target = 1 : Colis -->
|
||||
<#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "")>
|
||||
<#stop >
|
||||
<#else>
|
||||
{"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}"
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
</#if>
|
||||
<#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "")>
|
||||
<#stop>
|
||||
<#else>
|
||||
[
|
||||
{
|
||||
<#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}"
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user