reflex-wms-connector/RFXtoRP_HsrCarrierApt.ftl
2025-11-20 09:33:41 +01:00

72 lines
2.6 KiB
Java

<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#include "ActorPrefix.ftl">
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceBookAppointment>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_AppointmentCarrierExpected.ftl">
}
]
<#break>
<#case "U">
<#-- *********************************************** Action = Update ********************-->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)>
<#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?size == carrier_apt.physical_receipt_list?filter(l ->l??)?size)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCommissionsUpdated> <#-- à revoir-->
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_AppointmentCommissionsUpdated.ftl">
}
]
<#else>
<#stop> <#--no comission-->
</#if>
<#break>
<#case "D">
<#-- *********************************************** Action = Delete ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)>
[
<#-- Ajout des lignes-->
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteCancelAppointment>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl">
}
]
<#break>
<#default>
<#stop >
</#switch>