diff --git a/RFXtoRP_HsaDispute.ftl b/RFXtoRP_HsaDispute.ftl index 90f674f..55ee386 100644 --- a/RFXtoRP_HsaDispute.ftl +++ b/RFXtoRP_HsaDispute.ftl @@ -1,4 +1,8 @@ -<#-- *********************************************** Parameter global ******************** --> +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + <#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -6,14 +10,29 @@ <#assign aDateTime = .now> <#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#case "D"> - <#stop "no generic FTL file available yet for Dispute"> - <#break> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign dispute = JsonUtil.jsonToMap(dataRfx)> + [ + + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ClaimCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaDispute_Created.ftl"> + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop "event not supported - Case D "> + <#break> - <#default> - <#stop "event not supported"> + <#default> + <#stop "event not supported"> diff --git a/RFXtoRP_HsaDispute_Created.ftl b/RFXtoRP_HsaDispute_Created.ftl new file mode 100644 index 0000000..243ad4b --- /dev/null +++ b/RFXtoRP_HsaDispute_Created.ftl @@ -0,0 +1,40 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if dispute.dispute_preparation??> + "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?trim?json_string}${dispute.dispute_preparation.preparation_activity_code?trim?json_string}${dispute.dispute_preparation.preparation_order_list.preparation_order_contractor_code?trim?json_string}${dispute.dispute_year_number?trim?json_string}${dispute.dispute_number?trim?json_string}" + <#else> + <#if dispute.dispute_reception??> + "RefID": "${dispute.dispute_reception.reception_physical_depot_code?trim?json_string}${dispute.dispute_reception.reception_activity_code?trim?json_string}${dispute.dispute_reception.reception_contractor_code?trim?json_string}${dispute.dispute_year_number?trim?json_string}${dispute.dispute_number?trim?json_string}" + + + }, + "Payload": { + + <#-- Case of dispute on preparation --> + <#if dispute.dispute_type_code=="050" > + "EntityID":"${dispute.dispute_preparation.preparation_order_list.preparation_order_contractor_reference}", + <#if dispute.dispute_reason_code == "001"> <#--Enter your Reflex Reason code and mappe it with Platform reason code--> + "ClaimTypeID":"CLAIMTYPE_${projectRP}_ORDER_RETARDLIV" + + <#else> + <#-- Case of dispute on receipt --> + <#if dispute.dispute_type_code=="070" || dispute.dispute_type_code=="030" > + "EntityID":"${dispute.dispute_reception.reception_reference}", + <#if dispute.dispute_reason_code == "M1"> <#--Enter your Reflex Reason code and mappe it with Platform reason code--> + "ClaimTypeID":"CLAIMTYPE_${projectRP}_ORDER_RETARDLIV" + + + + + } + } +] + + + diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl index bee18d4..4fa3d1d 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl @@ -18,21 +18,21 @@ "Value": { "String" : "no batch"} <#else> "Value": { "String" : "${reflexMvtStockInterface.batch_1}"} - + }, { "Key": "HeldForSpecificCode", "Value": { "Bool" : "${reflexMvtStockInterface.ipg_specific_code_held}"} }, - + { - <#assign manufacturing_date = reflexMvtStockInterface.manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + <#assign manufacturing_date = reflexMvtStockInterface.manufacture_date?datetime(rfx_date_format_default)?iso_utc /> "Key": "ManufacturingDate", "Value": "Timestamp": { "AuthorTimeZone": "${time_zone_rfx}", "DateTime": "${manufacturing_date}" } - } + } ] --> diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index a8ce5c9..5e62e0b 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -24,7 +24,9 @@ <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">, <#-- Item Photo URI could be added here --> - <#--"PhotoURI": " ", --> + <#if item.url?? && item.url!==""> + "PhotoURI": "${item.url?json_string}", + <#-- Loop for the Logistical Variants - LV --> <#if item.logistical_variant_list??>