69 lines
2.4 KiB
Java
69 lines
2.4 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">
|
|
<#stop "Not yet implemented">
|
|
<#-- *********************************************** Action = Update ******************** -->
|
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
|
<#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)>
|
|
[
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceUpdateAppointment> <#-- à revoir -->
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrCarrierApt_SiteForceUpdateAppointment.ftl">
|
|
}
|
|
]
|
|
<#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>
|
|
|