Expiry group management
This commit is contained in:
parent
dc46aed100
commit
fa0766b00a
@ -4,19 +4,20 @@
|
|||||||
<#assign organisationRP = organisation>
|
<#assign organisationRP = organisation>
|
||||||
<#include "ExpiryGroupList.ftl">
|
<#include "ExpiryGroupList.ftl">
|
||||||
<#assign aDateTime = .now>
|
<#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>
|
<#switch cloudEventMsg.action>
|
||||||
<#case "C">
|
<#case "C">
|
||||||
<#case "U">
|
<#case "U">
|
||||||
<#case "D">
|
<#case "D">
|
||||||
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
|
<#-- *********************************************** Action = CREATE or UPDATE or DELETE ******************** -->
|
||||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||||
<#assign file = JsonUtil.jsonToMap(dataRfx)>
|
<#assign file = JsonUtil.jsonToMap(dataRfx)>
|
||||||
|
|
||||||
<#assign temp = ExpiryGroupList64>
|
<#assign temp = ExpiryGroupList64>
|
||||||
<#list file.expiry_group_list as expiry_group>
|
<#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>
|
</#list>
|
||||||
<#assign output = JsonUtil.print(temp)>
|
<#assign output = JsonUtil.print(temp)>
|
||||||
${output}
|
${output}
|
||||||
@ -25,4 +26,3 @@ ${output}
|
|||||||
<#default>
|
<#default>
|
||||||
<#stop>
|
<#stop>
|
||||||
</#switch>
|
</#switch>
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<#include "HfRpConfig.ftl">
|
<#include "HfRpConfig.ftl">
|
||||||
|
<#include "HfExpGrpList">
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"Header": {
|
"Header": {
|
||||||
@ -15,10 +16,8 @@
|
|||||||
"LanguageCodeISO6391": "${text_language_rfx}"
|
"LanguageCodeISO6391": "${text_language_rfx}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
<#-- /!\ table de correspondance à faire disparaitre /!\ -->
|
|
||||||
<#assign ExpiryConstraint = {"REC":"PRODUCTION_DATE", "DDM":"BEST_BEFORE_DATE", "DLC":"USE_BY_DATE"}/>
|
|
||||||
"ExpiryConstraint": {
|
"ExpiryConstraint": {
|
||||||
"Type": "${ExpiryConstraint[item.expiry_group_code]!"UNKNOWN_DATE"}"
|
"Type": "${ExpiryGroupList[item.expiry_group_code]!"UNKNOWN_DATE"}"
|
||||||
},
|
},
|
||||||
|
|
||||||
<#-- Item metadata inclusion -->
|
<#-- Item metadata inclusion -->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user