diff --git a/RPtoRFX_AppointmentEvent.ftl b/RPtoRFX_AppointmentEvent.ftl index a8f4055..3cf19d9 100644 --- a/RPtoRFX_AppointmentEvent.ftl +++ b/RPtoRFX_AppointmentEvent.ftl @@ -47,6 +47,18 @@ } ] <#break> +<#-- *********************************************** Action = SlotUpdated ******************** --> + <#case "Canceled"> + <#assign appointment = eventRP.data /> + [ + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentCanceled.ftl"> + } + ] + <#break> <#default> <#stop > diff --git a/RPtoRFX_CarrierAppointmentCanceled.ftl b/RPtoRFX_CarrierAppointmentCanceled.ftl new file mode 100644 index 0000000..3553375 --- /dev/null +++ b/RPtoRFX_CarrierAppointmentCanceled.ftl @@ -0,0 +1,16 @@ +{ + "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" : + { + "status": { + "status_code": "999", + "cancellation_reason_code": "RFT", + } + } + } \ No newline at end of file