<#-- **** 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"> }, { <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCustomFieldsUpdated> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrCarrierApt_AppointmentCustomFieldsUpdated.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?filter(l ->l??)?size != 0)> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceUpdateAppointment> <#-- à revoir--> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrCarrierApt_SiteForceUpdateAppointment.ftl"> } ] <#else> <#stop> <#--no comission--> <#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 >