diff --git a/RPtoRFX_AppointmentEvent.ftl b/RPtoRFX_AppointmentEvent.ftl index 23a2c15..2527390 100644 --- a/RPtoRFX_AppointmentEvent.ftl +++ b/RPtoRFX_AppointmentEvent.ftl @@ -11,28 +11,51 @@ <#assign organisationRP = organisation> <#switch eventRP.event> - <#case "Created"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign appointment = eventRP.data /> - [ - { +<#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#case "Created"> + <#assign appointment = eventRP.data /> + [ + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentCreated.ftl"> + } + <#--{ - <#assign apiRestReflexID = ApiRestReflexID.appointment_post> - "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_CarrierAppointmentCreated.ftl"> - }, - { - - <#assign apiRestReflexID = ApiRestReflexID.appointment_put> - "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_CarrierAppointmentUpdated.ftl"> - } - ] - <#break> - <#default> - <#stop > + <#assign apiRestReflexID = ApiRestReflexID.appointment_put> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentUpdated.ftl"> + }--> + ] + <#break> +<#-- *********************************************** Action = CommissionsUpdated ******************** --> + <#case "CommissionsUpdated"> + <#assign appointment = eventRP.data /> + [ + { + <#assign apiRestReflexID = ApiRestReflexID.physical_receipt_associations_post> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentAssociationPhysicalReceipt.ftl"> + } + ] + <#break> +<#-- *********************************************** Action = SlotUpdated ******************** --> + <#case "SlotUpdated"> + <#assign appointment = eventRP.data /> + [ + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_put> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentSlotUpdated.ftl"> + } + ] + <#break> +<#default> + <#stop > diff --git a/RPtoRFX_CarrierAppointmentAssociationPhysicalReceipt.ftl b/RPtoRFX_CarrierAppointmentAssociationPhysicalReceipt.ftl new file mode 100644 index 0000000..9927961 --- /dev/null +++ b/RPtoRFX_CarrierAppointmentAssociationPhysicalReceipt.ftl @@ -0,0 +1,26 @@ +{ + "id" : {"refid" : "${eventRP.refid?json_string}"}, + "route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments/{appointment_reference}/physical_receipt_associations", + "method" : "POST", + "uri_substitutions": { + "physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}", + "appointment_reference":"${eventRP.refid?json_string}" + }, + "payload" : + { + <#if appointment.Commissions??> + "physical_receipt_list": [ + <#list appointment.Commissions as commission> + { + "receipt_activity": "${eventRP.executionflowCustomFields.activity_code?json_string}", + "originator_code": "${eventRP.executionflowCustomFields.originator_code?json_string}", + "physical_receipt_reference": "${eventRP.executionflowCustomFields.reference?json_string}", + "receipt_year": "${eventRP.executionflowCustomFields.order_year?json_string}", + "receipt_number": "${eventRP.executionflowCustomFields.order_number?json_string}" + } + <#sep>, + + ], + + } + } diff --git a/RPtoRFX_CarrierAppointmentSlotUpdated.ftl b/RPtoRFX_CarrierAppointmentSlotUpdated.ftl new file mode 100644 index 0000000..6f90104 --- /dev/null +++ b/RPtoRFX_CarrierAppointmentSlotUpdated.ftl @@ -0,0 +1,27 @@ +{ + "id" : {"refid" : "${eventRP.refid?json_string}"}, + "route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments/{appointment_reference}", + "method" : "PUT", + "uri_substitutions": { + "physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}", + "appointment_reference":"${eventRP.refid?json_string}" + }, + "payload" : + { + + <#if appointment.Commissions??> + "physical_receipt_list": [ + <#list appointment.Commissions as commission> + { + "receipt_activity": "${eventRP.executionflowCustomFields.activity_code?json_string}", + "originator_code": "${eventRP.executionflowCustomFields.originator_code?json_string}", + "physical_receipt_reference": "${eventRP.executionflowCustomFields.reference?json_string}", + "receipt_year": "${eventRP.executionflowCustomFields.order_year?json_string}", + "receipt_number": "${eventRP.executionflowCustomFields.order_number?json_string}" + } + <#sep>, + + ] + + } + }