Expiry group management

This commit is contained in:
Laure Pascal 2023-09-07 14:59:06 +02:00
parent dc46aed100
commit fa0766b00a
2 changed files with 15 additions and 16 deletions

View File

@ -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])>
</#list>
<#assign output = JsonUtil.print(temp)>
${output}
@ -25,4 +26,3 @@ ${output}
<#default>
<#stop>
</#switch>

View File

@ -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??>