From df7e596a93d88d402850910a6b8733baddf74985 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Wed, 7 Jan 2026 09:08:23 +0100 Subject: [PATCH] RDV --- RFXtoRP_RestResponse.ftl | 50 +++++++++-------- RPtoRFX_AppointmentEvent.ftl | 55 +++++++++++++------ ...mentPhysicalReceiptAssociationByNumber.ftl | 32 +++++------ ...intmentPhysicalReceiptAssociationByRef.ftl | 32 +++++------ ...entPhysicalReceiptDissociationByNumber.ftl | 26 +++++++++ ...ntmentPhysicalReceiptDissociationByRef.ftl | 25 +++++++++ 6 files changed, 142 insertions(+), 78 deletions(-) create mode 100644 RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl create mode 100644 RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl diff --git a/RFXtoRP_RestResponse.ftl b/RFXtoRP_RestResponse.ftl index e5c8aa1..0dc81b0 100644 --- a/RFXtoRP_RestResponse.ftl +++ b/RFXtoRP_RestResponse.ftl @@ -212,10 +212,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] <#break> @@ -239,10 +239,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] @@ -261,10 +261,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] @@ -287,10 +287,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] <#break> @@ -314,10 +314,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] @@ -336,10 +336,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] @@ -362,10 +362,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] <#break> @@ -389,10 +389,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] @@ -411,10 +411,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] @@ -422,6 +422,8 @@ <#-- *********************************************** ApiRestID = appointment_post_physical_receipt_associations ******************** --> <#case "appointment_post_physical_receipt_associations_by_ref"> <#case "appointment_post_physical_receipt_associations_by_number"> + <#case "appointment_post_physical_receipt_dissociations_by_ref"> + <#case "appointment_post_physical_receipt_dissociations_by_number"> <#switch restResponsetMsg.status!no_status> <#case no_status> [ @@ -437,10 +439,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] <#break> @@ -464,10 +466,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] @@ -486,10 +488,10 @@ <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_RestResponseAllocationError.ftl"> + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> } ] diff --git a/RPtoRFX_AppointmentEvent.ftl b/RPtoRFX_AppointmentEvent.ftl index 0ee48cc..2c88da1 100644 --- a/RPtoRFX_AppointmentEvent.ftl +++ b/RPtoRFX_AppointmentEvent.ftl @@ -26,25 +26,44 @@ <#-- *********************************************** Action = CommissionsUpdated ******************** --> <#case "CommissionsUpdated"> <#assign appointment = eventRP.data /> - [ - <#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.value?? && l.value?has_content) as commission> - <#if eventRP.appointmentCustomFields?has_content> - { - <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number> - "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl"> - } - <#else> - { - <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_ref> - "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl"> - } + [ <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING"> + <#if eventRP.addedCommissions?? && eventRP.addedCommissions!=""> + <#if eventRP.appointmentCustomFields?has_content> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl"> + } + <#else> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_ref> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl"> + } + + + <#if eventRP.removedCommissions?? && eventRP.removedCommissions!=""> + <#if eventRP.appointmentCustomFields?has_content> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_number> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl"> + } + <#else> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_ref> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl"> + } + + + <#else> + <#stop "Unsupported Appointment Type for Commissions Update"> - <#sep>, - ] <#break> <#-- *********************************************** Action = SlotUpdated ******************** --> diff --git a/RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl b/RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl index fd9e237..39f9177 100644 --- a/RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl +++ b/RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl @@ -1,5 +1,5 @@ { - "id" : {"refid" : "${eventRP.refid?json_string}"}, + "id" : {"refid" : "${eventRP.refid?json_string}","actorID":"${RPtoRFXprefixDepot(eventRP.actor)}"}, "route" : "rest/public/v1/physical_depots/{physical_depot_code}/appointment_years/{appointment_year}/appointment_numbers/{appointment_number}/physical_receipt_associations", "method" : "POST", "uri_substitutions": { @@ -9,22 +9,18 @@ }, "payload" : { - <#if appointment.Commissions??> - <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING"> - "physical_receipt_list": [ - { - "receipt_activity": "${commission.value.activity_code?json_string}", - "originator_code": "${commission.value.originator_code?json_string}", - "physical_receipt_reference": "${commission.value.reference?json_string}", - "receipt_year": "${commission.value.order_year?json_string}", - "receipt_number": "${commission.value.order_number?json_string}" - } - ] - <#else> - <#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING"> - "appointment_designation":"${appointment.Reason!""?json_string}" - - - + <#assign executionflowCustomFields = eventRP.executionflowCustomFields > + "physical_receipt_list": [ + <#list eventRP.addedCommissions as addedCommission> + { + "receipt_activity": "${executionflowCustomFields[addedCommission.ExecutionflowID].activity_code?json_string}", + "originator_code": "${executionflowCustomFields[addedCommission.ExecutionflowID].originator_code?json_string}", + "physical_receipt_reference": "${executionflowCustomFields[addedCommission.ExecutionflowID].reference?json_string}", + "receipt_year": "${executionflowCustomFields[addedCommission.ExecutionflowID].order_year?json_string}", + "receipt_number": "${executionflowCustomFields[addedCommission.ExecutionflowID].order_number?json_string}" + } + <#sep>, + + ] } } diff --git a/RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl b/RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl index 223b1cb..333c8a0 100644 --- a/RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl +++ b/RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl @@ -1,5 +1,5 @@ { - "id" : {"refid" : "${eventRP.refid?json_string}"}, + "id" : {"refid" : "${eventRP.refid?json_string}","actorID":"${RPtoRFXprefixDepot(eventRP.actor)}"}, "route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments/{appointment_reference}/physical_receipt_associations", "method" : "POST", "uri_substitutions": { @@ -8,22 +8,18 @@ }, "payload" : { - <#if appointment.Commissions??> - <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING"> - "physical_receipt_list": [ - { - "receipt_activity": "${commission.value.activity_code?json_string}", - "originator_code": "${commission.value.originator_code?json_string}", - "physical_receipt_reference": "${commission.value.reference?json_string}", - "receipt_year": "${commission.value.order_year?json_string}", - "receipt_number": "${commission.value.order_number?json_string}" - } - ] - <#else> - <#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING"> - "appointment_designation":"${appointment.Reason!""?json_string}" - - - + <#assign executionflowCustomFields = eventRP.executionflowCustomFields > + "physical_receipt_list": [ + <#list eventRP.addedCommissions as addedCommission> + { + "receipt_activity": "${executionflowCustomFields[addedCommission.ExecutionflowID].activity_code?json_string}", + "originator_code": "${executionflowCustomFields[addedCommission.ExecutionflowID].originator_code?json_string}", + "physical_receipt_reference": "${executionflowCustomFields[addedCommission.ExecutionflowID].reference?json_string}", + "receipt_year": "${executionflowCustomFields[addedCommission.ExecutionflowID].order_year?json_string}", + "receipt_number": "${executionflowCustomFields[addedCommission.ExecutionflowID].order_number?json_string}" + } + <#sep>, + + ] } } diff --git a/RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl b/RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl new file mode 100644 index 0000000..2a3e93c --- /dev/null +++ b/RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl @@ -0,0 +1,26 @@ +{ + "id" : {"refid" : "${eventRP.refid?json_string}","actorID":"${RPtoRFXprefixDepot(eventRP.actor)}"}, + "route" : "rest/public/v1/physical_depots/{physical_depot_code}/appointment_years/{appointment_year}/appointment_numbers/{appointment_number}/physical_receipt_dissociations", + "method" : "POST", + "uri_substitutions": { + "physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}", + "appointment_year":"${eventRP.appointmentCustomFields.year?json_string}", + "appointment_number":"${eventRP.appointmentCustomFields.number?json_string}" + }, + "payload" : + { + <#assign executionflowCustomFields = eventRP.executionflowCustomFields > + "physical_receipt_list": [ + <#list eventRP.removedCommissions as removedCommission> + { + "receipt_activity": "${executionflowCustomFields[removedCommission.ExecutionflowID].activity_code?json_string}", + "originator_code": "${executionflowCustomFields[removedCommission.ExecutionflowID].originator_code?json_string}", + "physical_receipt_reference": "${executionflowCustomFields[removedCommission.ExecutionflowID].reference?json_string}", + "receipt_year": "${executionflowCustomFields[removedCommission.ExecutionflowID].order_year?json_string}", + "receipt_number": "${executionflowCustomFields[removedCommission.ExecutionflowID].order_number?json_string}" + } + <#sep>, + + ] + } + } diff --git a/RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl b/RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl new file mode 100644 index 0000000..2cc8e4c --- /dev/null +++ b/RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl @@ -0,0 +1,25 @@ +{ + "id" : {"refid" : "${eventRP.refid?json_string}","actorID":"${RPtoRFXprefixDepot(eventRP.actor)}"}, + "route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments/{appointment_reference}/physical_receipt_dissociations", + "method" : "POST", + "uri_substitutions": { + "physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}", + "appointment_reference":"${eventRP.refid?json_string}" + }, + "payload" : + { + <#assign executionflowCustomFields = eventRP.executionflowCustomFields > + "physical_receipt_list": [ + <#list eventRP.removedCommissions as removedCommission> + { + "receipt_activity": "${executionflowCustomFields[removedCommission.ExecutionflowID].activity_code?json_string}", + "originator_code": "${executionflowCustomFields[removedCommission.ExecutionflowID].originator_code?json_string}", + "physical_receipt_reference": "${executionflowCustomFields[removedCommission.ExecutionflowID].reference?json_string}", + "receipt_year": "${executionflowCustomFields[removedCommission.ExecutionflowID].order_year?json_string}", + "receipt_number": "${executionflowCustomFields[removedCommission.ExecutionflowID].order_number?json_string}" + } + <#sep>, + + ] + } + }