diff --git a/RFXtoRP_RestResponse.ftl b/RFXtoRP_RestResponse.ftl index 3520cdb..5c24aaa 100644 --- a/RFXtoRP_RestResponse.ftl +++ b/RFXtoRP_RestResponse.ftl @@ -441,6 +441,8 @@ <#case "appointment_post_physical_receipt_associations_by_number"> <#case "appointment_post_physical_receipt_dissociations_by_ref"> <#case "appointment_post_physical_receipt_dissociations_by_number"> + <#case "appointment_post_anticipated_receipt_associations_by_ref"> + <#case "appointment_post_anticipated_receipt_dissociations_by_number"> <#switch restResponsetMsg.status!no_status> <#case no_status> [ diff --git a/RPtoRFX_AppointmentEvent.ftl b/RPtoRFX_AppointmentEvent.ftl index c83464d..6214c0a 100644 --- a/RPtoRFX_AppointmentEvent.ftl +++ b/RPtoRFX_AppointmentEvent.ftl @@ -37,45 +37,79 @@ } <#else> <#if eventRP.commissionsUpdated> - <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING && eventRP.addedUnloadCommissions?? && eventRP.addedUnloadCommissions != ""> - <#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"> - } - - <#assign AddComma = true /> - - <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING && eventRP.removedUnloadCommissions?? && eventRP.removedUnloadCommissions!=""> - <#if AddComma == true> - , + <#if appointment.executionflowCustomFields?has_content> + <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING && eventRP.addedUnloadCommissions?? && eventRP.addedUnloadCommissions != ""> + <#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"> + } + + <#assign AddComma = true /> + <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING && eventRP.removedUnloadCommissions?? && eventRP.removedUnloadCommissions!=""> + <#if AddComma == true> + , + - <#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"> - } + <#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"> + } + + <#assign AddComma = true /> + + + + <#if appointment.orderCustomFields?has_content> + <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING && eventRP.addedUnloadCommissions?? && eventRP.addedUnloadCommissions != ""> + <#if AddComma == true> + , + + <#if eventRP.appointmentCustomFields?has_content> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_anticipated_receipt_associations_by_number> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentAnticipatedReceiptAssociationByNumber.ftl"> + } + + <#assign AddComma = true /> + + <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING && eventRP.removedUnloadCommissions?? && eventRP.removedUnloadCommissions!=""> + <#if AddComma == true> + , + + + <#if eventRP.appointmentCustomFields?has_content> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_anticipated_receipt_dissociations_by_number> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentAnticipatedReceiptDissociationByNumber.ftl"> + } + + <#assign AddComma = true /> - <#assign AddComma = true /> <#-- *********************************************** Action = reasonUpdated or slotUpdated ******************** --> diff --git a/RPtoRFX_CarrierAppointmentAnticipatedReceiptAssociationByNumber.ftl b/RPtoRFX_CarrierAppointmentAnticipatedReceiptAssociationByNumber.ftl new file mode 100644 index 0000000..5ccdd7c --- /dev/null +++ b/RPtoRFX_CarrierAppointmentAnticipatedReceiptAssociationByNumber.ftl @@ -0,0 +1,32 @@ +{ + "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}/anticipated_receipt_associations", + "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 orderCustomFields = eventRP.orderCustomFields > + <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING> + <#assign addedCommissions = eventRP.addedUnloadCommissions /> + <#else> + <#assign addedCommissions = eventRP.addedLoadCommissions /> + + + "anticipated_receipt_list": [ + <#list addedCommissions?filter(l -> l.OrderID??) as addedCommission> + { + "activity": "${orderCustomFields[addedCommission.OrderID].activity_code?json_string}", + "originator_code": "${orderCustomFields[addedCommission.OrderID].originator_code?json_string}", + "anticipated_receipt_reference": "${orderCustomFields[addedCommission.OrderID].anticipated_receipt_reference?json_string}", + "anticipated_receipt_year": "${orderCustomFields[addedCommission.OrderID].anticipated_receipt_year?json_string}", + "anticipated_receipt_number": "${orderCustomFields[addedCommission.OrderID].anticipated_receipt_number?json_string}" + } + <#sep>, + + ] + } + } diff --git a/RPtoRFX_CarrierAppointmentAnticipatedReceiptDissociationByNumber.ftl b/RPtoRFX_CarrierAppointmentAnticipatedReceiptDissociationByNumber.ftl new file mode 100644 index 0000000..2b784aa --- /dev/null +++ b/RPtoRFX_CarrierAppointmentAnticipatedReceiptDissociationByNumber.ftl @@ -0,0 +1,32 @@ +{ + "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}/anticipated_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 orderCustomFields = eventRP.orderCustomFields > + <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING> + <#assign removedCommissions = eventRP.removedUnloadCommissions /> + <#else> + <#assign removedCommissions = eventRP.removedLoadCommissions /> + + + "anticipated_receipt_list": [ + <#list removedCommissions?filter(l -> l.OrderID??) as removedCommission> + { + "activity": "${orderCustomFields[removedCommission.OrderID].activity_code?json_string}", + "originator_code": "${orderCustomFields[removedCommission.OrderID].originator_code?json_string}", + "anticipated_receipt_reference": "${orderCustomFields[removedCommission.OrderID].anticipated_receipt_reference?json_string}", + "anticipated_receipt_year": "${orderCustomFields[removedCommission.OrderID].anticipated_receipt_year?json_string}", + "anticipated_receipt_number": "${orderCustomFields[removedCommission.OrderID].anticipated_receipt_number?json_string}" + } + <#sep>, + + ] + } + }