<#-- **** input parameters ***** --> <#-- input : message HARDIS WMS for anticipated receipt --> <#-- project : projectId in HARDIS SC NETWORK --> <#-- organisation : organisationtId in HARDIS SC NETWORK --> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> <#assign aDateTime = .now> <#switch cloudEventMsg.action> <#case "C"> <#-- *********************************************** Action = CREATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)> [ <#if AncReceipt.line_list?? && AncReceipt.line_list[0]??> { <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCreated> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrAntRec_Created.ftl"> }, { <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderReceiptExpected> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrAntRec_ReceiptExpected.ftl"> } ] <#else> <#stop> <#break> <#case "U"> <#-- *********************************************** Action = UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)> [ <#if AncReceipt.generated?? && AncReceipt.generated.total_level_1_quantity==0 && AncReceipt.generated.total_level_2_quantity==0 && AncReceipt.generated.total_level_3_quantity==0 && AncReceipt.anticipated_receipt_closed == "true" > { <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCancelled> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrAntRec_Cancelled.ftl"> } <#else> <#if AncReceipt.anticipated_receipt_closed == "true" > { <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderAppointmentBookingDisabled> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrAntRec_AppointmentBookingDisabled.ftl"> }, { <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderAnticipatedClosed> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrAntRec_AnticipatedClosed.ftl"> } ] <#break> <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCancelled> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrAntRec_Cancelled.ftl"> } ] <#break> <#default> <#stop >