From 9872f3cf4ab12206448eda31db269878212c1d73 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 29 Aug 2023 09:45:59 +0200 Subject: [PATCH 01/68] initial import --- README.md | 85 ------------------------------------------------------- 1 file changed, 85 deletions(-) diff --git a/README.md b/README.md index bedbba3..00fc740 100644 --- a/README.md +++ b/README.md @@ -4,89 +4,4 @@ ## 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/reflex-wms-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/reflex-wms-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/) -- [ ] [Automatically merge when pipeline succeeds](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 b64d900833bc49501a3bb19db6c026d7cedcd50e Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 29 Aug 2023 09:46:06 +0200 Subject: [PATCH 02/68] initial import --- HfRpConfig.ftl | 35 +++++ RFXtoRP_HfDtlStockLs.ftl | 60 ++++++++ ...RP_HfDtlStockLs_ActorSnapshotCompleted.ftl | 27 ++++ RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl | 38 +++++ ...ckLs_StockSnapshotted_SegmentationKeys.ftl | 24 +++ RFXtoRP_HfRpConfig.ftl | 33 ++++ RFXtoRP_HsaCarrier.ftl | 46 ++++++ RFXtoRP_HsaCarrier_ActorCreated.ftl | 40 +++++ RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl | 5 + RFXtoRP_HsaCarrier_ActorDeleted.ftl | 12 ++ RFXtoRP_HsaCons.ftl | 46 ++++++ RFXtoRP_HsaCons_ActorCreated.ftl | 43 ++++++ RFXtoRP_HsaCons_ActorCreated_Metadata.ftl | 5 + RFXtoRP_HsaCons_ActorDeleted.ftl | 12 ++ RFXtoRP_HsaIpgMove.ftl | 74 +++++++++ RFXtoRP_HsaIpgMove_GoodsReceived.ftl | 43 ++++++ ...IpgMove_GoodsReceived_SegmentationKeys.ftl | 24 +++ RFXtoRP_HsaIpgMove_StockMoved.ftl | 63 ++++++++ ...HsaIpgMove_StockMoved_SegmentationKeys.ftl | 25 +++ RFXtoRP_HsaItm.ftl | 51 +++++++ RFXtoRP_HsaItmLv.ftl | 56 +++++++ RFXtoRP_HsaItmLv_LVRemoved.ftl | 14 ++ RFXtoRP_HsaItmLv_LVUpdated.ftl | 73 +++++++++ RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl | 4 + RFXtoRP_HsaItm_ItemCreated.ftl | 104 +++++++++++++ RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl | 5 + RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl | 5 + RFXtoRP_HsaItm_ItemDeleted.ftl | 12 ++ RFXtoRP_HsaProStatus.ftl | 97 ++++++++++++ ...RP_HsaProStatus_ExecutionflowCancelled.ftl | 20 +++ RFXtoRP_HsaProStatus_PreparationCompleted.ftl | 20 +++ RFXtoRP_HsaProStatus_PreparationExpected.ftl | 20 +++ RFXtoRP_HsaProStatus_PreparationStarted.ftl | 20 +++ RFXtoRP_HsaProStatus_TransportStarted.ftl | 20 +++ RFXtoRP_HsaSup.ftl | 46 ++++++ RFXtoRP_HsaSup_ActorCreated.ftl | 43 ++++++ RFXtoRP_HsaSup_ActorCreated_Metadata.ftl | 5 + RFXtoRP_HsaSup_ActorDeleted.ftl | 12 ++ RFXtoRP_HsrDepot.ftl | 46 ++++++ RFXtoRP_HsrDepot_ActorCreated.ftl | 39 +++++ RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl | 5 + RFXtoRP_HsrDepot_ActorDeleted.ftl | 12 ++ RFXtoRP_HsrPrepa.ftl | 49 ++++++ RFXtoRP_HsrPrepa_GoodsPrepared.ftl | 85 +++++++++++ RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl | 9 ++ ...srPrepa_GoodsPrepared_SegmentationKeys.ftl | 24 +++ RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl | 27 ++++ RFXtoRP_HsrPrepa_TransportStarted.ftl | 21 +++ RFXtoRP_HsrPro.ftl | 74 +++++++++ RFXtoRP_HsrPro_ExecutionflowCancelled.ftl | 12 ++ RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 106 +++++++++++++ ...o_ExecutionflowDetected_HeaderMetadata.ftl | 15 ++ ...Pro_ExecutionflowDetected_LineMetadata.ftl | 5 + ...utionflowDetected_LineSegmentationKeys.ftl | 20 +++ RFXtoRP_HsrPro_PreparationCompleted.ftl | 20 +++ RFXtoRP_HsrPro_PreparationExpected.ftl | 20 +++ RFXtoRP_HsrReceiptList.ftl | 79 ++++++++++ ...P_HsrReceiptList_ExecutionflowDetected.ftl | 144 ++++++++++++++++++ ...t_ExecutionflowDetected_HeaderMetadata.ftl | 14 ++ ...ist_ExecutionflowDetected_LineMetadata.ftl | 4 + ...utionflowDetected_LineSegmentationKeys.ftl | 19 +++ RFXtoRP_HsrReceiptList_OrderCancelled.ftl | 12 ++ RFXtoRP_HsrReceiptList_ReceiptExpected.ftl | 20 +++ RFXtoRP_HsrReceiptList_TransportCompleted.ftl | 14 ++ ...P_HsrReciptList_ExecutionflowCancelled.ftl | 12 ++ RFXtoRP_RfxConfigurationRp.ftl | 36 +++++ ReflexUtils.ftl | 9 ++ 67 files changed, 2234 insertions(+) create mode 100644 HfRpConfig.ftl create mode 100644 RFXtoRP_HfDtlStockLs.ftl create mode 100644 RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl create mode 100644 RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl create mode 100644 RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl create mode 100644 RFXtoRP_HfRpConfig.ftl create mode 100644 RFXtoRP_HsaCarrier.ftl create mode 100644 RFXtoRP_HsaCarrier_ActorCreated.ftl create mode 100644 RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl create mode 100644 RFXtoRP_HsaCarrier_ActorDeleted.ftl create mode 100644 RFXtoRP_HsaCons.ftl create mode 100644 RFXtoRP_HsaCons_ActorCreated.ftl create mode 100644 RFXtoRP_HsaCons_ActorCreated_Metadata.ftl create mode 100644 RFXtoRP_HsaCons_ActorDeleted.ftl create mode 100644 RFXtoRP_HsaIpgMove.ftl create mode 100644 RFXtoRP_HsaIpgMove_GoodsReceived.ftl create mode 100644 RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl create mode 100644 RFXtoRP_HsaIpgMove_StockMoved.ftl create mode 100644 RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl create mode 100644 RFXtoRP_HsaItm.ftl create mode 100644 RFXtoRP_HsaItmLv.ftl create mode 100644 RFXtoRP_HsaItmLv_LVRemoved.ftl create mode 100644 RFXtoRP_HsaItmLv_LVUpdated.ftl create mode 100644 RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl create mode 100644 RFXtoRP_HsaItm_ItemCreated.ftl create mode 100644 RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl create mode 100644 RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl create mode 100644 RFXtoRP_HsaItm_ItemDeleted.ftl create mode 100644 RFXtoRP_HsaProStatus.ftl create mode 100644 RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl create mode 100644 RFXtoRP_HsaProStatus_PreparationCompleted.ftl create mode 100644 RFXtoRP_HsaProStatus_PreparationExpected.ftl create mode 100644 RFXtoRP_HsaProStatus_PreparationStarted.ftl create mode 100644 RFXtoRP_HsaProStatus_TransportStarted.ftl create mode 100644 RFXtoRP_HsaSup.ftl create mode 100644 RFXtoRP_HsaSup_ActorCreated.ftl create mode 100644 RFXtoRP_HsaSup_ActorCreated_Metadata.ftl create mode 100644 RFXtoRP_HsaSup_ActorDeleted.ftl create mode 100644 RFXtoRP_HsrDepot.ftl create mode 100644 RFXtoRP_HsrDepot_ActorCreated.ftl create mode 100644 RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl create mode 100644 RFXtoRP_HsrDepot_ActorDeleted.ftl create mode 100644 RFXtoRP_HsrPrepa.ftl create mode 100644 RFXtoRP_HsrPrepa_GoodsPrepared.ftl create mode 100644 RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl create mode 100644 RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl create mode 100644 RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl create mode 100644 RFXtoRP_HsrPrepa_TransportStarted.ftl create mode 100644 RFXtoRP_HsrPro.ftl create mode 100644 RFXtoRP_HsrPro_ExecutionflowCancelled.ftl create mode 100644 RFXtoRP_HsrPro_ExecutionflowDetected.ftl create mode 100644 RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl create mode 100644 RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl create mode 100644 RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl create mode 100644 RFXtoRP_HsrPro_PreparationCompleted.ftl create mode 100644 RFXtoRP_HsrPro_PreparationExpected.ftl create mode 100644 RFXtoRP_HsrReceiptList.ftl create mode 100644 RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl create mode 100644 RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl create mode 100644 RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl create mode 100644 RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl create mode 100644 RFXtoRP_HsrReceiptList_OrderCancelled.ftl create mode 100644 RFXtoRP_HsrReceiptList_ReceiptExpected.ftl create mode 100644 RFXtoRP_HsrReceiptList_TransportCompleted.ftl create mode 100644 RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl create mode 100644 RFXtoRP_RfxConfigurationRp.ftl create mode 100644 ReflexUtils.ftl diff --git a/HfRpConfig.ftl b/HfRpConfig.ftl new file mode 100644 index 0000000..f68da52 --- /dev/null +++ b/HfRpConfig.ftl @@ -0,0 +1,35 @@ + + + +<#-- Warning the file is generated, if you modify it manually, do not enable automatic update via the pipeline --> +<#-- Date of last generation : Jul 10, 2023 2:39:59 PM --> + +<#-- if LVID is egal to **quantity_in_base_lv** keyword then LVID is egal to base VL of the item --> + <#assign quantity_in_base_lv_RP_Cst = "**quantity_in_base_lv**" > + <#assign rfx_date_format_default = "yyyy-MM-dd" > + + + <#assign length_unit_KV_rfx = {"MET":"MILLIMETER","CM":"CENTIMETER","MM":"METER","DM":"DECIMETER","KM":"KILOMETER","MIL":"MILE","YAR":"YARD","INC":"INCH","FT":"FOOT"}> + <#assign weight_unit_KV_rfx = {"GR":"GRAMME","DG":"DECIGRAM","KG":"KILOGRAM","TON":"TONNE","OCE":"ONCE","LTO":"LONG_TON","STO":"SHORT_TON","PND":"POUND"}> + <#assign area_unit_KV_rfx = {"MM²":"SQUARE_MILLIMETER","CM²":"SQUARE_CENTIMETER","DM²":"SQUARE_DECIMETER","M²":"SQUARE_METER","SQI":"SQUARE_INCH","SQF":"SQUARE_FOOT","SQY":"SQUARE_YARD"}> + <#assign volume_unit_KV_rfx = {"MM³":"CUBIC_MILLIMETER","CM³":"CUBIC_CENTIMETER","DM³":"CUBIC_DECIMETER","M³":"CUBIC_METER","CI":"CUBIC_INCH","CF":"CUBIC_FOOT","CY":"CUBIC_YARD","ML":"MILLI_LITER","CL":"CENTI_LITER","DL":"DECI_LITER","LIT":"LITER","HL":"HECTO_LITER","FT":"US_FLUID_OUNCE","USG":"US_GAL","PI":"IMPERIAL_PINT","GL":"IMPERIAL_GAL"}> + <#assign temperature_unit_KV_rfx = {"° C":"CELSIUS","° F":"FAHRENHEIT"}> + + + <#assign length_unit_rfx = length_unit_KV_rfx["CM"]!"CENTIMETER"> + <#assign distance_unit_rfx = length_unit_KV_rfx["MET"]!"CENTIMETER"> + <#assign transport_distance_unit_rfx = length_unit_KV_rfx["KM"]!"CENTIMETER"> + <#assign weight_unit_rfx = weight_unit_KV_rfx["KG"]!"KILOGRAM"> + <#assign area_unit_rfx = area_unit_KV_rfx["M²"]!"SQUARE_METER"> + <#assign volume_unit_rfx = volume_unit_KV_rfx["DM³"]!"CUBIC_DECIMETER"> + <#assign number_of_litres_unit_rfx = volume_unit_KV_rfx["LIT"]!"CUBIC_DECIMETER"> + + + + <#assign time_zone_rfx = "Europe/Paris"!"UTC"> + <#assign time_zone_offset_rfx = "+02:00"!"+00:00"> + + <#assign text_language_rfx = "fr"!"en"> + + + diff --git a/RFXtoRP_HfDtlStockLs.ftl b/RFXtoRP_HfDtlStockLs.ftl new file mode 100644 index 0000000..cbb8250 --- /dev/null +++ b/RFXtoRP_HfDtlStockLs.ftl @@ -0,0 +1,60 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> +<#-- sum_elt : nb element in snapshot (optional parameter) --> + +<#include "HfRpConfig.ftl"> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign reflexStockPicturesInterface = JsonUtil.jsonToMap(dataRfx)> + + <#-- idSnapshot MUST BE UNIQUE regardless of the number of messages in the stock image --> + <#if cloudEventMsg.messageSet??> + <#assign idSnapshot = cloudEventMsg.messageSet /> + <#else> + <#assign idSnapshot = cloudEventMsg.id /> + + + <#list reflexStockPicturesInterface.detailled_stock_list as stock> + <#if stock.stock_type_code != "200"> + <#stop "stock type different from 200"> + <#break> + + + [ + { + <#if sum_elt??> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorSnapshotCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl"> + <#else> + <#assign apiReflexPlatformID = ApiReflexPlatformID.StockSnapshotted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl"> + + } + ] + + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported"> + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl new file mode 100644 index 0000000..fd4107b --- /dev/null +++ b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl @@ -0,0 +1,27 @@ +<#include "ReflexUtils.ftl"> +[ + <#list reflexStockPicturesInterface.detailled_stock_list as stock> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${stock.physical_depot_code}" + }, + "Payload": { + <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> + "Snapshot": { + "EndDateTime": { + "DateTime": "${generation_date}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "ID": "${stock.physical_depot_code}-${idSnapshot}", + "MessageNb": ${sum_elt} + } + + } + } + <#break> + +] + diff --git a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl new file mode 100644 index 0000000..612b48d --- /dev/null +++ b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl @@ -0,0 +1,38 @@ +<#include "ReflexUtils.ftl"> +[ + <#list reflexStockPicturesInterface.detailled_stock_list as stock> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "Payload": { + "ActorID": "${stock.physical_depot_code}", + <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> + "Snapshot": { + "DateTime": { + "DateTime": "${generation_date}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "ID": "${stock.physical_depot_code}-${idSnapshot}", + "Quantity": + { + "Value" : "${stock.quantity_in_base_lvs!"0"}", + "LVID": "${quantity_in_base_lv_RP_Cst}" + } + }, + + "Goods": { + "ItemID": "${stock.item_code}", + "LVBranchID": "${stock.item_logistical_variant_code}", + <#assign priority_date = stock.priority_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate" : "${priority_date}", + + <#-- Segmentation keys inclusion --> + <#include "RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl"> + } + + } + }<#sep>, + +] + diff --git a/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl b/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl new file mode 100644 index 0000000..e7a7bf4 --- /dev/null +++ b/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl @@ -0,0 +1,24 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HfDtlStockLs to find Reflex WMS fields names --> + +<#--"SegmentationKeys": [ + { + "Key": "BatchNumber", + <#if stock.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${stock.batch_1}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${SegmentationKeys_KV[stock.grade_code]!Default_Value_Grade_SegmentationKey}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${stock.owner_code}"} + } + ], + +--> +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HfRpConfig.ftl b/RFXtoRP_HfRpConfig.ftl new file mode 100644 index 0000000..ed3522a --- /dev/null +++ b/RFXtoRP_HfRpConfig.ftl @@ -0,0 +1,33 @@ +<#-- **** +Reflex WMS provides some of their environment parameters through the class HfRpConfig +those parameters are stored in FTL file HfRpConfig.ftl for later use in some of the data ftl files +*** --> + +<#-- *********************************************** Parameter global ******************** --> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign file = JsonUtil.jsonToMap(dataRfx)> + + <#include "RFXtoRP_RfxConfigurationRp.ftl"> + + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "deletion of config not supported"> + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsaCarrier.ftl b/RFXtoRP_HsaCarrier.ftl new file mode 100644 index 0000000..de52386 --- /dev/null +++ b/RFXtoRP_HsaCarrier.ftl @@ -0,0 +1,46 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCarrier_ActorCreated.ftl"> + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************************* --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCarrier_ActorDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl new file mode 100644 index 0000000..b7c6648 --- /dev/null +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -0,0 +1,40 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier.carrier_code}" + }, + + "Payload": { + "Name": "${carrier.carrier_designation}", + "ManagedStock": false, + "IsCarrier": true, + <#-- ***Partner ID could be added here *** --> + <#-- "PartnerID": "${}", --> + + <#-- + <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, + --> + + "Address": + { + "StreetAddressOne" : "${carrier.address.address_1}", + "StreetAddressTwo" : "${carrier.address.address_2}", + + <#if carrier.address.address_3?length < 10> + "PostalCode" : "${carrier.address.address_3?trim}", + <#else> + "PostalCode" : "${carrier.address.address_3?substring(0,9)?trim}", + + <#if carrier.address.address_4?length < 14> + "CountryCode" : "" + <#else> + "CountryCode" : "${carrier.address.address_4?substring(10,13)?trim}" + + }, + "Typology": "TYPOLOGY_CARRIER" + } + } +] diff --git a/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl b/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl new file mode 100644 index 0000000..e855cdb --- /dev/null +++ b/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl @@ -0,0 +1,5 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsaCarrier to find Reflex WMS fields names --> + + +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaCarrier_ActorDeleted.ftl b/RFXtoRP_HsaCarrier_ActorDeleted.ftl new file mode 100644 index 0000000..9e56348 --- /dev/null +++ b/RFXtoRP_HsaCarrier_ActorDeleted.ftl @@ -0,0 +1,12 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier.carrier_code}" + }, + + "Payload": {} + } +] diff --git a/RFXtoRP_HsaCons.ftl b/RFXtoRP_HsaCons.ftl new file mode 100644 index 0000000..ec6677f --- /dev/null +++ b/RFXtoRP_HsaCons.ftl @@ -0,0 +1,46 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCons_ActorCreated.ftl"> + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCons_ActorDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl new file mode 100644 index 0000000..efe7d5c --- /dev/null +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -0,0 +1,43 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${actor.code}" + }, + + "Payload": { + "Name": "${actor.designation}", + "ManagedStock": false, + "IsCarrier": false, + <#-- ***Partner ID could be added here *** --> + <#-- "PartnerID": "${}", --> + + <#-- + <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl"> + --> + + + "Address": + { + <#if actor.address.address_3?length > 10> + "City" : "${actor.address.address_3?substring(10)?trim}", + + "StreetAddressOne" : "${actor.address.address_1}", + "StreetAddressTwo" : "${actor.address.address_2}", + <#if actor.address.address_3?length < 10> + "PostalCode" : "${actor.address.address_3?trim}", + <#else> + "PostalCode" : "${actor.address.address_3?substring(0,9)?trim}", + + <#if actor.address.address_4?length < 14> + "CountryCode" : "" + <#else> + "CountryCode" : "${actor.address.address_4?substring(10,13)?trim}" + + }, + "Typology": "TYPOLOGY_UNKNOWN" + } + } +] diff --git a/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl b/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl new file mode 100644 index 0000000..dd94be0 --- /dev/null +++ b/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl @@ -0,0 +1,5 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsaCons to find Reflex WMS fields names --> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaCons_ActorDeleted.ftl b/RFXtoRP_HsaCons_ActorDeleted.ftl new file mode 100644 index 0000000..3b4343b --- /dev/null +++ b/RFXtoRP_HsaCons_ActorDeleted.ftl @@ -0,0 +1,12 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${actor.code}" + }, + + "Payload": {} + } +] diff --git a/RFXtoRP_HsaIpgMove.ftl b/RFXtoRP_HsaIpgMove.ftl new file mode 100644 index 0000000..a683c10 --- /dev/null +++ b/RFXtoRP_HsaIpgMove.ftl @@ -0,0 +1,74 @@ +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)> + + <#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) --> + <#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0> + + <#-- IPG moves translated into Stock moves --> + <#if reflexMvtStockInterface.ipg_move_type == "130" || + reflexMvtStockInterface.ipg_move_type == "200" || + reflexMvtStockInterface.ipg_move_type == "210" || + reflexMvtStockInterface.ipg_move_type == "220" || + reflexMvtStockInterface.ipg_move_type == "230" || + reflexMvtStockInterface.ipg_move_type == "240" || + reflexMvtStockInterface.ipg_move_type == "260" || + reflexMvtStockInterface.ipg_move_type == "290" || + reflexMvtStockInterface.ipg_move_type == "300" || + reflexMvtStockInterface.ipg_move_type == "400" || + reflexMvtStockInterface.ipg_move_type == "410" || + reflexMvtStockInterface.ipg_move_type == "420" + > + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.StockMoved> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaIpgMove_StockMoved.ftl"> + + } + <#else> + <#-- IPG moves translated into goods received (all type of receipt) --> + <#if reflexMvtStockInterface.ipg_move_type == "100" || + reflexMvtStockInterface.ipg_move_type == "110" || + reflexMvtStockInterface.ipg_move_type == "120" + > + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsReceived> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl"> + + } + ] + <#else> + <#-- Case of IPG move type volontarilly ignored--> + <#stop "Move type not supported"> + + + <#else> + <#-- cases of an IPG move with quantity = 0 (weight modification))--> + <#stop "move ingored quantity = 0"> + + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported - Case D "> + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl new file mode 100644 index 0000000..c09bead --- /dev/null +++ b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl @@ -0,0 +1,43 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + <#assign receipt_confirmation_datetime = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> + + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${reflexMvtStockInterface.hd_number}" + }, + + "Payload": { + "ReceivedContents" :[ + { + "DateTime": { + "DateTime": "${receipt_confirmation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "Goods": { + "ItemID": "${reflexMvtStockInterface.item_code}", + "LVBranchID": "${reflexMvtStockInterface.lv_code}", + <#assign priority_date = "${Default_date}"?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + + <#-- Goods received Segmentation Keys inclusion --> + <#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl"> + + }, + "ExecutionflowID": "R-${reflexMvtStockInterface.receipt_year_number}-${reflexMvtStockInterface.receipt_number}", + "LineID": "${reflexMvtStockInterface.receipt_line_number}", + "ActorID": "${reflexMvtStockInterface.physical_depot_code}", + "Quantity": { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} + } + } + ] + } + } + +] diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl new file mode 100644 index 0000000..92b4f0c --- /dev/null +++ b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl @@ -0,0 +1,24 @@ +<#-- use protobuf of class HsaIpgMove to find Reflex WMS fields names --> + +<#--"SegmentationKeys": + [ + { + "Key": "Grade", + "Value": {"String": "${reflexMvtStockInterface.grade_code}"} + }, + { + "Key": "Owner", + "Value": {"String": "${reflexMvtStockInterface.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${reflexMvtStockInterface.batch_1}"} + + } + ], + +--> +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaIpgMove_StockMoved.ftl b/RFXtoRP_HsaIpgMove_StockMoved.ftl new file mode 100644 index 0000000..c0d1d16 --- /dev/null +++ b/RFXtoRP_HsaIpgMove_StockMoved.ftl @@ -0,0 +1,63 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> + +<#assign MoveType_KV = {"130":"STOCK_MOVEMENT_TYPE_PRODUCTION", + "200":"STOCK_MOVEMENT_TYPE_FIX", + "210":"STOCK_MOVEMENT_TYPE_FIX", + "220":"STOCK_MOVEMENT_TYPE_FIX", + "230":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "240":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "260":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "290":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "300":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "400":"STOCK_MOVEMENT_TYPE_FIX", + "410":"STOCK_MOVEMENT_TYPE_FIX", + "420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}> +<#assign generation_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> +<#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> + +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "Payload": { + "Goods": { + "ItemID": "${reflexMvtStockInterface.item_code}", + "PriorityDate": "${ipg_priority_datetime}", + + <#-- Segmentation keys inclusions --> + <#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl"> + + + "LVBranchID": "${reflexMvtStockInterface.lv_code}" + }, + "ActorID": "${reflexMvtStockInterface.physical_depot_code}", + "Movement": { + + "DateTime": { + "DateTime": "${generation_date}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "Author": "ReflexWMS-${reflexMvtStockInterface.ipg_move_creation_user_code}", + "ExternalMoveRef" : "${reflexMvtStockInterface.ipg_move_year_number} - ${reflexMvtStockInterface.ipg_move_number}", + "Type": "${MoveType_KV[reflexMvtStockInterface.ipg_move_type]!reflexMvtStockInterface.ipg_move_type}", + "Reason": "${reflexMvtStockInterface.miscellaneous_receipts_despatches_code}", + "ExternalInfo" : "${reflexMvtStockInterface.stock_move_reference}", + <#if reflexMvtStockInterface.ipg_move_operation_year_number!= 0> + "OperationReference": "${reflexMvtStockInterface.ipg_move_operation_year_number} - ${reflexMvtStockInterface.ipg_move_operation_number}", + + + "Quantity": + { + "LVID": "${quantity_in_base_lv_RP_Cst}", + <#if reflexMvtStockInterface.move_sign == "+"> + "Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} + <#else> + "Value": -${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} + + } + } + } + } +] diff --git a/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl b/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl new file mode 100644 index 0000000..8d7662c --- /dev/null +++ b/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl @@ -0,0 +1,25 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsaIpgMove to find Reflex WMS fields names --> + +<#--"SegmentationKeys": + [ + { + "Key": "Grade", + "Value": {"String": "${reflexMvtStockInterface.grade_code}"} + }, + { + "Key": "Owner", + "Value": {"String": "${reflexMvtStockInterface.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${reflexMvtStockInterface.batch_1}"} + + } + ], + +--> +"SegmentationKeys": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaItm.ftl b/RFXtoRP_HsaItm.ftl new file mode 100644 index 0000000..041016d --- /dev/null +++ b/RFXtoRP_HsaItm.ftl @@ -0,0 +1,51 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign item = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#if item.logistical_variant_list?? > + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaItm_ItemCreated.ftl"> + <#else> + <#stop "no LV for the item"> + + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign item = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaItm_ItemDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsaItmLv.ftl b/RFXtoRP_HsaItmLv.ftl new file mode 100644 index 0000000..b69fffb --- /dev/null +++ b/RFXtoRP_HsaItmLv.ftl @@ -0,0 +1,56 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign lv = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.LVUpdated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaItmLv_LVUpdated.ftl"> + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "LV deletion not supported" > + + <#-- supression LV a décommenter quand API ajouté au connecteur + + + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign item = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.LVDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaItmLv_LVRemoved.ftl"> + } + ] + + + --> + + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsaItmLv_LVRemoved.ftl b/RFXtoRP_HsaItmLv_LVRemoved.ftl new file mode 100644 index 0000000..44a0400 --- /dev/null +++ b/RFXtoRP_HsaItmLv_LVRemoved.ftl @@ -0,0 +1,14 @@ +<#include "HfRpConfig.ftl"> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${lv.item_code}" + }, + "Payload": { + "RemovedLogisticVariant": "${lv.logistical_variant_code} + } + } +] diff --git a/RFXtoRP_HsaItmLv_LVUpdated.ftl b/RFXtoRP_HsaItmLv_LVUpdated.ftl new file mode 100644 index 0000000..b897f61 --- /dev/null +++ b/RFXtoRP_HsaItmLv_LVUpdated.ftl @@ -0,0 +1,73 @@ +<#include "HfRpConfig.ftl"> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${lv.item_code}" + }, + "Payload": { + "LogisticVariants": [ + { + "LVID": "${lv.logistical_variant_code}", + "Name" : "${lv.lv_type_code}", + <#if lv.id_list??> + "Codes": [ + <#list lv.id_list as id> + { + "Key": "${id.logistical_variant_ID_type_code}", + "Value": "${id.logistical_variant_ID_code}" + }<#sep>, + + ], + + + <#-- LV Metadata inclusion --> + <#include "RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl"> + + "IsBaseLogisticVariant": ${lv.base_lv}, + + <#if lv.base_lv != "true"> + "RefLV": "${lv.subpackaging_lv_code}", + + + "QuantityInRefLV": ${lv.quantity_in_subpackaging_lv}, + + "NetWeight": { + "Value": ${lv.net_weight}, + "Unit": "${weight_unit_rfx}" + }, + "GrossWeight": { + "Value": ${lv.gross_weight}, + "Unit": "${weight_unit_rfx}" + }, + "Volume": { + "Value": ${lv.volume}, + "Unit": "${volume_unit_rfx}" + }, + "Height": { + "Value": ${lv.height}, + "Unit": "${length_unit_rfx}" + }, + "Width": { + "Value": ${lv.width}, + "Unit": "${length_unit_rfx}" + }, + "Length": { + "Value": ${lv.depth}, + "Unit": "${length_unit_rfx}" + }, + + <#if lv.packaging_lv == "true"> + "BranchIDs": ["${lv.logistical_variant_code}"] + <#else> + "BranchIDs": [] + + + + } + ] + } + } +] diff --git a/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl b/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl new file mode 100644 index 0000000..cc33334 --- /dev/null +++ b/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl @@ -0,0 +1,4 @@ +<#-- use protobuf of class HsaItmLv to find Reflex Wms fields names --> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl new file mode 100644 index 0000000..d9c121b --- /dev/null +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -0,0 +1,104 @@ +<#include "HfRpConfig.ftl"> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${item.item_code}" + }, + "Payload": { + "DescriptionsByLanguage": [{ + "ShortDescription": "${item.short_designation?json_string}", + "LongDescription": "${item.designation?json_string}", + "TechnicalDetails": "${item.item_description?json_string}", + "LanguageCodeISO6391": "${text_language_rfx}" + } + ], +<#-- /!\ table de correspondance à faire disparaitre /!\ --> + <#assign ExpiryConstraint = {"REC":"PRODUCTION_DATE", "DDM":"BEST_BEFORE_DATE", "DLC":"USE_BY_DATE"}/> + "ExpiryConstraint": { + "Type": "${ExpiryConstraint[item.expiry_group_code]!"UNKNOWN_DATE"}" + }, + + <#-- Item metadata inclusion --> + <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl"> + + <#-- Item Photo URI could be added here --> + <#--"PhotoURI": " ", --> + + <#-- Loop for the Logistical Variants - LV --> + <#if item.logistical_variant_list??> + "LogisticVariants": [ + + <#list item.logistical_variant_list as logistical_variant> + { + "LVID": "${logistical_variant.logistical_variant_code}", + "Name" : "${logistical_variant.lv_type_code}", + + <#if logistical_variant.id_list??> + "Codes": [ + <#list logistical_variant.id_list as id> + { + "Key": "${id.logistical_variant_ID_type_code}", + "Value": "${id.logistical_variant_ID_code}" + }<#sep>, + + ], + + + <#-- LV Metadata inclusion --> + <#include "RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl"> + + + "IsBaseLogisticVariant": ${logistical_variant.base_lv}, + + <#if logistical_variant.base_lv != "true"> + "RefLV": "${logistical_variant.subpackaging_lv_code}", + + + "QuantityInRefLV": ${logistical_variant.quantity_in_subpackaging_lv}, + + "NetWeight": { + "Value": ${logistical_variant.net_weight}, + "Unit": "${weight_unit_rfx}" + }, + "GrossWeight": { + "Value": ${logistical_variant.gross_weight}, + "Unit": "${weight_unit_rfx}" + }, + "Volume": { + "Value": ${logistical_variant.volume}, + "Unit": "${volume_unit_rfx}" + }, + "Height": { + "Value": ${logistical_variant.height}, + "Unit": "${length_unit_rfx}" + }, + "Width": { + "Value": ${logistical_variant.width}, + "Unit": "${length_unit_rfx}" + }, + "Length": { + "Value": ${logistical_variant.depth}, + "Unit": "${length_unit_rfx}" + }, + + + <#if logistical_variant.packaging_lv == "true"> + "BranchIDs": ["${logistical_variant.logistical_variant_code}"] + <#else> + "BranchIDs": [] + + + } + <#sep>, + + + ] + + <#-- End of LV loop --> + + } + } +] diff --git a/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl b/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl new file mode 100644 index 0000000..6bd2911 --- /dev/null +++ b/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl @@ -0,0 +1,5 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsaItm to find Reflex Wms fields names --> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl b/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl new file mode 100644 index 0000000..6bd2911 --- /dev/null +++ b/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl @@ -0,0 +1,5 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsaItm to find Reflex Wms fields names --> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaItm_ItemDeleted.ftl b/RFXtoRP_HsaItm_ItemDeleted.ftl new file mode 100644 index 0000000..c9ed2ac --- /dev/null +++ b/RFXtoRP_HsaItm_ItemDeleted.ftl @@ -0,0 +1,12 @@ +<#include "HfRpConfig.ftl"> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${item.item_code}" + }, + "Payload": {} + } +] diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl new file mode 100644 index 0000000..d951148 --- /dev/null +++ b/RFXtoRP_HsaProStatus.ftl @@ -0,0 +1,97 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx)> + [ + + <#-- + **Pick batch runned (100) ** + <#if preparationStatusInterface.preparation_status_type == "100" && + (preparationStatusInterface.preparation_status_code == "200" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationExpecteded.ftl"> + } + <#else> + --> + + <#-- ** Collection started (300) and Preparation in progress (400)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && + (preparationStatusInterface.preparation_status_code == "300" || + preparationStatusInterface.preparation_status_code == "400") > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> + } + <#else> + <#-- **Preparation to package (500) and preparationcompleted (550)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && + (preparationStatusInterface.preparation_status_code == "500" || + preparationStatusInterface.preparation_status_code == "550")> + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> + } + <#else> + <#-- ****Preparation dispatched (600)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && + preparationStatusInterface.preparation_status_code == "600" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_TransportStarted.ftl"> + } + <#else> + <#-- ****Preparation cancelled (650)**** --> + <#if preparationStatusInterface.preparation_status_type == "100" && + preparationStatusInterface.preparation_status_code == "650" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl"> + } + <#else> + + <#stop "Reflex WMS status not supported on Reflex Platform"> + + + + + + <#-- + + --> + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported (case D)"> + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl b/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl new file mode 100644 index 0000000..951c05d --- /dev/null +++ b/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> + +<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + } + } +] diff --git a/RFXtoRP_HsaProStatus_PreparationCompleted.ftl b/RFXtoRP_HsaProStatus_PreparationCompleted.ftl new file mode 100644 index 0000000..50b546d --- /dev/null +++ b/RFXtoRP_HsaProStatus_PreparationCompleted.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] diff --git a/RFXtoRP_HsaProStatus_PreparationExpected.ftl b/RFXtoRP_HsaProStatus_PreparationExpected.ftl new file mode 100644 index 0000000..50b546d --- /dev/null +++ b/RFXtoRP_HsaProStatus_PreparationExpected.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] diff --git a/RFXtoRP_HsaProStatus_PreparationStarted.ftl b/RFXtoRP_HsaProStatus_PreparationStarted.ftl new file mode 100644 index 0000000..50b546d --- /dev/null +++ b/RFXtoRP_HsaProStatus_PreparationStarted.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] diff --git a/RFXtoRP_HsaProStatus_TransportStarted.ftl b/RFXtoRP_HsaProStatus_TransportStarted.ftl new file mode 100644 index 0000000..50b546d --- /dev/null +++ b/RFXtoRP_HsaProStatus_TransportStarted.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] diff --git a/RFXtoRP_HsaSup.ftl b/RFXtoRP_HsaSup.ftl new file mode 100644 index 0000000..cb060be --- /dev/null +++ b/RFXtoRP_HsaSup.ftl @@ -0,0 +1,46 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaSup_ActorCreated.ftl"> + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaSup_ActorDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl new file mode 100644 index 0000000..efa6398 --- /dev/null +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -0,0 +1,43 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${actor.code}" + }, + + "Payload": { + "Name": "${actor.designation}", + "ManagedStock": false, + "IsCarrier": false, + <#-- ***Partner ID could be added here *** --> + <#-- "PartnerID": "${}", --> + + <#-- + <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl"> + --> + + "Address": + { + <#if actor.optional_attributes.address_3?length > 10> + "City" : "${actor.optional_attributes.address_3?substring(10)?trim}", + + "StreetAddressOne" : "${actor.optional_attributes.address_1}", + "StreetAddressTwo" : "${actor.optional_attributes.address_2}", + + <#if actor.optional_attributes.address_3?length < 10> + "PostalCode" : "${actor.optional_attributes.address_3?trim}", + <#else> + "PostalCode" : "${actor.optional_attributes.address_3?substring(0,9)?trim}", + + <#if actor.optional_attributes.address_4?length < 14> + "CountryCode" : "" + <#else> + "CountryCode" : "${actor.optional_attributes.address_4?substring(10,13)?trim}" + + }, + "Typology": "TYPOLOGY_UNKNOWN" + } + } +] diff --git a/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl b/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl new file mode 100644 index 0000000..4192694 --- /dev/null +++ b/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl @@ -0,0 +1,5 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsaSup to find Reflex WMS fields names --> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaSup_ActorDeleted.ftl b/RFXtoRP_HsaSup_ActorDeleted.ftl new file mode 100644 index 0000000..dafa8f3 --- /dev/null +++ b/RFXtoRP_HsaSup_ActorDeleted.ftl @@ -0,0 +1,12 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${actor.code}" + }, + + "Payload": {} + } +] diff --git a/RFXtoRP_HsrDepot.ftl b/RFXtoRP_HsrDepot.ftl new file mode 100644 index 0000000..0d21195 --- /dev/null +++ b/RFXtoRP_HsrDepot.ftl @@ -0,0 +1,46 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrDepot_ActorCreated.ftl"> + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE *************************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrDepot_ActorDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl new file mode 100644 index 0000000..36ced51 --- /dev/null +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -0,0 +1,39 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${depot.physical_depot_code}" + }, + + "Payload": { + "Name": "${depot.physical_depot_designation}", + "ManagedStock": true, + "IsCarrier": false, + <#-- ***Partner ID could be added here *** --> + <#-- "PartnerID": "${}", --> + + <#-- + <#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl"> + --> + + "Address": + { + "StreetAddressOne" : "${depot.physical_depot_address.address_1}", + "StreetAddressTwo" : "${depot.physical_depot_address.address_2}", + + <#if depot.physical_depot_address.address_3?length < 10> + "PostalCode" : "${depot.physical_depot_address.address_3?trim}", + <#else> + "PostalCode" : "${depot.physical_depot_address.address_3?substring(0,9)?trim}", + + <#if depot.physical_depot_address.address_4?length < 14> + "CountryCode" : "" + <#else> + "CountryCode" : "${depot.physical_depot_address.address_4?substring(10,13)?trim}" + + } + } + } +] diff --git a/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl b/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl new file mode 100644 index 0000000..519c0a8 --- /dev/null +++ b/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl @@ -0,0 +1,5 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsrDepot to find Reflex WMS fields names --> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrDepot_ActorDeleted.ftl b/RFXtoRP_HsrDepot_ActorDeleted.ftl new file mode 100644 index 0000000..4bfb3be --- /dev/null +++ b/RFXtoRP_HsrDepot_ActorDeleted.ftl @@ -0,0 +1,12 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${depot.physical_depot_code}" + }, + + "Payload": {} + } +] diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl new file mode 100644 index 0000000..08883df --- /dev/null +++ b/RFXtoRP_HsrPrepa.ftl @@ -0,0 +1,49 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#--<#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsPrepared> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_GoodsPrepared.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_Hsrprepa_TransportStarted.ftl"> + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported (Case D)"> + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared.ftl new file mode 100644 index 0000000..dffb29d --- /dev/null +++ b/RFXtoRP_HsrPrepa_GoodsPrepared.ftl @@ -0,0 +1,85 @@ +<#include "HfRpConfig.ftl"> + +[ + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparation_line.despatched_ipg_list as despatched_ipg> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if despatched_ipg.carton_number != "000000000000000000"> + "RefID": "${despatched_ipg.carton_number}" + <#else> + "RefID": "${despatched_ipg.hd_number}" + + }, + + "Payload": { + "Information" :{ + <#if despatched_ipg.carton_number != "000000000000000000"> + "ContainerType": "${despatched_ipg.carton_type_code}" + <#else> + "ContainerType": "${despatched_ipg.hd_type_code}" + + + }, + <#-- HU Metadata inclusin inclusion --> + <#include "RFXtoRP_HsrPrepa_GoodsPrepared_HUMetadata.ftl"> + , + "PreparedContents" :[ + { + "Goods": { + "ItemID": "${preparation_line.item_code}", + "LVBranchID": "${preparation_line.item_lv_code}", + <#if (despatched_ipg.ipg_manufacture_date?length != 0) && (despatched_ipg.ipg_manufacture_date?starts_with("00") == false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_manufacture_date) /> --> + <#assign priority_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + <#if (despatched_ipg.ipg_receipt_date?length != 0) && (despatched_ipg.ipg_receipt_date?starts_with("00")== false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_receipt_date) /> --> + <#assign priority_date = despatched_ipg.ipg_receipt_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + <#if (despatched_ipg.ipg_best_before_date?length != 0) && (despatched_ipg.ipg_best_before_date?starts_with("00")== false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_best_before_date) /> --> + <#assign priority_date = despatched_ipg.ipg_best_before_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + <#if (despatched_ipg.ipg_sell_by_date?length != 0) && (despatched_ipg.ipg_sell_by_date?starts_with("00")== false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_sell_by_date) /> --> + <#assign priority_date = despatched_ipg.ipg_sell_by_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + <#if (despatched_ipg.ipg_use_by_date?length != 0) && (despatched_ipg.ipg_use_by_date?starts_with("00")== false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_use_by_date) /> --> + <#assign priority_date = despatched_ipg.ipg_use_by_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + "PriorityDate": "error_date", + + + + + + + <#-- Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl"> + }, + "ExecutionflowID": "${preparation_line.preparation_order_originator_reference}", + "LineID": "${preparation_line.pro_line_number}", + "ActorID": "${preparationOrder.physical_depot_code}", + "Quantity": { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": ${despatched_ipg.quantity_lvs} + } + } + ] + } + + }<#sep>, + + <#sep>, + +] diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl new file mode 100644 index 0000000..4bac794 --- /dev/null +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl @@ -0,0 +1,9 @@ +<#-- use protobuf of class HsrPrepa to find Reflex WMS fields names --> + +<#-- +"Metadata" :[ + + ] + +--> +"Metadata": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl new file mode 100644 index 0000000..5732860 --- /dev/null +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl @@ -0,0 +1,24 @@ +<#-- use protobuf of class Hsrprepa to find Reflex WMS fields names --> + +<#-- +"SegmentationKeys" :[ + { + "Key": "BatchNumber", + <#if despatched_ipg.batch_number == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${despatched_ipg.batch_number}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${preparation_line.grade_code}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${preparation_line.owner_code}"} + } + ] + +--> +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl new file mode 100644 index 0000000..dec88fb --- /dev/null +++ b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl @@ -0,0 +1,27 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#assign preparationOrder_confirmation_datetime = RfxDateTimetoUTC(preparation_line.confirmation_datetime,time_zone_offset_rfx) /> + <#list preparation_line.despatched_ipg_list as despatched_ipg> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if despatched_ipg.carton_number != "000000000000000000"> + "RefID": "${despatched_ipg.carton_number}" + <#else> + "RefID": "${despatched_ipg.hd_number}" + + + }, + "Payload": { + + } + }<#sep>, + + <#sep>, + +] diff --git a/RFXtoRP_HsrPrepa_TransportStarted.ftl b/RFXtoRP_HsrPrepa_TransportStarted.ftl new file mode 100644 index 0000000..be8f1d2 --- /dev/null +++ b/RFXtoRP_HsrPrepa_TransportStarted.ftl @@ -0,0 +1,21 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = preparationOrder.stock_despatch_at_preparation_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparation_line.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] +<#-- ajouter une boucle sur tous les ODP de la prepa - --> diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl new file mode 100644 index 0000000..ba802a0 --- /dev/null +++ b/RFXtoRP_HsrPro.ftl @@ -0,0 +1,74 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign order = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#-- check preparation type code (internal order and reservation are ignored) --> + <#if order.preparation_type_code == "010" || + order.preparation_type_code == "030"> + + <#-- Preparation order not confirmed --> + <#if order.preparation_order_confirmed == "false" > + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> + + <#-- preparation expected a prendre en compte dans le connecteur + , + + <#assign apiReflexPlatformID = ApiReflexPlatformID.TransportExpected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPro_PreparationExpected.ftl"> + --> + + <#-- Preparation order confirmed --> + <#else> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPro_PreparationCompleted.ftl"> + + <#else> + <#stop "preparation type not supported"> + + + } + + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign order = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl new file mode 100644 index 0000000..068ec80 --- /dev/null +++ b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl @@ -0,0 +1,12 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}" + }, + "Payload": { + } + } +] diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl new file mode 100644 index 0000000..f250888 --- /dev/null +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -0,0 +1,106 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + { + <#assign planned_final_delivery_start_datetime = RfxDateTimetoUTC(order.planned_final_delivery_start_datetime,time_zone_offset_rfx) /> + <#assign pro_creation_datetime = RfxDateTimetoUTC(order.creation_datetime,time_zone_offset_rfx) /> + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${pro_creation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + "CreationDateTime": { + "DateTime": "${pro_creation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + <#-- Header Metadata inclusion --> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl"> + + "ShipFrom": { + "ActorID": "${order.physical_depot_code}" + }, + "ShipFromAcked": true, + "ShipTo": { + <#if order.end_consignee_code != "ECOM"> + "ActorID": "${order.end_consignee_code}" + <#else> + <#if order.address != ""> + "Actor": + { + "Name" : "${order.address.name_or_company_name!""}", + "Address" : + { + "City" : "${order.address.post_code_area_name!""}", + "CountryCode" : "${order.address.iso_country_code!""}", + "PostalCode" : "${order.address.postal_code!""}", + "StreetAddressOne" : "${order.address.street_and_number_and_po_box!""}", + "StreetAddressTwo" : "${order.address.additional_address_data_1!""}", + "StreetAddressThree" : "${order.address.additional_address_data_2!""}" + } + }, + "Contact" : + { + "FirstName" : "${order.address.first_name!""}", + "LastName" : "${order.address.last_name!""}", + "Emails" : ["${order.address.mail_address!""}"], + "Phones" : ["${order.address.mobile_phone_number!""}"] + } + + + }, + + <#if order.line_list??> + "Lines" : [ + <#list order.line_list as line> + { + <#if (line.originator_reference_line_number!0) != 0> + "LineID": "${line.originator_reference_line_number}", + <#else> + "LineID": "${line.preparation_order_line_number!0}", + + <#-- Line Metadata inclusion --> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl"> + + "RequestedContent": + { + "Goods": + { + "ItemID": "${line.item_code!"0"}", + "LVBranchID": "${line.item_lv_code!"0"}", + <#if (line.optional_attributes.forced_priority_date?length != 0) && (line.optional_attributes.forced_priority_date?starts_with("00") == false)> + <#assign forced_priority_date = line.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${forced_priority_date}", + + + <#-- Line Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl"> + + }, + "Quantity" : + { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": "${line.base_lv_quantity_to_prepare!0}" + } + } + }<#sep>, + + ], + + + "RequestedMilestones" : + { + "RequestedDeliveryDateTime" : + { + "DateTime": "${planned_final_delivery_start_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + } + } + } +] diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl new file mode 100644 index 0000000..c97abe1 --- /dev/null +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl @@ -0,0 +1,15 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsrPro to find Reflex Wms fields names --> + +<#-- + +"MetaData": [ + { + "Key": "OrderType", + "Value": { "String" : "${order.optional_attributes.reason_code}"} + } + ], +--> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl new file mode 100644 index 0000000..b72e0ed --- /dev/null +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl @@ -0,0 +1,5 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsrPro to find Reflex Wms fields names --> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl new file mode 100644 index 0000000..7fba11b --- /dev/null +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl @@ -0,0 +1,20 @@ +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsrPro to find Reflex WMS fields names --> + +<#-- +"SegmentationKeys": [ { + "Key": "BatchNumber", + <#if line.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line.batch_1}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${SegmentationKeys_KV[line.grade_code_to_prepare]!Default_Value_Grade_SegmentationKey}"} + } + ] + +--> +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPro_PreparationCompleted.ftl b/RFXtoRP_HsrPro_PreparationCompleted.ftl new file mode 100644 index 0000000..4ae7c8c --- /dev/null +++ b/RFXtoRP_HsrPro_PreparationCompleted.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = order.confirmation_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] diff --git a/RFXtoRP_HsrPro_PreparationExpected.ftl b/RFXtoRP_HsrPro_PreparationExpected.ftl new file mode 100644 index 0000000..dabb3a7 --- /dev/null +++ b/RFXtoRP_HsrPro_PreparationExpected.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = order.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl new file mode 100644 index 0000000..423aaed --- /dev/null +++ b/RFXtoRP_HsrReceiptList.ftl @@ -0,0 +1,79 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#-- *********************************************** Action = CREATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign receipt = JsonUtil.jsonToMap(dataRfx)> + [ + <#if receipt.line_list?? > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> + + } + <#else> + <#stop "Reception without lines"> + + + ] + <#break> + <#case "U"> + <#-- *********************************************** Action = UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign receipt = JsonUtil.jsonToMap(dataRfx)> + [ + <#if receipt.receipt_confirmed == "true" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> + } + <#else> + <#if receipt.line_list?? > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> + } + <#else> + <#stop "Reception without lines"> + + + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign receipt = JsonUtil.jsonToMap(dataRfx)> + [ + { + + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl"> + + } + ] + <#break> + + + <#default> + <#stop "event not supported"> + + diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl new file mode 100644 index 0000000..f11919a --- /dev/null +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -0,0 +1,144 @@ +<#include "HfRpConfig.ftl"> +<#include "actors.ftl"> +<#include "projectCst.ftl"> +<#include "ReflexUtils.ftl"> +[ + { + <#assign receipt_datetime = RfxDateTimetoUTC(receipt.receipt_datetime,time_zone_offset_rfx) /> + <#assign receipt_creation_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) /> + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${receipt.receipt_reference}" + }, + "Payload": { + "CreationDateTime": { + "DateTime": "${receipt_creation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + + }, + + <#-- Metadta inclusion --> + "MetaData": [ + { + "Key": "OrderType", + "Value": { "String" : "${receipt.receipt_reason_code}"} + } + ], + "ShipFrom": + { + "ActorID": "${receipt.original_code}" + }, + "ShipTo" : + { + "ActorID": "${receipt.physical_depot_code}" + }, + "ShipToAcked": true, + + <#if receipt.carrier_informations.carrier_code != ""> + "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code}"}, + + + <#if receipt.line_list??> + "Lines" : [ + <#list receipt.line_list as line> + + + <#if receipt.receipt_type = "030"> + <#-- Si réception retour, on a donc du détail --> + <#list line.line_detail as detail> + { + "LineID": "${line.receipt_line_number}${detail.receipt_detail_number}", + "RequestedContent": + { + "Goods": + { + "ItemID": "${line.item_code!"0"}", + "LVBranchID": "${line.item_lv_code!"0"}", + <#if (detail.priority_date?length != 0) && (detail.priority_date?starts_with("00") == false)> + <#-- <#assign line_detail_priority_date = JsonUtil.createDateTime(detail.priority_date,time_zone_rfx) /> --> + <#assign line_detail_priority_date = detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${line_detail_priority_date}", + + "SegmentationKeys": [ + { + "Key": "BatchNumber", + <#if detail.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${detail.batch_1}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${detail.grade_code}"} + } + ] + }, + "Quantity" : + { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": "${detail.confirmation_lv_quantity!0}" + } + } + }<#sep>, + + <#-- Réception non transfert --> + <#else> + { + "LineID": "${line.receipt_line_number}", + "RequestedContent": + { + "Goods": + { + "ItemID": "${line.item_code!"0"}", + "LVBranchID": "${line.item_lv_code!"0"}", + <#if line.line_without_detail??> + <#if (line.line_without_detail.priority_date?length != 0) && (line.line_without_detail.priority_date?starts_with("00") == false)> + <#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${line_without_detail_priority_date}", + + "SegmentationKeys": [ + { + "Key": "BatchNumber", + <#if line.line_without_detail.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line.line_without_detail.batch_1}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${SegmentationKeys_KV[line.grade_code]!Default_Value_Grade_SegmentationKey}"} + } + ] + <#else> + <#stop "Reception non transfert avec detail"> + + }, + "Quantity" : + { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": "${line.order_quantity_in_lv!0}" + } + } + + } + + <#sep>, + + ], + + + "RequestedMilestones" : + { + "RequestedDeliveryDateTime" : + { + "DateTime": "${receipt_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + } + } + } +] diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl new file mode 100644 index 0000000..34f0fb2 --- /dev/null +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl @@ -0,0 +1,14 @@ +<#-- use protobuf of class HsrReceiptList to find Reflex Wms fields names --> + +<#-- + +"MetaData": [ + { + "Key": "OrderType", + "Value": { "String" : "${order.optional_attributes.reason_code}"} + } + ], +--> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl new file mode 100644 index 0000000..bd26485 --- /dev/null +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl @@ -0,0 +1,4 @@ +<#-- use protobuf of class HsrReceiptList to find Reflex Wms fields names --> + + +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl new file mode 100644 index 0000000..669455e --- /dev/null +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl @@ -0,0 +1,19 @@ +<#-- use protobuf of class HsrReceiptList to find Reflex WMS fields names --> + +<#-- +"SegmentationKeys": [ { + "Key": "BatchNumber", + <#if line.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line.batch_1}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${line.grade_code_to_prepare} + } + ] + +--> +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_OrderCancelled.ftl b/RFXtoRP_HsrReceiptList_OrderCancelled.ftl new file mode 100644 index 0000000..74b44c9 --- /dev/null +++ b/RFXtoRP_HsrReceiptList_OrderCancelled.ftl @@ -0,0 +1,12 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${receipt.receipt_reference}" + }, + "Payload": { + } + } +] diff --git a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl new file mode 100644 index 0000000..dabb3a7 --- /dev/null +++ b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = order.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] diff --git a/RFXtoRP_HsrReceiptList_TransportCompleted.ftl b/RFXtoRP_HsrReceiptList_TransportCompleted.ftl new file mode 100644 index 0000000..d9a1296 --- /dev/null +++ b/RFXtoRP_HsrReceiptList_TransportCompleted.ftl @@ -0,0 +1,14 @@ +<#include "HfRpConfig.ftl"> +<#include "projectCst.ftl"> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${receipt.receipt_reference}" + }, + "Payload": { + } + } +] diff --git a/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl b/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl new file mode 100644 index 0000000..068ec80 --- /dev/null +++ b/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl @@ -0,0 +1,12 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}" + }, + "Payload": { + } + } +] diff --git a/RFXtoRP_RfxConfigurationRp.ftl b/RFXtoRP_RfxConfigurationRp.ftl new file mode 100644 index 0000000..78abc62 --- /dev/null +++ b/RFXtoRP_RfxConfigurationRp.ftl @@ -0,0 +1,36 @@ + +<#noparse><#-- /!\ Warning the file is generated, if you modify it manually, do not enable automatic update via the pipeline --> +<#noparse><#-- Date of last generation : ${aDateTime}<#noparse> --> + +<#noparse> +<#-- if LVID is egal to **quantity_in_base_lv** keyword then LVID is egal to base VL of the item --> + <#assign quantity_in_base_lv_RP_Cst = "**quantity_in_base_lv**" > + <#assign rfx_date_format_default = "yyyy-MM-dd" > + + + <#assign length_unit_KV_rfx = {"MET":"MILLIMETER","CM":"CENTIMETER","MM":"METER","DM":"DECIMETER","KM":"KILOMETER","MIL":"MILE","YAR":"YARD","INC":"INCH","FT":"FOOT"}> + <#assign weight_unit_KV_rfx = {"GR":"GRAMME","DG":"DECIGRAM","KG":"KILOGRAM","TON":"TONNE","OCE":"ONCE","LTO":"LONG_TON","STO":"SHORT_TON","PND":"POUND"}> + <#assign area_unit_KV_rfx = {"MM²":"SQUARE_MILLIMETER","CM²":"SQUARE_CENTIMETER","DM²":"SQUARE_DECIMETER","M²":"SQUARE_METER","SQI":"SQUARE_INCH","SQF":"SQUARE_FOOT","SQY":"SQUARE_YARD"}> + <#assign volume_unit_KV_rfx = {"MM³":"CUBIC_MILLIMETER","CM³":"CUBIC_CENTIMETER","DM³":"CUBIC_DECIMETER","M³":"CUBIC_METER","CI":"CUBIC_INCH","CF":"CUBIC_FOOT","CY":"CUBIC_YARD","ML":"MILLI_LITER","CL":"CENTI_LITER","DL":"DECI_LITER","LIT":"LITER","HL":"HECTO_LITER","FT":"US_FLUID_OUNCE","USG":"US_GAL","PI":"IMPERIAL_PINT","GL":"IMPERIAL_GAL"}> + + + + <#noparse><#assign length_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.length}"<#noparse>]!"CENTIMETER"> + <#noparse><#assign distance_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.distance}"<#noparse>]!"CENTIMETER"> + <#noparse><#assign transport_distance_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.transport_distance}"<#noparse>]!"CENTIMETER"> + <#noparse><#assign weight_unit_rfx = weight_unit_KV_rfx["${file.measurement_unit.weight}"<#noparse>]!"KILOGRAM"> + <#noparse><#assign area_unit_rfx = area_unit_KV_rfx["${file.measurement_unit.area}"<#noparse>]!"SQUARE_METER"> + <#noparse><#assign volume_unit_rfx = volume_unit_KV_rfx["${file.measurement_unit.volume}"<#noparse>]!"CUBIC_DECIMETER"> + <#noparse><#assign number_of_litres_unit_rfx = volume_unit_KV_rfx["${file.measurement_unit.litres_number}"<#noparse>]!"CUBIC_DECIMETER"> + + + + <#noparse><#assign time_zone_rfx = "${file.author_time_zone!"UTC"}<#noparse>"> + <#noparse><#assign time_zone_offset_rfx = "${file.time_zone_offset!"+00:00"}<#noparse>"> + + + <#list file.reflex_platform_project_list?filter(l -> l.name == projectRP) as reflex_platform_project> + <#noparse><#assign text_language_rfx = "${reflex_platform_project.text_language!"en"}<#noparse>"> + + + \ No newline at end of file diff --git a/ReflexUtils.ftl b/ReflexUtils.ftl new file mode 100644 index 0000000..5cc733f --- /dev/null +++ b/ReflexUtils.ftl @@ -0,0 +1,9 @@ +<#-- --------------------------------------------------------------------------------------- --> +<#-- Concat reflex timestamp with reflex time zone and format this date in ISO UTC format --> +<#-- --------------------------------------------------------------------------------------- --> +<#function RfxDateTimetoUTC rfxdatetime offset > + <#assign datetimeUTC = JsonUtil.createUTCDateTime(rfxdatetime,time_zone_rfx , "yyyy-MM-dd'T'HH:mm:ss") /> + <#return (datetimeUTC)> + + + \ No newline at end of file From c3ce993e1333ef7a7860e57397e9d8dd989f78c7 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 29 Aug 2023 10:57:16 +0200 Subject: [PATCH 03/68] correction HsaIpgMove --- RFXtoRP_HsaIpgMove.ftl | 1 + 1 file changed, 1 insertion(+) diff --git a/RFXtoRP_HsaIpgMove.ftl b/RFXtoRP_HsaIpgMove.ftl index a683c10..dfb3cb6 100644 --- a/RFXtoRP_HsaIpgMove.ftl +++ b/RFXtoRP_HsaIpgMove.ftl @@ -36,6 +36,7 @@ <#include "RFXtoRP_HsaIpgMove_StockMoved.ftl"> } + ] <#else> <#-- IPG moves translated into goods received (all type of receipt) --> <#if reflexMvtStockInterface.ipg_move_type == "100" || From 4f9ea8f4222879ba78aec990c7fec31c595ea9de Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Fri, 1 Sep 2023 17:26:41 +0200 Subject: [PATCH 04/68] Receipts --- RFXtoRP_HsrReceiptList.ftl | 9 --- ...P_HsrReceiptList_ExecutionflowDetected.ftl | 68 +++++++------------ 2 files changed, 25 insertions(+), 52 deletions(-) diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 423aaed..9a8ac22 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -15,7 +15,6 @@ <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign receipt = JsonUtil.jsonToMap(dataRfx)> [ - <#if receipt.line_list?? > { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> "apiReflexPlatformID" : "${apiReflexPlatformID}", @@ -23,10 +22,6 @@ <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> } - <#else> - <#stop "Reception without lines"> - - ] <#break> <#case "U"> @@ -42,16 +37,12 @@ <#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> } <#else> - <#if receipt.line_list?? > { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> } - <#else> - <#stop "Reception without lines"> - ] <#break> diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index f11919a..b298cd3 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -1,6 +1,4 @@ <#include "HfRpConfig.ftl"> -<#include "actors.ftl"> -<#include "projectCst.ftl"> <#include "ReflexUtils.ftl"> [ { @@ -11,6 +9,10 @@ }, "ID": { "RefID": "${receipt.receipt_reference}" + "RefDate": { + "DateTime": "${receipt_creation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } }, "Payload": { "CreationDateTime": { @@ -19,13 +21,9 @@ }, - <#-- Metadta inclusion --> - "MetaData": [ - { - "Key": "OrderType", - "Value": { "String" : "${receipt.receipt_reason_code}"} - } - ], + <#-- Header Metadata inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl"> + , "ShipFrom": { "ActorID": "${receipt.original_code}" @@ -40,16 +38,19 @@ "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code}"}, - <#if receipt.line_list??> + <#-- If receipt got lines --> + <#if receipt.line_list??> "Lines" : [ <#list receipt.line_list as line> - + <#-- if receipt type = 030 (transfert) --> <#if receipt.receipt_type = "030"> - <#-- Si réception retour, on a donc du détail --> + <#list line.line_detail as detail> { - "LineID": "${line.receipt_line_number}${detail.receipt_detail_number}", + "LineID": "${line.receipt_line_number}${detail.receipt_detail_number}", + <#-- Line Metadata inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, "RequestedContent": { "Goods": @@ -57,24 +58,13 @@ "ItemID": "${line.item_code!"0"}", "LVBranchID": "${line.item_lv_code!"0"}", <#if (detail.priority_date?length != 0) && (detail.priority_date?starts_with("00") == false)> - <#-- <#assign line_detail_priority_date = JsonUtil.createDateTime(detail.priority_date,time_zone_rfx) /> --> <#assign line_detail_priority_date = detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> "PriorityDate": "${line_detail_priority_date}", - "SegmentationKeys": [ - { - "Key": "BatchNumber", - <#if detail.batch_1 == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${detail.batch_1}"} - - }, - { - "Key": "Grade", - "Value": { "String" : "${detail.grade_code}"} - } - ] + + <#-- Line Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> + }, "Quantity" : { @@ -84,10 +74,12 @@ } }<#sep>, - <#-- Réception non transfert --> + <#-- receipt type different from transfert non transfert --> <#else> { "LineID": "${line.receipt_line_number}", + <#-- Line Metadata inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, "RequestedContent": { "Goods": @@ -99,20 +91,10 @@ <#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> "PriorityDate": "${line_without_detail_priority_date}", - "SegmentationKeys": [ - { - "Key": "BatchNumber", - <#if line.line_without_detail.batch_1 == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${line.line_without_detail.batch_1}"} - - }, - { - "Key": "Grade", - "Value": { "String" : "${SegmentationKeys_KV[line.grade_code]!Default_Value_Grade_SegmentationKey}"} - } - ] + + <#-- Line Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> + <#else> <#stop "Reception non transfert avec detail"> From 353f8a8ee23862cec065ff80e34d52845cf02d7c Mon Sep 17 00:00:00 2001 From: frea Date: Mon, 4 Sep 2023 13:32:00 +0200 Subject: [PATCH 05/68] Blindage : il est possible qu'une variante logistique n'ait pas de "additional_data_value_list" --- RFXtoRP_HsaItm_ItemCreated.ftl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index d9c121b..3e33b25 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -48,8 +48,9 @@ <#-- LV Metadata inclusion --> + <#if logistical_variant.additional_data_value_list??> <#include "RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl"> - + "IsBaseLogisticVariant": ${logistical_variant.base_lv}, From a7055b1a1efae32526f50a27a73e3fd791cdd946 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Mon, 4 Sep 2023 16:41:21 +0200 Subject: [PATCH 06/68] mise en forme --- HfRpConfig.ftl | 38 +-- RFXtoRP_HfDtlStockLs.ftl | 86 +++---- ...RP_HfDtlStockLs_ActorSnapshotCompleted.ftl | 38 +-- RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl | 56 ++-- ...ckLs_StockSnapshotted_SegmentationKeys.ftl | 32 +-- RFXtoRP_HfRpConfig.ftl | 32 +-- RFXtoRP_HsaCarrier.ftl | 62 ++--- RFXtoRP_HsaCarrier_ActorCreated.ftl | 56 ++-- RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl | 2 +- RFXtoRP_HsaCarrier_ActorDeleted.ftl | 20 +- RFXtoRP_HsaCons.ftl | 62 ++--- RFXtoRP_HsaCons_ActorCreated.ftl | 70 ++--- RFXtoRP_HsaCons_ActorCreated_Metadata.ftl | 2 +- RFXtoRP_HsaCons_ActorDeleted.ftl | 20 +- RFXtoRP_HsaIpgMove.ftl | 130 +++++----- RFXtoRP_HsaIpgMove_GoodsReceived.ftl | 76 +++--- ...IpgMove_GoodsReceived_SegmentationKeys.ftl | 34 +-- RFXtoRP_HsaIpgMove_StockMoved.ftl | 110 ++++---- ...HsaIpgMove_StockMoved_SegmentationKeys.ftl | 34 +-- RFXtoRP_HsaItm.ftl | 70 ++--- RFXtoRP_HsaItmLv.ftl | 80 +++--- RFXtoRP_HsaItmLv_LVRemoved.ftl | 22 +- RFXtoRP_HsaItmLv_LVUpdated.ftl | 136 +++++----- RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl | 2 +- RFXtoRP_HsaItm_ItemCreated.ftl | 198 +++++++-------- RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl | 2 +- RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl | 2 +- RFXtoRP_HsaItm_ItemDeleted.ftl | 18 +- RFXtoRP_HsaProStatus.ftl | 160 ++++++------ ...RP_HsaProStatus_ExecutionflowCancelled.ftl | 30 +-- RFXtoRP_HsaProStatus_PreparationCompleted.ftl | 30 +-- RFXtoRP_HsaProStatus_PreparationExpected.ftl | 30 +-- RFXtoRP_HsaProStatus_PreparationStarted.ftl | 30 +-- RFXtoRP_HsaProStatus_TransportStarted.ftl | 30 +-- RFXtoRP_HsaSup.ftl | 60 ++--- RFXtoRP_HsaSup_ActorCreated.ftl | 64 ++--- RFXtoRP_HsaSup_ActorCreated_Metadata.ftl | 2 +- RFXtoRP_HsaSup_ActorDeleted.ftl | 20 +- RFXtoRP_HsrDepot.ftl | 62 ++--- RFXtoRP_HsrDepot_ActorCreated.ftl | 56 ++-- RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl | 2 +- RFXtoRP_HsrDepot_ActorDeleted.ftl | 20 +- RFXtoRP_HsrPrepa.ftl | 68 ++--- RFXtoRP_HsrPrepa_GoodsPrepared.ftl | 162 ++++++------ RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl | 6 +- ...srPrepa_GoodsPrepared_SegmentationKeys.ftl | 36 +-- RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl | 42 +-- RFXtoRP_HsrPrepa_TransportStarted.ftl | 30 +-- RFXtoRP_HsrPro.ftl | 116 ++++----- RFXtoRP_HsrPro_ExecutionflowCancelled.ftl | 20 +- RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 186 +++++++------- ...o_ExecutionflowDetected_HeaderMetadata.ftl | 12 +- ...Pro_ExecutionflowDetected_LineMetadata.ftl | 2 +- ...utionflowDetected_LineSegmentationKeys.ftl | 28 +- RFXtoRP_HsrPro_PreparationCompleted.ftl | 30 +-- RFXtoRP_HsrPro_PreparationExpected.ftl | 30 +-- RFXtoRP_HsrReceiptList.ftl | 108 ++++---- ...P_HsrReceiptList_ExecutionflowDetected.ftl | 240 +++++++++--------- ...t_ExecutionflowDetected_HeaderMetadata.ftl | 12 +- ...ist_ExecutionflowDetected_LineMetadata.ftl | 2 +- ...utionflowDetected_LineSegmentationKeys.ftl | 28 +- RFXtoRP_HsrReceiptList_OrderCancelled.ftl | 20 +- RFXtoRP_HsrReceiptList_ReceiptExpected.ftl | 30 +-- RFXtoRP_HsrReceiptList_TransportCompleted.ftl | 18 +- ...P_HsrReciptList_ExecutionflowCancelled.ftl | 20 +- ReflexUtils.ftl | 2 +- 66 files changed, 1667 insertions(+), 1667 deletions(-) diff --git a/HfRpConfig.ftl b/HfRpConfig.ftl index f68da52..01ffd8a 100644 --- a/HfRpConfig.ftl +++ b/HfRpConfig.ftl @@ -1,14 +1,14 @@ - + <#-- Warning the file is generated, if you modify it manually, do not enable automatic update via the pipeline --> <#-- Date of last generation : Jul 10, 2023 2:39:59 PM --> <#-- if LVID is egal to **quantity_in_base_lv** keyword then LVID is egal to base VL of the item --> - <#assign quantity_in_base_lv_RP_Cst = "**quantity_in_base_lv**" > - <#assign rfx_date_format_default = "yyyy-MM-dd" > - - + <#assign quantity_in_base_lv_RP_Cst = "**quantity_in_base_lv**" > + <#assign rfx_date_format_default = "yyyy-MM-dd" > + + <#assign length_unit_KV_rfx = {"MET":"MILLIMETER","CM":"CENTIMETER","MM":"METER","DM":"DECIMETER","KM":"KILOMETER","MIL":"MILE","YAR":"YARD","INC":"INCH","FT":"FOOT"}> <#assign weight_unit_KV_rfx = {"GR":"GRAMME","DG":"DECIGRAM","KG":"KILOGRAM","TON":"TONNE","OCE":"ONCE","LTO":"LONG_TON","STO":"SHORT_TON","PND":"POUND"}> <#assign area_unit_KV_rfx = {"MM²":"SQUARE_MILLIMETER","CM²":"SQUARE_CENTIMETER","DM²":"SQUARE_DECIMETER","M²":"SQUARE_METER","SQI":"SQUARE_INCH","SQF":"SQUARE_FOOT","SQY":"SQUARE_YARD"}> @@ -16,20 +16,20 @@ <#assign temperature_unit_KV_rfx = {"° C":"CELSIUS","° F":"FAHRENHEIT"}> - <#assign length_unit_rfx = length_unit_KV_rfx["CM"]!"CENTIMETER"> - <#assign distance_unit_rfx = length_unit_KV_rfx["MET"]!"CENTIMETER"> - <#assign transport_distance_unit_rfx = length_unit_KV_rfx["KM"]!"CENTIMETER"> - <#assign weight_unit_rfx = weight_unit_KV_rfx["KG"]!"KILOGRAM"> - <#assign area_unit_rfx = area_unit_KV_rfx["M²"]!"SQUARE_METER"> - <#assign volume_unit_rfx = volume_unit_KV_rfx["DM³"]!"CUBIC_DECIMETER"> - <#assign number_of_litres_unit_rfx = volume_unit_KV_rfx["LIT"]!"CUBIC_DECIMETER"> - + <#assign length_unit_rfx = length_unit_KV_rfx["CM"]!"CENTIMETER"> + <#assign distance_unit_rfx = length_unit_KV_rfx["MET"]!"CENTIMETER"> + <#assign transport_distance_unit_rfx = length_unit_KV_rfx["KM"]!"CENTIMETER"> + <#assign weight_unit_rfx = weight_unit_KV_rfx["KG"]!"KILOGRAM"> + <#assign area_unit_rfx = area_unit_KV_rfx["M²"]!"SQUARE_METER"> + <#assign volume_unit_rfx = volume_unit_KV_rfx["DM³"]!"CUBIC_DECIMETER"> + <#assign number_of_litres_unit_rfx = volume_unit_KV_rfx["LIT"]!"CUBIC_DECIMETER"> + + + + <#assign time_zone_rfx = "Europe/Paris"!"UTC"> + <#assign time_zone_offset_rfx = "+02:00"!"+00:00"> + + <#assign text_language_rfx = "fr"!"en"> - - <#assign time_zone_rfx = "Europe/Paris"!"UTC"> - <#assign time_zone_offset_rfx = "+02:00"!"+00:00"> - - <#assign text_language_rfx = "fr"!"en"> - diff --git a/RFXtoRP_HfDtlStockLs.ftl b/RFXtoRP_HfDtlStockLs.ftl index cbb8250..14595ff 100644 --- a/RFXtoRP_HfDtlStockLs.ftl +++ b/RFXtoRP_HfDtlStockLs.ftl @@ -11,50 +11,50 @@ <#assign organisationRP = organisation> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign reflexStockPicturesInterface = JsonUtil.jsonToMap(dataRfx)> - - <#-- idSnapshot MUST BE UNIQUE regardless of the number of messages in the stock image --> - <#if cloudEventMsg.messageSet??> - <#assign idSnapshot = cloudEventMsg.messageSet /> - <#else> - <#assign idSnapshot = cloudEventMsg.id /> - - - <#list reflexStockPicturesInterface.detailled_stock_list as stock> - <#if stock.stock_type_code != "200"> - <#stop "stock type different from 200"> - <#break> - - - [ - { - <#if sum_elt??> - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorSnapshotCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl"> - <#else> - <#assign apiReflexPlatformID = ApiReflexPlatformID.StockSnapshotted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl"> - - } - ] + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign reflexStockPicturesInterface = JsonUtil.jsonToMap(dataRfx)> + + <#-- idSnapshot MUST BE UNIQUE regardless of the number of messages in the stock image --> + <#if cloudEventMsg.messageSet??> + <#assign idSnapshot = cloudEventMsg.messageSet /> + <#else> + <#assign idSnapshot = cloudEventMsg.id /> + + + <#list reflexStockPicturesInterface.detailled_stock_list as stock> + <#if stock.stock_type_code != "200"> + <#stop "stock type different from 200"> + <#break> + + + [ + { + <#if sum_elt??> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorSnapshotCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl"> + <#else> + <#assign apiReflexPlatformID = ApiReflexPlatformID.StockSnapshotted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl"> + + } + ] - <#break> - + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "event not supported"> - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported"> + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl index fd4107b..6e6600b 100644 --- a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl +++ b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl @@ -1,27 +1,27 @@ <#include "ReflexUtils.ftl"> [ - <#list reflexStockPicturesInterface.detailled_stock_list as stock> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { + <#list reflexStockPicturesInterface.detailled_stock_list as stock> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { "RefID": "${stock.physical_depot_code}" }, - "Payload": { - <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> - "Snapshot": { - "EndDateTime": { - "DateTime": "${generation_date}", - "AuthorTimeZone": "${time_zone_rfx}" - }, + "Payload": { + <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> + "Snapshot": { + "EndDateTime": { + "DateTime": "${generation_date}", + "AuthorTimeZone": "${time_zone_rfx}" + }, "ID": "${stock.physical_depot_code}-${idSnapshot}", "MessageNb": ${sum_elt} - } - - } - } - <#break> - + } + + } + } + <#break> + ] diff --git a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl index 612b48d..60bca2f 100644 --- a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl +++ b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl @@ -1,38 +1,38 @@ <#include "ReflexUtils.ftl"> [ - <#list reflexStockPicturesInterface.detailled_stock_list as stock> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "Payload": { - "ActorID": "${stock.physical_depot_code}", - <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> - "Snapshot": { - "DateTime": { - "DateTime": "${generation_date}", - "AuthorTimeZone": "${time_zone_rfx}" - }, + <#list reflexStockPicturesInterface.detailled_stock_list as stock> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "Payload": { + "ActorID": "${stock.physical_depot_code}", + <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> + "Snapshot": { + "DateTime": { + "DateTime": "${generation_date}", + "AuthorTimeZone": "${time_zone_rfx}" + }, "ID": "${stock.physical_depot_code}-${idSnapshot}", "Quantity": { "Value" : "${stock.quantity_in_base_lvs!"0"}", "LVID": "${quantity_in_base_lv_RP_Cst}" } - }, - - "Goods": { - "ItemID": "${stock.item_code}", - "LVBranchID": "${stock.item_logistical_variant_code}", - <#assign priority_date = stock.priority_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate" : "${priority_date}", - - <#-- Segmentation keys inclusion --> - <#include "RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl"> - } - - } - }<#sep>, - + }, + + "Goods": { + "ItemID": "${stock.item_code}", + "LVBranchID": "${stock.item_logistical_variant_code}", + <#assign priority_date = stock.priority_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate" : "${priority_date}", + + <#-- Segmentation keys inclusion --> + <#include "RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl"> + } + + } + }<#sep>, + ] diff --git a/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl b/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl index e7a7bf4..34ef750 100644 --- a/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl +++ b/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl @@ -2,23 +2,23 @@ <#-- use protobuf of class HfDtlStockLs to find Reflex WMS fields names --> <#--"SegmentationKeys": [ - { - "Key": "BatchNumber", - <#if stock.batch_1 == ""> - "Value": { "String" : "no batch"} + { + "Key": "BatchNumber", + <#if stock.batch_1 == ""> + "Value": { "String" : "no batch"} <#else> "Value": { "String" : "${stock.batch_1}"} - - }, - { - "Key": "Grade", - "Value": { "String" : "${SegmentationKeys_KV[stock.grade_code]!Default_Value_Grade_SegmentationKey}"} - }, - { - "Key": "Owner", - "Value": { "String" : "${stock.owner_code}"} - } - ], + + }, + { + "Key": "Grade", + "Value": { "String" : "${SegmentationKeys_KV[stock.grade_code]!Default_Value_Grade_SegmentationKey}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${stock.owner_code}"} + } + ], --> -"SegmentationKeys": [ ] \ No newline at end of file +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HfRpConfig.ftl b/RFXtoRP_HfRpConfig.ftl index ed3522a..8792d92 100644 --- a/RFXtoRP_HfRpConfig.ftl +++ b/RFXtoRP_HfRpConfig.ftl @@ -11,23 +11,23 @@ those parameters are stored in FTL file HfRpConfig.ftl for later use in some of <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign file = JsonUtil.jsonToMap(dataRfx)> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign file = JsonUtil.jsonToMap(dataRfx)> - <#include "RFXtoRP_RfxConfigurationRp.ftl"> - - <#break> - + <#include "RFXtoRP_RfxConfigurationRp.ftl"> + + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "deletion of config not supported"> - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "deletion of config not supported"> + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaCarrier.ftl b/RFXtoRP_HsaCarrier.ftl index de52386..c0b031b 100644 --- a/RFXtoRP_HsaCarrier.ftl +++ b/RFXtoRP_HsaCarrier.ftl @@ -10,37 +10,37 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign carrier = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaCarrier_ActorCreated.ftl"> - } - ] - <#break> - + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCarrier_ActorCreated.ftl"> + } + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************************* --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign carrier = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaCarrier_ActorDeleted.ftl"> - } - ] - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************************* --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCarrier_ActorDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl index b7c6648..6fdcf7f 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -1,40 +1,40 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${carrier.carrier_code}" - }, - - "Payload": { - "Name": "${carrier.carrier_designation}", + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier.carrier_code}" + }, + + "Payload": { + "Name": "${carrier.carrier_designation}", "ManagedStock": false, "IsCarrier": true, - <#-- ***Partner ID could be added here *** --> - <#-- "PartnerID": "${}", --> - - <#-- - <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, - --> + <#-- ***Partner ID could be added here *** --> + <#-- "PartnerID": "${}", --> + + <#-- + <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, + --> - "Address": - { - "StreetAddressOne" : "${carrier.address.address_1}", - "StreetAddressTwo" : "${carrier.address.address_2}", + "Address": + { + "StreetAddressOne" : "${carrier.address.address_1}", + "StreetAddressTwo" : "${carrier.address.address_2}", - <#if carrier.address.address_3?length < 10> + <#if carrier.address.address_3?length < 10> "PostalCode" : "${carrier.address.address_3?trim}", <#else> "PostalCode" : "${carrier.address.address_3?substring(0,9)?trim}", - - <#if carrier.address.address_4?length < 14> + + <#if carrier.address.address_4?length < 14> "CountryCode" : "" <#else> "CountryCode" : "${carrier.address.address_4?substring(10,13)?trim}" - - }, - "Typology": "TYPOLOGY_CARRIER" - } - } + + }, + "Typology": "TYPOLOGY_CARRIER" + } + } ] diff --git a/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl b/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl index e855cdb..7c35b0f 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl @@ -2,4 +2,4 @@ <#-- use protobuf of class HsaCarrier to find Reflex WMS fields names --> -"MetaData": [ ] \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaCarrier_ActorDeleted.ftl b/RFXtoRP_HsaCarrier_ActorDeleted.ftl index 9e56348..bc5f838 100644 --- a/RFXtoRP_HsaCarrier_ActorDeleted.ftl +++ b/RFXtoRP_HsaCarrier_ActorDeleted.ftl @@ -1,12 +1,12 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${carrier.carrier_code}" - }, - - "Payload": {} - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier.carrier_code}" + }, + + "Payload": {} + } ] diff --git a/RFXtoRP_HsaCons.ftl b/RFXtoRP_HsaCons.ftl index ec6677f..1c7b34b 100644 --- a/RFXtoRP_HsaCons.ftl +++ b/RFXtoRP_HsaCons.ftl @@ -10,37 +10,37 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign actor = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaCons_ActorCreated.ftl"> - } - ] - <#break> - + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCons_ActorCreated.ftl"> + } + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign actor = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaCons_ActorDeleted.ftl"> - } - ] - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCons_ActorDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index efe7d5c..788df93 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -1,43 +1,43 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${actor.code}" - }, - - "Payload": { - "Name": "${actor.designation}", + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${actor.code}" + }, + + "Payload": { + "Name": "${actor.designation}", "ManagedStock": false, - "IsCarrier": false, - <#-- ***Partner ID could be added here *** --> - <#-- "PartnerID": "${}", --> - - <#-- - <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl"> - --> - - - "Address": - { - <#if actor.address.address_3?length > 10> - "City" : "${actor.address.address_3?substring(10)?trim}", - - "StreetAddressOne" : "${actor.address.address_1}", - "StreetAddressTwo" : "${actor.address.address_2}", - <#if actor.address.address_3?length < 10> + "IsCarrier": false, + <#-- ***Partner ID could be added here *** --> + <#-- "PartnerID": "${}", --> + + <#-- + <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl"> + --> + + + "Address": + { + <#if actor.address.address_3?length > 10> + "City" : "${actor.address.address_3?substring(10)?trim}", + + "StreetAddressOne" : "${actor.address.address_1}", + "StreetAddressTwo" : "${actor.address.address_2}", + <#if actor.address.address_3?length < 10> "PostalCode" : "${actor.address.address_3?trim}", <#else> - "PostalCode" : "${actor.address.address_3?substring(0,9)?trim}", - - <#if actor.address.address_4?length < 14> + "PostalCode" : "${actor.address.address_3?substring(0,9)?trim}", + + <#if actor.address.address_4?length < 14> "CountryCode" : "" <#else> "CountryCode" : "${actor.address.address_4?substring(10,13)?trim}" - - }, - "Typology": "TYPOLOGY_UNKNOWN" - } - } + + }, + "Typology": "TYPOLOGY_UNKNOWN" + } + } ] diff --git a/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl b/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl index dd94be0..8bdbc3e 100644 --- a/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl +++ b/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl @@ -2,4 +2,4 @@ <#-- use protobuf of class HsaCons to find Reflex WMS fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaCons_ActorDeleted.ftl b/RFXtoRP_HsaCons_ActorDeleted.ftl index 3b4343b..abce0a0 100644 --- a/RFXtoRP_HsaCons_ActorDeleted.ftl +++ b/RFXtoRP_HsaCons_ActorDeleted.ftl @@ -1,12 +1,12 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${actor.code}" - }, - - "Payload": {} - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${actor.code}" + }, + + "Payload": {} + } ] diff --git a/RFXtoRP_HsaIpgMove.ftl b/RFXtoRP_HsaIpgMove.ftl index dfb3cb6..1969f5a 100644 --- a/RFXtoRP_HsaIpgMove.ftl +++ b/RFXtoRP_HsaIpgMove.ftl @@ -5,71 +5,71 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)> - - <#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) --> - <#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0> - - <#-- IPG moves translated into Stock moves --> - <#if reflexMvtStockInterface.ipg_move_type == "130" || - reflexMvtStockInterface.ipg_move_type == "200" || - reflexMvtStockInterface.ipg_move_type == "210" || - reflexMvtStockInterface.ipg_move_type == "220" || - reflexMvtStockInterface.ipg_move_type == "230" || - reflexMvtStockInterface.ipg_move_type == "240" || - reflexMvtStockInterface.ipg_move_type == "260" || - reflexMvtStockInterface.ipg_move_type == "290" || - reflexMvtStockInterface.ipg_move_type == "300" || - reflexMvtStockInterface.ipg_move_type == "400" || - reflexMvtStockInterface.ipg_move_type == "410" || - reflexMvtStockInterface.ipg_move_type == "420" - > - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.StockMoved> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaIpgMove_StockMoved.ftl"> - - } - ] - <#else> - <#-- IPG moves translated into goods received (all type of receipt) --> - <#if reflexMvtStockInterface.ipg_move_type == "100" || - reflexMvtStockInterface.ipg_move_type == "110" || - reflexMvtStockInterface.ipg_move_type == "120" - > - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsReceived> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl"> - - } - ] - <#else> - <#-- Case of IPG move type volontarilly ignored--> - <#stop "Move type not supported"> - - - <#else> - <#-- cases of an IPG move with quantity = 0 (weight modification))--> - <#stop "move ingored quantity = 0"> - - <#break> - + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)> + + <#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) --> + <#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0> + + <#-- IPG moves translated into Stock moves --> + <#if reflexMvtStockInterface.ipg_move_type == "130" || + reflexMvtStockInterface.ipg_move_type == "200" || + reflexMvtStockInterface.ipg_move_type == "210" || + reflexMvtStockInterface.ipg_move_type == "220" || + reflexMvtStockInterface.ipg_move_type == "230" || + reflexMvtStockInterface.ipg_move_type == "240" || + reflexMvtStockInterface.ipg_move_type == "260" || + reflexMvtStockInterface.ipg_move_type == "290" || + reflexMvtStockInterface.ipg_move_type == "300" || + reflexMvtStockInterface.ipg_move_type == "400" || + reflexMvtStockInterface.ipg_move_type == "410" || + reflexMvtStockInterface.ipg_move_type == "420" + > + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.StockMoved> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaIpgMove_StockMoved.ftl"> + + } + ] + <#else> + <#-- IPG moves translated into goods received (all type of receipt) --> + <#if reflexMvtStockInterface.ipg_move_type == "100" || + reflexMvtStockInterface.ipg_move_type == "110" || + reflexMvtStockInterface.ipg_move_type == "120" + > + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsReceived> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl"> + + } + ] + <#else> + <#-- Case of IPG move type volontarilly ignored--> + <#stop "Move type not supported"> + + + <#else> + <#-- cases of an IPG move with quantity = 0 (weight modification))--> + <#stop "move ingored quantity = 0"> + + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "event not supported - Case D "> - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported - Case D "> + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl index c09bead..1c473bf 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl @@ -2,42 +2,42 @@ <#include "ReflexUtils.ftl"> [ <#assign receipt_confirmation_datetime = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> - - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${reflexMvtStockInterface.hd_number}" - }, - - "Payload": { - "ReceivedContents" :[ - { - "DateTime": { - "DateTime": "${receipt_confirmation_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - }, - "Goods": { - "ItemID": "${reflexMvtStockInterface.item_code}", - "LVBranchID": "${reflexMvtStockInterface.lv_code}", - <#assign priority_date = "${Default_date}"?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${priority_date}", - - <#-- Goods received Segmentation Keys inclusion --> - <#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl"> - - }, - "ExecutionflowID": "R-${reflexMvtStockInterface.receipt_year_number}-${reflexMvtStockInterface.receipt_number}", - "LineID": "${reflexMvtStockInterface.receipt_line_number}", - "ActorID": "${reflexMvtStockInterface.physical_depot_code}", - "Quantity": { - "LVID": "${quantity_in_base_lv_RP_Cst}", - "Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} - } - } - ] - } - } - + + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${reflexMvtStockInterface.hd_number}" + }, + + "Payload": { + "ReceivedContents" :[ + { + "DateTime": { + "DateTime": "${receipt_confirmation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "Goods": { + "ItemID": "${reflexMvtStockInterface.item_code}", + "LVBranchID": "${reflexMvtStockInterface.lv_code}", + <#assign priority_date = "${Default_date}"?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + + <#-- Goods received Segmentation Keys inclusion --> + <#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl"> + + }, + "ExecutionflowID": "R-${reflexMvtStockInterface.receipt_year_number}-${reflexMvtStockInterface.receipt_number}", + "LineID": "${reflexMvtStockInterface.receipt_line_number}", + "ActorID": "${reflexMvtStockInterface.physical_depot_code}", + "Quantity": { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} + } + } + ] + } + } + ] diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl index 92b4f0c..78816d5 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl @@ -1,24 +1,24 @@ <#-- use protobuf of class HsaIpgMove to find Reflex WMS fields names --> <#--"SegmentationKeys": - [ - { - "Key": "Grade", - "Value": {"String": "${reflexMvtStockInterface.grade_code}"} - }, - { - "Key": "Owner", - "Value": {"String": "${reflexMvtStockInterface.owner_code}"} - }, - { - "Key": "BatchNumber", - <#if reflexMvtStockInterface.batch_1 == ""> - "Value": { "String" : "no batch"} + [ + { + "Key": "Grade", + "Value": {"String": "${reflexMvtStockInterface.grade_code}"} + }, + { + "Key": "Owner", + "Value": {"String": "${reflexMvtStockInterface.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} <#else> "Value": { "String" : "${reflexMvtStockInterface.batch_1}"} - - } - ], + + } + ], --> -"SegmentationKeys": [ ] \ No newline at end of file +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaIpgMove_StockMoved.ftl b/RFXtoRP_HsaIpgMove_StockMoved.ftl index c0d1d16..e9bf2bd 100644 --- a/RFXtoRP_HsaIpgMove_StockMoved.ftl +++ b/RFXtoRP_HsaIpgMove_StockMoved.ftl @@ -2,62 +2,62 @@ <#include "ReflexUtils.ftl"> <#assign MoveType_KV = {"130":"STOCK_MOVEMENT_TYPE_PRODUCTION", - "200":"STOCK_MOVEMENT_TYPE_FIX", - "210":"STOCK_MOVEMENT_TYPE_FIX", - "220":"STOCK_MOVEMENT_TYPE_FIX", - "230":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", - "240":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", - "260":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", - "290":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", - "300":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", - "400":"STOCK_MOVEMENT_TYPE_FIX", - "410":"STOCK_MOVEMENT_TYPE_FIX", - "420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}> + "200":"STOCK_MOVEMENT_TYPE_FIX", + "210":"STOCK_MOVEMENT_TYPE_FIX", + "220":"STOCK_MOVEMENT_TYPE_FIX", + "230":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "240":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "260":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "290":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "300":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "400":"STOCK_MOVEMENT_TYPE_FIX", + "410":"STOCK_MOVEMENT_TYPE_FIX", + "420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}> <#assign generation_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> -<#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> +<#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "Payload": { - "Goods": { - "ItemID": "${reflexMvtStockInterface.item_code}", - "PriorityDate": "${ipg_priority_datetime}", - - <#-- Segmentation keys inclusions --> - <#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl"> - - - "LVBranchID": "${reflexMvtStockInterface.lv_code}" - }, - "ActorID": "${reflexMvtStockInterface.physical_depot_code}", - "Movement": { - - "DateTime": { - "DateTime": "${generation_date}", - "AuthorTimeZone": "${time_zone_rfx}" - }, - "Author": "ReflexWMS-${reflexMvtStockInterface.ipg_move_creation_user_code}", - "ExternalMoveRef" : "${reflexMvtStockInterface.ipg_move_year_number} - ${reflexMvtStockInterface.ipg_move_number}", - "Type": "${MoveType_KV[reflexMvtStockInterface.ipg_move_type]!reflexMvtStockInterface.ipg_move_type}", - "Reason": "${reflexMvtStockInterface.miscellaneous_receipts_despatches_code}", - "ExternalInfo" : "${reflexMvtStockInterface.stock_move_reference}", - <#if reflexMvtStockInterface.ipg_move_operation_year_number!= 0> - "OperationReference": "${reflexMvtStockInterface.ipg_move_operation_year_number} - ${reflexMvtStockInterface.ipg_move_operation_number}", - - - "Quantity": - { - "LVID": "${quantity_in_base_lv_RP_Cst}", - <#if reflexMvtStockInterface.move_sign == "+"> - "Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} - <#else> - "Value": -${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} - - } - } - } - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "Payload": { + "Goods": { + "ItemID": "${reflexMvtStockInterface.item_code}", + "PriorityDate": "${ipg_priority_datetime}", + + <#-- Segmentation keys inclusions --> + <#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl"> + + + "LVBranchID": "${reflexMvtStockInterface.lv_code}" + }, + "ActorID": "${reflexMvtStockInterface.physical_depot_code}", + "Movement": { + + "DateTime": { + "DateTime": "${generation_date}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "Author": "ReflexWMS-${reflexMvtStockInterface.ipg_move_creation_user_code}", + "ExternalMoveRef" : "${reflexMvtStockInterface.ipg_move_year_number} - ${reflexMvtStockInterface.ipg_move_number}", + "Type": "${MoveType_KV[reflexMvtStockInterface.ipg_move_type]!reflexMvtStockInterface.ipg_move_type}", + "Reason": "${reflexMvtStockInterface.miscellaneous_receipts_despatches_code}", + "ExternalInfo" : "${reflexMvtStockInterface.stock_move_reference}", + <#if reflexMvtStockInterface.ipg_move_operation_year_number!= 0> + "OperationReference": "${reflexMvtStockInterface.ipg_move_operation_year_number} - ${reflexMvtStockInterface.ipg_move_operation_number}", + + + "Quantity": + { + "LVID": "${quantity_in_base_lv_RP_Cst}", + <#if reflexMvtStockInterface.move_sign == "+"> + "Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} + <#else> + "Value": -${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} + + } + } + } + } ] diff --git a/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl b/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl index 8d7662c..8079043 100644 --- a/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl +++ b/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl @@ -2,24 +2,24 @@ <#-- use protobuf of class HsaIpgMove to find Reflex WMS fields names --> <#--"SegmentationKeys": - [ - { - "Key": "Grade", - "Value": {"String": "${reflexMvtStockInterface.grade_code}"} - }, - { - "Key": "Owner", - "Value": {"String": "${reflexMvtStockInterface.owner_code}"} - }, - { - "Key": "BatchNumber", - <#if reflexMvtStockInterface.batch_1 == ""> - "Value": { "String" : "no batch"} + [ + { + "Key": "Grade", + "Value": {"String": "${reflexMvtStockInterface.grade_code}"} + }, + { + "Key": "Owner", + "Value": {"String": "${reflexMvtStockInterface.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} <#else> "Value": { "String" : "${reflexMvtStockInterface.batch_1}"} - - } - ], + + } + ], --> -"SegmentationKeys": [ ], \ No newline at end of file +"SegmentationKeys": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaItm.ftl b/RFXtoRP_HsaItm.ftl index 041016d..d495402 100644 --- a/RFXtoRP_HsaItm.ftl +++ b/RFXtoRP_HsaItm.ftl @@ -11,41 +11,41 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign item = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#if item.logistical_variant_list?? > - <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemCreated> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaItm_ItemCreated.ftl"> - <#else> - <#stop "no LV for the item"> - - } - ] - <#break> - + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign item = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#if item.logistical_variant_list?? > + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaItm_ItemCreated.ftl"> + <#else> + <#stop "no LV for the item"> + + } + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign item = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemDeleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaItm_ItemDeleted.ftl"> - } - ] - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign item = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaItm_ItemDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaItmLv.ftl b/RFXtoRP_HsaItmLv.ftl index b69fffb..9a7cd2e 100644 --- a/RFXtoRP_HsaItmLv.ftl +++ b/RFXtoRP_HsaItmLv.ftl @@ -11,46 +11,46 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign lv = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.LVUpdated> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaItmLv_LVUpdated.ftl"> - } - ] - <#break> - + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign lv = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.LVUpdated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaItmLv_LVUpdated.ftl"> + } + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "LV deletion not supported" > - - <#-- supression LV a décommenter quand API ajouté au connecteur - - - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign item = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.LVDeleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaItmLv_LVRemoved.ftl"> - } - ] - - - --> - - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "LV deletion not supported" > + + <#-- supression LV a décommenter quand API ajouté au connecteur + + + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign item = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.LVDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaItmLv_LVRemoved.ftl"> + } + ] + + + --> + + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaItmLv_LVRemoved.ftl b/RFXtoRP_HsaItmLv_LVRemoved.ftl index 44a0400..5200043 100644 --- a/RFXtoRP_HsaItmLv_LVRemoved.ftl +++ b/RFXtoRP_HsaItmLv_LVRemoved.ftl @@ -1,14 +1,14 @@ <#include "HfRpConfig.ftl"> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${lv.item_code}" - }, - "Payload": { - "RemovedLogisticVariant": "${lv.logistical_variant_code} - } - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${lv.item_code}" + }, + "Payload": { + "RemovedLogisticVariant": "${lv.logistical_variant_code} + } + } ] diff --git a/RFXtoRP_HsaItmLv_LVUpdated.ftl b/RFXtoRP_HsaItmLv_LVUpdated.ftl index b897f61..7583a6b 100644 --- a/RFXtoRP_HsaItmLv_LVUpdated.ftl +++ b/RFXtoRP_HsaItmLv_LVUpdated.ftl @@ -1,73 +1,73 @@ <#include "HfRpConfig.ftl"> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${lv.item_code}" - }, - "Payload": { - "LogisticVariants": [ - { - "LVID": "${lv.logistical_variant_code}", - "Name" : "${lv.lv_type_code}", - <#if lv.id_list??> - "Codes": [ - <#list lv.id_list as id> - { - "Key": "${id.logistical_variant_ID_type_code}", - "Value": "${id.logistical_variant_ID_code}" - }<#sep>, - - ], - - - <#-- LV Metadata inclusion --> - <#include "RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl"> - - "IsBaseLogisticVariant": ${lv.base_lv}, - - <#if lv.base_lv != "true"> - "RefLV": "${lv.subpackaging_lv_code}", - - - "QuantityInRefLV": ${lv.quantity_in_subpackaging_lv}, + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${lv.item_code}" + }, + "Payload": { + "LogisticVariants": [ + { + "LVID": "${lv.logistical_variant_code}", + "Name" : "${lv.lv_type_code}", + <#if lv.id_list??> + "Codes": [ + <#list lv.id_list as id> + { + "Key": "${id.logistical_variant_ID_type_code}", + "Value": "${id.logistical_variant_ID_code}" + }<#sep>, + + ], + + + <#-- LV Metadata inclusion --> + <#include "RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl"> + + "IsBaseLogisticVariant": ${lv.base_lv}, + + <#if lv.base_lv != "true"> + "RefLV": "${lv.subpackaging_lv_code}", + + + "QuantityInRefLV": ${lv.quantity_in_subpackaging_lv}, - "NetWeight": { - "Value": ${lv.net_weight}, - "Unit": "${weight_unit_rfx}" - }, - "GrossWeight": { - "Value": ${lv.gross_weight}, - "Unit": "${weight_unit_rfx}" - }, - "Volume": { - "Value": ${lv.volume}, - "Unit": "${volume_unit_rfx}" - }, - "Height": { - "Value": ${lv.height}, - "Unit": "${length_unit_rfx}" - }, - "Width": { - "Value": ${lv.width}, - "Unit": "${length_unit_rfx}" - }, - "Length": { - "Value": ${lv.depth}, - "Unit": "${length_unit_rfx}" - }, + "NetWeight": { + "Value": ${lv.net_weight}, + "Unit": "${weight_unit_rfx}" + }, + "GrossWeight": { + "Value": ${lv.gross_weight}, + "Unit": "${weight_unit_rfx}" + }, + "Volume": { + "Value": ${lv.volume}, + "Unit": "${volume_unit_rfx}" + }, + "Height": { + "Value": ${lv.height}, + "Unit": "${length_unit_rfx}" + }, + "Width": { + "Value": ${lv.width}, + "Unit": "${length_unit_rfx}" + }, + "Length": { + "Value": ${lv.depth}, + "Unit": "${length_unit_rfx}" + }, - <#if lv.packaging_lv == "true"> - "BranchIDs": ["${lv.logistical_variant_code}"] - <#else> - "BranchIDs": [] - - - - } - ] - } - } + <#if lv.packaging_lv == "true"> + "BranchIDs": ["${lv.logistical_variant_code}"] + <#else> + "BranchIDs": [] + + + + } + ] + } + } ] diff --git a/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl b/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl index cc33334..d8a0a32 100644 --- a/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl +++ b/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl @@ -1,4 +1,4 @@ <#-- use protobuf of class HsaItmLv to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index 3e33b25..8f6d9fc 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -1,105 +1,105 @@ <#include "HfRpConfig.ftl"> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${item.item_code}" - }, - "Payload": { - "DescriptionsByLanguage": [{ - "ShortDescription": "${item.short_designation?json_string}", - "LongDescription": "${item.designation?json_string}", - "TechnicalDetails": "${item.item_description?json_string}", - "LanguageCodeISO6391": "${text_language_rfx}" - } - ], + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${item.item_code}" + }, + "Payload": { + "DescriptionsByLanguage": [{ + "ShortDescription": "${item.short_designation?json_string}", + "LongDescription": "${item.designation?json_string}", + "TechnicalDetails": "${item.item_description?json_string}", + "LanguageCodeISO6391": "${text_language_rfx}" + } + ], <#-- /!\ table de correspondance à faire disparaitre /!\ --> - <#assign ExpiryConstraint = {"REC":"PRODUCTION_DATE", "DDM":"BEST_BEFORE_DATE", "DLC":"USE_BY_DATE"}/> - "ExpiryConstraint": { - "Type": "${ExpiryConstraint[item.expiry_group_code]!"UNKNOWN_DATE"}" - }, - - <#-- Item metadata inclusion --> - <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl"> - - <#-- Item Photo URI could be added here --> - <#--"PhotoURI": " ", --> + <#assign ExpiryConstraint = {"REC":"PRODUCTION_DATE", "DDM":"BEST_BEFORE_DATE", "DLC":"USE_BY_DATE"}/> + "ExpiryConstraint": { + "Type": "${ExpiryConstraint[item.expiry_group_code]!"UNKNOWN_DATE"}" + }, + + <#-- Item metadata inclusion --> + <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl"> + + <#-- Item Photo URI could be added here --> + <#--"PhotoURI": " ", --> - <#-- Loop for the Logistical Variants - LV --> - <#if item.logistical_variant_list??> - "LogisticVariants": [ - - <#list item.logistical_variant_list as logistical_variant> - { - "LVID": "${logistical_variant.logistical_variant_code}", - "Name" : "${logistical_variant.lv_type_code}", - - <#if logistical_variant.id_list??> - "Codes": [ - <#list logistical_variant.id_list as id> - { - "Key": "${id.logistical_variant_ID_type_code}", - "Value": "${id.logistical_variant_ID_code}" - }<#sep>, - - ], - - - <#-- LV Metadata inclusion --> - <#if logistical_variant.additional_data_value_list??> - <#include "RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl"> - - - "IsBaseLogisticVariant": ${logistical_variant.base_lv}, - - <#if logistical_variant.base_lv != "true"> - "RefLV": "${logistical_variant.subpackaging_lv_code}", - - - "QuantityInRefLV": ${logistical_variant.quantity_in_subpackaging_lv}, - - "NetWeight": { - "Value": ${logistical_variant.net_weight}, - "Unit": "${weight_unit_rfx}" - }, - "GrossWeight": { - "Value": ${logistical_variant.gross_weight}, - "Unit": "${weight_unit_rfx}" - }, - "Volume": { - "Value": ${logistical_variant.volume}, - "Unit": "${volume_unit_rfx}" - }, - "Height": { - "Value": ${logistical_variant.height}, - "Unit": "${length_unit_rfx}" - }, - "Width": { - "Value": ${logistical_variant.width}, - "Unit": "${length_unit_rfx}" - }, - "Length": { - "Value": ${logistical_variant.depth}, - "Unit": "${length_unit_rfx}" - }, + <#-- Loop for the Logistical Variants - LV --> + <#if item.logistical_variant_list??> + "LogisticVariants": [ + + <#list item.logistical_variant_list as logistical_variant> + { + "LVID": "${logistical_variant.logistical_variant_code}", + "Name" : "${logistical_variant.lv_type_code}", + + <#if logistical_variant.id_list??> + "Codes": [ + <#list logistical_variant.id_list as id> + { + "Key": "${id.logistical_variant_ID_type_code}", + "Value": "${id.logistical_variant_ID_code}" + }<#sep>, + + ], + + + <#-- LV Metadata inclusion --> + <#if logistical_variant.additional_data_value_list??> + <#include "RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl"> + + + "IsBaseLogisticVariant": ${logistical_variant.base_lv}, + + <#if logistical_variant.base_lv != "true"> + "RefLV": "${logistical_variant.subpackaging_lv_code}", + + + "QuantityInRefLV": ${logistical_variant.quantity_in_subpackaging_lv}, + + "NetWeight": { + "Value": ${logistical_variant.net_weight}, + "Unit": "${weight_unit_rfx}" + }, + "GrossWeight": { + "Value": ${logistical_variant.gross_weight}, + "Unit": "${weight_unit_rfx}" + }, + "Volume": { + "Value": ${logistical_variant.volume}, + "Unit": "${volume_unit_rfx}" + }, + "Height": { + "Value": ${logistical_variant.height}, + "Unit": "${length_unit_rfx}" + }, + "Width": { + "Value": ${logistical_variant.width}, + "Unit": "${length_unit_rfx}" + }, + "Length": { + "Value": ${logistical_variant.depth}, + "Unit": "${length_unit_rfx}" + }, - - <#if logistical_variant.packaging_lv == "true"> - "BranchIDs": ["${logistical_variant.logistical_variant_code}"] - <#else> - "BranchIDs": [] - - - } - <#sep>, - - - ] - - <#-- End of LV loop --> - - } - } + + <#if logistical_variant.packaging_lv == "true"> + "BranchIDs": ["${logistical_variant.logistical_variant_code}"] + <#else> + "BranchIDs": [] + + + } + <#sep>, + + + ] + + <#-- End of LV loop --> + + } + } ] diff --git a/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl b/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl index 6bd2911..566f271 100644 --- a/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl +++ b/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl @@ -2,4 +2,4 @@ <#-- use protobuf of class HsaItm to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl b/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl index 6bd2911..566f271 100644 --- a/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl +++ b/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl @@ -2,4 +2,4 @@ <#-- use protobuf of class HsaItm to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaItm_ItemDeleted.ftl b/RFXtoRP_HsaItm_ItemDeleted.ftl index c9ed2ac..9250205 100644 --- a/RFXtoRP_HsaItm_ItemDeleted.ftl +++ b/RFXtoRP_HsaItm_ItemDeleted.ftl @@ -1,12 +1,12 @@ <#include "HfRpConfig.ftl"> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${item.item_code}" - }, - "Payload": {} - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${item.item_code}" + }, + "Payload": {} + } ] diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl index d951148..7a45395 100644 --- a/RFXtoRP_HsaProStatus.ftl +++ b/RFXtoRP_HsaProStatus.ftl @@ -10,88 +10,88 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx)> - [ - - <#-- - **Pick batch runned (100) ** - <#if preparationStatusInterface.preparation_status_type == "100" && - (preparationStatusInterface.preparation_status_code == "200" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationExpecteded.ftl"> - } - <#else> - --> - - <#-- ** Collection started (300) and Preparation in progress (400)** --> - <#if preparationStatusInterface.preparation_status_type == "100" && - (preparationStatusInterface.preparation_status_code == "300" || - preparationStatusInterface.preparation_status_code == "400") > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> - } - <#else> - <#-- **Preparation to package (500) and preparationcompleted (550)** --> - <#if preparationStatusInterface.preparation_status_type == "100" && - (preparationStatusInterface.preparation_status_code == "500" || - preparationStatusInterface.preparation_status_code == "550")> - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> - } - <#else> - <#-- ****Preparation dispatched (600)** --> - <#if preparationStatusInterface.preparation_status_type == "100" && - preparationStatusInterface.preparation_status_code == "600" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_TransportStarted.ftl"> - } - <#else> - <#-- ****Preparation cancelled (650)**** --> - <#if preparationStatusInterface.preparation_status_type == "100" && - preparationStatusInterface.preparation_status_code == "650" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl"> - } - <#else> - - <#stop "Reflex WMS status not supported on Reflex Platform"> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx)> + [ + + <#-- + **Pick batch runned (100) ** + <#if preparationStatusInterface.preparation_status_type == "100" && + (preparationStatusInterface.preparation_status_code == "200" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationExpecteded.ftl"> + } + <#else> + --> + + <#-- ** Collection started (300) and Preparation in progress (400)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && + (preparationStatusInterface.preparation_status_code == "300" || + preparationStatusInterface.preparation_status_code == "400") > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> + } + <#else> + <#-- **Preparation to package (500) and preparationcompleted (550)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && + (preparationStatusInterface.preparation_status_code == "500" || + preparationStatusInterface.preparation_status_code == "550")> + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> + } + <#else> + <#-- ****Preparation dispatched (600)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && + preparationStatusInterface.preparation_status_code == "600" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_TransportStarted.ftl"> + } + <#else> + <#-- ****Preparation cancelled (650)**** --> + <#if preparationStatusInterface.preparation_status_type == "100" && + preparationStatusInterface.preparation_status_code == "650" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl"> + } + <#else> + + <#stop "Reflex WMS status not supported on Reflex Platform"> - - - - <#-- - - --> - ] - <#break> - + + + + <#-- + + --> + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "event not supported (case D)"> - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported (case D)"> + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl b/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl index 951c05d..adb35f5 100644 --- a/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl +++ b/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl @@ -1,20 +1,20 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - "Payload": { - } - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + } + } ] diff --git a/RFXtoRP_HsaProStatus_PreparationCompleted.ftl b/RFXtoRP_HsaProStatus_PreparationCompleted.ftl index 50b546d..e53c45e 100644 --- a/RFXtoRP_HsaProStatus_PreparationCompleted.ftl +++ b/RFXtoRP_HsaProStatus_PreparationCompleted.ftl @@ -2,19 +2,19 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } ] diff --git a/RFXtoRP_HsaProStatus_PreparationExpected.ftl b/RFXtoRP_HsaProStatus_PreparationExpected.ftl index 50b546d..e53c45e 100644 --- a/RFXtoRP_HsaProStatus_PreparationExpected.ftl +++ b/RFXtoRP_HsaProStatus_PreparationExpected.ftl @@ -2,19 +2,19 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } ] diff --git a/RFXtoRP_HsaProStatus_PreparationStarted.ftl b/RFXtoRP_HsaProStatus_PreparationStarted.ftl index 50b546d..e53c45e 100644 --- a/RFXtoRP_HsaProStatus_PreparationStarted.ftl +++ b/RFXtoRP_HsaProStatus_PreparationStarted.ftl @@ -2,19 +2,19 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } ] diff --git a/RFXtoRP_HsaProStatus_TransportStarted.ftl b/RFXtoRP_HsaProStatus_TransportStarted.ftl index 50b546d..e53c45e 100644 --- a/RFXtoRP_HsaProStatus_TransportStarted.ftl +++ b/RFXtoRP_HsaProStatus_TransportStarted.ftl @@ -2,19 +2,19 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparationStatusInterface.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } ] diff --git a/RFXtoRP_HsaSup.ftl b/RFXtoRP_HsaSup.ftl index cb060be..52fe20f 100644 --- a/RFXtoRP_HsaSup.ftl +++ b/RFXtoRP_HsaSup.ftl @@ -10,37 +10,37 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign actor = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaSup_ActorCreated.ftl"> - } - ] - <#break> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaSup_ActorCreated.ftl"> + } + ] + <#break> <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign actor = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaSup_ActorDeleted.ftl"> - } - ] - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaSup_ActorDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index efa6398..700cd05 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -1,43 +1,43 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${actor.code}" - }, - - "Payload": { - "Name": "${actor.designation}", + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${actor.code}" + }, + + "Payload": { + "Name": "${actor.designation}", "ManagedStock": false, - "IsCarrier": false, - <#-- ***Partner ID could be added here *** --> - <#-- "PartnerID": "${}", --> - - <#-- - <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl"> - --> - - "Address": - { - <#if actor.optional_attributes.address_3?length > 10> + "IsCarrier": false, + <#-- ***Partner ID could be added here *** --> + <#-- "PartnerID": "${}", --> + + <#-- + <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl"> + --> + + "Address": + { + <#if actor.optional_attributes.address_3?length > 10> "City" : "${actor.optional_attributes.address_3?substring(10)?trim}", - - "StreetAddressOne" : "${actor.optional_attributes.address_1}", - "StreetAddressTwo" : "${actor.optional_attributes.address_2}", + + "StreetAddressOne" : "${actor.optional_attributes.address_1}", + "StreetAddressTwo" : "${actor.optional_attributes.address_2}", - <#if actor.optional_attributes.address_3?length < 10> + <#if actor.optional_attributes.address_3?length < 10> "PostalCode" : "${actor.optional_attributes.address_3?trim}", <#else> "PostalCode" : "${actor.optional_attributes.address_3?substring(0,9)?trim}", - - <#if actor.optional_attributes.address_4?length < 14> + + <#if actor.optional_attributes.address_4?length < 14> "CountryCode" : "" <#else> "CountryCode" : "${actor.optional_attributes.address_4?substring(10,13)?trim}" - - }, - "Typology": "TYPOLOGY_UNKNOWN" - } - } + + }, + "Typology": "TYPOLOGY_UNKNOWN" + } + } ] diff --git a/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl b/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl index 4192694..82b66d8 100644 --- a/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl +++ b/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl @@ -2,4 +2,4 @@ <#-- use protobuf of class HsaSup to find Reflex WMS fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsaSup_ActorDeleted.ftl b/RFXtoRP_HsaSup_ActorDeleted.ftl index dafa8f3..07f19fc 100644 --- a/RFXtoRP_HsaSup_ActorDeleted.ftl +++ b/RFXtoRP_HsaSup_ActorDeleted.ftl @@ -1,12 +1,12 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${actor.code}" - }, - - "Payload": {} - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${actor.code}" + }, + + "Payload": {} + } ] diff --git a/RFXtoRP_HsrDepot.ftl b/RFXtoRP_HsrDepot.ftl index 0d21195..08a4082 100644 --- a/RFXtoRP_HsrDepot.ftl +++ b/RFXtoRP_HsrDepot.ftl @@ -10,37 +10,37 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign depot = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrDepot_ActorCreated.ftl"> - } - ] - <#break> - + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrDepot_ActorCreated.ftl"> + } + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE *************************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign depot = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrDepot_ActorDeleted.ftl"> - } - ] - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE *************************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrDepot_ActorDeleted.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index 36ced51..6971aaa 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -1,39 +1,39 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${depot.physical_depot_code}" - }, - - "Payload": { - "Name": "${depot.physical_depot_designation}", + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${depot.physical_depot_code}" + }, + + "Payload": { + "Name": "${depot.physical_depot_designation}", "ManagedStock": true, "IsCarrier": false, - <#-- ***Partner ID could be added here *** --> - <#-- "PartnerID": "${}", --> - - <#-- - <#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl"> - --> - - "Address": - { - "StreetAddressOne" : "${depot.physical_depot_address.address_1}", - "StreetAddressTwo" : "${depot.physical_depot_address.address_2}", + <#-- ***Partner ID could be added here *** --> + <#-- "PartnerID": "${}", --> + + <#-- + <#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl"> + --> + + "Address": + { + "StreetAddressOne" : "${depot.physical_depot_address.address_1}", + "StreetAddressTwo" : "${depot.physical_depot_address.address_2}", - <#if depot.physical_depot_address.address_3?length < 10> + <#if depot.physical_depot_address.address_3?length < 10> "PostalCode" : "${depot.physical_depot_address.address_3?trim}", <#else> "PostalCode" : "${depot.physical_depot_address.address_3?substring(0,9)?trim}", - - <#if depot.physical_depot_address.address_4?length < 14> + + <#if depot.physical_depot_address.address_4?length < 14> "CountryCode" : "" <#else> "CountryCode" : "${depot.physical_depot_address.address_4?substring(10,13)?trim}" - - } - } - } + + } + } + } ] diff --git a/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl b/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl index 519c0a8..bf694c2 100644 --- a/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl @@ -2,4 +2,4 @@ <#-- use protobuf of class HsrDepot to find Reflex WMS fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrDepot_ActorDeleted.ftl b/RFXtoRP_HsrDepot_ActorDeleted.ftl index 4bfb3be..164f67e 100644 --- a/RFXtoRP_HsrDepot_ActorDeleted.ftl +++ b/RFXtoRP_HsrDepot_ActorDeleted.ftl @@ -1,12 +1,12 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${depot.physical_depot_code}" - }, - - "Payload": {} - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${depot.physical_depot_code}" + }, + + "Payload": {} + } ] diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index 08883df..387f232 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -10,40 +10,40 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#--<#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsPrepared> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_GoodsPrepared.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_Hsrprepa_TransportStarted.ftl"> - } - ] - <#break> - + <#case "C"> + <#--<#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsPrepared> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_GoodsPrepared.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_Hsrprepa_TransportStarted.ftl"> + } + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "event not supported (Case D)"> - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported (Case D)"> + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared.ftl index dffb29d..8cec9c2 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared.ftl @@ -1,85 +1,85 @@ <#include "HfRpConfig.ftl"> [ - <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> - <#list preparation_line.despatched_ipg_list as despatched_ipg> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - <#if despatched_ipg.carton_number != "000000000000000000"> - "RefID": "${despatched_ipg.carton_number}" - <#else> - "RefID": "${despatched_ipg.hd_number}" - - }, - - "Payload": { - "Information" :{ - <#if despatched_ipg.carton_number != "000000000000000000"> - "ContainerType": "${despatched_ipg.carton_type_code}" - <#else> - "ContainerType": "${despatched_ipg.hd_type_code}" - - - }, - <#-- HU Metadata inclusin inclusion --> - <#include "RFXtoRP_HsrPrepa_GoodsPrepared_HUMetadata.ftl"> - , - "PreparedContents" :[ - { - "Goods": { - "ItemID": "${preparation_line.item_code}", - "LVBranchID": "${preparation_line.item_lv_code}", - <#if (despatched_ipg.ipg_manufacture_date?length != 0) && (despatched_ipg.ipg_manufacture_date?starts_with("00") == false)> - <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_manufacture_date) /> --> - <#assign priority_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${priority_date}", - <#else> - <#if (despatched_ipg.ipg_receipt_date?length != 0) && (despatched_ipg.ipg_receipt_date?starts_with("00")== false)> - <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_receipt_date) /> --> - <#assign priority_date = despatched_ipg.ipg_receipt_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${priority_date}", - <#else> - <#if (despatched_ipg.ipg_best_before_date?length != 0) && (despatched_ipg.ipg_best_before_date?starts_with("00")== false)> - <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_best_before_date) /> --> - <#assign priority_date = despatched_ipg.ipg_best_before_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${priority_date}", - <#else> - <#if (despatched_ipg.ipg_sell_by_date?length != 0) && (despatched_ipg.ipg_sell_by_date?starts_with("00")== false)> - <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_sell_by_date) /> --> - <#assign priority_date = despatched_ipg.ipg_sell_by_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${priority_date}", - <#else> - <#if (despatched_ipg.ipg_use_by_date?length != 0) && (despatched_ipg.ipg_use_by_date?starts_with("00")== false)> - <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_use_by_date) /> --> - <#assign priority_date = despatched_ipg.ipg_use_by_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${priority_date}", - <#else> - "PriorityDate": "error_date", - - - - - - - <#-- Segmentation Keys inclusion --> - <#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl"> - }, - "ExecutionflowID": "${preparation_line.preparation_order_originator_reference}", - "LineID": "${preparation_line.pro_line_number}", - "ActorID": "${preparationOrder.physical_depot_code}", - "Quantity": { - "LVID": "${quantity_in_base_lv_RP_Cst}", - "Value": ${despatched_ipg.quantity_lvs} - } - } - ] - } - - }<#sep>, - - <#sep>, - + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparation_line.despatched_ipg_list as despatched_ipg> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if despatched_ipg.carton_number != "000000000000000000"> + "RefID": "${despatched_ipg.carton_number}" + <#else> + "RefID": "${despatched_ipg.hd_number}" + + }, + + "Payload": { + "Information" :{ + <#if despatched_ipg.carton_number != "000000000000000000"> + "ContainerType": "${despatched_ipg.carton_type_code}" + <#else> + "ContainerType": "${despatched_ipg.hd_type_code}" + + + }, + <#-- HU Metadata inclusin inclusion --> + <#include "RFXtoRP_HsrPrepa_GoodsPrepared_HUMetadata.ftl"> + , + "PreparedContents" :[ + { + "Goods": { + "ItemID": "${preparation_line.item_code}", + "LVBranchID": "${preparation_line.item_lv_code}", + <#if (despatched_ipg.ipg_manufacture_date?length != 0) && (despatched_ipg.ipg_manufacture_date?starts_with("00") == false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_manufacture_date) /> --> + <#assign priority_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + <#if (despatched_ipg.ipg_receipt_date?length != 0) && (despatched_ipg.ipg_receipt_date?starts_with("00")== false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_receipt_date) /> --> + <#assign priority_date = despatched_ipg.ipg_receipt_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + <#if (despatched_ipg.ipg_best_before_date?length != 0) && (despatched_ipg.ipg_best_before_date?starts_with("00")== false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_best_before_date) /> --> + <#assign priority_date = despatched_ipg.ipg_best_before_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + <#if (despatched_ipg.ipg_sell_by_date?length != 0) && (despatched_ipg.ipg_sell_by_date?starts_with("00")== false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_sell_by_date) /> --> + <#assign priority_date = despatched_ipg.ipg_sell_by_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + <#if (despatched_ipg.ipg_use_by_date?length != 0) && (despatched_ipg.ipg_use_by_date?starts_with("00")== false)> + <#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_use_by_date) /> --> + <#assign priority_date = despatched_ipg.ipg_use_by_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${priority_date}", + <#else> + "PriorityDate": "error_date", + + + + + + + <#-- Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl"> + }, + "ExecutionflowID": "${preparation_line.preparation_order_originator_reference}", + "LineID": "${preparation_line.pro_line_number}", + "ActorID": "${preparationOrder.physical_depot_code}", + "Quantity": { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": ${despatched_ipg.quantity_lvs} + } + } + ] + } + + }<#sep>, + + <#sep>, + ] diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl index 4bac794..e4f2590 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl @@ -2,8 +2,8 @@ <#-- "Metadata" :[ - - ] + + ] --> -"Metadata": [ ] \ No newline at end of file +"Metadata": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl index 5732860..6f43935 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl @@ -2,23 +2,23 @@ <#-- "SegmentationKeys" :[ - { - "Key": "BatchNumber", - <#if despatched_ipg.batch_number == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${despatched_ipg.batch_number}"} - - }, - { - "Key": "Grade", - "Value": { "String" : "${preparation_line.grade_code}"} - }, - { - "Key": "Owner", - "Value": { "String" : "${preparation_line.owner_code}"} - } - ] + { + "Key": "BatchNumber", + <#if despatched_ipg.batch_number == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${despatched_ipg.batch_number}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${preparation_line.grade_code}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${preparation_line.owner_code}"} + } + ] --> -"SegmentationKeys": [ ] \ No newline at end of file +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl index dec88fb..8e1c598 100644 --- a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl +++ b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl @@ -2,26 +2,26 @@ <#include "ReflexUtils.ftl"> [ - <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> <#assign preparationOrder_confirmation_datetime = RfxDateTimetoUTC(preparation_line.confirmation_datetime,time_zone_offset_rfx) /> - <#list preparation_line.despatched_ipg_list as despatched_ipg> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - <#if despatched_ipg.carton_number != "000000000000000000"> - "RefID": "${despatched_ipg.carton_number}" - <#else> - "RefID": "${despatched_ipg.hd_number}" - - - }, - "Payload": { - - } - }<#sep>, - - <#sep>, - + <#list preparation_line.despatched_ipg_list as despatched_ipg> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if despatched_ipg.carton_number != "000000000000000000"> + "RefID": "${despatched_ipg.carton_number}" + <#else> + "RefID": "${despatched_ipg.hd_number}" + + + }, + "Payload": { + + } + }<#sep>, + + <#sep>, + ] diff --git a/RFXtoRP_HsrPrepa_TransportStarted.ftl b/RFXtoRP_HsrPrepa_TransportStarted.ftl index be8f1d2..affaa18 100644 --- a/RFXtoRP_HsrPrepa_TransportStarted.ftl +++ b/RFXtoRP_HsrPrepa_TransportStarted.ftl @@ -2,20 +2,20 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = preparationOrder.stock_despatch_at_preparation_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${preparation_line.preparation_order_originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${preparation_line.preparation_order_originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } ] <#-- ajouter une boucle sur tous les ODP de la prepa - --> diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index ba802a0..4b6ef39 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -10,65 +10,65 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign order = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#-- check preparation type code (internal order and reservation are ignored) --> - <#if order.preparation_type_code == "010" || - order.preparation_type_code == "030"> - - <#-- Preparation order not confirmed --> - <#if order.preparation_order_confirmed == "false" > - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> - - <#-- preparation expected a prendre en compte dans le connecteur - , + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign order = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#-- check preparation type code (internal order and reservation are ignored) --> + <#if order.preparation_type_code == "010" || + order.preparation_type_code == "030"> + + <#-- Preparation order not confirmed --> + <#if order.preparation_order_confirmed == "false" > + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> + + <#-- preparation expected a prendre en compte dans le connecteur + , - <#assign apiReflexPlatformID = ApiReflexPlatformID.TransportExpected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPro_PreparationExpected.ftl"> - --> - - <#-- Preparation order confirmed --> - <#else> - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPro_PreparationCompleted.ftl"> - - <#else> - <#stop "preparation type not supported"> - - - } - - ] - <#break> - + <#assign apiReflexPlatformID = ApiReflexPlatformID.TransportExpected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPro_PreparationExpected.ftl"> + --> + + <#-- Preparation order confirmed --> + <#else> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPro_PreparationCompleted.ftl"> + + <#else> + <#stop "preparation type not supported"> + + + } + + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign order = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl"> - } - ] - <#break> - - - <#default> - <#stop "event not supported"> + <#-- *********************************************** Action = DELETE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign order = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl"> + } + ] + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl index 068ec80..503df5e 100644 --- a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl @@ -1,12 +1,12 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}" - }, - "Payload": { - } - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}" + }, + "Payload": { + } + } ] diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index f250888..c983001 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -1,106 +1,106 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> [ - { + { <#assign planned_final_delivery_start_datetime = RfxDateTimetoUTC(order.planned_final_delivery_start_datetime,time_zone_offset_rfx) /> <#assign pro_creation_datetime = RfxDateTimetoUTC(order.creation_datetime,time_zone_offset_rfx) /> - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}", - "RefDate": { - "DateTime": "${pro_creation_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - "Payload": { - "CreationDateTime": { - "DateTime": "${pro_creation_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - }, - <#-- Header Metadata inclusion --> - <#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl"> - - "ShipFrom": { - "ActorID": "${order.physical_depot_code}" - }, - "ShipFromAcked": true, - "ShipTo": { - <#if order.end_consignee_code != "ECOM"> - "ActorID": "${order.end_consignee_code}" - <#else> - <#if order.address != ""> - "Actor": - { - "Name" : "${order.address.name_or_company_name!""}", + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${pro_creation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + "CreationDateTime": { + "DateTime": "${pro_creation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + <#-- Header Metadata inclusion --> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl"> + + "ShipFrom": { + "ActorID": "${order.physical_depot_code}" + }, + "ShipFromAcked": true, + "ShipTo": { + <#if order.end_consignee_code != "ECOM"> + "ActorID": "${order.end_consignee_code}" + <#else> + <#if order.address != ""> + "Actor": + { + "Name" : "${order.address.name_or_company_name!""}", "Address" : { "City" : "${order.address.post_code_area_name!""}", "CountryCode" : "${order.address.iso_country_code!""}", "PostalCode" : "${order.address.postal_code!""}", "StreetAddressOne" : "${order.address.street_and_number_and_po_box!""}", - "StreetAddressTwo" : "${order.address.additional_address_data_1!""}", - "StreetAddressThree" : "${order.address.additional_address_data_2!""}" + "StreetAddressTwo" : "${order.address.additional_address_data_1!""}", + "StreetAddressThree" : "${order.address.additional_address_data_2!""}" } - }, - "Contact" : - { - "FirstName" : "${order.address.first_name!""}", - "LastName" : "${order.address.last_name!""}", - "Emails" : ["${order.address.mail_address!""}"], - "Phones" : ["${order.address.mobile_phone_number!""}"] - } - - - }, - - <#if order.line_list??> - "Lines" : [ - <#list order.line_list as line> - { - <#if (line.originator_reference_line_number!0) != 0> - "LineID": "${line.originator_reference_line_number}", - <#else> - "LineID": "${line.preparation_order_line_number!0}", - - <#-- Line Metadata inclusion --> - <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl"> - - "RequestedContent": - { - "Goods": - { - "ItemID": "${line.item_code!"0"}", - "LVBranchID": "${line.item_lv_code!"0"}", - <#if (line.optional_attributes.forced_priority_date?length != 0) && (line.optional_attributes.forced_priority_date?starts_with("00") == false)> - <#assign forced_priority_date = line.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${forced_priority_date}", - - - <#-- Line Segmentation Keys inclusion --> - <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl"> - - }, - "Quantity" : - { - "LVID": "${quantity_in_base_lv_RP_Cst}", - "Value": "${line.base_lv_quantity_to_prepare!0}" - } - } - }<#sep>, - - ], - - - "RequestedMilestones" : - { - "RequestedDeliveryDateTime" : - { - "DateTime": "${planned_final_delivery_start_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - } - } - } + }, + "Contact" : + { + "FirstName" : "${order.address.first_name!""}", + "LastName" : "${order.address.last_name!""}", + "Emails" : ["${order.address.mail_address!""}"], + "Phones" : ["${order.address.mobile_phone_number!""}"] + } + + + }, + + <#if order.line_list??> + "Lines" : [ + <#list order.line_list as line> + { + <#if (line.originator_reference_line_number!0) != 0> + "LineID": "${line.originator_reference_line_number}", + <#else> + "LineID": "${line.preparation_order_line_number!0}", + + <#-- Line Metadata inclusion --> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl"> + + "RequestedContent": + { + "Goods": + { + "ItemID": "${line.item_code!"0"}", + "LVBranchID": "${line.item_lv_code!"0"}", + <#if (line.optional_attributes.forced_priority_date?length != 0) && (line.optional_attributes.forced_priority_date?starts_with("00") == false)> + <#assign forced_priority_date = line.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${forced_priority_date}", + + + <#-- Line Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl"> + + }, + "Quantity" : + { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": "${line.base_lv_quantity_to_prepare!0}" + } + } + }<#sep>, + + ], + + + "RequestedMilestones" : + { + "RequestedDeliveryDateTime" : + { + "DateTime": "${planned_final_delivery_start_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + } + } + } ] diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl index c97abe1..854f86d 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl @@ -4,12 +4,12 @@ <#-- "MetaData": [ - { - "Key": "OrderType", - "Value": { "String" : "${order.optional_attributes.reason_code}"} - } - ], + { + "Key": "OrderType", + "Value": { "String" : "${order.optional_attributes.reason_code}"} + } + ], --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl index b72e0ed..1b3d04d 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl @@ -2,4 +2,4 @@ <#-- use protobuf of class HsrPro to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl index 7fba11b..6482f78 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl @@ -2,19 +2,19 @@ <#-- use protobuf of class HsrPro to find Reflex WMS fields names --> <#-- -"SegmentationKeys": [ { - "Key": "BatchNumber", - <#if line.batch_1 == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${line.batch_1}"} - - }, - { - "Key": "Grade", - "Value": { "String" : "${SegmentationKeys_KV[line.grade_code_to_prepare]!Default_Value_Grade_SegmentationKey}"} - } - ] +"SegmentationKeys": [ { + "Key": "BatchNumber", + <#if line.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line.batch_1}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${SegmentationKeys_KV[line.grade_code_to_prepare]!Default_Value_Grade_SegmentationKey}"} + } + ] --> -"SegmentationKeys": [ ] \ No newline at end of file +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPro_PreparationCompleted.ftl b/RFXtoRP_HsrPro_PreparationCompleted.ftl index 4ae7c8c..b78bb03 100644 --- a/RFXtoRP_HsrPro_PreparationCompleted.ftl +++ b/RFXtoRP_HsrPro_PreparationCompleted.ftl @@ -2,19 +2,19 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = order.confirmation_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } ] diff --git a/RFXtoRP_HsrPro_PreparationExpected.ftl b/RFXtoRP_HsrPro_PreparationExpected.ftl index dabb3a7..9a8755b 100644 --- a/RFXtoRP_HsrPro_PreparationExpected.ftl +++ b/RFXtoRP_HsrPro_PreparationExpected.ftl @@ -2,19 +2,19 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = order.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } ] diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 9a8ac22..07688c2 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -10,61 +10,61 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#-- *********************************************** Action = CREATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign receipt = JsonUtil.jsonToMap(dataRfx)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> - - } - ] - <#break> - <#case "U"> - <#-- *********************************************** Action = UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign receipt = JsonUtil.jsonToMap(dataRfx)> - [ - <#if receipt.receipt_confirmed == "true" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> - } - <#else> - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> - } - - ] - <#break> - + <#case "C"> + <#-- *********************************************** Action = CREATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign receipt = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> + + } + ] + <#break> + <#case "U"> + <#-- *********************************************** Action = UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign receipt = JsonUtil.jsonToMap(dataRfx)> + [ + <#if receipt.receipt_confirmed == "true" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> + } + <#else> + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> + } + + ] + <#break> + <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign receipt = JsonUtil.jsonToMap(dataRfx)> - [ - { + <#-- *********************************************** Action = DELETE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign receipt = JsonUtil.jsonToMap(dataRfx)> + [ + { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl"> - - } - ] - <#break> - - - <#default> - <#stop "event not supported"> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl"> + + } + ] + <#break> + + + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index b298cd3..0c320ca 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -1,126 +1,126 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> [ - { - <#assign receipt_datetime = RfxDateTimetoUTC(receipt.receipt_datetime,time_zone_offset_rfx) /> - <#assign receipt_creation_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) /> + { + <#assign receipt_datetime = RfxDateTimetoUTC(receipt.receipt_datetime,time_zone_offset_rfx) /> + <#assign receipt_creation_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) /> "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${receipt.receipt_reference}" - "RefDate": { - "DateTime": "${receipt_creation_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - "Payload": { - "CreationDateTime": { - "DateTime": "${receipt_creation_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - - }, - - <#-- Header Metadata inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl"> - , - "ShipFrom": - { - "ActorID": "${receipt.original_code}" - }, - "ShipTo" : - { - "ActorID": "${receipt.physical_depot_code}" - }, - "ShipToAcked": true, - - <#if receipt.carrier_informations.carrier_code != ""> + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${receipt.receipt_reference}" + "RefDate": { + "DateTime": "${receipt_creation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + "CreationDateTime": { + "DateTime": "${receipt_creation_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + + }, + + <#-- Header Metadata inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl"> + , + "ShipFrom": + { + "ActorID": "${receipt.original_code}" + }, + "ShipTo" : + { + "ActorID": "${receipt.physical_depot_code}" + }, + "ShipToAcked": true, + + <#if receipt.carrier_informations.carrier_code != ""> "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code}"}, - - - <#-- If receipt got lines --> - <#if receipt.line_list??> - "Lines" : [ - <#list receipt.line_list as line> - - <#-- if receipt type = 030 (transfert) --> - <#if receipt.receipt_type = "030"> - - <#list line.line_detail as detail> - { - "LineID": "${line.receipt_line_number}${detail.receipt_detail_number}", - <#-- Line Metadata inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, - "RequestedContent": - { - "Goods": - { - "ItemID": "${line.item_code!"0"}", - "LVBranchID": "${line.item_lv_code!"0"}", - <#if (detail.priority_date?length != 0) && (detail.priority_date?starts_with("00") == false)> - <#assign line_detail_priority_date = detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${line_detail_priority_date}", - - - <#-- Line Segmentation Keys inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> - - }, - "Quantity" : - { - "LVID": "${quantity_in_base_lv_RP_Cst}", - "Value": "${detail.confirmation_lv_quantity!0}" - } - } - }<#sep>, - - <#-- receipt type different from transfert non transfert --> - <#else> - { - "LineID": "${line.receipt_line_number}", - <#-- Line Metadata inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, - "RequestedContent": - { - "Goods": - { - "ItemID": "${line.item_code!"0"}", - "LVBranchID": "${line.item_lv_code!"0"}", - <#if line.line_without_detail??> - <#if (line.line_without_detail.priority_date?length != 0) && (line.line_without_detail.priority_date?starts_with("00") == false)> - <#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${line_without_detail_priority_date}", - - - <#-- Line Segmentation Keys inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> - - <#else> - <#stop "Reception non transfert avec detail"> - - }, - "Quantity" : - { - "LVID": "${quantity_in_base_lv_RP_Cst}", - "Value": "${line.order_quantity_in_lv!0}" - } - } - - } - - <#sep>, - - ], - - - "RequestedMilestones" : - { - "RequestedDeliveryDateTime" : - { - "DateTime": "${receipt_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - } - } - } + + + <#-- If receipt got lines --> + <#if receipt.line_list??> + "Lines" : [ + <#list receipt.line_list as line> + + <#-- if receipt type = 030 (transfert) --> + <#if receipt.receipt_type = "030"> + + <#list line.line_detail as detail> + { + "LineID": "${line.receipt_line_number}${detail.receipt_detail_number}", + <#-- Line Metadata inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, + "RequestedContent": + { + "Goods": + { + "ItemID": "${line.item_code!"0"}", + "LVBranchID": "${line.item_lv_code!"0"}", + <#if (detail.priority_date?length != 0) && (detail.priority_date?starts_with("00") == false)> + <#assign line_detail_priority_date = detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${line_detail_priority_date}", + + + <#-- Line Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> + + }, + "Quantity" : + { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": "${detail.confirmation_lv_quantity!0}" + } + } + }<#sep>, + + <#-- receipt type different from transfert non transfert --> + <#else> + { + "LineID": "${line.receipt_line_number}", + <#-- Line Metadata inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, + "RequestedContent": + { + "Goods": + { + "ItemID": "${line.item_code!"0"}", + "LVBranchID": "${line.item_lv_code!"0"}", + <#if line.line_without_detail??> + <#if (line.line_without_detail.priority_date?length != 0) && (line.line_without_detail.priority_date?starts_with("00") == false)> + <#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> + "PriorityDate": "${line_without_detail_priority_date}", + + + <#-- Line Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> + + <#else> + <#stop "Reception non transfert avec detail"> + + }, + "Quantity" : + { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": "${line.order_quantity_in_lv!0}" + } + } + + } + + <#sep>, + + ], + + + "RequestedMilestones" : + { + "RequestedDeliveryDateTime" : + { + "DateTime": "${receipt_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + } + } + } ] diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl index 34f0fb2..de365c0 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl @@ -3,12 +3,12 @@ <#-- "MetaData": [ - { - "Key": "OrderType", - "Value": { "String" : "${order.optional_attributes.reason_code}"} - } - ], + { + "Key": "OrderType", + "Value": { "String" : "${order.optional_attributes.reason_code}"} + } + ], --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl index bd26485..028dff1 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl @@ -1,4 +1,4 @@ <#-- use protobuf of class HsrReceiptList to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl index 669455e..ef2e808 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl @@ -1,19 +1,19 @@ <#-- use protobuf of class HsrReceiptList to find Reflex WMS fields names --> <#-- -"SegmentationKeys": [ { - "Key": "BatchNumber", - <#if line.batch_1 == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${line.batch_1}"} - - }, - { - "Key": "Grade", - "Value": { "String" : "${line.grade_code_to_prepare} - } - ] +"SegmentationKeys": [ { + "Key": "BatchNumber", + <#if line.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line.batch_1}"} + + }, + { + "Key": "Grade", + "Value": { "String" : "${line.grade_code_to_prepare} + } + ] --> -"SegmentationKeys": [ ] \ No newline at end of file +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_OrderCancelled.ftl b/RFXtoRP_HsrReceiptList_OrderCancelled.ftl index 74b44c9..61b9149 100644 --- a/RFXtoRP_HsrReceiptList_OrderCancelled.ftl +++ b/RFXtoRP_HsrReceiptList_OrderCancelled.ftl @@ -1,12 +1,12 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${receipt.receipt_reference}" - }, - "Payload": { - } - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${receipt.receipt_reference}" + }, + "Payload": { + } + } ] diff --git a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl index dabb3a7..9a8755b 100644 --- a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl +++ b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl @@ -2,19 +2,19 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = order.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } ] diff --git a/RFXtoRP_HsrReceiptList_TransportCompleted.ftl b/RFXtoRP_HsrReceiptList_TransportCompleted.ftl index d9a1296..3bf47b7 100644 --- a/RFXtoRP_HsrReceiptList_TransportCompleted.ftl +++ b/RFXtoRP_HsrReceiptList_TransportCompleted.ftl @@ -1,14 +1,14 @@ <#include "HfRpConfig.ftl"> <#include "projectCst.ftl"> [ - { + { "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${receipt.receipt_reference}" - }, - "Payload": { - } - } + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${receipt.receipt_reference}" + }, + "Payload": { + } + } ] diff --git a/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl b/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl index 068ec80..503df5e 100644 --- a/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl +++ b/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl @@ -1,12 +1,12 @@ [ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}" - }, - "Payload": { - } - } + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${order.originator_reference}" + }, + "Payload": { + } + } ] diff --git a/ReflexUtils.ftl b/ReflexUtils.ftl index 5cc733f..35a703c 100644 --- a/ReflexUtils.ftl +++ b/ReflexUtils.ftl @@ -6,4 +6,4 @@ <#return (datetimeUTC)> - \ No newline at end of file + \ No newline at end of file From 80f25f29adc0ec8b39f4b6025bb66fd69a3cef7f Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Mon, 4 Sep 2023 17:28:35 +0200 Subject: [PATCH 07/68] receipt list --- RFXtoRP_HsrReceiptList.ftl | 8 +++- ...P_HsrReceiptList_ExecutionflowDetected.ftl | 43 ++----------------- 2 files changed, 10 insertions(+), 41 deletions(-) diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 07688c2..9e3732f 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -12,8 +12,13 @@ <#switch cloudEventMsg.action> <#case "C"> <#-- *********************************************** Action = CREATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign receipt = JsonUtil.jsonToMap(dataRfx)> + + <#if receipt.receipt_type = "030"> + <#stop "ignored message because receipt type = transfert"> + <#else> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> @@ -22,7 +27,8 @@ <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> } - ] + ] + <#break> <#case "U"> <#-- *********************************************** Action = UPDATE ******************** --> diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index 0c320ca..7038628 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -38,44 +38,9 @@ "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code}"}, - <#-- If receipt got lines --> - <#if receipt.line_list??> + "Lines" : [ <#list receipt.line_list as line> - - <#-- if receipt type = 030 (transfert) --> - <#if receipt.receipt_type = "030"> - - <#list line.line_detail as detail> - { - "LineID": "${line.receipt_line_number}${detail.receipt_detail_number}", - <#-- Line Metadata inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, - "RequestedContent": - { - "Goods": - { - "ItemID": "${line.item_code!"0"}", - "LVBranchID": "${line.item_lv_code!"0"}", - <#if (detail.priority_date?length != 0) && (detail.priority_date?starts_with("00") == false)> - <#assign line_detail_priority_date = detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> - "PriorityDate": "${line_detail_priority_date}", - - - <#-- Line Segmentation Keys inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> - - }, - "Quantity" : - { - "LVID": "${quantity_in_base_lv_RP_Cst}", - "Value": "${detail.confirmation_lv_quantity!0}" - } - } - }<#sep>, - - <#-- receipt type different from transfert non transfert --> - <#else> { "LineID": "${line.receipt_line_number}", <#-- Line Metadata inclusion --> @@ -90,13 +55,13 @@ <#if (line.line_without_detail.priority_date?length != 0) && (line.line_without_detail.priority_date?starts_with("00") == false)> <#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> "PriorityDate": "${line_without_detail_priority_date}", - + <#-- Line Segmentation Keys inclusion --> <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> <#else> - <#stop "Reception non transfert avec detail"> + <#stop "line with detail"> }, "Quantity" : @@ -107,11 +72,9 @@ } } - <#sep>, ], - "RequestedMilestones" : { From 78101a1362cc0aa145a2f4da044d29b08afe680f Mon Sep 17 00:00:00 2001 From: frea Date: Mon, 4 Sep 2023 18:04:33 +0200 Subject: [PATCH 08/68] correction du FTL --- RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index 7038628..e9fbe46 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -8,10 +8,10 @@ "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${receipt.receipt_reference}" - "RefDate": { + "RefID": "${receipt.receipt_reference}", + "RefDate": { "DateTime": "${receipt_creation_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" + "AuthorTimeZone": "${time_zone_rfx}" } }, "Payload": { @@ -23,7 +23,6 @@ <#-- Header Metadata inclusion --> <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl"> - , "ShipFrom": { "ActorID": "${receipt.original_code}" @@ -44,7 +43,7 @@ { "LineID": "${line.receipt_line_number}", <#-- Line Metadata inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl"> "RequestedContent": { "Goods": From cdef1e3803ef6f386994870c0556a4fdfab65848 Mon Sep 17 00:00:00 2001 From: frea Date: Tue, 5 Sep 2023 10:36:01 +0200 Subject: [PATCH 09/68] faute de frappe sur le nom d'un fichier FTL --- RFXtoRP_HsrPrepa.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index 387f232..cb84d59 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -32,7 +32,7 @@ <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_Hsrprepa_TransportStarted.ftl"> + <#include "RFXtoRP_HsrPrepa_TransportStarted.ftl"> } ] <#break> From 74c368c2ee3867df479b990bd4f42340a278a965 Mon Sep 17 00:00:00 2001 From: frea Date: Tue, 5 Sep 2023 11:30:00 +0200 Subject: [PATCH 10/68] Ajout de la boucle sur transportstarted --- RFXtoRP_HsrPrepa_TransportStarted.ftl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RFXtoRP_HsrPrepa_TransportStarted.ftl b/RFXtoRP_HsrPrepa_TransportStarted.ftl index affaa18..ca326ef 100644 --- a/RFXtoRP_HsrPrepa_TransportStarted.ftl +++ b/RFXtoRP_HsrPrepa_TransportStarted.ftl @@ -2,6 +2,7 @@ <#include "ReflexUtils.ftl"> <#assign preparation_status_datetime = preparationOrder.stock_despatch_at_preparation_datetime?datetime(rfx_date_format_default)?iso_utc /> [ + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> { "Header": { "ProjectID": "${projectRP}" @@ -17,5 +18,7 @@ "Payload": {} } + <#sep>, + ] -<#-- ajouter une boucle sur tous les ODP de la prepa - --> + From 8cdcafd70eec9152d33353f66d13ba386bdce2fa Mon Sep 17 00:00:00 2001 From: frea Date: Tue, 5 Sep 2023 11:57:24 +0200 Subject: [PATCH 11/68] ajout du fichier FTL --- RFXtoRP_HfLvTypeList.ftl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 RFXtoRP_HfLvTypeList.ftl diff --git a/RFXtoRP_HfLvTypeList.ftl b/RFXtoRP_HfLvTypeList.ftl new file mode 100644 index 0000000..1f98762 --- /dev/null +++ b/RFXtoRP_HfLvTypeList.ftl @@ -0,0 +1,28 @@ +<#-- *********************************************** Parameter global ******************** --> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign file = JsonUtil.jsonToMap(dataRfx)> + <#noparse><#--TODO RFXtoRP_HfLvTypeList.ftl --> + <#--<#include "RFXtoRP_RfxConfigurationRp.ftl"> --> + + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "en attente de FTL"> + <#break> + + + <#default> + <#stop> + + From 0f6dcfb497485faa07a2a4b1128adbf9c9c28e3c Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 5 Sep 2023 15:05:31 +0200 Subject: [PATCH 12/68] Prise en compte de l'API LVRemoved --- RFXtoRP_HsaItmLv.ftl | 21 +++++-------------- ...FXtoRP_HsaItmLv_LogisticVariantRemoved.ftl | 0 ...FXtoRP_HsaItmLv_LogisticVariantUpdated.ftl | 2 +- ...aItmLv_LogisticVariantUpdated_Metadata.ftl | 6 +++--- 4 files changed, 9 insertions(+), 20 deletions(-) rename RFXtoRP_HsaItmLv_LVRemoved.ftl => RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl (100%) rename RFXtoRP_HsaItmLv_LVUpdated.ftl => RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl (96%) rename RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl => RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl (97%) diff --git a/RFXtoRP_HsaItmLv.ftl b/RFXtoRP_HsaItmLv.ftl index 9a7cd2e..b8f9162 100644 --- a/RFXtoRP_HsaItmLv.ftl +++ b/RFXtoRP_HsaItmLv.ftl @@ -18,38 +18,27 @@ <#assign lv = JsonUtil.jsonToMap(dataRfx)> [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.LVUpdated> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemLogisticVariantUpdated> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsaItmLv_LVUpdated.ftl"> + <#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl"> } ] <#break> <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> - <#stop "LV deletion not supported" > - - <#-- supression LV a décommenter quand API ajouté au connecteur - - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign item = JsonUtil.jsonToMap(dataRfx)> [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.LVDeleted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemLogisticVariantRemoved> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsaItmLv_LVRemoved.ftl"> + <#include "RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl"> } ] - - - --> - - <#break> - - + <#break> <#default> <#stop "event not supported"> diff --git a/RFXtoRP_HsaItmLv_LVRemoved.ftl b/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl similarity index 100% rename from RFXtoRP_HsaItmLv_LVRemoved.ftl rename to RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl diff --git a/RFXtoRP_HsaItmLv_LVUpdated.ftl b/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl similarity index 96% rename from RFXtoRP_HsaItmLv_LVUpdated.ftl rename to RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl index 7583a6b..229a89b 100644 --- a/RFXtoRP_HsaItmLv_LVUpdated.ftl +++ b/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl @@ -24,7 +24,7 @@ <#-- LV Metadata inclusion --> - <#include "RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl"> + <#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl"> "IsBaseLogisticVariant": ${lv.base_lv}, diff --git a/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl b/RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl similarity index 97% rename from RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl rename to RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl index d8a0a32..e3dddf3 100644 --- a/RFXtoRP_HsaItmLv_LVUpdated_Metadata.ftl +++ b/RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl @@ -1,4 +1,4 @@ -<#-- use protobuf of class HsaItmLv to find Reflex Wms fields names --> - - +<#-- use protobuf of class HsaItmLv to find Reflex Wms fields names --> + + "MetaData": [ ], \ No newline at end of file From 4feae053f2c648381e07035b1b11cd698b5cfd00 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 5 Sep 2023 15:16:47 +0200 Subject: [PATCH 13/68] reprise noms de fichier avec contraction (LV/HU) --- RFXtoRP_HsaItm_ItemCreated.ftl | 2 +- ...saItm_ItemCreated_LogisticVariantMetadata.ftl | 8 ++++---- RFXtoRP_HsrPrepa_GoodsPrepared.ftl | 2 +- ...rPrepa_GoodsPrepared_HandlingUnitMetadata.ftl | 16 ++++++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) rename RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl => RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl (97%) rename RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl => RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl (94%) diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index 8f6d9fc..f338745 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -49,7 +49,7 @@ <#-- LV Metadata inclusion --> <#if logistical_variant.additional_data_value_list??> - <#include "RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl"> + <#include "RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl"> "IsBaseLogisticVariant": ${logistical_variant.base_lv}, diff --git a/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl b/RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl similarity index 97% rename from RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl rename to RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl index 566f271..c26c9f5 100644 --- a/RFXtoRP_HsaItm_ItemCreated_LVMetadata.ftl +++ b/RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl @@ -1,5 +1,5 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> -<#-- use protobuf of class HsaItm to find Reflex Wms fields names --> - - +<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> +<#-- use protobuf of class HsaItm to find Reflex Wms fields names --> + + "MetaData": [ ], \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared.ftl index 8cec9c2..043fa12 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared.ftl @@ -25,7 +25,7 @@ }, <#-- HU Metadata inclusin inclusion --> - <#include "RFXtoRP_HsrPrepa_GoodsPrepared_HUMetadata.ftl"> + <#include "RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl"> , "PreparedContents" :[ { diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl similarity index 94% rename from RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl rename to RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl index e4f2590..50b6569 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared_HuMetadata.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl @@ -1,9 +1,9 @@ -<#-- use protobuf of class HsrPrepa to find Reflex WMS fields names --> - -<#-- -"Metadata" :[ - - ] - ---> +<#-- use protobuf of class HsrPrepa to find Reflex WMS fields names --> + +<#-- +"Metadata" :[ + + ] + +--> "Metadata": [ ] \ No newline at end of file From 39b18a45b7b4db1c639831f793944a7c267a876f Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 5 Sep 2023 15:59:11 +0200 Subject: [PATCH 14/68] correction sur HsaItmLv --- RFXtoRP_HsaItmLv.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsaItmLv.ftl b/RFXtoRP_HsaItmLv.ftl index b8f9162..2b91ca2 100644 --- a/RFXtoRP_HsaItmLv.ftl +++ b/RFXtoRP_HsaItmLv.ftl @@ -29,7 +29,7 @@ <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign item = JsonUtil.jsonToMap(dataRfx)> + <#assign lv = JsonUtil.jsonToMap(dataRfx)> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemLogisticVariantRemoved> From 5ee8a8eba0e3d3470c2cdafe1a6c1664587f8312 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 5 Sep 2023 16:04:26 +0200 Subject: [PATCH 15/68] correction --- RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl b/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl index 5200043..44da0f4 100644 --- a/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl +++ b/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl @@ -8,7 +8,7 @@ "RefID": "${lv.item_code}" }, "Payload": { - "RemovedLogisticVariant": "${lv.logistical_variant_code} + "RemovedLogisticVariant": "${lv.logistical_variant_code}" } } ] From 0d9a4948a7733f1dd88f2ab043a5ddcf56a1f45b Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 5 Sep 2023 16:20:49 +0200 Subject: [PATCH 16/68] correction Lv removed --- RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl b/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl index 44da0f4..5c1c26e 100644 --- a/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl +++ b/RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl @@ -8,7 +8,7 @@ "RefID": "${lv.item_code}" }, "Payload": { - "RemovedLogisticVariant": "${lv.logistical_variant_code}" + "RemovedLogisticVariantIDs":["${lv.logistical_variant_code}"] } } ] From 8991420bbb56af2cd90c090f6e5a3de5e09e01b4 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 5 Sep 2023 17:45:53 +0200 Subject: [PATCH 17/68] Prepration Expected (new API) --- RFXtoRP_HsaProStatus.ftl | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl index 7a45395..2587ca0 100644 --- a/RFXtoRP_HsaProStatus.ftl +++ b/RFXtoRP_HsaProStatus.ftl @@ -17,25 +17,24 @@ <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx)> [ - <#-- - **Pick batch runned (100) ** + + <#--**Pick batch runned (100) **--> <#if preparationStatusInterface.preparation_status_type == "100" && - (preparationStatusInterface.preparation_status_code == "200" > + preparationStatusInterface.preparation_status_code == "200" > { - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationStarted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaProStatus_PreparationExpecteded.ftl"> } <#else> - --> <#-- ** Collection started (300) and Preparation in progress (400)** --> <#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") > { - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationStarted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> @@ -46,7 +45,7 @@ (preparationStatusInterface.preparation_status_code == "500" || preparationStatusInterface.preparation_status_code == "550")> { - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> @@ -75,13 +74,12 @@ <#stop "Reflex WMS status not supported on Reflex Platform"> - - - - - <#-- - - --> + + + + + + ] <#break> From 4c978f2450f9f3cb2a34bc4e230ec92c5e9e3e25 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 5 Sep 2023 18:04:14 +0200 Subject: [PATCH 18/68] preparation expected --- RFXtoRP_HsaProStatus.ftl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl index 2587ca0..4d85b39 100644 --- a/RFXtoRP_HsaProStatus.ftl +++ b/RFXtoRP_HsaProStatus.ftl @@ -17,7 +17,6 @@ <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx)> [ - <#--**Pick batch runned (100) **--> <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" > @@ -25,7 +24,7 @@ <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationExpecteded.ftl"> + <#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl"> } <#else> From 426401b0e6340e8acb4635168dff13f6d7be85e4 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 6 Sep 2023 11:32:14 +0200 Subject: [PATCH 19/68] Receipt expected addition --- RFXtoRP_HsrReceiptList.ftl | 10 +++++++++- RFXtoRP_HsrReceiptList_ReceiptExpected.ftl | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 9e3732f..50ef75c 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -26,7 +26,15 @@ "datas" : <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> - } + }, + + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl"> + + } ] <#break> diff --git a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl index 9a8755b..0d9e3ff 100644 --- a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl +++ b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = order.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign preparation_status_datetime = receipt.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> [ { "Header": { From d263897eb7692fd97d62feb44a2ec6f6b93aa06a Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 6 Sep 2023 11:55:57 +0200 Subject: [PATCH 20/68] Receipt adaptation --- RFXtoRP_HsrReceiptList.ftl | 8 +++++++- ..._HsrReceiptList_ExecutionflowCancelled.ftl | 20 +++++++++++++++++++ ...P_HsrReceiptList_ExecutionflowDetected.ftl | 8 ++++---- RFXtoRP_HsrReceiptList_OrderCancelled.ftl | 12 ----------- RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl | 19 ++++++++++++++++++ RFXtoRP_HsrReceiptList_ReceiptExpected.ftl | 6 +++--- RFXtoRP_HsrReceiptList_TransportCompleted.ftl | 14 ------------- 7 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl delete mode 100644 RFXtoRP_HsrReceiptList_OrderCancelled.ftl create mode 100644 RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl delete mode 100644 RFXtoRP_HsrReceiptList_TransportCompleted.ftl diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 50ef75c..4ff1cb1 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -27,7 +27,6 @@ <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> }, - { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected> "apiReflexPlatformID" : "${apiReflexPlatformID}", @@ -56,6 +55,13 @@ "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl"> + } ] diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl new file mode 100644 index 0000000..8cabd47 --- /dev/null +++ b/RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl @@ -0,0 +1,20 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign receipt_status_datetime = receipt.modification_datetime?datetime(rfx_date_format_default)?iso_utc /> + +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${receipt.receipt_reference}", + "RefDate": { + "DateTime": "${receipt_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + } + } +] diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index e9fbe46..bb6050e 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -18,12 +18,12 @@ "CreationDateTime": { "DateTime": "${receipt_creation_datetime}", "AuthorTimeZone": "${time_zone_rfx}" - }, - + <#-- Header Metadata inclusion --> <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl"> - "ShipFrom": + + "ShipFrom": { "ActorID": "${receipt.original_code}" }, @@ -35,7 +35,7 @@ <#if receipt.carrier_informations.carrier_code != ""> "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code}"}, - + "Lines" : [ diff --git a/RFXtoRP_HsrReceiptList_OrderCancelled.ftl b/RFXtoRP_HsrReceiptList_OrderCancelled.ftl deleted file mode 100644 index 61b9149..0000000 --- a/RFXtoRP_HsrReceiptList_OrderCancelled.ftl +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${receipt.receipt_reference}" - }, - "Payload": { - } - } -] diff --git a/RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl b/RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl new file mode 100644 index 0000000..64a33f1 --- /dev/null +++ b/RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl @@ -0,0 +1,19 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign receipt_status_datetime = receipt.confirmation_datetime?datetime(rfx_date_format_default)?iso_utc /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${receipt.receipt_reference}", + "RefDate": { + "DateTime": "${receipt_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + } + } +] diff --git a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl index 0d9e3ff..5120310 100644 --- a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl +++ b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl @@ -1,15 +1,15 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = receipt.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign receipt_status_datetime = receipt.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${order.originator_reference}", + "RefID": "${receipt.receipt_reference}", "RefDate": { - "DateTime": "${preparation_status_datetime}", + "DateTime": "${receipt_status_datetime}", "AuthorTimeZone": "${time_zone_rfx}" } }, diff --git a/RFXtoRP_HsrReceiptList_TransportCompleted.ftl b/RFXtoRP_HsrReceiptList_TransportCompleted.ftl deleted file mode 100644 index 3bf47b7..0000000 --- a/RFXtoRP_HsrReceiptList_TransportCompleted.ftl +++ /dev/null @@ -1,14 +0,0 @@ -<#include "HfRpConfig.ftl"> -<#include "projectCst.ftl"> -[ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${receipt.receipt_reference}" - }, - "Payload": { - } - } -] From 7a46793fe77ce214e46feb666640d01973b37dcb Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 6 Sep 2023 15:13:47 +0200 Subject: [PATCH 21/68] Format date from Reflex --- RFXtoRP_HsaIpgMove_GoodsReceived.ftl | 4 +--- RFXtoRP_HsaIpgMove_StockMoved.ftl | 2 +- ...RP_HsaProStatus_ExecutionflowCancelled.ftl | 2 +- RFXtoRP_HsaProStatus_PreparationCompleted.ftl | 2 +- RFXtoRP_HsaProStatus_PreparationExpected.ftl | 2 +- RFXtoRP_HsaProStatus_PreparationStarted.ftl | 2 +- RFXtoRP_HsaProStatus_TransportStarted.ftl | 2 +- RFXtoRP_HsrPrepa_TransportStarted.ftl | 2 +- RFXtoRP_HsrPro_ExecutionflowCancelled.ftl | 9 ++++++++- RFXtoRP_HsrPro_PreparationCompleted.ftl | 2 +- RFXtoRP_HsrPro_PreparationExpected.ftl | 20 ------------------- ..._HsrReceiptList_ExecutionflowCancelled.ftl | 2 +- ...P_HsrReceiptList_ExecutionflowDetected.ftl | 8 ++++---- RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl | 2 +- RFXtoRP_HsrReceiptList_ReceiptExpected.ftl | 3 ++- ...P_HsrReciptList_ExecutionflowCancelled.ftl | 12 ----------- 16 files changed, 25 insertions(+), 51 deletions(-) delete mode 100644 RFXtoRP_HsrPro_PreparationExpected.ftl delete mode 100644 RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl index 1c473bf..53a2efd 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl @@ -2,7 +2,7 @@ <#include "ReflexUtils.ftl"> [ <#assign receipt_confirmation_datetime = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> - + <#assign priority_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_priority_datetime,time_zone_offset_rfx) /> { "Header": { "ProjectID": "${projectRP}" @@ -21,12 +21,10 @@ "Goods": { "ItemID": "${reflexMvtStockInterface.item_code}", "LVBranchID": "${reflexMvtStockInterface.lv_code}", - <#assign priority_date = "${Default_date}"?datetime(rfx_date_format_default)?iso_utc /> "PriorityDate": "${priority_date}", <#-- Goods received Segmentation Keys inclusion --> <#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl"> - }, "ExecutionflowID": "R-${reflexMvtStockInterface.receipt_year_number}-${reflexMvtStockInterface.receipt_number}", "LineID": "${reflexMvtStockInterface.receipt_line_number}", diff --git a/RFXtoRP_HsaIpgMove_StockMoved.ftl b/RFXtoRP_HsaIpgMove_StockMoved.ftl index e9bf2bd..089a70a 100644 --- a/RFXtoRP_HsaIpgMove_StockMoved.ftl +++ b/RFXtoRP_HsaIpgMove_StockMoved.ftl @@ -14,7 +14,7 @@ "410":"STOCK_MOVEMENT_TYPE_FIX", "420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}> <#assign generation_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> -<#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> +<#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> [ { diff --git a/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl b/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl index adb35f5..847ec8a 100644 --- a/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl +++ b/RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl @@ -1,7 +1,7 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> -<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> [ { "Header": { diff --git a/RFXtoRP_HsaProStatus_PreparationCompleted.ftl b/RFXtoRP_HsaProStatus_PreparationCompleted.ftl index e53c45e..110b7f6 100644 --- a/RFXtoRP_HsaProStatus_PreparationCompleted.ftl +++ b/RFXtoRP_HsaProStatus_PreparationCompleted.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> [ { "Header": { diff --git a/RFXtoRP_HsaProStatus_PreparationExpected.ftl b/RFXtoRP_HsaProStatus_PreparationExpected.ftl index e53c45e..110b7f6 100644 --- a/RFXtoRP_HsaProStatus_PreparationExpected.ftl +++ b/RFXtoRP_HsaProStatus_PreparationExpected.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> [ { "Header": { diff --git a/RFXtoRP_HsaProStatus_PreparationStarted.ftl b/RFXtoRP_HsaProStatus_PreparationStarted.ftl index e53c45e..110b7f6 100644 --- a/RFXtoRP_HsaProStatus_PreparationStarted.ftl +++ b/RFXtoRP_HsaProStatus_PreparationStarted.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> [ { "Header": { diff --git a/RFXtoRP_HsaProStatus_TransportStarted.ftl b/RFXtoRP_HsaProStatus_TransportStarted.ftl index e53c45e..110b7f6 100644 --- a/RFXtoRP_HsaProStatus_TransportStarted.ftl +++ b/RFXtoRP_HsaProStatus_TransportStarted.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = preparationStatusInterface.preparation_status_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> [ { "Header": { diff --git a/RFXtoRP_HsrPrepa_TransportStarted.ftl b/RFXtoRP_HsrPrepa_TransportStarted.ftl index ca326ef..6075737 100644 --- a/RFXtoRP_HsrPrepa_TransportStarted.ftl +++ b/RFXtoRP_HsrPrepa_TransportStarted.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = preparationOrder.stock_despatch_at_preparation_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) /> [ <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> { diff --git a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl index 503df5e..bac9ea4 100644 --- a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl @@ -1,10 +1,17 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#assign preparation_status_datetime = RfxDateTimetoUTC(order.modification_datetime,time_zone_offset_rfx) /> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${order.originator_reference}" + "RefID": "${order.originator_reference}", + "RefDate": { + "DateTime": "${preparation_status_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } }, "Payload": { } diff --git a/RFXtoRP_HsrPro_PreparationCompleted.ftl b/RFXtoRP_HsrPro_PreparationCompleted.ftl index b78bb03..4cfb270 100644 --- a/RFXtoRP_HsrPro_PreparationCompleted.ftl +++ b/RFXtoRP_HsrPro_PreparationCompleted.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = order.confirmation_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign preparation_status_datetime = RfxDateTimetoUTC(order.confirmation_datetime,time_zone_offset_rfx) /> [ { "Header": { diff --git a/RFXtoRP_HsrPro_PreparationExpected.ftl b/RFXtoRP_HsrPro_PreparationExpected.ftl deleted file mode 100644 index 9a8755b..0000000 --- a/RFXtoRP_HsrPro_PreparationExpected.ftl +++ /dev/null @@ -1,20 +0,0 @@ -<#include "HfRpConfig.ftl"> -<#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = order.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> -[ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } -] diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl index 8cabd47..e294ccf 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign receipt_status_datetime = receipt.modification_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.modification_datetime,time_zone_offset_rfx) /> [ { diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index bb6050e..2531f21 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -38,6 +38,7 @@ + <#if receipt.line_list??> "Lines" : [ <#list receipt.line_list as line> { @@ -55,13 +56,11 @@ <#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> "PriorityDate": "${line_without_detail_priority_date}", - - <#-- Line Segmentation Keys inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> - <#else> <#stop "line with detail"> + <#-- Line Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> }, "Quantity" : { @@ -74,6 +73,7 @@ <#sep>, ], + "RequestedMilestones" : { diff --git a/RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl b/RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl index 64a33f1..3d36bb1 100644 --- a/RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl +++ b/RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl @@ -1,6 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign receipt_status_datetime = receipt.confirmation_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.confirmation_datetime,time_zone_offset_rfx) /> [ { "Header": { diff --git a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl index 5120310..823866d 100644 --- a/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl +++ b/RFXtoRP_HsrReceiptList_ReceiptExpected.ftl @@ -1,6 +1,7 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign receipt_status_datetime = receipt.creation_datetime?datetime(rfx_date_format_default)?iso_utc /> +<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) /> + [ { "Header": { diff --git a/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl b/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl deleted file mode 100644 index 503df5e..0000000 --- a/RFXtoRP_HsrReciptList_ExecutionflowCancelled.ftl +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}" - }, - "Payload": { - } - } -] From d050ade2b9e5f37e87d04dfa2187d86d8cb9eabc Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 6 Sep 2023 16:43:31 +0200 Subject: [PATCH 22/68] Addition of example in SK inclusions --- ...ckLs_StockSnapshotted_SegmentationKeys.ftl | 44 +++++++++++----- ...IpgMove_GoodsReceived_SegmentationKeys.ftl | 49 +++++++++++------- ...HsaIpgMove_StockMoved_SegmentationKeys.ftl | 51 +++++++++++-------- ...srPrepa_GoodsPrepared_SegmentationKeys.ftl | 49 ++++++++++++------ RFXtoRP_HsrPro.ftl | 9 ---- ...utionflowDetected_LineSegmentationKeys.ftl | 33 ++++++------ ...utionflowDetected_LineSegmentationKeys.ftl | 48 ++++++++++++----- 7 files changed, 180 insertions(+), 103 deletions(-) diff --git a/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl b/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl index 34ef750..a26d58e 100644 --- a/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl +++ b/RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl @@ -1,24 +1,42 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HfDtlStockLs to find Reflex WMS fields names --> -<#--"SegmentationKeys": [ - { +<#-- + +"SegmentationKeys": [ + { + "Key": "Grade", + "Value": { "String" : "${stock.grade_code}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${stock.owner_code}"} + }, + { "Key": "BatchNumber", <#if stock.batch_1 == ""> "Value": { "String" : "no batch"} <#else> "Value": { "String" : "${stock.batch_1}"} - + }, - { - "Key": "Grade", - "Value": { "String" : "${SegmentationKeys_KV[stock.grade_code]!Default_Value_Grade_SegmentationKey}"} + { + "Key": "HeldForSpecificCode", + "Value": { "Bool" : "${stock.held_for_specific_code}"} }, - { - "Key": "Owner", - "Value": { "String" : "${stock.owner_code}"} - } - ], - + + { + <#assign manufacturing_datetime = RfxDateTimetoUTC(stock.Date_of_manufacture,time_zone_offset_rfx) /> + "Key": "ManufacturingDate", + "Value": "Timestamp": { + "AuthorTimeZone": "${time_zone_rfx}", + "DateTime": "${manufacturing_datetime}" + } + } + ] --> + + + + + "SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl index 78816d5..bee18d4 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl @@ -1,24 +1,39 @@ <#-- use protobuf of class HsaIpgMove to find Reflex WMS fields names --> -<#--"SegmentationKeys": - [ - { - "Key": "Grade", - "Value": {"String": "${reflexMvtStockInterface.grade_code}"} - }, - { - "Key": "Owner", - "Value": {"String": "${reflexMvtStockInterface.owner_code}"} - }, - { - "Key": "BatchNumber", - <#if reflexMvtStockInterface.batch_1 == ""> +<#-- + + +"SegmentationKeys": [ + { + "Key": "Grade", + "Value": { "String" : "${reflexMvtStockInterface.grade_code}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${reflexMvtStockInterface.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> "Value": { "String" : "no batch"} - <#else> + <#else> "Value": { "String" : "${reflexMvtStockInterface.batch_1}"} - - } - ], + + }, + { + "Key": "HeldForSpecificCode", + "Value": { "Bool" : "${reflexMvtStockInterface.ipg_specific_code_held}"} + }, + + { + <#assign manufacturing_date = reflexMvtStockInterface.manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + "Key": "ManufacturingDate", + "Value": "Timestamp": { + "AuthorTimeZone": "${time_zone_rfx}", + "DateTime": "${manufacturing_date}" + } + } + ] --> "SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl b/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl index 8079043..efb4f7b 100644 --- a/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl +++ b/RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl @@ -1,25 +1,36 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsaIpgMove to find Reflex WMS fields names --> - -<#--"SegmentationKeys": - [ - { - "Key": "Grade", - "Value": {"String": "${reflexMvtStockInterface.grade_code}"} - }, - { - "Key": "Owner", - "Value": {"String": "${reflexMvtStockInterface.owner_code}"} - }, - { - "Key": "BatchNumber", - <#if reflexMvtStockInterface.batch_1 == ""> +<#-- +"SegmentationKeys": [ + { + "Key": "Grade", + "Value": { "String" : "${reflexMvtStockInterface.grade_code}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${reflexMvtStockInterface.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> "Value": { "String" : "no batch"} - <#else> + <#else> "Value": { "String" : "${reflexMvtStockInterface.batch_1}"} - - } - ], + + }, + { + "Key": "HeldForSpecificCode", + "Value": { "Bool" : "${reflexMvtStockInterface.ipg_specific_code_held}"} + }, + + { + <#assign manufacturing_date = reflexMvtStockInterface.manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + "Key": "ManufacturingDate", + "Value": "Timestamp": { + "AuthorTimeZone": "${time_zone_rfx}", + "DateTime": "${manufacturing_date}" + } + } + ] --> -"SegmentationKeys": [ ], \ No newline at end of file +"SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl index 6f43935..e3a46d3 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl @@ -1,24 +1,41 @@ <#-- use protobuf of class Hsrprepa to find Reflex WMS fields names --> - <#-- -"SegmentationKeys" :[ - { - "Key": "BatchNumber", - <#if despatched_ipg.batch_number == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${despatched_ipg.batch_number}"} - - }, +"SegmentationKeys": [ { - "Key": "Grade", - "Value": { "String" : "${preparation_line.grade_code}"} + "Key": "Grade", + "Value": { "String" : "${preparation_line.grade_code}"} }, - { - "Key": "Owner", - "Value": { "String" : "${preparation_line.owner_code}"} - } + { + "Key": "Owner", + "Value": { "String" : "${preparation_line.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${despatched_ipg.batch_number}"} + + }, + { + "Key": "HeldForSpecificCode", + <#if despatched_ipg.ipg_held == "true"> + "Value": { "Bool" : "True"} + <#else> + "Value": { "Bool" : "False"} + }, + + { + <#assign manufacturing_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + "Key": "ManufacturingDate", + "Value": "Timestamp": { + "AuthorTimeZone": "${time_zone_rfx}", + "DateTime": "${manufacturing_date}" + } + } ] + + --> "SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index 4b6ef39..b8b998a 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -27,15 +27,6 @@ "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> - - <#-- preparation expected a prendre en compte dans le connecteur - , - - <#assign apiReflexPlatformID = ApiReflexPlatformID.TransportExpected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPro_PreparationExpected.ftl"> - --> <#-- Preparation order confirmed --> <#else> diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl index 6482f78..eec0805 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl @@ -1,20 +1,23 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsrPro to find Reflex WMS fields names --> - <#-- -"SegmentationKeys": [ { - "Key": "BatchNumber", - <#if line.batch_1 == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${line.batch_1}"} - - }, - { - "Key": "Grade", - "Value": { "String" : "${SegmentationKeys_KV[line.grade_code_to_prepare]!Default_Value_Grade_SegmentationKey}"} - } - ] +"SegmentationKeys": [ + { + "Key": "Grade", + "Value": { "String" : "${line.grade_code_to_prepare}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${line.owner_code_to_prepare}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line.batch_1}"} + + } + ] --> "SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl index ef2e808..2282e33 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl @@ -1,19 +1,41 @@ <#-- use protobuf of class HsrReceiptList to find Reflex WMS fields names --> <#-- -"SegmentationKeys": [ { - "Key": "BatchNumber", - <#if line.batch_1 == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${line.batch_1}"} - - }, - { - "Key": "Grade", - "Value": { "String" : "${line.grade_code_to_prepare} - } - ] +"SegmentationKeys": [ + { + "Key": "Grade", + "Value": { "String" : "${line.grade_code}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${line.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line_without_detail.batch_1}"} + + }, + { + "Key": "HeldForSpecificCode", + <#if line_without_detail.hold_for_specific_code == "true"> + "Value": { "Bool" : "True"} + <#else> + "Value": { "Bool" : "False"} + }, + + { + <#assign manufacturing_date = line_without_detail.ipg_date_of_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + "Key": "ManufacturingDate", + "Value": "Timestamp": { + "AuthorTimeZone": "${time_zone_rfx}", + "DateTime": "${manufacturing_date}" + } + } + + ] --> "SegmentationKeys": [ ] \ No newline at end of file From 77436cce0788d12bdcc313c1ae2bdd1160ae237b Mon Sep 17 00:00:00 2001 From: frea Date: Thu, 7 Sep 2023 10:23:04 +0200 Subject: [PATCH 23/68] =?UTF-8?q?add=20fichier=20sur=20les=20familles=20p?= =?UTF-8?q?=C3=A9remption.ftl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ExpiryGroupList.ftl | 4 ++++ RFXtoRP_HfExpGrpList.ftl | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ExpiryGroupList.ftl create mode 100644 RFXtoRP_HfExpGrpList.ftl diff --git a/ExpiryGroupList.ftl b/ExpiryGroupList.ftl new file mode 100644 index 0000000..79fffe8 --- /dev/null +++ b/ExpiryGroupList.ftl @@ -0,0 +1,4 @@ +<#assign ExpiryGroupList = {}/> +<#assign ExpiryGroupList64 = ""/> + + \ No newline at end of file diff --git a/RFXtoRP_HfExpGrpList.ftl b/RFXtoRP_HfExpGrpList.ftl new file mode 100644 index 0000000..4c31349 --- /dev/null +++ b/RFXtoRP_HfExpGrpList.ftl @@ -0,0 +1,28 @@ +<#-- *********************************************** Parameter global ******************** --> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> +<#include "ExpiryGroupList.ftl"> +<#assign aDateTime = .now> + + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#case "D"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign file = JsonUtil.jsonToMap(dataRfx)> + + <#assign temp = ExpiryGroupList64> + <#list file.expiry_group_list as expiry_group> + <#assign temp = JsonUtil.update(temp,cloudEventMsg.action,expiry_group.exipiry_group_code,expiry_group.priority_date_type_code)> + + <#assign output = JsonUtil.print(temp)> +${output} + <#break> + + <#default> + <#stop> + + From dc46aed1009fcda4219ce3d1f6207f480228c5bb Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 7 Sep 2023 14:22:46 +0200 Subject: [PATCH 24/68] Metadata inclusion uniformisation --- RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl | 1 - RFXtoRP_HsaCons_ActorCreated.ftl | 2 +- RFXtoRP_HsaCons_ActorCreated_Metadata.ftl | 3 +-- RFXtoRP_HsaIpgMove_StockMoved.ftl | 2 +- RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl | 2 +- RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl | 2 +- RFXtoRP_HsaItm_ItemCreated.ftl | 12 +++++------- RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl | 3 +-- ...RP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl | 3 +-- RFXtoRP_HsaSup_ActorCreated.ftl | 2 +- RFXtoRP_HsaSup_ActorCreated_Metadata.ftl | 3 +-- RFXtoRP_HsrDepot_ActorCreated.ftl | 2 +- RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl | 3 +-- RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 4 ++-- ...P_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl | 3 +-- ...oRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl | 3 +-- RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl | 4 ++-- ...eiptList_ExecutionflowDetected_HeaderMetadata.ftl | 2 +- ...eceiptList_ExecutionflowDetected_LineMetadata.ftl | 2 +- 19 files changed, 24 insertions(+), 34 deletions(-) diff --git a/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl b/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl index 7c35b0f..f013ed3 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl @@ -1,4 +1,3 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsaCarrier to find Reflex WMS fields names --> diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index 788df93..2d495e8 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -15,7 +15,7 @@ <#-- "PartnerID": "${}", --> <#-- - <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl"> + <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">, --> diff --git a/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl b/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl index 8bdbc3e..19decec 100644 --- a/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl +++ b/RFXtoRP_HsaCons_ActorCreated_Metadata.ftl @@ -1,5 +1,4 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsaCons to find Reflex WMS fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaIpgMove_StockMoved.ftl b/RFXtoRP_HsaIpgMove_StockMoved.ftl index 089a70a..1735316 100644 --- a/RFXtoRP_HsaIpgMove_StockMoved.ftl +++ b/RFXtoRP_HsaIpgMove_StockMoved.ftl @@ -27,7 +27,7 @@ "PriorityDate": "${ipg_priority_datetime}", <#-- Segmentation keys inclusions --> - <#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl"> + <#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl">, "LVBranchID": "${reflexMvtStockInterface.lv_code}" diff --git a/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl b/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl index 229a89b..1385a6e 100644 --- a/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl +++ b/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl @@ -24,7 +24,7 @@ <#-- LV Metadata inclusion --> - <#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl"> + <#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl">, "IsBaseLogisticVariant": ${lv.base_lv}, diff --git a/RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl b/RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl index e3dddf3..72f7aa3 100644 --- a/RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl +++ b/RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl @@ -1,4 +1,4 @@ <#-- use protobuf of class HsaItmLv to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index f338745..c6dd4ef 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -22,7 +22,7 @@ }, <#-- Item metadata inclusion --> - <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl"> + <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">, <#-- Item Photo URI could be added here --> <#--"PhotoURI": " ", --> @@ -33,11 +33,11 @@ <#list item.logistical_variant_list as logistical_variant> { - "LVID": "${logistical_variant.logistical_variant_code}", + "LVID": "${logistical_variant.logistical_variant_code}", "Name" : "${logistical_variant.lv_type_code}", <#if logistical_variant.id_list??> - "Codes": [ + "Codes": [ <#list logistical_variant.id_list as id> { "Key": "${id.logistical_variant_ID_type_code}", @@ -47,10 +47,8 @@ ], - <#-- LV Metadata inclusion --> - <#if logistical_variant.additional_data_value_list??> - <#include "RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl"> - + <#-- LV Metadata inclusion --> + <#include "RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl">, "IsBaseLogisticVariant": ${logistical_variant.base_lv}, diff --git a/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl b/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl index 566f271..881c81c 100644 --- a/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl +++ b/RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl @@ -1,5 +1,4 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsaItm to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl b/RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl index c26c9f5..49607a6 100644 --- a/RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl +++ b/RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl @@ -1,5 +1,4 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsaItm to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index 700cd05..55252cf 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -15,7 +15,7 @@ <#-- "PartnerID": "${}", --> <#-- - <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl"> + <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl">, --> "Address": diff --git a/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl b/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl index 82b66d8..770bf64 100644 --- a/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl +++ b/RFXtoRP_HsaSup_ActorCreated_Metadata.ftl @@ -1,5 +1,4 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsaSup to find Reflex WMS fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index 6971aaa..9421a12 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -15,7 +15,7 @@ <#-- "PartnerID": "${}", --> <#-- - <#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl"> + <#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl">, --> "Address": diff --git a/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl b/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl index bf694c2..68c665e 100644 --- a/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl @@ -1,5 +1,4 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsrDepot to find Reflex WMS fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index c983001..e38b479 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -20,7 +20,7 @@ "AuthorTimeZone": "${time_zone_rfx}" }, <#-- Header Metadata inclusion --> - <#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl"> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl">, "ShipFrom": { "ActorID": "${order.physical_depot_code}" @@ -65,7 +65,7 @@ "LineID": "${line.preparation_order_line_number!0}", <#-- Line Metadata inclusion --> - <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl"> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl">, "RequestedContent": { diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl index 854f86d..125bbd5 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl @@ -1,4 +1,3 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsrPro to find Reflex Wms fields names --> <#-- @@ -12,4 +11,4 @@ --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl index 1b3d04d..8dc79af 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl @@ -1,5 +1,4 @@ -<#-- **** file included in RFXtoRP_HsaItm_ItemCreated.ftl ***** --> <#-- use protobuf of class HsrPro to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index 2531f21..ba8c19c 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -21,7 +21,7 @@ }, <#-- Header Metadata inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl"> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl">, "ShipFrom": { @@ -44,7 +44,7 @@ { "LineID": "${line.receipt_line_number}", <#-- Line Metadata inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl"> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, "RequestedContent": { "Goods": diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl index de365c0..301e1e2 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl @@ -11,4 +11,4 @@ --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl index 028dff1..de873ff 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl @@ -1,4 +1,4 @@ <#-- use protobuf of class HsrReceiptList to find Reflex Wms fields names --> -"MetaData": [ ], \ No newline at end of file +"MetaData": [ ] \ No newline at end of file From fa0766b00ab751facf8b7cd171a429ec8b890178 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 7 Sep 2023 14:59:06 +0200 Subject: [PATCH 25/68] Expiry group management --- RFXtoRP_HfExpGrpList.ftl | 6 +++--- RFXtoRP_HsaItm_ItemCreated.ftl | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/RFXtoRP_HfExpGrpList.ftl b/RFXtoRP_HfExpGrpList.ftl index 4c31349..cece3f9 100644 --- a/RFXtoRP_HfExpGrpList.ftl +++ b/RFXtoRP_HfExpGrpList.ftl @@ -4,19 +4,20 @@ <#assign organisationRP = organisation> <#include "ExpiryGroupList.ftl"> <#assign aDateTime = .now> +<#assign Date_Tye_Code_KV = {"010":"PRODUCTION_DATE","020":"PRODUCTION_DATE","030":"BEST_BEFORE_DATE","040":"SELL_BY_DATE","050":"USE_BY_DATE"} > <#switch cloudEventMsg.action> <#case "C"> <#case "U"> <#case "D"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#-- *********************************************** Action = CREATE or UPDATE or DELETE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign file = JsonUtil.jsonToMap(dataRfx)> <#assign temp = ExpiryGroupList64> <#list file.expiry_group_list as expiry_group> - <#assign temp = JsonUtil.update(temp,cloudEventMsg.action,expiry_group.exipiry_group_code,expiry_group.priority_date_type_code)> + <#assign temp = JsonUtil.update(temp,cloudEventMsg.action,expiry_group.exipiry_group_code,Date_Tye_Code_KV[expiry_group.priority_date_type_code])> <#assign output = JsonUtil.print(temp)> ${output} @@ -25,4 +26,3 @@ ${output} <#default> <#stop> - diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index c6dd4ef..48727ea 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -1,4 +1,5 @@ <#include "HfRpConfig.ftl"> +<#include "HfExpGrpList"> [ { "Header": { @@ -9,23 +10,21 @@ }, "Payload": { "DescriptionsByLanguage": [{ - "ShortDescription": "${item.short_designation?json_string}", - "LongDescription": "${item.designation?json_string}", - "TechnicalDetails": "${item.item_description?json_string}", - "LanguageCodeISO6391": "${text_language_rfx}" - } - ], -<#-- /!\ table de correspondance à faire disparaitre /!\ --> - <#assign ExpiryConstraint = {"REC":"PRODUCTION_DATE", "DDM":"BEST_BEFORE_DATE", "DLC":"USE_BY_DATE"}/> + "ShortDescription": "${item.short_designation?json_string}", + "LongDescription": "${item.designation?json_string}", + "TechnicalDetails": "${item.item_description?json_string}", + "LanguageCodeISO6391": "${text_language_rfx}" + } + ], "ExpiryConstraint": { - "Type": "${ExpiryConstraint[item.expiry_group_code]!"UNKNOWN_DATE"}" - }, + "Type": "${ExpiryGroupList[item.expiry_group_code]!"UNKNOWN_DATE"}" + }, <#-- Item metadata inclusion --> - <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">, + <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">, - <#-- Item Photo URI could be added here --> - <#--"PhotoURI": " ", --> + <#-- Item Photo URI could be added here --> + <#--"PhotoURI": " ", --> <#-- Loop for the Logistical Variants - LV --> <#if item.logistical_variant_list??> From 31b007120a0029bf99b894a3e5a977ff3ae78aeb Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 7 Sep 2023 15:04:02 +0200 Subject: [PATCH 26/68] Expiry group --- ExpiryGroupList.ftl => HfExpGrpList.ftl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ExpiryGroupList.ftl => HfExpGrpList.ftl (100%) diff --git a/ExpiryGroupList.ftl b/HfExpGrpList.ftl similarity index 100% rename from ExpiryGroupList.ftl rename to HfExpGrpList.ftl From cd858cab4fde50efb1f69a627cafbb3a3a2dacd4 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 7 Sep 2023 16:23:29 +0200 Subject: [PATCH 27/68] changement de statut uniquement sur HsrProStatus --- RFXtoRP_HsaProStatus.ftl | 2 +- RFXtoRP_HsrPrepa.ftl | 8 +------- RFXtoRP_HsrPrepa_TransportStarted.ftl | 24 ------------------------ RFXtoRP_HsrPro.ftl | 17 +++++------------ RFXtoRP_HsrPro_PreparationCompleted.ftl | 20 -------------------- RFXtoRP_HsrReceiptList.ftl | 6 +++++- 6 files changed, 12 insertions(+), 65 deletions(-) delete mode 100644 RFXtoRP_HsrPrepa_TransportStarted.ftl delete mode 100644 RFXtoRP_HsrPro_PreparationCompleted.ftl diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl index 4d85b39..974cfe3 100644 --- a/RFXtoRP_HsaProStatus.ftl +++ b/RFXtoRP_HsaProStatus.ftl @@ -39,7 +39,7 @@ <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> } <#else> - <#-- **Preparation to package (500) and preparationcompleted (550)** --> + <#-- **Preparation to package (500) and preparation completed (550)** --> <#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "500" || preparationStatusInterface.preparation_status_code == "550")> diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index cb84d59..9ed9935 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -27,13 +27,7 @@ "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_TransportStarted.ftl"> - } + } ] <#break> diff --git a/RFXtoRP_HsrPrepa_TransportStarted.ftl b/RFXtoRP_HsrPrepa_TransportStarted.ftl deleted file mode 100644 index 6075737..0000000 --- a/RFXtoRP_HsrPrepa_TransportStarted.ftl +++ /dev/null @@ -1,24 +0,0 @@ -<#include "HfRpConfig.ftl"> -<#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) /> -[ - <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${preparation_line.preparation_order_originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } - <#sep>, - -] - diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index b8b998a..b073207 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -19,26 +19,19 @@ { <#-- check preparation type code (internal order and reservation are ignored) --> <#if order.preparation_type_code == "010" || - order.preparation_type_code == "030"> + order.preparation_type_code == "030"> - <#-- Preparation order not confirmed --> + <#-- Only if preparation order not confirmed --> <#if order.preparation_order_confirmed == "false" > <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> - - <#-- Preparation order confirmed --> - <#else> - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPro_PreparationCompleted.ftl"> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> + <#else> <#stop "preparation type not supported"> - - + } ] diff --git a/RFXtoRP_HsrPro_PreparationCompleted.ftl b/RFXtoRP_HsrPro_PreparationCompleted.ftl deleted file mode 100644 index 4cfb270..0000000 --- a/RFXtoRP_HsrPro_PreparationCompleted.ftl +++ /dev/null @@ -1,20 +0,0 @@ -<#include "HfRpConfig.ftl"> -<#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = RfxDateTimetoUTC(order.confirmation_datetime,time_zone_offset_rfx) /> -[ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } -] diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 4ff1cb1..4932a33 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -49,7 +49,10 @@ "datas" : <#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> } - <#else> + <#else> + <#if receipt.receipt_type = "030"> + <#stop "ignored message because receipt type = transfert"> + <#else> { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> "apiReflexPlatformID" : "${apiReflexPlatformID}", @@ -64,6 +67,7 @@ } + ] <#break> From f367a57df76a430dffd76b9e4af1f6e406b8f7be Mon Sep 17 00:00:00 2001 From: frea Date: Fri, 8 Sep 2023 10:35:39 +0200 Subject: [PATCH 28/68] correction sur l'include de HfExpGrpList.ftl --- RFXtoRP_HfExpGrpList.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HfExpGrpList.ftl b/RFXtoRP_HfExpGrpList.ftl index cece3f9..08e4a69 100644 --- a/RFXtoRP_HfExpGrpList.ftl +++ b/RFXtoRP_HfExpGrpList.ftl @@ -2,7 +2,7 @@ <#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> -<#include "ExpiryGroupList.ftl"> +<#include "HfExpGrpList.ftl"> <#assign aDateTime = .now> <#assign Date_Tye_Code_KV = {"010":"PRODUCTION_DATE","020":"PRODUCTION_DATE","030":"BEST_BEFORE_DATE","040":"SELL_BY_DATE","050":"USE_BY_DATE"} > From f368a82c3e011cbd7fc4275d151ac11e03f4703d Mon Sep 17 00:00:00 2001 From: frea Date: Fri, 8 Sep 2023 10:57:59 +0200 Subject: [PATCH 29/68] correction sur l'include du fichier HfExpGrpList.ftl --- RFXtoRP_HsaItm_ItemCreated.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index 48727ea..f38c95d 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -1,5 +1,5 @@ <#include "HfRpConfig.ftl"> -<#include "HfExpGrpList"> +<#include "HfExpGrpList.ftl"> [ { "Header": { From fa5f0d5292bd378ec6d72ee5acfca68d63f1ddc9 Mon Sep 17 00:00:00 2001 From: frea Date: Fri, 8 Sep 2023 11:38:22 +0200 Subject: [PATCH 30/68] faute d'orthographe --- RFXtoRP_HsaIpgMove.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsaIpgMove.ftl b/RFXtoRP_HsaIpgMove.ftl index 1969f5a..5fb123e 100644 --- a/RFXtoRP_HsaIpgMove.ftl +++ b/RFXtoRP_HsaIpgMove.ftl @@ -59,7 +59,7 @@ <#else> <#-- cases of an IPG move with quantity = 0 (weight modification))--> - <#stop "move ingored quantity = 0"> + <#stop "move ignored quantity = 0"> <#break> From 539af352d87b30b86afbe454a27c2db2017fedd3 Mon Sep 17 00:00:00 2001 From: frea Date: Fri, 8 Sep 2023 11:48:06 +0200 Subject: [PATCH 31/68] correction sur le champ Metadata en MetaData --- RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl index 50b6569..22d1c4d 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl @@ -1,9 +1,9 @@ <#-- use protobuf of class HsrPrepa to find Reflex WMS fields names --> <#-- -"Metadata" :[ +"MetaData" :[ ] --> -"Metadata": [ ] \ No newline at end of file +"MetaData": [ ] \ No newline at end of file From 2987c33610176c24587718ef749b6bd943fc2d09 Mon Sep 17 00:00:00 2001 From: frea Date: Fri, 8 Sep 2023 16:06:11 +0200 Subject: [PATCH 32/68] Correction sur une date --- RFXtoRP_HsaIpgMove_GoodsReceived.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl index 53a2efd..47662b7 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl @@ -2,8 +2,8 @@ <#include "ReflexUtils.ftl"> [ <#assign receipt_confirmation_datetime = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> - <#assign priority_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_priority_datetime,time_zone_offset_rfx) /> - { + <#assign priority_date = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> + { "Header": { "ProjectID": "${projectRP}" }, From 9c3f6cac3e6436b3f2145320e2fd75fa0a2e600e Mon Sep 17 00:00:00 2001 From: frea Date: Fri, 8 Sep 2023 16:51:31 +0200 Subject: [PATCH 33/68] test --- RFXtoRP_HsaIpgMove_GoodsReceived.ftl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl index 47662b7..ffcfd47 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl @@ -5,12 +5,11 @@ <#assign priority_date = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> { "Header": { - "ProjectID": "${projectRP}" + "ProjectID": "${projectRP}" }, "ID": { "RefID": "${reflexMvtStockInterface.hd_number}" - }, - + }, "Payload": { "ReceivedContents" :[ { From d81489d59f5d6e7564e3164a193cc9ae8c463636 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Mon, 11 Sep 2023 17:22:45 +0200 Subject: [PATCH 34/68] structured address from WMS --- RFXtoRP_HsaCarrier_ActorCreated.ftl | 28 +++++++++++++--------------- RFXtoRP_HsaCons_ActorCreated.ftl | 29 ++++++++++++----------------- RFXtoRP_HsaSup_ActorCreated.ftl | 29 ++++++++++++----------------- 3 files changed, 37 insertions(+), 49 deletions(-) diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl index 6fdcf7f..77d450d 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -18,23 +18,21 @@ <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, --> - "Address": + "Address": { - "StreetAddressOne" : "${carrier.address.address_1}", - "StreetAddressTwo" : "${carrier.address.address_2}", - - <#if carrier.address.address_3?length < 10> - "PostalCode" : "${carrier.address.address_3?trim}", - <#else> - "PostalCode" : "${carrier.address.address_3?substring(0,9)?trim}", - - <#if carrier.address.address_4?length < 14> - "CountryCode" : "" - <#else> - "CountryCode" : "${carrier.address.address_4?substring(10,13)?trim}" - + "Name": "${carrier.carrier_structured_address.name_or_company}", + "StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO}", + "StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data}", + "PostalCode" : "${carrier.carrier_structured_address.postal_code}", + "City" : "${carrier.carrier_structured_address.post_code_area_name}", + "CountryCode" : "${carrier.carrier_structured_address.country_code}", + "ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code}", + "State": "${carrier.carrier_structured_address.country_designation}" }, - "Typology": "TYPOLOGY_CARRIER" + "Phones": ["${carrier.address.telephone}", + "${carrier.address.other_number}" + ], + "Typology": "TYPOLOGY_CARRIER" } } ] diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index 2d495e8..7acf9f1 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -18,26 +18,21 @@ <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">, --> - "Address": { - <#if actor.address.address_3?length > 10> - "City" : "${actor.address.address_3?substring(10)?trim}", - - "StreetAddressOne" : "${actor.address.address_1}", - "StreetAddressTwo" : "${actor.address.address_2}", - <#if actor.address.address_3?length < 10> - "PostalCode" : "${actor.address.address_3?trim}", - <#else> - "PostalCode" : "${actor.address.address_3?substring(0,9)?trim}", - - <#if actor.address.address_4?length < 14> - "CountryCode" : "" - <#else> - "CountryCode" : "${actor.address.address_4?substring(10,13)?trim}" - + "Name": "${actor.consignee_structured_address.name_or_company}", + "StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO}", + "StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data}", + "PostalCode" : "${actor.consignee_structured_address.postal_code}", + "City" : "${actor.consignee_structured_address.post_code_area_name}", + "CountryCode" : "${actor.consignee_structured_address.country_code}", + "ProvinceCode": "${actor.consignee_structured_address.territorial_div_code}", + "State": "${actor.consignee_structured_address.country_designation}" }, - "Typology": "TYPOLOGY_UNKNOWN" + "Phones": ["${actor.address.telephone}", + "${actor.address.other_number}" + ], + "Typology": "TYPOLOGY_UNKNOWN" } } ] diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index 55252cf..2b5e4d3 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -18,25 +18,20 @@ <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl">, --> - "Address": + "Address": { - <#if actor.optional_attributes.address_3?length > 10> - "City" : "${actor.optional_attributes.address_3?substring(10)?trim}", - - "StreetAddressOne" : "${actor.optional_attributes.address_1}", - "StreetAddressTwo" : "${actor.optional_attributes.address_2}", - - <#if actor.optional_attributes.address_3?length < 10> - "PostalCode" : "${actor.optional_attributes.address_3?trim}", - <#else> - "PostalCode" : "${actor.optional_attributes.address_3?substring(0,9)?trim}", - - <#if actor.optional_attributes.address_4?length < 14> - "CountryCode" : "" - <#else> - "CountryCode" : "${actor.optional_attributes.address_4?substring(10,13)?trim}" - + "Name": "${actor.supplier_structured_address.name_or_company}", + "StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO}", + "StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data}", + "PostalCode" : "${actor.supplier_structured_address.postal_code}", + "City" : "${actor.supplier_structured_address.post_code_area_name}", + "CountryCode" : "${actor.supplier_structured_address.country_code}", + "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code}", + "State": "${actor.supplier_structured_address.country_designation}" }, + "Phones": ["${actor.optional_attributes.telephone}", + "${actor.optional_attributes.other_number}" + ], "Typology": "TYPOLOGY_UNKNOWN" } } From da3692787489e536e5c7ab14118c41b955e9ddb5 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 13 Sep 2023 12:06:06 +0200 Subject: [PATCH 35/68] structured adress on actors --- RFXtoRP_HsaCarrier_ActorCreated.ftl | 33 ++++++++++++++++-------- RFXtoRP_HsaCons_ActorCreated.ftl | 31 +++++++++++++++++------ RFXtoRP_HsaSup_ActorCreated.ftl | 28 +++++++++++++++------ RFXtoRP_HsrDepot_ActorCreated.ftl | 39 ++++++++++++++++++----------- 4 files changed, 91 insertions(+), 40 deletions(-) diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl index 77d450d..3ec3bc5 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -17,19 +17,32 @@ <#-- <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, --> - + + "Address": { - "Name": "${carrier.carrier_structured_address.name_or_company}", - "StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO}", - "StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data}", - "PostalCode" : "${carrier.carrier_structured_address.postal_code}", - "City" : "${carrier.carrier_structured_address.post_code_area_name}", - "CountryCode" : "${carrier.carrier_structured_address.country_code}", - "ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code}", - "State": "${carrier.carrier_structured_address.country_designation}" + <#-- if Reflex WMS address is structured --> + <#if carrier.carrier_structured_address?? > + + "Name": "${carrier.carrier_structured_address.name_or_company}", + "StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO}", + "StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data}", + "PostalCode" : "${carrier.carrier_structured_address.postal_code}", + "City" : "${carrier.carrier_structured_address.post_code_area_name}", + "CountryCode" : "${carrier.carrier_structured_address.country_code}", + "ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code}", + "State": "${carrier.carrier_structured_address.country_designation}" + + <#-- if Reflex WMS address is not structured --> + <#else> + "Name": "${carrier.address.company_name}", + "StreetAddressOne" : "${carrier.address.address_1}", + "StreetAddressTwo" : "${carrier.address.address_2}", + "StreetAddressThree" : "${carrier.address.address_3}" + }, - "Phones": ["${carrier.address.telephone}", + + "Phones": ["${carrier.address.telephone}", "${carrier.address.other_number}" ], "Typology": "TYPOLOGY_CARRIER" diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index 7acf9f1..6186125 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -17,9 +17,13 @@ <#-- <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">, --> + + "Address": + { + + <#-- if Reflex WMS is structured --> + <#if actor.consignee_structured_address??> - "Address": - { "Name": "${actor.consignee_structured_address.name_or_company}", "StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO}", "StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data}", @@ -27,12 +31,23 @@ "City" : "${actor.consignee_structured_address.post_code_area_name}", "CountryCode" : "${actor.consignee_structured_address.country_code}", "ProvinceCode": "${actor.consignee_structured_address.territorial_div_code}", - "State": "${actor.consignee_structured_address.country_designation}" - }, - "Phones": ["${actor.address.telephone}", - "${actor.address.other_number}" - ], - "Typology": "TYPOLOGY_UNKNOWN" + "State": "${actor.consignee_structured_address.country_designation}" + + <#-- if Reflex WMS is not structured --> + <#else> + + "Name": "${actor.address.company_name}", + "StreetAddressOne" : "${actor.address.address_1}", + "StreetAddressTwo" : "${actor.address.address_2}", + "StreetAddressThree" : "${actor.address.address_3}", + + + }, + + "Phones": ["${actor.address.telephone}", + "${actor.address.other_number}" + ], + "Typology": "TYPOLOGY_UNKNOWN" } } ] diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index 2b5e4d3..65a8315 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -20,14 +20,26 @@ "Address": { - "Name": "${actor.supplier_structured_address.name_or_company}", - "StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO}", - "StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data}", - "PostalCode" : "${actor.supplier_structured_address.postal_code}", - "City" : "${actor.supplier_structured_address.post_code_area_name}", - "CountryCode" : "${actor.supplier_structured_address.country_code}", - "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code}", - "State": "${actor.supplier_structured_address.country_designation}" + <#-- if Reflex WMS address is structured --> + <#if actor.supplier_structured_address?? > + + "Name": "${actor.supplier_structured_address.name_or_company}", + "StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO}", + "StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data}", + "PostalCode" : "${actor.supplier_structured_address.postal_code}", + "City" : "${actor.supplier_structured_address.post_code_area_name}", + "CountryCode" : "${actor.supplier_structured_address.country_code}", + "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code}", + "State": "${actor.supplier_structured_address.country_designation}" + + <#-- if Reflex WMS address is not structured --> + <#else> + "Name": "${actor.optional_attributes.company_name}", + "StreetAddressOne" : "${actor.optional_attributes.address_1}", + "StreetAddressTwo" : "${actor.optional_attributes.address_2}", + "StreetAddressThree" : "${actor.optional_attributes.address_3}" + + }, "Phones": ["${actor.optional_attributes.telephone}", "${actor.optional_attributes.other_number}" diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index 9421a12..ca4bd63 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -18,22 +18,33 @@ <#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl">, --> - "Address": + "Address": { - "StreetAddressOne" : "${depot.physical_depot_address.address_1}", - "StreetAddressTwo" : "${depot.physical_depot_address.address_2}", + <#-- if Reflex WMS address is structured --> + <#if depot.physical_depot_structured_address?? > - <#if depot.physical_depot_address.address_3?length < 10> - "PostalCode" : "${depot.physical_depot_address.address_3?trim}", - <#else> - "PostalCode" : "${depot.physical_depot_address.address_3?substring(0,9)?trim}", - - <#if depot.physical_depot_address.address_4?length < 14> - "CountryCode" : "" - <#else> - "CountryCode" : "${depot.physical_depot_address.address_4?substring(10,13)?trim}" - - } + "Name": "${depot.physical_depot_structured_address.name_or_company}", + "StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO}", + "StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data}", + "PostalCode" : "${depot.physical_depot_structured_address.postal_code}", + "City" : "${depot.physical_depot_structured_address.post_code_area_name}", + "CountryCode" : "${depot.physical_depot_structured_address.country_code}", + "ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code}", + "State": "${depot.physical_depot_structured_address.country_designation}" + + <#-- if Reflex WMS address is not structured --> + <#else> + "Name": "${depot.physical-depot_address.company_name}", + "StreetAddressOne" : "${depot.physical-depot_address.address_1}", + "StreetAddressTwo" : "${depot.physical-depot_address.address_2}", + "StreetAddressThree" : "${depot.physical-depot_address.address_3}" + + + }, + "Phones": ["${depot.physical-depot_address.telephone}", + "${depot.physical-depot_address.other_number}" + ], + "Typology": "TYPOLOGY_UNKNOWN" } } ] From ff08a73ffadcb28e3b1d0750860b7db0c655f143 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 13 Sep 2023 16:28:04 +0200 Subject: [PATCH 36/68] correction in depot created --- RFXtoRP_HsrDepot_ActorCreated.ftl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index ca4bd63..98fef20 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -26,7 +26,7 @@ "Name": "${depot.physical_depot_structured_address.name_or_company}", "StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO}", "StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data}", - "PostalCode" : "${depot.physical_depot_structured_address.postal_code}", + "PostalCode" : "${depot.physical_depot_structured_address.postal_code}", "City" : "${depot.physical_depot_structured_address.post_code_area_name}", "CountryCode" : "${depot.physical_depot_structured_address.country_code}", "ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code}", @@ -34,15 +34,15 @@ <#-- if Reflex WMS address is not structured --> <#else> - "Name": "${depot.physical-depot_address.company_name}", - "StreetAddressOne" : "${depot.physical-depot_address.address_1}", - "StreetAddressTwo" : "${depot.physical-depot_address.address_2}", - "StreetAddressThree" : "${depot.physical-depot_address.address_3}" + "Name": "${depot.physical_depot_address.company_name}", + "StreetAddressOne" : "${depot.physical_depot_address.address_1}", + "StreetAddressTwo" : "${depot.physical_depot_address.address_2}", + "StreetAddressThree" : "${depot.physical_depot_address.address_3}" }, - "Phones": ["${depot.physical-depot_address.telephone}", - "${depot.physical-depot_address.other_number}" + "Phones": ["${depot.physical_depot_address.telephone}", + "${depot.physical_depot_address.other_number}" ], "Typology": "TYPOLOGY_UNKNOWN" } From 44d0155835866ded52d52b0a55546ff7df7c6995 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 14 Sep 2023 11:36:47 +0200 Subject: [PATCH 37/68] correction on addresses --- RFXtoRP_HsaCons_ActorCreated.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index 6186125..64bee0d 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -39,7 +39,7 @@ "Name": "${actor.address.company_name}", "StreetAddressOne" : "${actor.address.address_1}", "StreetAddressTwo" : "${actor.address.address_2}", - "StreetAddressThree" : "${actor.address.address_3}", + "StreetAddressThree" : "${actor.address.address_3}" }, From 02e7b8b4c3817d06e000f52b9e35b3f1011bf275 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 14 Sep 2023 16:44:36 +0200 Subject: [PATCH 38/68] correction --- RFXtoRP_HsrPro.ftl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index b073207..3b2e00c 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -18,8 +18,7 @@ [ { <#-- check preparation type code (internal order and reservation are ignored) --> - <#if order.preparation_type_code == "010" || - order.preparation_type_code == "030"> + <#if order.preparation_type_code == "010" || order.preparation_type_code == "030"> <#-- Only if preparation order not confirmed --> <#if order.preparation_order_confirmed == "false" > @@ -27,6 +26,8 @@ "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> + <#else> + <#stop "preparation already confirmed"> <#else> From c21d71a72ac80dbb8275b3f18fff523ea84f04c1 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 14 Sep 2023 17:39:19 +0200 Subject: [PATCH 39/68] correction messages stop --- RFXtoRP_HsrPro.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index 3b2e00c..089092a 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -27,11 +27,11 @@ "datas" : <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> <#else> - <#stop "preparation already confirmed"> + <#stop "preparation order already confirmed"> <#else> - <#stop "preparation type not supported"> + <#stop "preparation order type not supported"> } From c5dbe1f5a68fa2c24d9e56126cfe25bed81d96a8 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 19 Sep 2023 11:12:24 +0200 Subject: [PATCH 40/68] management of double quote in actors addresses --- RFXtoRP_HsaCarrier_ActorCreated.ftl | 30 ++++++++++++++--------------- RFXtoRP_HsaCons_ActorCreated.ftl | 30 ++++++++++++++--------------- RFXtoRP_HsaSup_ActorCreated.ftl | 30 ++++++++++++++--------------- RFXtoRP_HsrDepot_ActorCreated.ftl | 30 ++++++++++++++--------------- 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl index 3ec3bc5..d581b2e 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -8,7 +8,7 @@ }, "Payload": { - "Name": "${carrier.carrier_designation}", + "Name": "${carrier.carrier_designation?json_string}", "ManagedStock": false, "IsCarrier": true, <#-- ***Partner ID could be added here *** --> @@ -24,26 +24,26 @@ <#-- if Reflex WMS address is structured --> <#if carrier.carrier_structured_address?? > - "Name": "${carrier.carrier_structured_address.name_or_company}", - "StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO}", - "StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data}", - "PostalCode" : "${carrier.carrier_structured_address.postal_code}", - "City" : "${carrier.carrier_structured_address.post_code_area_name}", - "CountryCode" : "${carrier.carrier_structured_address.country_code}", - "ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code}", - "State": "${carrier.carrier_structured_address.country_designation}" + "Name": "${carrier.carrier_structured_address.name_or_company?json_string}", + "StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO?json_string}", + "StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data?json_string}", + "PostalCode" : "${carrier.carrier_structured_address.postal_code?json_string}", + "City" : "${carrier.carrier_structured_address.post_code_area_name?json_string}", + "CountryCode" : "${carrier.carrier_structured_address.country_code?json_string}", + "ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code?json_string}", + "State": "${carrier.carrier_structured_address.country_designation?json_string}" <#-- if Reflex WMS address is not structured --> <#else> - "Name": "${carrier.address.company_name}", - "StreetAddressOne" : "${carrier.address.address_1}", - "StreetAddressTwo" : "${carrier.address.address_2}", - "StreetAddressThree" : "${carrier.address.address_3}" + "Name": "${carrier.address.company_name?json_string}", + "StreetAddressOne" : "${carrier.address.address_1?json_string}", + "StreetAddressTwo" : "${carrier.address.address_2?json_string}", + "StreetAddressThree" : "${carrier.address.address_3?json_string}" }, - "Phones": ["${carrier.address.telephone}", - "${carrier.address.other_number}" + "Phones": ["${carrier.address.telephone?json_string}", + "${carrier.address.other_number?json_string}" ], "Typology": "TYPOLOGY_CARRIER" } diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index 64bee0d..8f09d9c 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -8,7 +8,7 @@ }, "Payload": { - "Name": "${actor.designation}", + "Name": "${actor.designation?json_string}", "ManagedStock": false, "IsCarrier": false, <#-- ***Partner ID could be added here *** --> @@ -24,28 +24,28 @@ <#-- if Reflex WMS is structured --> <#if actor.consignee_structured_address??> - "Name": "${actor.consignee_structured_address.name_or_company}", - "StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO}", - "StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data}", - "PostalCode" : "${actor.consignee_structured_address.postal_code}", - "City" : "${actor.consignee_structured_address.post_code_area_name}", - "CountryCode" : "${actor.consignee_structured_address.country_code}", - "ProvinceCode": "${actor.consignee_structured_address.territorial_div_code}", - "State": "${actor.consignee_structured_address.country_designation}" + "Name": "${actor.consignee_structured_address.name_or_company?json_string}", + "StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO?json_string}", + "StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data?json_string}", + "PostalCode" : "${actor.consignee_structured_address.postal_code?json_string}", + "City" : "${actor.consignee_structured_address.post_code_area_name?json_string}", + "CountryCode" : "${actor.consignee_structured_address.country_code?json_string}", + "ProvinceCode": "${actor.consignee_structured_address.territorial_div_code?json_string}", + "State": "${actor.consignee_structured_address.country_designation?json_string}" <#-- if Reflex WMS is not structured --> <#else> - "Name": "${actor.address.company_name}", - "StreetAddressOne" : "${actor.address.address_1}", - "StreetAddressTwo" : "${actor.address.address_2}", - "StreetAddressThree" : "${actor.address.address_3}" + "Name": "${actor.address.company_name?json_string}", + "StreetAddressOne" : "${actor.address.address_1?json_string}", + "StreetAddressTwo" : "${actor.address.address_2?json_string}", + "StreetAddressThree" : "${actor.address.address_3?json_string}" }, - "Phones": ["${actor.address.telephone}", - "${actor.address.other_number}" + "Phones": ["${actor.address.telephone?json_string}", + "${actor.address.other_number?json_string}" ], "Typology": "TYPOLOGY_UNKNOWN" } diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index 65a8315..a4e5d12 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -8,7 +8,7 @@ }, "Payload": { - "Name": "${actor.designation}", + "Name": "${actor.designation?json_string}", "ManagedStock": false, "IsCarrier": false, <#-- ***Partner ID could be added here *** --> @@ -23,26 +23,26 @@ <#-- if Reflex WMS address is structured --> <#if actor.supplier_structured_address?? > - "Name": "${actor.supplier_structured_address.name_or_company}", - "StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO}", - "StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data}", - "PostalCode" : "${actor.supplier_structured_address.postal_code}", - "City" : "${actor.supplier_structured_address.post_code_area_name}", - "CountryCode" : "${actor.supplier_structured_address.country_code}", - "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code}", - "State": "${actor.supplier_structured_address.country_designation}" + "Name": "${actor.supplier_structured_address.name_or_company?json_string}", + "StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO?json_string}", + "StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data?json_string}", + "PostalCode" : "${actor.supplier_structured_address.postal_code?json_string}", + "City" : "${actor.supplier_structured_address.post_code_area_name?json_string}", + "CountryCode" : "${actor.supplier_structured_address.country_code?json_string}", + "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code?json_string}", + "State": "${actor.supplier_structured_address.country_designation?json_string}" <#-- if Reflex WMS address is not structured --> <#else> - "Name": "${actor.optional_attributes.company_name}", - "StreetAddressOne" : "${actor.optional_attributes.address_1}", - "StreetAddressTwo" : "${actor.optional_attributes.address_2}", - "StreetAddressThree" : "${actor.optional_attributes.address_3}" + "Name": "${actor.optional_attributes.company_name?json_string}", + "StreetAddressOne" : "${actor.optional_attributes.address_1?json_string}", + "StreetAddressTwo" : "${actor.optional_attributes.address_2?json_string}", + "StreetAddressThree" : "${actor.optional_attributes.address_3?json_string}" }, - "Phones": ["${actor.optional_attributes.telephone}", - "${actor.optional_attributes.other_number}" + "Phones": ["${actor.optional_attributes.telephone?json_string}", + "${actor.optional_attributes.other_number?json_string}" ], "Typology": "TYPOLOGY_UNKNOWN" } diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index 98fef20..07adb7e 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -8,7 +8,7 @@ }, "Payload": { - "Name": "${depot.physical_depot_designation}", + "Name": "${depot.physical_depot_designation?json_string}", "ManagedStock": true, "IsCarrier": false, <#-- ***Partner ID could be added here *** --> @@ -23,26 +23,26 @@ <#-- if Reflex WMS address is structured --> <#if depot.physical_depot_structured_address?? > - "Name": "${depot.physical_depot_structured_address.name_or_company}", - "StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO}", - "StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data}", - "PostalCode" : "${depot.physical_depot_structured_address.postal_code}", - "City" : "${depot.physical_depot_structured_address.post_code_area_name}", - "CountryCode" : "${depot.physical_depot_structured_address.country_code}", - "ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code}", - "State": "${depot.physical_depot_structured_address.country_designation}" + "Name": "${depot.physical_depot_structured_address.name_or_company?json_string}", + "StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO?json_string}", + "StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data?json_string}", + "PostalCode" : "${depot.physical_depot_structured_address.postal_code?json_string}", + "City" : "${depot.physical_depot_structured_address.post_code_area_name?json_string}", + "CountryCode" : "${depot.physical_depot_structured_address.country_code?json_string}", + "ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code?json_string}", + "State": "${depot.physical_depot_structured_address.country_designation?json_string}" <#-- if Reflex WMS address is not structured --> <#else> - "Name": "${depot.physical_depot_address.company_name}", - "StreetAddressOne" : "${depot.physical_depot_address.address_1}", - "StreetAddressTwo" : "${depot.physical_depot_address.address_2}", - "StreetAddressThree" : "${depot.physical_depot_address.address_3}" + "Name": "${depot.physical_depot_address.company_name?json_string}", + "StreetAddressOne" : "${depot.physical_depot_address.address_1?json_string}", + "StreetAddressTwo" : "${depot.physical_depot_address.address_2?json_string}", + "StreetAddressThree" : "${depot.physical_depot_address.address_3?json_string}" }, - "Phones": ["${depot.physical_depot_address.telephone}", - "${depot.physical_depot_address.other_number}" + "Phones": ["${depot.physical_depot_address.telephone?json_string}", + "${depot.physical_depot_address.other_number?json_string}" ], "Typology": "TYPOLOGY_UNKNOWN" } From d8c89f8639a3c9781b19cd9ba5e6e71254d6a6ad Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Tue, 26 Sep 2023 11:53:10 +0200 Subject: [PATCH 41/68] Addition of HfGrade and HfOwner --- RFXtoRP_HfGrade.ftl | 28 +++++++++ RFXtoRP_HfOwner.ftl | 28 +++++++++ RFXtoRP_HsaProStatus.ftl | 131 ++++++++++++++++++--------------------- 3 files changed, 115 insertions(+), 72 deletions(-) create mode 100644 RFXtoRP_HfGrade.ftl create mode 100644 RFXtoRP_HfOwner.ftl diff --git a/RFXtoRP_HfGrade.ftl b/RFXtoRP_HfGrade.ftl new file mode 100644 index 0000000..b23f046 --- /dev/null +++ b/RFXtoRP_HfGrade.ftl @@ -0,0 +1,28 @@ +<#-- *********************************************** Parameter global ******************** --> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign file = JsonUtil.jsonToMap(dataRfx)> + <#noparse><#--TODO RFXtoRP_HfGrade.ftl --> + <#--<#include "RFXtoRP_RfxConfigurationRp.ftl"> --> + + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "en attente de FTL"> + <#break> + + + <#default> + <#stop> + + diff --git a/RFXtoRP_HfOwner.ftl b/RFXtoRP_HfOwner.ftl new file mode 100644 index 0000000..b9c7bc7 --- /dev/null +++ b/RFXtoRP_HfOwner.ftl @@ -0,0 +1,28 @@ +<#-- *********************************************** Parameter global ******************** --> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign file = JsonUtil.jsonToMap(dataRfx)> + <#noparse><#--TODO RFXtoRP_HfOwner.ftl --> + <#--<#include "RFXtoRP_RfxConfigurationRp.ftl"> --> + + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "en attente de FTL"> + <#break> + + + <#default> + <#stop> + + diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl index 974cfe3..63f96df 100644 --- a/RFXtoRP_HsaProStatus.ftl +++ b/RFXtoRP_HsaProStatus.ftl @@ -10,85 +10,72 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#case "C"> + <#case "U"> + <#-- Action = CREATE or UPDATE --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx)> - [ - - <#--**Pick batch runned (100) **--> - <#if preparationStatusInterface.preparation_status_type == "100" && - preparationStatusInterface.preparation_status_code == "200" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : + <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx) /> + [ + <#--**Pick batch runned (100) **--> + <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : <#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl"> - } - <#else> - - <#-- ** Collection started (300) and Preparation in progress (400)** --> - <#if preparationStatusInterface.preparation_status_type == "100" && - (preparationStatusInterface.preparation_status_code == "300" || - preparationStatusInterface.preparation_status_code == "400") > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> - } - <#else> - <#-- **Preparation to package (500) and preparation completed (550)** --> - <#if preparationStatusInterface.preparation_status_type == "100" && - (preparationStatusInterface.preparation_status_code == "500" || - preparationStatusInterface.preparation_status_code == "550")> - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> - } - <#else> - <#-- ****Preparation dispatched (600)** --> - <#if preparationStatusInterface.preparation_status_type == "100" && - preparationStatusInterface.preparation_status_code == "600" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_TransportStarted.ftl"> - } - <#else> - <#-- ****Preparation cancelled (650)**** --> - <#if preparationStatusInterface.preparation_status_type == "100" && - preparationStatusInterface.preparation_status_code == "650" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl"> - } - <#else> - - <#stop "Reflex WMS status not supported on Reflex Platform"> - + } + <#else> + <#-- ** Collection started (300) and Preparation in progress (400)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> + } + <#else> + <#-- **Preparation to package (500) and preparation completed (550)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "500" || preparationStatusInterface.preparation_status_code == "550")> + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> + } + <#else> + <#-- ****Preparation dispatched (600)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_TransportStarted.ftl"> + } + <#else> + <#-- ****Preparation cancelled (650)**** --> + <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "650" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl"> + } + <#else> + <#stop "Reflex WMS status not supported on Reflex Platform"> + + + + - - - - - - ] + ] <#break> - <#case "D"> + <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#stop "event not supported (case D)"> <#break> - - - <#default> - <#stop "event not supported"> + + <#default> + <#stop "event not supported"> From 717cd294eb7248158b099868e484136a7fbd8c5f Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 27 Sep 2023 10:21:41 +0200 Subject: [PATCH 42/68] cases where no generic FTL available yet --- RFXtoRP_HfGrade.ftl | 23 +++++++---------------- RFXtoRP_HfLvTypeList.ftl | 23 +++++++---------------- RFXtoRP_HfOwner.ftl | 23 +++++++---------------- 3 files changed, 21 insertions(+), 48 deletions(-) diff --git a/RFXtoRP_HfGrade.ftl b/RFXtoRP_HfGrade.ftl index b23f046..ee9990d 100644 --- a/RFXtoRP_HfGrade.ftl +++ b/RFXtoRP_HfGrade.ftl @@ -6,23 +6,14 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign file = JsonUtil.jsonToMap(dataRfx)> - <#noparse><#--TODO RFXtoRP_HfGrade.ftl --> - <#--<#include "RFXtoRP_RfxConfigurationRp.ftl"> --> - - <#break> - - <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "en attente de FTL"> - <#break> + <#case "C"> + <#case "U"> + <#case "D"> + <#stop "no generic FTL file available yet for Grades"> + <#break> - <#default> - <#stop> + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HfLvTypeList.ftl b/RFXtoRP_HfLvTypeList.ftl index 1f98762..2f03386 100644 --- a/RFXtoRP_HfLvTypeList.ftl +++ b/RFXtoRP_HfLvTypeList.ftl @@ -6,23 +6,14 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign file = JsonUtil.jsonToMap(dataRfx)> - <#noparse><#--TODO RFXtoRP_HfLvTypeList.ftl --> - <#--<#include "RFXtoRP_RfxConfigurationRp.ftl"> --> - - <#break> - - <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "en attente de FTL"> - <#break> + <#case "C"> + <#case "U"> + <#case "D"> + <#stop "no generic FTL file available yet for LV types"> + <#break> - <#default> - <#stop> + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HfOwner.ftl b/RFXtoRP_HfOwner.ftl index b9c7bc7..571248a 100644 --- a/RFXtoRP_HfOwner.ftl +++ b/RFXtoRP_HfOwner.ftl @@ -6,23 +6,14 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign file = JsonUtil.jsonToMap(dataRfx)> - <#noparse><#--TODO RFXtoRP_HfOwner.ftl --> - <#--<#include "RFXtoRP_RfxConfigurationRp.ftl"> --> - - <#break> - - <#case "D"> - <#-- *********************************************** Action = DELETE ******************** --> - <#stop "en attente de FTL"> - <#break> + <#case "C"> + <#case "U"> + <#case "D"> + <#stop "no generic FTL file available yet for Owners"> + <#break> - <#default> - <#stop> + <#default> + <#stop "event not supported"> From b50d2573f321cec55a9cd39533086398150e3820 Mon Sep 17 00:00:00 2001 From: frea Date: Thu, 5 Oct 2023 13:16:31 +0200 Subject: [PATCH 43/68] =?UTF-8?q?ajout=20des=20FTL=20li=C3=A9s=20=C3=A0=20?= =?UTF-8?q?la=20cr=C3=A9ation=20de=20commande=20(SCPN1-5019)=20=C3=A0=20va?= =?UTF-8?q?lider=20par=20Laure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RFXtoRP_PlatformLogCreate.ftl | 43 ++++++++++++ RFXtoRP_PrepOrder-ShipFromAcked.ftl | 15 +++++ RFXtoRP_Receipt-ShipToAcked.ftl | 15 +++++ RFXtoRP_RestResponse.ftl | 101 ++++++++++++++++++++++++++++ RPtoRFX_ExecutionflowEvent.ftl | 37 ++++++++++ RPtoRFX_Preparation_orders_post.ftl | 83 +++++++++++++++++++++++ RPtoRFX_Receipts_post.ftl | 68 +++++++++++++++++++ 7 files changed, 362 insertions(+) create mode 100644 RFXtoRP_PlatformLogCreate.ftl create mode 100644 RFXtoRP_PrepOrder-ShipFromAcked.ftl create mode 100644 RFXtoRP_Receipt-ShipToAcked.ftl create mode 100644 RFXtoRP_RestResponse.ftl create mode 100644 RPtoRFX_ExecutionflowEvent.ftl create mode 100644 RPtoRFX_Preparation_orders_post.ftl create mode 100644 RPtoRFX_Receipts_post.ftl diff --git a/RFXtoRP_PlatformLogCreate.ftl b/RFXtoRP_PlatformLogCreate.ftl new file mode 100644 index 0000000..7806150 --- /dev/null +++ b/RFXtoRP_PlatformLogCreate.ftl @@ -0,0 +1,43 @@ +<#include "HfRpConfig.ftl"> +[ + <#assign UUID = UUID.randomUUID()> + <#assign strJsonBody = JsonUtil.espaceQuoteInJsonString(restResponseBody)> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${UUID}", + "RefDate": { + "DateTime": "${aDateTime?iso_utc}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + <#assign severity = SeverityLevel.ERROR> + "Severity": "${severity}", + "Namespace": "ReflexIntegration", + "DateTime": { + "DateTime": "${aDateTime?iso_utc}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "TechMessage": { + "Code": "${restResponsetMsg.status}", + "Label": ${strJsonBody} + }, + "UserMessage": { + "Code": "${restResponsetMsg.status}", + "Label": ${strJsonBody}, + "Params": [] + }, + "DetailElements": [], + "CorrelationID": "${id.correlationid}", + "ContextPayload": "rfxresponse", + "Type": "RP_EXECUTIONFLOW_EVENT", + "Task": "${id.apiRestReflexID}", + "OriginalID": "${id.refid}", + "StackTrace": "" + } + } +] + diff --git a/RFXtoRP_PrepOrder-ShipFromAcked.ftl b/RFXtoRP_PrepOrder-ShipFromAcked.ftl new file mode 100644 index 0000000..69d0247 --- /dev/null +++ b/RFXtoRP_PrepOrder-ShipFromAcked.ftl @@ -0,0 +1,15 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${id.refid}" + }, + + "Payload": { + "ShipFromAcked": true + } + + } +] diff --git a/RFXtoRP_Receipt-ShipToAcked.ftl b/RFXtoRP_Receipt-ShipToAcked.ftl new file mode 100644 index 0000000..ae00aae --- /dev/null +++ b/RFXtoRP_Receipt-ShipToAcked.ftl @@ -0,0 +1,15 @@ +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${id.refid}" + }, + + "Payload": { + "ShipToAcked": true + } + + } +] diff --git a/RFXtoRP_RestResponse.ftl b/RFXtoRP_RestResponse.ftl new file mode 100644 index 0000000..c468f3e --- /dev/null +++ b/RFXtoRP_RestResponse.ftl @@ -0,0 +1,101 @@ +<#-- **** input parameters ***** --> +<#-- input : Response message from Reflex --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign restResponsetMsg = JsonUtil.jsonToMap(input)> +<#assign id = JsonUtil.jsonToMap(restResponsetMsg.id)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + + +<#assign aDateTime = .now> + +<#switch id.apiRestReflexID> + <#case "preparation_orders_post"> + <#switch restResponsetMsg.status> + <#case 200> + <#case 201> + <#-- *********************************************** ApiRestID = preparation_orders_post ******************** --> + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> + <#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" > + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipFromAcked> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_PrepOrder-ShipFromAcked.ftl"> + } + ] + <#else> + [ + { + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_PlatformLogCreate.ftl"> + } + ] + + <#break> + <#default> + [ + { + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_PlatformLogCreate.ftl"> + } + ] + + <#break> + + <#case "receipts_post"> + <#switch restResponsetMsg.status> + <#case 200> + <#case 201> + <#-- *********************************************** ApiRestID = preparation_orders_post ******************** --> + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> + <#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" > + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipToAcked> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_Receipt-ShipToAcked.ftl"> + } + ] + <#else> + [ + { + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_PlatformLogCreate.ftl"> + } + ] + + + <#break> + <#default> + [ + { + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_PlatformLogCreate.ftl"> + } + ] + + <#break> + + <#default> + <#stop> + + diff --git a/RPtoRFX_ExecutionflowEvent.ftl b/RPtoRFX_ExecutionflowEvent.ftl new file mode 100644 index 0000000..eeb38f1 --- /dev/null +++ b/RPtoRFX_ExecutionflowEvent.ftl @@ -0,0 +1,37 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign eventRP = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#switch eventRP.event> + <#case "Created"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign executionflow = eventRP.data /> + [ + <#if eventRP.partnerAppRole == "ShipFrom" && executionflow.ShipFrom.ActorID != "" && executionflow.ShipFrom.Actor.IsShipFromConnected?? && executionflow.ShipFrom.Actor.IsShipFromConnected> + { + <#assign apiRestReflexID = ApiRestReflexID.preparation_orders_post> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_Preparation_orders_post.ftl"> + } + + <#if eventRP.partnerAppRole == "ShipTo" && executionflow.ShipTo.ActorID != "" && executionflow.ShipTo.Actor.IsShipToConnected?? && executionflow.ShipTo.Actor.IsShipToConnected> + { + <#assign apiRestReflexID = ApiRestReflexID.receipts_post> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_Receipts_post.ftl"> + } + + + ] + <#break> + <#default> + <#stop "Event not process"> + + diff --git a/RPtoRFX_Preparation_orders_post.ftl b/RPtoRFX_Preparation_orders_post.ftl new file mode 100644 index 0000000..6914da7 --- /dev/null +++ b/RPtoRFX_Preparation_orders_post.ftl @@ -0,0 +1,83 @@ +<#assign Default_Value_Owner_SegmentationKey = ""/> +<#assign Default_Value_Grade_SegmentationKey = "STD"/> +<#assign Reflex_Originator = "50000189"/> +<#assign activity_code = "PEN"/> +<#assign preparation_type_code = "010"/> +<#assign load_grouping = "DEFAUT"/> +<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} > +<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/> +<#assign aDateTime = .now> +{ + "id" : {"refid" : "${executionflow.OrderID}"}, + "route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/preparation_orders", + "method" : "POST", + "uri_substitutions": { + "activity_code": "${activity_code}", + "physical_depot_code": "${ActorID_RPtoRFX[executionflow.ShipFrom.ActorID]!executionflow.ShipFrom.ActorID}", + "originator_code": "${Reflex_Originator}" + }, + "payload" : + { + "originator_reference": "${executionflow.OrderID}", + "preparation_type_code": "${preparation_type_code}", + "end_consignee_code": "${ActorID_RPtoRFX[executionflow.ShipTo.ActorID]!executionflow.ShipTo.ActorID}", + <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> + "requested_delivery_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", + <#else> + "requested_delivery_start_datetime": "${aDateTime?iso_utc}", + + "automatic_generation": "true", + "consolidated_delivery": "false", + "intermediate_consignee": "false", + "print_deconsolidation_sheet": "false", + "print_final_delivery_note": "false", + "protected": "false", + "automatic_generation": "false", + "stock_despatch_at_preparation_confirmation": "false", + "deactivate": "false", + "requested_delivery_date_type": "010", + <#if executionflow.ShipTo.ActorID == ""> + "address": { + "mail_address": "${executionflow.Carrier.Actor.Emails[0]!""}", + "mobile_phone_number": "${executionflow.Carrier.Actor.Phones[0]!""}", + "street_and_number_and_po_box": "${executionflow.Carrier.Actor.Address.StreetAddressOne!""}", + "additional_address_data_1": "${executionflow.Carrier.Actor.Address.StreetAddressTwo!""}", + "additional_address_data_2": "${executionflow.Carrier.Actor.Address.StreetAddressThree!""}", + "postal_code": "${executionflow.Carrier.Actor.Address.PostalCode!""}", + "iso_country_code": "${executionflow.Carrier.Actor.Address.CountryCode!""}" + }, + + <#if executionflow.Lines??> + "line_list": [ + <#list executionflow.Lines as line> + { + + <#if line.RequestedContent.Goods.SegmentationKeys??> + <#assign ic_map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> + "owner_code_to_prepare": "${ic_map.Owner.String!"${Default_Value_Owner_SegmentationKey}"}", + "grade_code_to_prepare": "${SegmentationKeys_RPtoRFX[ic_map.Grade.String!""]!"${Default_Value_Grade_SegmentationKey}"}", + "batch_1": "${ic_map.BatchNumber!""}", + + "originator_reference_line_number": ${line.LineID?number}, + "item_code": "${line.RequestedContent.Goods.ItemID!""}", + "item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}", + "base_lv_quantity_to_prepare": ${line.RequestedMetrics.QuantityInBaseLV.Value!0}, + "input_order_data": "false", + "stock_reservation": "false", + "forced_priority_date_min_lead_time": "false", + "temp_substitution_possible": "false", + "substitution_possible": "false", + "base_lv_quantity": "true", + "any_lv": "false" + }<#sep>, + + ], + + "optional_attributes": { + "apt_with_end_consignee": "false", + "apt_with_intermediate": "false", + <#-- "load_grouping": "${executionflow.Carrier.ActorID!""}" --> + "load_grouping": "${load_grouping}" + } + } + } diff --git a/RPtoRFX_Receipts_post.ftl b/RPtoRFX_Receipts_post.ftl new file mode 100644 index 0000000..ee2ffd8 --- /dev/null +++ b/RPtoRFX_Receipts_post.ftl @@ -0,0 +1,68 @@ +<#assign Default_Value_Owner_SegmentationKey = "PEN"/> +<#assign Default_Value_Grade_SegmentationKey = "STD"/> +<#assign Reflex_Originator = "STANDARD"/> +<#assign work_mode_code = "LPA"/> +<#assign activity_code = "PEN"/> +<#assign receipt_reason_code = "REC"/> +<#assign receipt_type = "010"/> +<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} > +<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/> +<#assign aDateTime = .now> +{ + "id" : {"refid" : "${executionflow.OrderID}"}, + "route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/receipts", + "method" : "POST", + "uri_substitutions": { + "activity_code": "${activity_code}", + "physical_depot_code": "${ActorID_RPtoRFX[executionflow.ShipTo.ActorID]!executionflow.ShipTo.ActorID}", + "originator_code": "${Reflex_Originator}" + }, + "payload" : + { + "receipt_reference": "${executionflow.OrderID}", + "receipt_type": "${receipt_type}", + "receipt_reason_code": "${receipt_reason_code}", + "work_mode_code" : "${work_mode_code}", + "original_code" : "${ActorID_RPtoRFX[executionflow.ShipFrom.ActorID]!executionflow.ShipFrom.ActorID}", + "carrier_code" : "${ActorID_RPtoRFX[executionflow.Carrier.ActorID]!executionflow.Carrier.ActorID}", + <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> + "carrier_appointment_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", + <#else> + "carrier_appointment_start_datetime": "${aDateTime?iso_utc}", + + "carrier_appointment_made": "false", + "receipt_in_cross_docking": "false", + "dock_occupation_duration": 10, + + <#if executionflow.Lines??> + "line_list": [ + <#list executionflow.Lines as line> + { + + <#if line.RequestedContent.Goods.SegmentationKeys??> + <#assign ic_map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> + "owner_code": "${ic_map.Owner.String!"${Default_Value_Owner_SegmentationKey}"}", + "grade_code": "${SegmentationKeys_RPtoRFX[ic_map.Grade.String!""]!"${Default_Value_Grade_SegmentationKey}"}", + "batch_1": "${ic_map.BatchNumber!""}", + + "receipt_reference_line_no": ${line.LineID?number}, + "item_code": "${line.RequestedContent.Goods.ItemID!""}", + "item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}", + "level_1_quantity": ${line.RequestedMetrics.QuantityInBaseLV.Value!0} + + }<#sep>, + + ], + + "optional_attributes": { + "held_for_check": "false", + "held _for_repacking": "false", + "hold_for_specific_code": "false", + "hold_code": "false" + }, + "quality_control_attributes": { + "qcf_to_create_for_receipt_line": "false", + "exclude_item_from_inspection": "false" + } + } + } From 495d64591f6f60fbce9c8fe59d9e181b9fef07fe Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 5 Oct 2023 15:13:19 +0200 Subject: [PATCH 44/68] receipt IPG move --- RFXtoRP_HsaIpgMove_GoodsReceived.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl index ffcfd47..3b60527 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl @@ -25,7 +25,7 @@ <#-- Goods received Segmentation Keys inclusion --> <#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl"> }, - "ExecutionflowID": "R-${reflexMvtStockInterface.receipt_year_number}-${reflexMvtStockInterface.receipt_number}", + "ExecutionflowID": "${reflexMvtStockInterface.receipt_reference}", "LineID": "${reflexMvtStockInterface.receipt_line_number}", "ActorID": "${reflexMvtStockInterface.physical_depot_code}", "Quantity": { From 71c2512cbbc9cf7623b54029921699d66a0db45e Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Fri, 6 Oct 2023 16:39:27 +0200 Subject: [PATCH 45/68] modification "lineSK" to "SK" --- RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 4 +- ...ExecutionflowDetected_SegmentationKeys.ftl | 44 +++++----- ...P_HsrReceiptList_ExecutionflowDetected.ftl | 4 +- ...ExecutionflowDetected_SegmentationKeys.ftl | 80 +++++++++---------- 4 files changed, 66 insertions(+), 66 deletions(-) rename RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl => RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl (96%) rename RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl => RFXtoRP_HsrReceiptList_ExecutionflowDetected_SegmentationKeys.ftl (96%) diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index e38b479..dbe895e 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -78,8 +78,8 @@ "PriorityDate": "${forced_priority_date}", - <#-- Line Segmentation Keys inclusion --> - <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl"> + <#-- Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl"> }, "Quantity" : diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl similarity index 96% rename from RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl rename to RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl index eec0805..5c9da3d 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_LineSegmentationKeys.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl @@ -1,23 +1,23 @@ -<#-- use protobuf of class HsrPro to find Reflex WMS fields names --> -<#-- - -"SegmentationKeys": [ - { - "Key": "Grade", - "Value": { "String" : "${line.grade_code_to_prepare}"} - }, - { - "Key": "Owner", - "Value": { "String" : "${line.owner_code_to_prepare}"} - }, - { - "Key": "BatchNumber", - <#if reflexMvtStockInterface.batch_1 == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${line.batch_1}"} - - } - ] ---> +<#-- use protobuf of class HsrPro to find Reflex WMS fields names --> +<#-- + +"SegmentationKeys": [ + { + "Key": "Grade", + "Value": { "String" : "${line.grade_code_to_prepare}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${line.owner_code_to_prepare}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line.batch_1}"} + + } + ] +--> "SegmentationKeys": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index ba8c19c..477456f 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -59,8 +59,8 @@ <#else> <#stop "line with detail"> - <#-- Line Segmentation Keys inclusion --> - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl"> + <#-- Segmentation Keys inclusion --> + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_SegmentationKeys.ftl"> }, "Quantity" : { diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_SegmentationKeys.ftl similarity index 96% rename from RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl rename to RFXtoRP_HsrReceiptList_ExecutionflowDetected_SegmentationKeys.ftl index 2282e33..8950e72 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected_SegmentationKeys.ftl @@ -1,41 +1,41 @@ -<#-- use protobuf of class HsrReceiptList to find Reflex WMS fields names --> - -<#-- -"SegmentationKeys": [ - { - "Key": "Grade", - "Value": { "String" : "${line.grade_code}"} - }, - { - "Key": "Owner", - "Value": { "String" : "${line.owner_code}"} - }, - { - "Key": "BatchNumber", - <#if reflexMvtStockInterface.batch_1 == ""> - "Value": { "String" : "no batch"} - <#else> - "Value": { "String" : "${line_without_detail.batch_1}"} - - }, - { - "Key": "HeldForSpecificCode", - <#if line_without_detail.hold_for_specific_code == "true"> - "Value": { "Bool" : "True"} - <#else> - "Value": { "Bool" : "False"} - }, - - { - <#assign manufacturing_date = line_without_detail.ipg_date_of_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> - "Key": "ManufacturingDate", - "Value": "Timestamp": { - "AuthorTimeZone": "${time_zone_rfx}", - "DateTime": "${manufacturing_date}" - } - } - - ] - ---> +<#-- use protobuf of class HsrReceiptList to find Reflex WMS fields names --> + +<#-- +"SegmentationKeys": [ + { + "Key": "Grade", + "Value": { "String" : "${line.grade_code}"} + }, + { + "Key": "Owner", + "Value": { "String" : "${line.owner_code}"} + }, + { + "Key": "BatchNumber", + <#if reflexMvtStockInterface.batch_1 == ""> + "Value": { "String" : "no batch"} + <#else> + "Value": { "String" : "${line_without_detail.batch_1}"} + + }, + { + "Key": "HeldForSpecificCode", + <#if line_without_detail.hold_for_specific_code == "true"> + "Value": { "Bool" : "True"} + <#else> + "Value": { "Bool" : "False"} + }, + + { + <#assign manufacturing_date = line_without_detail.ipg_date_of_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + "Key": "ManufacturingDate", + "Value": "Timestamp": { + "AuthorTimeZone": "${time_zone_rfx}", + "DateTime": "${manufacturing_date}" + } + } + + ] + +--> "SegmentationKeys": [ ] \ No newline at end of file From 96757a5262f584ef0765764a1089be9b5be6e00c Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 12 Oct 2023 10:47:42 +0200 Subject: [PATCH 46/68] ajustement noms de fichiers --- ...r-ShipFromAcked.ftl => RFXtoRP_PrepOrder_ShipFromAcked.ftl | 0 ...Receipt-ShipToAcked.ftl => RFXtoRP_Receipt_ShipToAcked.ftl | 0 RFXtoRP_RestResponse.ftl | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename RFXtoRP_PrepOrder-ShipFromAcked.ftl => RFXtoRP_PrepOrder_ShipFromAcked.ftl (100%) rename RFXtoRP_Receipt-ShipToAcked.ftl => RFXtoRP_Receipt_ShipToAcked.ftl (100%) diff --git a/RFXtoRP_PrepOrder-ShipFromAcked.ftl b/RFXtoRP_PrepOrder_ShipFromAcked.ftl similarity index 100% rename from RFXtoRP_PrepOrder-ShipFromAcked.ftl rename to RFXtoRP_PrepOrder_ShipFromAcked.ftl diff --git a/RFXtoRP_Receipt-ShipToAcked.ftl b/RFXtoRP_Receipt_ShipToAcked.ftl similarity index 100% rename from RFXtoRP_Receipt-ShipToAcked.ftl rename to RFXtoRP_Receipt_ShipToAcked.ftl diff --git a/RFXtoRP_RestResponse.ftl b/RFXtoRP_RestResponse.ftl index c468f3e..eb4cdd4 100644 --- a/RFXtoRP_RestResponse.ftl +++ b/RFXtoRP_RestResponse.ftl @@ -25,7 +25,7 @@ <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipFromAcked> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_PrepOrder-ShipFromAcked.ftl"> + <#include "RFXtoRP_PrepOrder_ShipFromAcked.ftl"> } ] <#else> @@ -66,7 +66,7 @@ <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipToAcked> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_Receipt-ShipToAcked.ftl"> + <#include "RFXtoRP_Receipt_ShipToAcked.ftl"> } ] <#else> From bee2e4add3296ba5cacad9ee8b1a2e0e5eba2ff1 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 12 Oct 2023 11:21:19 +0200 Subject: [PATCH 47/68] initialisation for default data files --- RPtoRFX_ExecutionflowEvent.ftl | 6 +++--- ...eparation_orders_post.ftl => RPtoRFX_PrepOrder.ftl | 11 +++-------- RPtoRFX_PrepOrder_DefaultData.ftl | 9 +++++++++ RPtoRFX_Receipts_post.ftl => RPtoRFX_Receipt.ftl | 10 +--------- RPtoRFX_Receipt_DefaultData.ftl | 9 +++++++++ 5 files changed, 25 insertions(+), 20 deletions(-) rename RPtoRFX_Preparation_orders_post.ftl => RPtoRFX_PrepOrder.ftl (88%) create mode 100644 RPtoRFX_PrepOrder_DefaultData.ftl rename RPtoRFX_Receipts_post.ftl => RPtoRFX_Receipt.ftl (84%) create mode 100644 RPtoRFX_Receipt_DefaultData.ftl diff --git a/RPtoRFX_ExecutionflowEvent.ftl b/RPtoRFX_ExecutionflowEvent.ftl index eeb38f1..65c55a5 100644 --- a/RPtoRFX_ExecutionflowEvent.ftl +++ b/RPtoRFX_ExecutionflowEvent.ftl @@ -17,7 +17,7 @@ <#assign apiRestReflexID = ApiRestReflexID.preparation_orders_post> "apiRestReflexID" : "${apiRestReflexID}", "datas" : - <#include "RPtoRFX_Preparation_orders_post.ftl"> + <#include "RPtoRFX_PrepOrder.ftl"> } <#if eventRP.partnerAppRole == "ShipTo" && executionflow.ShipTo.ActorID != "" && executionflow.ShipTo.Actor.IsShipToConnected?? && executionflow.ShipTo.Actor.IsShipToConnected> @@ -25,13 +25,13 @@ <#assign apiRestReflexID = ApiRestReflexID.receipts_post> "apiRestReflexID" : "${apiRestReflexID}", "datas" : - <#include "RPtoRFX_Receipts_post.ftl"> + <#include "RPtoRFX_Receipt.ftl"> } ] <#break> <#default> - <#stop "Event not process"> + <#stop "Event not processed"> diff --git a/RPtoRFX_Preparation_orders_post.ftl b/RPtoRFX_PrepOrder.ftl similarity index 88% rename from RPtoRFX_Preparation_orders_post.ftl rename to RPtoRFX_PrepOrder.ftl index 6914da7..3ecefc0 100644 --- a/RPtoRFX_Preparation_orders_post.ftl +++ b/RPtoRFX_PrepOrder.ftl @@ -1,12 +1,7 @@ -<#assign Default_Value_Owner_SegmentationKey = ""/> -<#assign Default_Value_Grade_SegmentationKey = "STD"/> -<#assign Reflex_Originator = "50000189"/> -<#assign activity_code = "PEN"/> -<#assign preparation_type_code = "010"/> -<#assign load_grouping = "DEFAUT"/> -<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} > -<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/> +<#include "RPtoRFX_PrepOrder_DefaultData.ftl"> + <#assign aDateTime = .now> + { "id" : {"refid" : "${executionflow.OrderID}"}, "route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/preparation_orders", diff --git a/RPtoRFX_PrepOrder_DefaultData.ftl b/RPtoRFX_PrepOrder_DefaultData.ftl new file mode 100644 index 0000000..28d731a --- /dev/null +++ b/RPtoRFX_PrepOrder_DefaultData.ftl @@ -0,0 +1,9 @@ +<#assign Default_Value_Owner_SegmentationKey = ""/> +<#assign Default_Value_Grade_SegmentationKey = "STD"/> +<#assign Reflex_Originator = "50000189"/> +<#assign activity_code = "PEN"/> +<#assign preparation_type_code = "010"/> +<#assign load_grouping = "DEFAUT"/> +<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} > +<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/> + diff --git a/RPtoRFX_Receipts_post.ftl b/RPtoRFX_Receipt.ftl similarity index 84% rename from RPtoRFX_Receipts_post.ftl rename to RPtoRFX_Receipt.ftl index ee2ffd8..9e1ac64 100644 --- a/RPtoRFX_Receipts_post.ftl +++ b/RPtoRFX_Receipt.ftl @@ -1,12 +1,4 @@ -<#assign Default_Value_Owner_SegmentationKey = "PEN"/> -<#assign Default_Value_Grade_SegmentationKey = "STD"/> -<#assign Reflex_Originator = "STANDARD"/> -<#assign work_mode_code = "LPA"/> -<#assign activity_code = "PEN"/> -<#assign receipt_reason_code = "REC"/> -<#assign receipt_type = "010"/> -<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} > -<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/> +<#include "RPtoRFX_Receipt_DefaultData.ftl"> <#assign aDateTime = .now> { "id" : {"refid" : "${executionflow.OrderID}"}, diff --git a/RPtoRFX_Receipt_DefaultData.ftl b/RPtoRFX_Receipt_DefaultData.ftl new file mode 100644 index 0000000..c98c038 --- /dev/null +++ b/RPtoRFX_Receipt_DefaultData.ftl @@ -0,0 +1,9 @@ +<#assign Default_Value_Owner_SegmentationKey = "PEN"/> +<#assign Default_Value_Grade_SegmentationKey = "STD"/> +<#assign Reflex_Originator = "STANDARD"/> +<#assign work_mode_code = "LPA"/> +<#assign activity_code = "PEN"/> +<#assign receipt_reason_code = "REC"/> +<#assign receipt_type = "010"/> +<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} > +<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/> \ No newline at end of file From 9e1c0fcaae376c6f15159d6b0b044653a49f7f38 Mon Sep 17 00:00:00 2001 From: frea Date: Tue, 17 Oct 2023 17:58:00 +0200 Subject: [PATCH 48/68] suppression du fichier HfRpConfig.ftl --- HfRpConfig.ftl | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 HfRpConfig.ftl diff --git a/HfRpConfig.ftl b/HfRpConfig.ftl deleted file mode 100644 index 01ffd8a..0000000 --- a/HfRpConfig.ftl +++ /dev/null @@ -1,35 +0,0 @@ - - - -<#-- Warning the file is generated, if you modify it manually, do not enable automatic update via the pipeline --> -<#-- Date of last generation : Jul 10, 2023 2:39:59 PM --> - -<#-- if LVID is egal to **quantity_in_base_lv** keyword then LVID is egal to base VL of the item --> - <#assign quantity_in_base_lv_RP_Cst = "**quantity_in_base_lv**" > - <#assign rfx_date_format_default = "yyyy-MM-dd" > - - - <#assign length_unit_KV_rfx = {"MET":"MILLIMETER","CM":"CENTIMETER","MM":"METER","DM":"DECIMETER","KM":"KILOMETER","MIL":"MILE","YAR":"YARD","INC":"INCH","FT":"FOOT"}> - <#assign weight_unit_KV_rfx = {"GR":"GRAMME","DG":"DECIGRAM","KG":"KILOGRAM","TON":"TONNE","OCE":"ONCE","LTO":"LONG_TON","STO":"SHORT_TON","PND":"POUND"}> - <#assign area_unit_KV_rfx = {"MM²":"SQUARE_MILLIMETER","CM²":"SQUARE_CENTIMETER","DM²":"SQUARE_DECIMETER","M²":"SQUARE_METER","SQI":"SQUARE_INCH","SQF":"SQUARE_FOOT","SQY":"SQUARE_YARD"}> - <#assign volume_unit_KV_rfx = {"MM³":"CUBIC_MILLIMETER","CM³":"CUBIC_CENTIMETER","DM³":"CUBIC_DECIMETER","M³":"CUBIC_METER","CI":"CUBIC_INCH","CF":"CUBIC_FOOT","CY":"CUBIC_YARD","ML":"MILLI_LITER","CL":"CENTI_LITER","DL":"DECI_LITER","LIT":"LITER","HL":"HECTO_LITER","FT":"US_FLUID_OUNCE","USG":"US_GAL","PI":"IMPERIAL_PINT","GL":"IMPERIAL_GAL"}> - <#assign temperature_unit_KV_rfx = {"° C":"CELSIUS","° F":"FAHRENHEIT"}> - - - <#assign length_unit_rfx = length_unit_KV_rfx["CM"]!"CENTIMETER"> - <#assign distance_unit_rfx = length_unit_KV_rfx["MET"]!"CENTIMETER"> - <#assign transport_distance_unit_rfx = length_unit_KV_rfx["KM"]!"CENTIMETER"> - <#assign weight_unit_rfx = weight_unit_KV_rfx["KG"]!"KILOGRAM"> - <#assign area_unit_rfx = area_unit_KV_rfx["M²"]!"SQUARE_METER"> - <#assign volume_unit_rfx = volume_unit_KV_rfx["DM³"]!"CUBIC_DECIMETER"> - <#assign number_of_litres_unit_rfx = volume_unit_KV_rfx["LIT"]!"CUBIC_DECIMETER"> - - - - <#assign time_zone_rfx = "Europe/Paris"!"UTC"> - <#assign time_zone_offset_rfx = "+02:00"!"+00:00"> - - <#assign text_language_rfx = "fr"!"en"> - - - From d067be597b9db3a6a17295f17717bac61e909510 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 18 Oct 2023 09:40:02 +0200 Subject: [PATCH 49/68] RP to RFX prep order post --- RPtoRFX_ExecutionflowEvent.ftl | 9 ++ RPtoRFX_PrepOrder.ftl | 130 ++++++++++--------- RPtoRFX_PrepOrder_DefaultData.ftl | 9 -- RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl | 19 +++ RPtoRFX_PrepOrder_DefaultLineData.ftl | 8 ++ 5 files changed, 104 insertions(+), 71 deletions(-) delete mode 100644 RPtoRFX_PrepOrder_DefaultData.ftl create mode 100644 RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl create mode 100644 RPtoRFX_PrepOrder_DefaultLineData.ftl diff --git a/RPtoRFX_ExecutionflowEvent.ftl b/RPtoRFX_ExecutionflowEvent.ftl index 65c55a5..a392f4a 100644 --- a/RPtoRFX_ExecutionflowEvent.ftl +++ b/RPtoRFX_ExecutionflowEvent.ftl @@ -7,10 +7,19 @@ <#assign projectRP = project> <#assign organisationRP = organisation> + + + <#switch eventRP.event> <#case "Created"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign executionflow = eventRP.data /> + + <#-- ******* Header MetaData to maps ******** --> + <#if executionflow.MetaData??> + <#assign Header_MetaData_Map = JsonUtil.sequenceToMap(executionflow.MetaData, "Key", "Value") /> + + [ <#if eventRP.partnerAppRole == "ShipFrom" && executionflow.ShipFrom.ActorID != "" && executionflow.ShipFrom.Actor.IsShipFromConnected?? && executionflow.ShipFrom.Actor.IsShipFromConnected> { diff --git a/RPtoRFX_PrepOrder.ftl b/RPtoRFX_PrepOrder.ftl index 3ecefc0..c17ef61 100644 --- a/RPtoRFX_PrepOrder.ftl +++ b/RPtoRFX_PrepOrder.ftl @@ -1,78 +1,84 @@ -<#include "RPtoRFX_PrepOrder_DefaultData.ftl"> +<#include "RPtoRFX_PrepOrder_DefaultHeaderData.ftl"> <#assign aDateTime = .now> + { "id" : {"refid" : "${executionflow.OrderID}"}, "route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/preparation_orders", "method" : "POST", "uri_substitutions": { "activity_code": "${activity_code}", - "physical_depot_code": "${ActorID_RPtoRFX[executionflow.ShipFrom.ActorID]!executionflow.ShipFrom.ActorID}", - "originator_code": "${Reflex_Originator}" + "physical_depot_code": "${executionflow.ShipFrom.ActorID}", + "originator_code": "${originator_code}" }, "payload" : { - "originator_reference": "${executionflow.OrderID}", - "preparation_type_code": "${preparation_type_code}", - "end_consignee_code": "${ActorID_RPtoRFX[executionflow.ShipTo.ActorID]!executionflow.ShipTo.ActorID}", - <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> - "requested_delivery_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", - <#else> - "requested_delivery_start_datetime": "${aDateTime?iso_utc}", - - "automatic_generation": "true", - "consolidated_delivery": "false", - "intermediate_consignee": "false", - "print_deconsolidation_sheet": "false", - "print_final_delivery_note": "false", - "protected": "false", - "automatic_generation": "false", - "stock_despatch_at_preparation_confirmation": "false", - "deactivate": "false", - "requested_delivery_date_type": "010", - <#if executionflow.ShipTo.ActorID == ""> - "address": { - "mail_address": "${executionflow.Carrier.Actor.Emails[0]!""}", - "mobile_phone_number": "${executionflow.Carrier.Actor.Phones[0]!""}", - "street_and_number_and_po_box": "${executionflow.Carrier.Actor.Address.StreetAddressOne!""}", - "additional_address_data_1": "${executionflow.Carrier.Actor.Address.StreetAddressTwo!""}", - "additional_address_data_2": "${executionflow.Carrier.Actor.Address.StreetAddressThree!""}", - "postal_code": "${executionflow.Carrier.Actor.Address.PostalCode!""}", - "iso_country_code": "${executionflow.Carrier.Actor.Address.CountryCode!""}" + "originator_reference": "${executionflow.OrderID}", + "preparation_type_code": "${preparation_type_code}", + "end_consignee_code": "${executionflow.ShipTo.ActorID!""}", + <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> + "requested_delivery_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", + <#else> + "requested_delivery_start_datetime": "${aDateTime?iso_utc}", + + "requested_delivery_date_type": "${requested_delivery_date_type}", + "consolidated_delivery": "${consolidated_delivery_flag}", + "pick_sequence_code": "${pick_sequence_code}", + "intermediate_consignee": "false", + "protected": "${protected_flag}", + "automatic_generation": "${automatic_generation_flag}", + "optional_attributes": { + "apt_with_end_consignee": "${apt_with_end_consignee_flag}", + "apt_with_intermediate": "false", + "load_grouping": "${load_grouping}" + }, + <#if executionflow.ShipTo.ActorID == ""> + "address": { + "first_name": "${executionflow.ShipTo.Contact.FirstName!""}", + "last_name" :"${executionflow.ShipTo.Contact.Lastname!""}", + "mail_address": "${executionflow.ShipTo.Actor.Emails[0]!""}", + "mobile_phone_number": "${executionflow.ShipTo.Actor.Phones[0]!""}", + "street_and_number_and_po_box": "${executionflow.ShipTo.Actor.Address.StreetAddressOne?json_string!""}", + "additional_address_data_1": "${executionflow.ShipTo.Actor.Address.StreetAddressTwo?json_string!""}", + "additional_address_data_2": "${executionflow.ShipTo.Actor.Address.StreetAddressThree?json_string!""}", + "postal_code": "${executionflow.ShipTo.Actor.Address.PostalCode!""}", + "iso_country_code": "${executionflow.ShipTo.Actor.Address.CountryCode!""}" }, - - <#if executionflow.Lines??> - "line_list": [ - <#list executionflow.Lines as line> - { - - <#if line.RequestedContent.Goods.SegmentationKeys??> - <#assign ic_map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> - "owner_code_to_prepare": "${ic_map.Owner.String!"${Default_Value_Owner_SegmentationKey}"}", - "grade_code_to_prepare": "${SegmentationKeys_RPtoRFX[ic_map.Grade.String!""]!"${Default_Value_Grade_SegmentationKey}"}", - "batch_1": "${ic_map.BatchNumber!""}", - - "originator_reference_line_number": ${line.LineID?number}, - "item_code": "${line.RequestedContent.Goods.ItemID!""}", - "item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}", - "base_lv_quantity_to_prepare": ${line.RequestedMetrics.QuantityInBaseLV.Value!0}, - "input_order_data": "false", - "stock_reservation": "false", - "forced_priority_date_min_lead_time": "false", - "temp_substitution_possible": "false", - "substitution_possible": "false", - "base_lv_quantity": "true", - "any_lv": "false" - }<#sep>, - - ], + + <#if executionflow.Lines??> + "line_list": [ + <#list executionflow.Lines as line> + <#-- ******* line MetaData and Segmentationkeys to maps ******** --> + <#if executionflow.line.MetaData??> + <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(executionflow.line.MetaData, "Key", "Value") /> - "optional_attributes": { - "apt_with_end_consignee": "false", - "apt_with_intermediate": "false", - <#-- "load_grouping": "${executionflow.Carrier.ActorID!""}" --> - "load_grouping": "${load_grouping}" - } + <#if executionflow.line.RequestedContent.Goods.SegmentationKeys??> + <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(execution.line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> + + <#include "RPtoRFX_PrepOrder_DefaultLineData.ftl"> + { + "originator_reference_line_number": ${line.LineID?number}, + "item_code": "${line.RequestedContent.Goods.ItemID!""}", + "item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}", + "base_lv_quantity_to_prepare": ${line.RequestedMetrics.QuantityInBaseLV.Value!0}, + "owner_code_to_prepare" :"${owner_code_to_prepare}", + "grade_code_to_prepare" :"${grade_code_to_prepare}", + "input_order_data": "false", + "batch_1": "${batch_1}", + "any_lv": "false" + <#-- + "stock_reservation": "false", + "forced_priority_date_min_lead_time": "false", + "temp_substitution_possible": "false", + "substitution_possible": "false", + "base_lv_quantity": "true", + --> + + }<#sep>, + + + ] } } + \ No newline at end of file diff --git a/RPtoRFX_PrepOrder_DefaultData.ftl b/RPtoRFX_PrepOrder_DefaultData.ftl deleted file mode 100644 index 28d731a..0000000 --- a/RPtoRFX_PrepOrder_DefaultData.ftl +++ /dev/null @@ -1,9 +0,0 @@ -<#assign Default_Value_Owner_SegmentationKey = ""/> -<#assign Default_Value_Grade_SegmentationKey = "STD"/> -<#assign Reflex_Originator = "50000189"/> -<#assign activity_code = "PEN"/> -<#assign preparation_type_code = "010"/> -<#assign load_grouping = "DEFAUT"/> -<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} > -<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/> - diff --git a/RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl b/RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl new file mode 100644 index 0000000..89f5f38 --- /dev/null +++ b/RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl @@ -0,0 +1,19 @@ +<#-- Note : you can use Order Header Metadata, using the define map : Header_MetaData_Map --> + +<#assign activity_code = "PEN"/> +<#assign originator_code = "50000189"/> +<#assign preparation_type_code = "010"/> +<#assign requested_delivery_date_type = "010"/> +<#assign consolidated_delivery_flag ="false"/> +<#assign pick_sequence_code = ""/> +<#assign protected_flag ="false"/> +<#assign automatic_generation_flag ="false"/> +<#assign apt_with_end_consignee_flag="false"/> +<#assign load_grouping = "DEFAUT"/> + + + + + + + diff --git a/RPtoRFX_PrepOrder_DefaultLineData.ftl b/RPtoRFX_PrepOrder_DefaultLineData.ftl new file mode 100644 index 0000000..99252ef --- /dev/null +++ b/RPtoRFX_PrepOrder_DefaultLineData.ftl @@ -0,0 +1,8 @@ +<#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map --> +<#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map --> + +<#assign owner_code_to_prepare = ${SegmentationKeys_Map["myOwner"]}/> +<#assign grade_code_to_prepare =""/> +<#assign batch_1 =""/> + + From 5401e416a3a2368438a751502f9c0048ad068884 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Wed, 18 Oct 2023 10:48:09 +0200 Subject: [PATCH 50/68] RP to RFX receipt post --- ...=> RPtoRFX_PrepOrder_DefaultHeaderData.ftl | 6 ++ RPtoRFX_PrepOrder_DefaultLineData.ftl | 7 +- RPtoRFX_Receipt.ftl | 98 +++++++++++-------- RPtoRFX_Receipt_DefaultData.ftl | 9 -- RPtoRFX_Receipt_DefaultHeaderData.ftl | 12 +++ RPtoRFX_Receipt_DefaultLineData.ftl | 12 +++ 6 files changed, 92 insertions(+), 52 deletions(-) rename RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl => RPtoRFX_PrepOrder_DefaultHeaderData.ftl (80%) delete mode 100644 RPtoRFX_Receipt_DefaultData.ftl create mode 100644 RPtoRFX_Receipt_DefaultHeaderData.ftl create mode 100644 RPtoRFX_Receipt_DefaultLineData.ftl diff --git a/RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl similarity index 80% rename from RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl rename to RPtoRFX_PrepOrder_DefaultHeaderData.ftl index 89f5f38..63f104d 100644 --- a/RPtoRFX_PrepOrder_DefaultHeaderData copy.ftl +++ b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl @@ -1,5 +1,11 @@ <#-- Note : you can use Order Header Metadata, using the define map : Header_MetaData_Map --> +<#-- How to use MD Header map + Example : + <#assign pick_sequence_code = Header_MetaData_Map["OrderType"]/> +--> + + <#assign activity_code = "PEN"/> <#assign originator_code = "50000189"/> <#assign preparation_type_code = "010"/> diff --git a/RPtoRFX_PrepOrder_DefaultLineData.ftl b/RPtoRFX_PrepOrder_DefaultLineData.ftl index 99252ef..5f914d3 100644 --- a/RPtoRFX_PrepOrder_DefaultLineData.ftl +++ b/RPtoRFX_PrepOrder_DefaultLineData.ftl @@ -1,7 +1,12 @@ <#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map --> <#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map --> -<#assign owner_code_to_prepare = ${SegmentationKeys_Map["myOwner"]}/> +<#-- How to use MD or SK map + Example : + <#assign owner_code_to_prepare = SegmentationKeys_Map["Owner"]/> +--> + +<#assign owner_code_to_prepare = SegmentationKeys_Map["myOwner"]/> <#assign grade_code_to_prepare =""/> <#assign batch_1 =""/> diff --git a/RPtoRFX_Receipt.ftl b/RPtoRFX_Receipt.ftl index 9e1ac64..472f0c1 100644 --- a/RPtoRFX_Receipt.ftl +++ b/RPtoRFX_Receipt.ftl @@ -1,4 +1,4 @@ -<#include "RPtoRFX_Receipt_DefaultData.ftl"> +<#include "RPtoRFX_Receipt_DefaultHeaderData.ftl"> <#assign aDateTime = .now> { "id" : {"refid" : "${executionflow.OrderID}"}, @@ -6,55 +6,69 @@ "method" : "POST", "uri_substitutions": { "activity_code": "${activity_code}", - "physical_depot_code": "${ActorID_RPtoRFX[executionflow.ShipTo.ActorID]!executionflow.ShipTo.ActorID}", - "originator_code": "${Reflex_Originator}" + "physical_depot_code": "${executionflow.ShipTo.ActorID!""}", + "originator_code": "${originator_code}" }, "payload" : { - "receipt_reference": "${executionflow.OrderID}", - "receipt_type": "${receipt_type}", - "receipt_reason_code": "${receipt_reason_code}", - "work_mode_code" : "${work_mode_code}", - "original_code" : "${ActorID_RPtoRFX[executionflow.ShipFrom.ActorID]!executionflow.ShipFrom.ActorID}", - "carrier_code" : "${ActorID_RPtoRFX[executionflow.Carrier.ActorID]!executionflow.Carrier.ActorID}", - <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> - "carrier_appointment_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", - <#else> - "carrier_appointment_start_datetime": "${aDateTime?iso_utc}", - + "receipt_reference": "${executionflow.OrderID}", + "receipt_type": "${receipt_type}", + "receipt_reason_code": "${receipt_reason_code}", + "work_mode_code" : "${work_mode_code}", + "original_code" : "${executionflow.ShipFrom.ActorID}", + "carrier_code" : "${executionflow.Carrier.ActorID!""}", + + <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> + "receipt_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", + <#else> + "receipt_datetime": "${aDateTime?iso_utc}", + + + <#-- "carrier_appointment_made": "false", "receipt_in_cross_docking": "false", "dock_occupation_duration": 10, + --> - <#if executionflow.Lines??> - "line_list": [ - <#list executionflow.Lines as line> - { + <#if executionflow.Lines??> + "line_list": [ + <#list executionflow.Lines as line> - <#if line.RequestedContent.Goods.SegmentationKeys??> - <#assign ic_map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> - "owner_code": "${ic_map.Owner.String!"${Default_Value_Owner_SegmentationKey}"}", - "grade_code": "${SegmentationKeys_RPtoRFX[ic_map.Grade.String!""]!"${Default_Value_Grade_SegmentationKey}"}", - "batch_1": "${ic_map.BatchNumber!""}", - - "receipt_reference_line_no": ${line.LineID?number}, - "item_code": "${line.RequestedContent.Goods.ItemID!""}", - "item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}", - "level_1_quantity": ${line.RequestedMetrics.QuantityInBaseLV.Value!0} - - }<#sep>, - - ], + <#-- ******* line MetaData and Segmentationkeys to maps ******** --> + <#if executionflow.line.MetaData??> + <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(executionflow.line.MetaData, "Key", "Value") /> - "optional_attributes": { - "held_for_check": "false", - "held _for_repacking": "false", - "hold_for_specific_code": "false", - "hold_code": "false" - }, - "quality_control_attributes": { - "qcf_to_create_for_receipt_line": "false", - "exclude_item_from_inspection": "false" - } + <#if executionflow.line.RequestedContent.Goods.SegmentationKeys??> + <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(execution.line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> + + <#include "RPtoRFX_Receipt_DefaultLineData.ftl"> + + { + "receipt_reference_line_no": ${line.LineID?number}, + "item_code": "${line.RequestedContent.Goods.ItemID!""}", + "item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}", + "level_1_quantity": ${line.RequestedMetrics.QuantityInBaseLV.Value!0}, + "owner_code": "${owner_code}", + "grade_code": "${grade_code}", + "batch_1": "${batch_1!""}", + + <#-- + "optional_attributes": { + "held_for_check": "false", + "held _for_repacking": "false", + "hold_for_specific_code": "false", + "hold_code": "false" + }, + --> + "quality_control_attributes": { + <#--"qcf_to_create_for_receipt_line": "false",--> + "exclude_item_from_inspection": "false" + } + + }<#sep>, + + ], + + } } diff --git a/RPtoRFX_Receipt_DefaultData.ftl b/RPtoRFX_Receipt_DefaultData.ftl deleted file mode 100644 index c98c038..0000000 --- a/RPtoRFX_Receipt_DefaultData.ftl +++ /dev/null @@ -1,9 +0,0 @@ -<#assign Default_Value_Owner_SegmentationKey = "PEN"/> -<#assign Default_Value_Grade_SegmentationKey = "STD"/> -<#assign Reflex_Originator = "STANDARD"/> -<#assign work_mode_code = "LPA"/> -<#assign activity_code = "PEN"/> -<#assign receipt_reason_code = "REC"/> -<#assign receipt_type = "010"/> -<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} > -<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/> \ No newline at end of file diff --git a/RPtoRFX_Receipt_DefaultHeaderData.ftl b/RPtoRFX_Receipt_DefaultHeaderData.ftl new file mode 100644 index 0000000..3f815a6 --- /dev/null +++ b/RPtoRFX_Receipt_DefaultHeaderData.ftl @@ -0,0 +1,12 @@ +<#-- Note : you can use Order Header Metadata, using the define map : Header_MetaData_Map --> + +<#-- How to use MD Header map + Example : + <#assign receipt_type = Header_MetaData_Map["OrderType"]/> +--> + +<#assign activity_code = "PEN"/> +<#assign originator_code = "STANDARD"/> +<#assign receipt_type = "010"/> +<#assign receipt_reason_code = "REC"/> +<#assign work_mode_code = "LPA"/> diff --git a/RPtoRFX_Receipt_DefaultLineData.ftl b/RPtoRFX_Receipt_DefaultLineData.ftl new file mode 100644 index 0000000..9948b79 --- /dev/null +++ b/RPtoRFX_Receipt_DefaultLineData.ftl @@ -0,0 +1,12 @@ +<#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map --> +<#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map --> + +<#-- How to use MD or SK map + Example : + <#assign owner_code = SegmentationKeys_Map["Owner"]/> +--> + + +<#assign owner_code = "PEN"/> +<#assign grade_code = "STD"/> +<#assign batch_1 = "STD"/> \ No newline at end of file From 5d1a3ac6806ba15ec25418a73d711f03d9da906b Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 14:23:42 +0200 Subject: [PATCH 51/68] correction syntaxe ftl --- RPtoRFX_PrepOrder.ftl | 6 +++--- RPtoRFX_Receipt.ftl | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/RPtoRFX_PrepOrder.ftl b/RPtoRFX_PrepOrder.ftl index c17ef61..09d525d 100644 --- a/RPtoRFX_PrepOrder.ftl +++ b/RPtoRFX_PrepOrder.ftl @@ -50,10 +50,10 @@ "line_list": [ <#list executionflow.Lines as line> <#-- ******* line MetaData and Segmentationkeys to maps ******** --> - <#if executionflow.line.MetaData??> - <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(executionflow.line.MetaData, "Key", "Value") /> + <#if line.MetaData??> + <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(line.MetaData, "Key", "Value") /> - <#if executionflow.line.RequestedContent.Goods.SegmentationKeys??> + <#if line.RequestedContent.Goods.SegmentationKeys??> <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(execution.line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> <#include "RPtoRFX_PrepOrder_DefaultLineData.ftl"> diff --git a/RPtoRFX_Receipt.ftl b/RPtoRFX_Receipt.ftl index 472f0c1..534bf02 100644 --- a/RPtoRFX_Receipt.ftl +++ b/RPtoRFX_Receipt.ftl @@ -35,11 +35,11 @@ <#list executionflow.Lines as line> <#-- ******* line MetaData and Segmentationkeys to maps ******** --> - <#if executionflow.line.MetaData??> - <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(executionflow.line.MetaData, "Key", "Value") /> + <#if line.MetaData??> + <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(line.MetaData, "Key", "Value") /> - <#if executionflow.line.RequestedContent.Goods.SegmentationKeys??> - <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(execution.line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> + <#if line.RequestedContent.Goods.SegmentationKeys??> + <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> <#include "RPtoRFX_Receipt_DefaultLineData.ftl"> From 9575d790d0ffa534254eba0e65c985104f55ccd6 Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 14:34:50 +0200 Subject: [PATCH 52/68] correction syntaxe ftl --- RPtoRFX_PrepOrder.ftl | 2 +- RPtoRFX_Receipt.ftl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RPtoRFX_PrepOrder.ftl b/RPtoRFX_PrepOrder.ftl index 09d525d..f55bfbb 100644 --- a/RPtoRFX_PrepOrder.ftl +++ b/RPtoRFX_PrepOrder.ftl @@ -54,7 +54,7 @@ <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(line.MetaData, "Key", "Value") /> <#if line.RequestedContent.Goods.SegmentationKeys??> - <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(execution.line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> + <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> <#include "RPtoRFX_PrepOrder_DefaultLineData.ftl"> { diff --git a/RPtoRFX_Receipt.ftl b/RPtoRFX_Receipt.ftl index 534bf02..4fa8873 100644 --- a/RPtoRFX_Receipt.ftl +++ b/RPtoRFX_Receipt.ftl @@ -67,7 +67,7 @@ }<#sep>, - ], + ] } From d75526a5df5aefed691401057b4a21991a33fa82 Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 14:55:22 +0200 Subject: [PATCH 53/68] correction syntaxe ftl --- RPtoRFX_PrepOrder_DefaultHeaderData.ftl | 2 +- RPtoRFX_PrepOrder_DefaultLineData.ftl | 4 ++-- RPtoRFX_Receipt_DefaultHeaderData.ftl | 2 +- RPtoRFX_Receipt_DefaultLineData.ftl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RPtoRFX_PrepOrder_DefaultHeaderData.ftl b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl index 63f104d..9e82457 100644 --- a/RPtoRFX_PrepOrder_DefaultHeaderData.ftl +++ b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl @@ -2,7 +2,7 @@ <#-- How to use MD Header map Example : - <#assign pick_sequence_code = Header_MetaData_Map["OrderType"]/> + <#assign pick_sequence_code = Header_MetaData_Map[OrderType]/> --> diff --git a/RPtoRFX_PrepOrder_DefaultLineData.ftl b/RPtoRFX_PrepOrder_DefaultLineData.ftl index 5f914d3..7acb00f 100644 --- a/RPtoRFX_PrepOrder_DefaultLineData.ftl +++ b/RPtoRFX_PrepOrder_DefaultLineData.ftl @@ -3,10 +3,10 @@ <#-- How to use MD or SK map Example : - <#assign owner_code_to_prepare = SegmentationKeys_Map["Owner"]/> + <#assign owner_code_to_prepare = SegmentationKeys_Map[Owner]/> --> -<#assign owner_code_to_prepare = SegmentationKeys_Map["myOwner"]/> +<#assign owner_code_to_prepare = SegmentationKeys_Map[myOwner]/> <#assign grade_code_to_prepare =""/> <#assign batch_1 =""/> diff --git a/RPtoRFX_Receipt_DefaultHeaderData.ftl b/RPtoRFX_Receipt_DefaultHeaderData.ftl index 3f815a6..b1b9027 100644 --- a/RPtoRFX_Receipt_DefaultHeaderData.ftl +++ b/RPtoRFX_Receipt_DefaultHeaderData.ftl @@ -2,7 +2,7 @@ <#-- How to use MD Header map Example : - <#assign receipt_type = Header_MetaData_Map["OrderType"]/> + <#assign receipt_type = Header_MetaData_Map[OrderType]/> --> <#assign activity_code = "PEN"/> diff --git a/RPtoRFX_Receipt_DefaultLineData.ftl b/RPtoRFX_Receipt_DefaultLineData.ftl index 9948b79..02db5ac 100644 --- a/RPtoRFX_Receipt_DefaultLineData.ftl +++ b/RPtoRFX_Receipt_DefaultLineData.ftl @@ -3,7 +3,7 @@ <#-- How to use MD or SK map Example : - <#assign owner_code = SegmentationKeys_Map["Owner"]/> + <#assign owner_code = SegmentationKeys_Map[Owner]/> --> From 3d03e46188d84ad23261aab0547f4bd397c65ed7 Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 15:05:23 +0200 Subject: [PATCH 54/68] correction syntaxe ftl --- RPtoRFX_PrepOrder_DefaultHeaderData.ftl | 2 +- RPtoRFX_PrepOrder_DefaultLineData.ftl | 4 ++-- RPtoRFX_Receipt_DefaultHeaderData.ftl | 2 +- RPtoRFX_Receipt_DefaultLineData.ftl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RPtoRFX_PrepOrder_DefaultHeaderData.ftl b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl index 9e82457..0bd2ced 100644 --- a/RPtoRFX_PrepOrder_DefaultHeaderData.ftl +++ b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl @@ -2,7 +2,7 @@ <#-- How to use MD Header map Example : - <#assign pick_sequence_code = Header_MetaData_Map[OrderType]/> + <#assign pick_sequence_code = Header_MetaData_Map['OrderType']/> --> diff --git a/RPtoRFX_PrepOrder_DefaultLineData.ftl b/RPtoRFX_PrepOrder_DefaultLineData.ftl index 7acb00f..2929075 100644 --- a/RPtoRFX_PrepOrder_DefaultLineData.ftl +++ b/RPtoRFX_PrepOrder_DefaultLineData.ftl @@ -3,10 +3,10 @@ <#-- How to use MD or SK map Example : - <#assign owner_code_to_prepare = SegmentationKeys_Map[Owner]/> + <#assign owner_code_to_prepare = SegmentationKeys_Map['Owner']/> --> -<#assign owner_code_to_prepare = SegmentationKeys_Map[myOwner]/> +<#assign owner_code_to_prepare = SegmentationKeys_Map['myOwner']/> <#assign grade_code_to_prepare =""/> <#assign batch_1 =""/> diff --git a/RPtoRFX_Receipt_DefaultHeaderData.ftl b/RPtoRFX_Receipt_DefaultHeaderData.ftl index b1b9027..fd8f82d 100644 --- a/RPtoRFX_Receipt_DefaultHeaderData.ftl +++ b/RPtoRFX_Receipt_DefaultHeaderData.ftl @@ -2,7 +2,7 @@ <#-- How to use MD Header map Example : - <#assign receipt_type = Header_MetaData_Map[OrderType]/> + <#assign receipt_type = Header_MetaData_Map['OrderType']/> --> <#assign activity_code = "PEN"/> diff --git a/RPtoRFX_Receipt_DefaultLineData.ftl b/RPtoRFX_Receipt_DefaultLineData.ftl index 02db5ac..821122b 100644 --- a/RPtoRFX_Receipt_DefaultLineData.ftl +++ b/RPtoRFX_Receipt_DefaultLineData.ftl @@ -3,7 +3,7 @@ <#-- How to use MD or SK map Example : - <#assign owner_code = SegmentationKeys_Map[Owner]/> + <#assign owner_code = SegmentationKeys_Map['Owner']/> --> From 202804ad663637af76517bd858955118f84e19d9 Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 15:15:14 +0200 Subject: [PATCH 55/68] correction syntaxe ftl --- RPtoRFX_PrepOrder.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RPtoRFX_PrepOrder.ftl b/RPtoRFX_PrepOrder.ftl index f55bfbb..72b42f3 100644 --- a/RPtoRFX_PrepOrder.ftl +++ b/RPtoRFX_PrepOrder.ftl @@ -53,9 +53,9 @@ <#if line.MetaData??> <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(line.MetaData, "Key", "Value") /> - <#if line.RequestedContent.Goods.SegmentationKeys??> + <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> - + <#include "RPtoRFX_PrepOrder_DefaultLineData.ftl"> { "originator_reference_line_number": ${line.LineID?number}, From 6fd0e7e2e4d6a0ea0eb1c0ed8431720d704d4ef5 Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 16:05:07 +0200 Subject: [PATCH 56/68] correction syntaxe ftl --- RPtoRFX_ExecutionflowEvent.ftl | 5 +++-- RPtoRFX_PrepOrder.ftl | 4 ++-- RPtoRFX_PrepOrder_DefaultHeaderData.ftl | 2 +- RPtoRFX_PrepOrder_DefaultLineData.ftl | 4 ++-- RPtoRFX_Receipt_DefaultHeaderData.ftl | 2 +- RPtoRFX_Receipt_DefaultLineData.ftl | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/RPtoRFX_ExecutionflowEvent.ftl b/RPtoRFX_ExecutionflowEvent.ftl index a392f4a..24d6407 100644 --- a/RPtoRFX_ExecutionflowEvent.ftl +++ b/RPtoRFX_ExecutionflowEvent.ftl @@ -7,8 +7,9 @@ <#assign projectRP = project> <#assign organisationRP = organisation> - - +#-- initialisation map for SegmentationKey and MetaData --> +<#assign Header_MetaData_Map {} /> +<#assign SegmentationKeys_Map {} /> <#switch eventRP.event> <#case "Created"> diff --git a/RPtoRFX_PrepOrder.ftl b/RPtoRFX_PrepOrder.ftl index 72b42f3..f55bfbb 100644 --- a/RPtoRFX_PrepOrder.ftl +++ b/RPtoRFX_PrepOrder.ftl @@ -53,9 +53,9 @@ <#if line.MetaData??> <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(line.MetaData, "Key", "Value") /> - + <#if line.RequestedContent.Goods.SegmentationKeys??> <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> - + <#include "RPtoRFX_PrepOrder_DefaultLineData.ftl"> { "originator_reference_line_number": ${line.LineID?number}, diff --git a/RPtoRFX_PrepOrder_DefaultHeaderData.ftl b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl index 0bd2ced..1879fd8 100644 --- a/RPtoRFX_PrepOrder_DefaultHeaderData.ftl +++ b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl @@ -2,7 +2,7 @@ <#-- How to use MD Header map Example : - <#assign pick_sequence_code = Header_MetaData_Map['OrderType']/> + <#assign pick_sequence_code = Header_MetaData_Map["OrderType"]!""/> --> diff --git a/RPtoRFX_PrepOrder_DefaultLineData.ftl b/RPtoRFX_PrepOrder_DefaultLineData.ftl index 2929075..1ff229a 100644 --- a/RPtoRFX_PrepOrder_DefaultLineData.ftl +++ b/RPtoRFX_PrepOrder_DefaultLineData.ftl @@ -3,10 +3,10 @@ <#-- How to use MD or SK map Example : - <#assign owner_code_to_prepare = SegmentationKeys_Map['Owner']/> + <#assign owner_code_to_prepare = SegmentationKeys_Map["Owner"]!""/> --> -<#assign owner_code_to_prepare = SegmentationKeys_Map['myOwner']/> +<#assign owner_code_to_prepare = SegmentationKeys_Map["myOwner"]!""/> <#assign grade_code_to_prepare =""/> <#assign batch_1 =""/> diff --git a/RPtoRFX_Receipt_DefaultHeaderData.ftl b/RPtoRFX_Receipt_DefaultHeaderData.ftl index fd8f82d..f2d8220 100644 --- a/RPtoRFX_Receipt_DefaultHeaderData.ftl +++ b/RPtoRFX_Receipt_DefaultHeaderData.ftl @@ -2,7 +2,7 @@ <#-- How to use MD Header map Example : - <#assign receipt_type = Header_MetaData_Map['OrderType']/> + <#assign receipt_type = Header_MetaData_Map["OrderType"]!""/> --> <#assign activity_code = "PEN"/> diff --git a/RPtoRFX_Receipt_DefaultLineData.ftl b/RPtoRFX_Receipt_DefaultLineData.ftl index 821122b..d7383f7 100644 --- a/RPtoRFX_Receipt_DefaultLineData.ftl +++ b/RPtoRFX_Receipt_DefaultLineData.ftl @@ -3,7 +3,7 @@ <#-- How to use MD or SK map Example : - <#assign owner_code = SegmentationKeys_Map['Owner']/> + <#assign owner_code = SegmentationKeys_Map["Owner"]!""/> --> From 510376d5382bb7ba2c0fde38783982640d8786bc Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 16:11:18 +0200 Subject: [PATCH 57/68] correction syntaxe ftl --- RPtoRFX_ExecutionflowEvent.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RPtoRFX_ExecutionflowEvent.ftl b/RPtoRFX_ExecutionflowEvent.ftl index 24d6407..92ae39a 100644 --- a/RPtoRFX_ExecutionflowEvent.ftl +++ b/RPtoRFX_ExecutionflowEvent.ftl @@ -8,8 +8,8 @@ <#assign organisationRP = organisation> #-- initialisation map for SegmentationKey and MetaData --> -<#assign Header_MetaData_Map {} /> -<#assign SegmentationKeys_Map {} /> +<#assign Header_MetaData_Map = {} /> +<#assign SegmentationKeys_Map = {} /> <#switch eventRP.event> <#case "Created"> From b90c1306dbf2972f78bd90320d0b90bede9b4317 Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 16:14:06 +0200 Subject: [PATCH 58/68] correction syntaxe ftl --- RPtoRFX_ExecutionflowEvent.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RPtoRFX_ExecutionflowEvent.ftl b/RPtoRFX_ExecutionflowEvent.ftl index 92ae39a..8bb8e50 100644 --- a/RPtoRFX_ExecutionflowEvent.ftl +++ b/RPtoRFX_ExecutionflowEvent.ftl @@ -7,7 +7,7 @@ <#assign projectRP = project> <#assign organisationRP = organisation> -#-- initialisation map for SegmentationKey and MetaData --> +<#-- initialisation map for SegmentationKey and MetaData --> <#assign Header_MetaData_Map = {} /> <#assign SegmentationKeys_Map = {} /> From c388a7ff870f7f5f10e681115ea54d15767ae12f Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 18 Oct 2023 17:31:06 +0200 Subject: [PATCH 59/68] correction syntaxe ftl --- RPtoRFX_ExecutionflowEvent.ftl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RPtoRFX_ExecutionflowEvent.ftl b/RPtoRFX_ExecutionflowEvent.ftl index 8bb8e50..30f9c0e 100644 --- a/RPtoRFX_ExecutionflowEvent.ftl +++ b/RPtoRFX_ExecutionflowEvent.ftl @@ -10,6 +10,8 @@ <#-- initialisation map for SegmentationKey and MetaData --> <#assign Header_MetaData_Map = {} /> <#assign SegmentationKeys_Map = {} /> +<#assign Line_MetaData_Map = {} /> + <#switch eventRP.event> <#case "Created"> From 8fe64aa5b08d6c881450c651612d64d6a04e4a51 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 19 Oct 2023 16:31:56 +0200 Subject: [PATCH 60/68] ecom consignee management --- RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 37 ++++++++++++------------ 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index dbe895e..4e0b4b8 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -27,31 +27,30 @@ }, "ShipFromAcked": true, "ShipTo": { - <#if order.end_consignee_code != "ECOM"> - "ActorID": "${order.end_consignee_code}" - <#else> - <#if order.address != ""> - "Actor": - { - "Name" : "${order.address.name_or_company_name!""}", - "Address" : - { - "City" : "${order.address.post_code_area_name!""}", - "CountryCode" : "${order.address.iso_country_code!""}", - "PostalCode" : "${order.address.postal_code!""}", - "StreetAddressOne" : "${order.address.street_and_number_and_po_box!""}", - "StreetAddressTwo" : "${order.address.additional_address_data_1!""}", - "StreetAddressThree" : "${order.address.additional_address_data_2!""}" - } + <#if order.address.type_code == "" && order.address.title_code == "" && order.address.first_name == "" && order.address.last_name == "" && order.address.mail_address == "" && order.address.contact_type_code == "" && order.address.mobile_phone_number == "" && order.address.land_line_phone_number == "" && order.address.fax_number == "" && order.address.address_type_code == "" && order.address.name_or_company_name == "" && order.address.additional_address_data_1 == "" && order.address.additional_address_data_2 == "" && order.address.post_code_area_name == "" && order.address.territorial_division_code == "" && order.address.postal_code == "" && order.address.iso_country_code == "" && > + "ActorID": "${order.end_consignee_code}" + <#else> + "Actor": + { + "Name" : "${order.address.name_or_company_name!""}", + "Address" : + { + "City" : "${order.address.post_code_area_name!""}", + "CountryCode" : "${order.address.iso_country_code!""}", + "PostalCode" : "${order.address.postal_code!""}", + "StreetAddressOne" : "${order.address.street_and_number_and_po_box!""}", + "StreetAddressTwo" : "${order.address.additional_address_data_1!""}", + "StreetAddressThree" : "${order.address.additional_address_data_2!""}" + } }, - "Contact" : + "Contact" : { "FirstName" : "${order.address.first_name!""}", "LastName" : "${order.address.last_name!""}", "Emails" : ["${order.address.mail_address!""}"], - "Phones" : ["${order.address.mobile_phone_number!""}"] + "Phones" : ["${order.address.mobile_phone_number!""}","${order.address.land_line_phone_number!""}", "${order.address.fax_number!""}" ] } - + }, From edb9c99a5905d2b19a503512716e3501a641d9d5 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 19 Oct 2023 16:37:52 +0200 Subject: [PATCH 61/68] syntax correction --- RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index 4e0b4b8..353d997 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -27,7 +27,7 @@ }, "ShipFromAcked": true, "ShipTo": { - <#if order.address.type_code == "" && order.address.title_code == "" && order.address.first_name == "" && order.address.last_name == "" && order.address.mail_address == "" && order.address.contact_type_code == "" && order.address.mobile_phone_number == "" && order.address.land_line_phone_number == "" && order.address.fax_number == "" && order.address.address_type_code == "" && order.address.name_or_company_name == "" && order.address.additional_address_data_1 == "" && order.address.additional_address_data_2 == "" && order.address.post_code_area_name == "" && order.address.territorial_division_code == "" && order.address.postal_code == "" && order.address.iso_country_code == "" && > + <#if order.address.type_code == "" && order.address.title_code == "" && order.address.first_name == "" && order.address.last_name == "" && order.address.mail_address == "" && order.address.contact_type_code == "" && order.address.mobile_phone_number == "" && order.address.land_line_phone_number == "" && order.address.fax_number == "" && order.address.address_type_code == "" && order.address.name_or_company_name == "" && order.address.additional_address_data_1 == "" && order.address.additional_address_data_2 == "" && order.address.post_code_area_name == "" && order.address.territorial_division_code == "" && order.address.postal_code == "" && order.address.iso_country_code == ""> "ActorID": "${order.end_consignee_code}" <#else> "Actor": From 9ac84ae63bdc01a8227c4ef46acc99d445a39888 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 19 Oct 2023 18:29:34 +0200 Subject: [PATCH 62/68] addition for HU labelled --- RFXtoRP_HsrPrepa.ftl | 9 +++++++ RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl | 30 ++++++++++----------- RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl | 24 +++++++++++++++++ 3 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index 9ed9935..45ed74d 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -28,6 +28,15 @@ "datas" : <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> } + <#if preparationOrder.preparation_line_lst.despatched_ipg.consignment_unit_id != ""> <#-- if le colis a un tracking - pb listes--> + , + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> + } + ] <#break> diff --git a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl index 8e1c598..6e99c6b 100644 --- a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl +++ b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl @@ -1,25 +1,25 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> [ - +<#assign dispatched_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) /> <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> - <#assign preparationOrder_confirmation_datetime = RfxDateTimetoUTC(preparation_line.confirmation_datetime,time_zone_offset_rfx) /> - <#list preparation_line.despatched_ipg_list as despatched_ipg> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - <#if despatched_ipg.carton_number != "000000000000000000"> - "RefID": "${despatched_ipg.carton_number}" + <#list preparation_line.despatched_ipg_list as despatched_ipg> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if despatched_ipg.carton_number != "000000000000000000"> + "RefID": "${despatched_ipg.carton_number}" <#else> - "RefID": "${despatched_ipg.hd_number}" + "RefID": "${despatched_ipg.hd_number}" - - }, - "Payload": { - + "RefDate": { + "DateTime": "${dispatched_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" } + }, + "Payload": { } }<#sep>, <#sep>, diff --git a/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl new file mode 100644 index 0000000..ae20883 --- /dev/null +++ b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl @@ -0,0 +1,24 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparation_line.despatched_ipg_list as despatched_ipg> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${despatched_ipg.consignment_unit_id}" + }, + "Payload": { + <#if despatched_ipg.carton_number != "000000000000000000"> + "HandlingunitID": "${despatched_ipg.carton_number}" + <#else> + "HandlingunitID": "${despatched_ipg.hd_number}" + + } + }<#sep>, + + <#sep>, + +] From d9f9a4762afb54e4a4a227f153d7d75f06403af7 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Fri, 20 Oct 2023 09:28:44 +0200 Subject: [PATCH 63/68] Tracking HU labelled --- RFXtoRP_HsrPrepa.ftl | 24 ++++++++++------- RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl | 36 +++++++++++-------------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index 45ed74d..f365bc0 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -28,15 +28,21 @@ "datas" : <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> } - <#if preparationOrder.preparation_line_lst.despatched_ipg.consignment_unit_id != ""> <#-- if le colis a un tracking - pb listes--> - , - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> - } - + + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparation_line.despatched_ipg_list as despatched_ipg> + <#if despatched_ipg.consignment_unit_id != ""> + , + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> + } + + + + ] <#break> diff --git a/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl index ae20883..dd55a18 100644 --- a/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl +++ b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl @@ -1,24 +1,20 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> [ - <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> - <#list preparation_line.despatched_ipg_list as despatched_ipg> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${despatched_ipg.consignment_unit_id}" - }, - "Payload": { - <#if despatched_ipg.carton_number != "000000000000000000"> - "HandlingunitID": "${despatched_ipg.carton_number}" - <#else> - "HandlingunitID": "${despatched_ipg.hd_number}" - - } - }<#sep>, - - <#sep>, - + + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${despatched_ipg.consignment_unit_id}" + }, + "Payload": { + <#if despatched_ipg.carton_number != "000000000000000000"> + "HandlingunitID": "${despatched_ipg.carton_number}" + <#else> + "HandlingunitID": "${despatched_ipg.hd_number}" + + } + } ] From 18df36ad611e364b428ccbe0c3d7710c2cb048bd Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Fri, 20 Oct 2023 16:03:59 +0200 Subject: [PATCH 64/68] syntax correction --- RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl index 6e99c6b..6105a16 100644 --- a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl +++ b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl @@ -10,9 +10,9 @@ }, "ID": { <#if despatched_ipg.carton_number != "000000000000000000"> - "RefID": "${despatched_ipg.carton_number}" + "RefID": "${despatched_ipg.carton_number}", <#else> - "RefID": "${despatched_ipg.hd_number}" + "RefID": "${despatched_ipg.hd_number}", "RefDate": { "DateTime": "${dispatched_datetime}", From a214af479debb920b168c975fabf72f6a63182ea Mon Sep 17 00:00:00 2001 From: Vincent LEMAITRE Date: Mon, 23 Oct 2023 15:07:17 +0000 Subject: [PATCH 65/68] added version file for release management --- VERSION | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..9d7c109 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.3.0-SNAPSHOT From a354a01d3243f1f54aa932ce588ace9a56da8e27 Mon Sep 17 00:00:00 2001 From: Christian Senet Date: Mon, 23 Oct 2023 15:30:28 +0000 Subject: [PATCH 66/68] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00fc740..d20fd83 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ -# reflex-wms-connector +# Reflex Platform Core FTLs + +These FTL core files aim to translate data flow from Reflex WMS into Reflex platform API. -## Getting started + +You can find more info about those files in the Reflex platform documentation center : https://docs.viz.reflex-platform.com/connectivity/howto/reflex-wms-connector/ + From b209e8b5e1ecd838fc609b992c7edd5c9f91694a Mon Sep 17 00:00:00 2001 From: Vincent Le Maitre Date: Tue, 24 Oct 2023 08:22:11 +0200 Subject: [PATCH 67/68] release 1.2.4 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9d7c109..e8ea05d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.0-SNAPSHOT +1.2.4 From 04ec57377a567b98f1073e86d0a409f8e07cb431 Mon Sep 17 00:00:00 2001 From: Vincent Le Maitre Date: Tue, 24 Oct 2023 16:47:19 +0200 Subject: [PATCH 68/68] Release 1.2.5 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e8ea05d..c813fe1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.4 +1.2.5