diff --git a/RFXtoRP_HfExpGrpList.ftl b/RFXtoRP_HfExpGrpList.ftl index 4c31349..cece3f9 100644 --- a/RFXtoRP_HfExpGrpList.ftl +++ b/RFXtoRP_HfExpGrpList.ftl @@ -4,19 +4,20 @@ <#assign organisationRP = organisation> <#include "ExpiryGroupList.ftl"> <#assign aDateTime = .now> +<#assign Date_Tye_Code_KV = {"010":"PRODUCTION_DATE","020":"PRODUCTION_DATE","030":"BEST_BEFORE_DATE","040":"SELL_BY_DATE","050":"USE_BY_DATE"} > <#switch cloudEventMsg.action> <#case "C"> <#case "U"> <#case "D"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#-- *********************************************** Action = CREATE or UPDATE or DELETE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign file = JsonUtil.jsonToMap(dataRfx)> <#assign temp = ExpiryGroupList64> <#list file.expiry_group_list as expiry_group> - <#assign temp = JsonUtil.update(temp,cloudEventMsg.action,expiry_group.exipiry_group_code,expiry_group.priority_date_type_code)> + <#assign temp = JsonUtil.update(temp,cloudEventMsg.action,expiry_group.exipiry_group_code,Date_Tye_Code_KV[expiry_group.priority_date_type_code])> <#assign output = JsonUtil.print(temp)> ${output} @@ -25,4 +26,3 @@ ${output} <#default> <#stop> - diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index c6dd4ef..48727ea 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -1,4 +1,5 @@ <#include "HfRpConfig.ftl"> +<#include "HfExpGrpList"> [ { "Header": { @@ -9,23 +10,21 @@ }, "Payload": { "DescriptionsByLanguage": [{ - "ShortDescription": "${item.short_designation?json_string}", - "LongDescription": "${item.designation?json_string}", - "TechnicalDetails": "${item.item_description?json_string}", - "LanguageCodeISO6391": "${text_language_rfx}" - } - ], -<#-- /!\ table de correspondance à faire disparaitre /!\ --> - <#assign ExpiryConstraint = {"REC":"PRODUCTION_DATE", "DDM":"BEST_BEFORE_DATE", "DLC":"USE_BY_DATE"}/> + "ShortDescription": "${item.short_designation?json_string}", + "LongDescription": "${item.designation?json_string}", + "TechnicalDetails": "${item.item_description?json_string}", + "LanguageCodeISO6391": "${text_language_rfx}" + } + ], "ExpiryConstraint": { - "Type": "${ExpiryConstraint[item.expiry_group_code]!"UNKNOWN_DATE"}" - }, + "Type": "${ExpiryGroupList[item.expiry_group_code]!"UNKNOWN_DATE"}" + }, <#-- Item metadata inclusion --> - <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">, + <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">, - <#-- Item Photo URI could be added here --> - <#--"PhotoURI": " ", --> + <#-- Item Photo URI could be added here --> + <#--"PhotoURI": " ", --> <#-- Loop for the Logistical Variants - LV --> <#if item.logistical_variant_list??>