From 45aac8758950788541b9e072d737c96fab0eae4b Mon Sep 17 00:00:00 2001 From: Francis Reat Date: Mon, 2 Feb 2026 12:25:10 +0100 Subject: [PATCH] SCPN1-10100 --- RFXtoRP_HsrCarrierApt.ftl | 14 +--- ...t_AppointmentCarrierInformationUpdated.ftl | 9 ++ ...ntCarrierInformationUpdatedToConfigure.ftl | 42 ++++++++++ ...rierApt_AppointmentCustomFieldsUpdated.ftl | 8 ++ ..._AppointmentMetadataUpdatedToConfigure.ftl | 8 +- ...HsrCarrierApt_SiteForceBookAppointment.ftl | 8 ++ RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl | 19 +++-- ...RP_HsrCarrierApt_UpdateSlotAppointment.ftl | 84 ------------------- RPtoRFX_AppointmentEvent.ftl | 26 ++++-- RPtoRFX_CarrierAppointmentDataUpdated.ftl | 21 +++++ ...arrierAppointmentReasonUpdatedByNumber.ftl | 8 +- ...X_CarrierAppointmentReasonUpdatedByRef.ftl | 39 +++++++++ ...lotOrCarrierInformationUpdatedByNumber.ftl | 39 +++++++++ ...ntSlotOrCarrierInformationUpdatedByRef.ftl | 1 + 14 files changed, 207 insertions(+), 119 deletions(-) create mode 100644 RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdated.ftl create mode 100644 RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdatedToConfigure.ftl delete mode 100644 RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl create mode 100644 RPtoRFX_CarrierAppointmentDataUpdated.ftl rename RPtoRFX_CarrierAppointmentSlotUpdatedByNumber.ftl => RPtoRFX_CarrierAppointmentReasonUpdatedByNumber.ftl (91%) create mode 100644 RPtoRFX_CarrierAppointmentReasonUpdatedByRef.ftl create mode 100644 RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByNumber.ftl rename RPtoRFX_CarrierAppointmentSlotUpdatedByRef.ftl => RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByRef.ftl (97%) diff --git a/RFXtoRP_HsrCarrierApt.ftl b/RFXtoRP_HsrCarrierApt.ftl index d96a39e..dc2a734 100644 --- a/RFXtoRP_HsrCarrierApt.ftl +++ b/RFXtoRP_HsrCarrierApt.ftl @@ -37,6 +37,7 @@ <#include "RFXtoRP_HsrCarrierApt_AppointmentCustomFieldsUpdated.ftl"> }, <#include "RFXtoRP_HsrCarrierApt_AppointmentMetadataUpdated.ftl"> + <#include "RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdated.ftl"> <#if carrier_apt.status?? && (carrier_apt.status.status_code=="999" || carrier_apt.status.status_code=="040" || carrier_apt.status.status_code=="030")> [ { @@ -107,7 +108,6 @@ } ] <#else> - <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0) && ((carrier_apt.unloading_appointment =="true" && carrier_apt.load_appointment =="false") || (carrier_apt.unloading_appointment =="false" && carrier_apt.load_appointment =="true"))> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteWMSUpdateAppointment> @@ -116,16 +116,6 @@ <#include "RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl"> } ] - <#else> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceRescheduleAppointment> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl"> - } - ] - @@ -138,7 +128,7 @@ <#case "D"> <#-- *********************************************** Action = Delete ******************** --> [ - <#-- Ajout des lignes--> + { <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteCancelAppointment> "apiReflexPlatformID" : "${apiReflexPlatformID}", diff --git a/RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdated.ftl b/RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdated.ftl new file mode 100644 index 0000000..9ae2079 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdated.ftl @@ -0,0 +1,9 @@ + <#-- A décommenter si besoin de les utiliser--> + <#-- Uncomment if you need to use them--> + <#--{ + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierInformationUpdated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdatedToConfigure.ftl"> + }, +--> \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdatedToConfigure.ftl b/RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdatedToConfigure.ftl new file mode 100644 index 0000000..b74a5e4 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_AppointmentCarrierInformationUpdatedToConfigure.ftl @@ -0,0 +1,42 @@ +<#-- + [ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true"> + <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> + "RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}", + <#else> + "RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", + + <#else> + <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> + "RefID": "${carrier_apt.appointment_reference?json_string}", + <#else> + "RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", + + + } + "Payload": { + "ActorID": "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}", + <#--To configure--> +<#-- "CarrierInformation": [ + { + "Key": "string", + "Value": { + "Bool": "true / false", + "Float": 3.1415, + "Int": 42, + "String": "Hello World !", + "Timestamp": { + "AuthorTimeZone": "Europe/Paris", + "DateTime": "2023-01-01T00:00:00Z" + } + } + ] + } +} +] +--> \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_AppointmentCustomFieldsUpdated.ftl b/RFXtoRP_HsrCarrierApt_AppointmentCustomFieldsUpdated.ftl index 795d001..781581f 100644 --- a/RFXtoRP_HsrCarrierApt_AppointmentCustomFieldsUpdated.ftl +++ b/RFXtoRP_HsrCarrierApt_AppointmentCustomFieldsUpdated.ftl @@ -42,6 +42,14 @@ { "Key": "carrier", "Value": "${carrier_apt.planned_carrier?json_string}" + }, + { + "Key": "loading", + "Value": "${carrier_apt.load_appointment?json_string}" + }, + { + "Key": "unloading", + "Value": "${carrier_apt.unloading_appointment?json_string}" } ] }, diff --git a/RFXtoRP_HsrCarrierApt_AppointmentMetadataUpdatedToConfigure.ftl b/RFXtoRP_HsrCarrierApt_AppointmentMetadataUpdatedToConfigure.ftl index f746294..8f27a20 100644 --- a/RFXtoRP_HsrCarrierApt_AppointmentMetadataUpdatedToConfigure.ftl +++ b/RFXtoRP_HsrCarrierApt_AppointmentMetadataUpdatedToConfigure.ftl @@ -7,15 +7,15 @@ "ID": { <#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true"> <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}", + "RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}", <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", + "RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", <#else> <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}", + "RefID": "${carrier_apt.appointment_reference?json_string}", <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", + "RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", } diff --git a/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl b/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl index 8ea9242..a8bdd1f 100644 --- a/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl +++ b/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl @@ -75,6 +75,14 @@ { "Key": "carrier", "Value": "${carrier_apt.planned_carrier?json_string}" + }, + { + "Key": "loading", + "Value": "${carrier_apt.load_appointment?json_string}" + }, + { + "Key": "unloading", + "Value": "${carrier_apt.unloading_appointment?json_string}" } ], <#include "RFXtoRP_HsrCarrierApt_SegmentationSelections.ftl">, diff --git a/RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl b/RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl index 1f65c78..0b58baa 100644 --- a/RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl +++ b/RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl @@ -50,7 +50,7 @@ <#else> <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN> - <#assign duration = 0 /> <#-- à confirmer --> + <#assign duration = 0 /> @@ -77,9 +77,17 @@ { "Key": "carrier", "Value": "${carrier_apt.planned_carrier?json_string}" + }, + { + "Key": "loading", + "Value": "${carrier_apt.load_appointment?json_string}" + }, + { + "Key": "unloading", + "Value": "${carrier_apt.unloading_appointment?json_string}" } ], - <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0)> + <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0) && ((carrier_apt.unloading_appointment =="true" && carrier_apt.load_appointment =="false") || (carrier_apt.unloading_appointment =="false" && carrier_apt.load_appointment =="true"))> "Commissions": [ <#list carrier_apt.physical_receipt_list?filter(l ->l??) as physical_receipt> { @@ -95,13 +103,6 @@ ], <#else> - "Commissions": [ - { - "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}", - "ProjectID": "${projectRP}", - <#include "RFXtoRP_HsrCarrierApt_Quantities.ftl"> - } - ], <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> "Reason": "UNLOADING AND LOADING / ${carrier_apt.appointment_designation?json_string}", <#else> diff --git a/RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl b/RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl deleted file mode 100644 index 0570db5..0000000 --- a/RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl +++ /dev/null @@ -1,84 +0,0 @@ -[ - { - <#assign creation_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) /> - "Header":{ - "ProjectID": "${projectRP}" - }, - <#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true"> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}", - <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - <#else> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}", - <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - - "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}", - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-") || carrier_apt.planned_unloading_end_datetime?starts_with("00") || carrier_apt.planned_unloading_end_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNLOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_unloading_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend are not valid" > - - <#else> - <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" > - <#if carrier_apt.planned_load_start_datetime?starts_with("00") || carrier_apt.planned_load_start_datetime?contains("-00-") || carrier_apt.planned_load_end_datetime?starts_with("00") || carrier_apt.planned_load_end_datetime?contains("-00-")> - <#stop "planned_load_start_datetime or planned_load_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_LOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_load_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend are not valid" > - - <#else> - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_load_end_datetime?starts_with("00") || carrier_apt.planned_load_end_datetime?contains("-00-") || carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-") > - <#stop "planned_unloading_start_datetime or planned_load_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNLOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_load_end_datetime field of appointmend are not valid" > - - <#else> - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN> - <#assign duration = 0 /> <#-- à confirmer --> - - - - "Slots": [{ - <#-- calcul de de la durée en fonction des start et end time--> - "DurationInSeconds": "${duration}", - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false" > - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime field of appointmend is not initialized" > - - "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" - <#else> - <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_load_start_datetime?starts_with("00") || carrier_apt.planned_load_start_datetime?contains("-00-")> - <#stop "planned_load_start_datetime field of appointmend is not initialized" > - - "StartDateTime": "${carrier_apt.planned_load_start_datetime}" - <#else> - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime field of appointmend is not initialized" > - - "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" - <#else> - <#stop "Appointment type not supported" > - - - - }] - - } -] \ No newline at end of file diff --git a/RPtoRFX_AppointmentEvent.ftl b/RPtoRFX_AppointmentEvent.ftl index 69ea68f..9bb9247 100644 --- a/RPtoRFX_AppointmentEvent.ftl +++ b/RPtoRFX_AppointmentEvent.ftl @@ -66,12 +66,28 @@ <#else> - <#stop "Unsupported Appointment Type for Commissions Update"> + <#if eventRP.appointmentCustomFields?has_content> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_number> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentReasonUpdatedByNumber.ftl"> + } + <#else> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_ref> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentReasonUpdatedByRef.ftl"> + } + ] <#break> -<#-- *********************************************** Action = SlotUpdated ******************** --> +<#-- *********************************************** Action = SlotUpdated or CarrierInformationUpdated or ReasonUpdated******************** --> <#case "SlotUpdated"> + <#case "CarrierInformationUpdated"> + <#case "ReasonUpdated"> <#assign appointment = eventRP.data /> [ <#if eventRP.appointmentCustomFields?has_content> @@ -79,19 +95,19 @@ <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_number> "apiRestReflexID" : "${apiRestReflexID}", "datas" : - <#include "RPtoRFX_CarrierAppointmentSlotUpdatedByNumber.ftl"> + <#include "RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByNumber.ftl"> } <#else> { <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_ref> "apiRestReflexID" : "${apiRestReflexID}", "datas" : - <#include "RPtoRFX_CarrierAppointmentSlotUpdatedByRef.ftl"> + <#include "RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByRef.ftl"> } ] <#break> -<#-- *********************************************** Action = SlotUpdated ******************** --> +<#-- *********************************************** Action = Canceled ******************** --> <#case "Canceled"> <#assign appointment = eventRP.data /> [ diff --git a/RPtoRFX_CarrierAppointmentDataUpdated.ftl b/RPtoRFX_CarrierAppointmentDataUpdated.ftl new file mode 100644 index 0000000..93b4aa7 --- /dev/null +++ b/RPtoRFX_CarrierAppointmentDataUpdated.ftl @@ -0,0 +1,21 @@ +<#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map --> +<#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map --> + +<#-- How to use MD or SK map + <#if appointment.CarrierInformation??> + <#assign CarrierInformation_Map = JsonUtil.sequenceToMap(appointment.CarrierInformation, "Key", "Value") /> + <#if CarrierInformation_Map["Immatriculation"]??> + <#assign registration_number1 = CarrierInformation_Map["Immatriculation"].String!""/> + "registration_number":"${registration_number1}", + <#else> + "registration_number":"no plate number", + + + + If your SK is : + Boolean : .Bool + Float : .Float + Timestamp : .Timestamp.DateTime or .Timestamp.AuthorTimeZone + Int : .Int + String : .String +--> \ No newline at end of file diff --git a/RPtoRFX_CarrierAppointmentSlotUpdatedByNumber.ftl b/RPtoRFX_CarrierAppointmentReasonUpdatedByNumber.ftl similarity index 91% rename from RPtoRFX_CarrierAppointmentSlotUpdatedByNumber.ftl rename to RPtoRFX_CarrierAppointmentReasonUpdatedByNumber.ftl index 1261a72..7a57906 100644 --- a/RPtoRFX_CarrierAppointmentSlotUpdatedByNumber.ftl +++ b/RPtoRFX_CarrierAppointmentReasonUpdatedByNumber.ftl @@ -9,10 +9,10 @@ }, "payload" : { - <#switch appointment.AppointmentType> + "unloading_appointment" : "${eventRP.appointmentCustomFields.unloading?json_string}", + "load_appointment" : "${eventRP.appointmentCustomFields.loading?json_string}", + <#switch appointment.AppointmentType> <#case "APPOINTMENT_TYPE_LOADING"> - "unloading_appointment" : "false", - "load_appointment" : "true", <#if appointment.TimeZone?? && appointment.TimeZone!=""> "planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,appointment.TimeZone),time_zone_rfx)}", "planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,appointment.TimeZone),time_zone_rfx)}", @@ -22,8 +22,6 @@ <#break> <#case "APPOINTMENT_TYPE_UNLOADING"> - "unloading_appointment" : "true", - "load_appointment" : "false", <#if appointment.TimeZone?? && appointment.TimeZone!=""> "planned_unloading_start_datetime":"${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,appointment.TimeZone),time_zone_rfx)}", "planned_unloading_end_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,appointment.TimeZone),time_zone_rfx)}", diff --git a/RPtoRFX_CarrierAppointmentReasonUpdatedByRef.ftl b/RPtoRFX_CarrierAppointmentReasonUpdatedByRef.ftl new file mode 100644 index 0000000..00595f4 --- /dev/null +++ b/RPtoRFX_CarrierAppointmentReasonUpdatedByRef.ftl @@ -0,0 +1,39 @@ +{ + "id" : {"refid" : "${eventRP.refid?json_string}","actorID":"${RPtoRFXprefixDepot(eventRP.actor)}"}, + "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" : + { + <#switch appointment.AppointmentType> + <#case "APPOINTMENT_TYPE_LOADING"> + "unloading_appointment" : "false", + "load_appointment" : "true", + <#if appointment.TimeZone?? && appointment.TimeZone!=""> + "planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,appointment.TimeZone),time_zone_rfx)}", + "planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,appointment.TimeZone),time_zone_rfx)}", + <#else> + "planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,time_zone_rfx),time_zone_rfx)}", + "planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}", + + <#break> + <#case "APPOINTMENT_TYPE_UNLOADING"> + "unloading_appointment" : "true", + "load_appointment" : "false", + <#if appointment.TimeZone?? && appointment.TimeZone!=""> + "planned_unloading_start_datetime":"${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,appointment.TimeZone),time_zone_rfx)}", + "planned_unloading_end_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,appointment.TimeZone),time_zone_rfx)}", + <#else> + "planned_unloading_start_datetime":"${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,time_zone_rfx),time_zone_rfx)}", + "planned_unloading_end_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}", + + <#break> + <#default> + <#stop "appointment.AppointmentType not implemented" > + + "appointment_designation":"${(appointment.Reason!"")!?json_string}" + } + } diff --git a/RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByNumber.ftl b/RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByNumber.ftl new file mode 100644 index 0000000..21333a8 --- /dev/null +++ b/RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByNumber.ftl @@ -0,0 +1,39 @@ +{ + "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}", + "method" : "PUT", + "uri_substitutions": { + "physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}", + "appointment_year":"${eventRP.appointmentCustomFields.year?json_string}", + "appointment_number":"${eventRP.appointmentCustomFields.number?json_string}" + }, + "payload" : + { + <#include "RPtoRFX_CarrierAppointmentDataUpdated.ftl"> + "unloading_appointment" : "${eventRP.appointmentCustomFields.unloading?json_string}", + "load_appointment" : "${eventRP.appointmentCustomFields.loading?json_string}", + <#switch appointment.AppointmentType> + <#case "APPOINTMENT_TYPE_LOADING"> + <#if appointment.TimeZone?? && appointment.TimeZone!=""> + "planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,appointment.TimeZone),time_zone_rfx)}", + "planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,appointment.TimeZone),time_zone_rfx)}", + <#else> + "planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,time_zone_rfx),time_zone_rfx)}", + "planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}", + + <#break> + <#case "APPOINTMENT_TYPE_UNLOADING"> + <#if appointment.TimeZone?? && appointment.TimeZone!=""> + "planned_unloading_start_datetime":"${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,appointment.TimeZone),time_zone_rfx)}", + "planned_unloading_end_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,appointment.TimeZone),time_zone_rfx)}", + <#else> + "planned_unloading_start_datetime":"${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,time_zone_rfx),time_zone_rfx)}", + "planned_unloading_end_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}", + + <#break> + <#default> + <#stop "appointment.AppointmentType not implemented" > + + "appointment_designation":"${(appointment.Reason!"")!?json_string}" + } + } diff --git a/RPtoRFX_CarrierAppointmentSlotUpdatedByRef.ftl b/RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByRef.ftl similarity index 97% rename from RPtoRFX_CarrierAppointmentSlotUpdatedByRef.ftl rename to RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByRef.ftl index 6bfd554..8c9f571 100644 --- a/RPtoRFX_CarrierAppointmentSlotUpdatedByRef.ftl +++ b/RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByRef.ftl @@ -8,6 +8,7 @@ }, "payload" : { + <#include "RPtoRFX_CarrierAppointmentDataUpdated.ftl"> <#switch appointment.AppointmentType> <#case "APPOINTMENT_TYPE_LOADING"> "unloading_appointment" : "false",