From 188e2e289dfe8e9410c32b3e035dc359b9295fa5 Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 12 Mar 2025 16:39:01 +0100 Subject: [PATCH 01/12] update URL in readme.md (cherry picked from commit 2f24b0328d9f98cb4ae7a4e357eb9e8c83bf0ca6) --- README.md | 90 +------------------------------------------------------ 1 file changed, 1 insertion(+), 89 deletions(-) diff --git a/README.md b/README.md index 46072fa..495e44b 100644 --- a/README.md +++ b/README.md @@ -1,92 +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/ - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab.hardis-group.com/r-d-technique/tiers/tdi-connector.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.hardis-group.com/r-d-technique/tiers/tdi-connector/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. From c1084983684b86d443481bb25dcd56005bbe4bdd Mon Sep 17 00:00:00 2001 From: Vincent Le Maitre Date: Tue, 8 Apr 2025 09:58:27 +0200 Subject: [PATCH 02/12] Snapshot tdi-connector 2.2.0-SNAPSHOT --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 61bc4c6..31941db 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0-SNAPSHOT +2.2.0-SNAPSHOT From 02e5b9af0ec15cc4ba1812d72d1725f341724a8f Mon Sep 17 00:00:00 2001 From: Vincent LEMAITRE Date: Tue, 8 Apr 2025 07:59:34 +0000 Subject: [PATCH 03/12] Edit VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 31941db..61bc4c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.0-SNAPSHOT +2.1.0-SNAPSHOT From 6a9caba0e99a88c0d846f1c417ad594f8ecd7864 Mon Sep 17 00:00:00 2001 From: frea Date: Thu, 10 Apr 2025 09:55:51 +0200 Subject: [PATCH 04/12] SCPN1-8601 (cherry picked from commit 9d16833c49095f9d6e5870c11d52df93f854169b) --- TDItoRP.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TDItoRP.ftl b/TDItoRP.ftl index 0165cbf..1e5f49e 100644 --- a/TDItoRP.ftl +++ b/TDItoRP.ftl @@ -7,7 +7,7 @@ <#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 == "") || (tdiEvent.HUReference1?? && tdiEvent.HUReference1 =="")))> <#stop > <#else> {"Header": From 249a81ce7bfa004a91c7e59e31208b3c09ddc173 Mon Sep 17 00:00:00 2001 From: frea Date: Fri, 11 Apr 2025 15:57:29 +0200 Subject: [PATCH 05/12] SCPN1-8601 (cherry picked from commit ff72d30b18aa081287c94fd88f1a951c08721179) --- TDItoRP.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TDItoRP.ftl b/TDItoRP.ftl index 1e5f49e..05ecbc7 100644 --- a/TDItoRP.ftl +++ b/TDItoRP.ftl @@ -7,7 +7,7 @@ <#assign senderTag = tdiEventMsg.senderTag> <#-- Target = 0 : Expedition , Target = 1 : Colis --> -<#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && ((tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "") || (tdiEvent.HUReference1?? && tdiEvent.HUReference1 =="")))> +<#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "")> <#stop > <#else> {"Header": @@ -16,7 +16,7 @@ }, "ID": { - "RefID": "${tdiEvent.ParcelNumber!tdiEvent.HUReference1}" + "RefID": "${tdiEvent.ParcelNumber}" }, "Payload": {"Events": [ From 987892baae8284ca208d307875163fceb9f3ae23 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Tue, 1 Jul 2025 11:31:53 +0200 Subject: [PATCH 06/12] Test --- TDItoRP.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TDItoRP.ftl b/TDItoRP.ftl index 05ecbc7..8349013 100644 --- a/TDItoRP.ftl +++ b/TDItoRP.ftl @@ -5,7 +5,7 @@ <#assign tdiEvent64b = JsonUtil.decodeBase64(tdiEventMsg.data) /> <#assign tdiEvent = JsonUtil.jsonToMap(tdiEvent64b)> <#assign senderTag = tdiEventMsg.senderTag> - +test <#-- Target = 0 : Expedition , Target = 1 : Colis --> <#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "")> <#stop > From 4d5c2be5f2347acee8217c7c8db54f5604873b4a Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Tue, 1 Jul 2025 11:32:16 +0200 Subject: [PATCH 07/12] modi --- TDItoRP.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TDItoRP.ftl b/TDItoRP.ftl index 8349013..05ecbc7 100644 --- a/TDItoRP.ftl +++ b/TDItoRP.ftl @@ -5,7 +5,7 @@ <#assign tdiEvent64b = JsonUtil.decodeBase64(tdiEventMsg.data) /> <#assign tdiEvent = JsonUtil.jsonToMap(tdiEvent64b)> <#assign senderTag = tdiEventMsg.senderTag> -test + <#-- Target = 0 : Expedition , Target = 1 : Colis --> <#if tdiEvent.Target == 0 || (tdiEvent.Target == 1 && tdiEvent.ParcelNumber?? && tdiEvent.ParcelNumber == "")> <#stop > From 95f67c4c0c9fe9281f14558c61d7f83e65ecf2a2 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Tue, 1 Jul 2025 17:31:10 +0200 Subject: [PATCH 08/12] Modifs TDI LMO --- TDItoRP2.ftl | 35 +++++++++++++++++++ TDItoRP_TrackingETAUpdated.ftl | 20 +++++++++++ TDItoRP_TrackingNotified.ftl | 62 ++++++++++++++++++++++++++++++++++ TDItoRP_TrackingURLUpdated.ftl | 11 ++++++ 4 files changed, 128 insertions(+) create mode 100644 TDItoRP2.ftl create mode 100644 TDItoRP_TrackingETAUpdated.ftl create mode 100644 TDItoRP_TrackingNotified.ftl create mode 100644 TDItoRP_TrackingURLUpdated.ftl diff --git a/TDItoRP2.ftl b/TDItoRP2.ftl new file mode 100644 index 0000000..aca1e21 --- /dev/null +++ b/TDItoRP2.ftl @@ -0,0 +1,35 @@ +<#assign tdiEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign tdiEvent64b = JsonUtil.decodeBase64(tdiEventMsg.data) /> +<#assign tdiEvent = JsonUtil.jsonToMap(tdiEvent64b)> +<#assign senderTag = tdiEventMsg.senderTag> + <#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 tdiEvent.TrackingUrl?? && tdiEvent.TrackingUrl!=""> + , + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingURLUpdated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "TDItoRP_TrackingURLUpdated.ftl"> + } + + \ No newline at end of file diff --git a/TDItoRP_TrackingETAUpdated.ftl b/TDItoRP_TrackingETAUpdated.ftl new file mode 100644 index 0000000..e2ed43a --- /dev/null +++ b/TDItoRP_TrackingETAUpdated.ftl @@ -0,0 +1,20 @@ +{ + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${tdiEvent.ParcelNumber}" + }, + "Payload": { + "TrackingETA": { + "EndETA": { + "AuthorTimeZone": "Europe/Paris", + "DateTime": "2023-01-01T00:00:00Z" + }, + "StartETA": { + "AuthorTimeZone": "Europe/Paris", + "DateTime": "2023-01-01T00:00:00Z" + } + } + } +} \ No newline at end of file diff --git a/TDItoRP_TrackingNotified.ftl b/TDItoRP_TrackingNotified.ftl new file mode 100644 index 0000000..969e1d0 --- /dev/null +++ b/TDItoRP_TrackingNotified.ftl @@ -0,0 +1,62 @@ +{ + "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", + + + + + + "Reason": "${tdiEvent.EventLabel}" + } + ] + } +} \ No newline at end of file diff --git a/TDItoRP_TrackingURLUpdated.ftl b/TDItoRP_TrackingURLUpdated.ftl new file mode 100644 index 0000000..fe33996 --- /dev/null +++ b/TDItoRP_TrackingURLUpdated.ftl @@ -0,0 +1,11 @@ +{ + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${tdiEvent.ParcelNumber}" + }, + "Payload": { + "TrackingURL": "${tdiEvent.TrackingUrl}" + } +} \ No newline at end of file From 1e77bbdaf63e4559167d84864912bc231cd06277 Mon Sep 17 00:00:00 2001 From: "GROUP\\frea" Date: Fri, 4 Jul 2025 10:47:44 +0200 Subject: [PATCH 09/12] SCPN1-9007 --- README.md | 8 +-- TDItoRP.ftl | 95 +++++++++------------------- TDItoRP_TrackingETAUpdated.ftl | 36 ++++++----- TDItoRP_TrackingNotified.ftl | 112 +++++++++++++++++---------------- TDItoRP_TrackingURLUpdated.ftl | 22 ++++--- VERSION | 2 +- 6 files changed, 123 insertions(+), 152 deletions(-) diff --git a/README.md b/README.md index 495e44b..48b2a3b 100644 --- a/README.md +++ b/README.md @@ -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/ - +# 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/ + diff --git a/TDItoRP.ftl b/TDItoRP.ftl index 05ecbc7..2cd82d8 100644 --- a/TDItoRP.ftl +++ b/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", - - - - - - "Reason": "${tdiEvent.EventLabel}" - - } - ] - } - } - \ No newline at end of file + <#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 tdiEvent.TrackingUrl?? && tdiEvent.TrackingUrl!=""> + , + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingURLUpdated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "TDItoRP_TrackingURLUpdated.ftl"> + } + + ] + \ No newline at end of file diff --git a/TDItoRP_TrackingETAUpdated.ftl b/TDItoRP_TrackingETAUpdated.ftl index e2ed43a..f4ff9ec 100644 --- a/TDItoRP_TrackingETAUpdated.ftl +++ b/TDItoRP_TrackingETAUpdated.ftl @@ -1,20 +1,22 @@ -{ - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${tdiEvent.ParcelNumber}" - }, - "Payload": { - "TrackingETA": { - "EndETA": { - "AuthorTimeZone": "Europe/Paris", - "DateTime": "2023-01-01T00:00:00Z" - }, - "StartETA": { - "AuthorTimeZone": "Europe/Paris", - "DateTime": "2023-01-01T00:00:00Z" +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${tdiEvent.ParcelNumber}" + }, + "Payload": { + "TrackingETA": { + "EndETA": { + "AuthorTimeZone": "Europe/Paris", + "DateTime": "2023-01-01T00:00:00Z" + }, + "StartETA": { + "AuthorTimeZone": "Europe/Paris", + "DateTime": "2023-01-01T00:00:00Z" + } } } } -} \ No newline at end of file +] \ No newline at end of file diff --git a/TDItoRP_TrackingNotified.ftl b/TDItoRP_TrackingNotified.ftl index 969e1d0..09e575b 100644 --- a/TDItoRP_TrackingNotified.ftl +++ b/TDItoRP_TrackingNotified.ftl @@ -1,62 +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 --> + "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("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 --> + <#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> - "Code": "TRACKING_EVENT_UNKNOWN", + <#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", + - - "Reason": "${tdiEvent.EventLabel}" - } - ] - } -} \ No newline at end of file + "Reason": "${tdiEvent.EventLabel}" + } + ] + } + } +] \ No newline at end of file diff --git a/TDItoRP_TrackingURLUpdated.ftl b/TDItoRP_TrackingURLUpdated.ftl index fe33996..721032b 100644 --- a/TDItoRP_TrackingURLUpdated.ftl +++ b/TDItoRP_TrackingURLUpdated.ftl @@ -1,11 +1,13 @@ -{ - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${tdiEvent.ParcelNumber}" - }, - "Payload": { - "TrackingURL": "${tdiEvent.TrackingUrl}" +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${tdiEvent.ParcelNumber}" + }, + "Payload": { + "TrackingURL": "${tdiEvent.TrackingUrl}" + } } -} \ No newline at end of file +] \ No newline at end of file diff --git a/VERSION b/VERSION index 61bc4c6..cf902fc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0-SNAPSHOT +2.1.0-SNAPSHOT From a6a004545fecfd907795c175a4a883c16a84e7da Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Fri, 4 Jul 2025 11:05:39 +0200 Subject: [PATCH 10/12] suppression fichier --- TDItoRP2.ftl | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 TDItoRP2.ftl diff --git a/TDItoRP2.ftl b/TDItoRP2.ftl deleted file mode 100644 index aca1e21..0000000 --- a/TDItoRP2.ftl +++ /dev/null @@ -1,35 +0,0 @@ -<#assign tdiEventMsg = JsonUtil.jsonToMap(input)> -<#assign projectRP = project> -<#assign organisationRP = organisation> - -<#assign tdiEvent64b = JsonUtil.decodeBase64(tdiEventMsg.data) /> -<#assign tdiEvent = JsonUtil.jsonToMap(tdiEvent64b)> -<#assign senderTag = tdiEventMsg.senderTag> - <#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 tdiEvent.TrackingUrl?? && tdiEvent.TrackingUrl!=""> - , - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingURLUpdated> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "TDItoRP_TrackingURLUpdated.ftl"> - } - - \ No newline at end of file From b86280b4f8ab1d7cfd2a2b75cd79221718fb8e24 Mon Sep 17 00:00:00 2001 From: ltakouti Date: Mon, 7 Jul 2025 11:28:44 +0200 Subject: [PATCH 11/12] auto update licences --- LICENCE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENCE diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..044c9b5 --- /dev/null +++ b/LICENCE @@ -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. From cbf41cd4e00b862092f481f215e2bdd5566144e1 Mon Sep 17 00:00:00 2001 From: "GROUP\\frea" Date: Mon, 18 Aug 2025 10:48:43 +0200 Subject: [PATCH 12/12] update TrackingETA field --- TDItoRP_TrackingETAUpdated.ftl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TDItoRP_TrackingETAUpdated.ftl b/TDItoRP_TrackingETAUpdated.ftl index f4ff9ec..793d3f2 100644 --- a/TDItoRP_TrackingETAUpdated.ftl +++ b/TDItoRP_TrackingETAUpdated.ftl @@ -9,12 +9,12 @@ "Payload": { "TrackingETA": { "EndETA": { - "AuthorTimeZone": "Europe/Paris", - "DateTime": "2023-01-01T00:00:00Z" + "AuthorTimeZone": "UTC", + "DateTime": "${tdiEvent.EstimatedDeliveryDate}" }, "StartETA": { - "AuthorTimeZone": "Europe/Paris", - "DateTime": "2023-01-01T00:00:00Z" + "AuthorTimeZone": "UTC", + "DateTime": "${tdiEvent.EstimatedDeliveryDate}" } } }