From a7055b1a1efae32526f50a27a73e3fd791cdd946 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Mon, 4 Sep 2023 16:41:21 +0200 Subject: [PATCH] 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