This commit is contained in:
Laurie MONTANT 2025-12-11 15:49:22 +01:00
parent 0113829f9b
commit be4dcf11f6
10 changed files with 202 additions and 55 deletions

View File

@ -29,7 +29,13 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrCarrierApt_AppointmentCarrierExpected.ftl"> <#include "RFXtoRP_HsrCarrierApt_AppointmentCarrierExpected.ftl">
} },
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCustomFieldsUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_AppointmentCustomFieldsUpdated.ftl">
},
] ]
<#break> <#break>
<#case "U"> <#case "U">

View File

@ -0,0 +1,48 @@
[
<#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) />
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}",
<#else>
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
"RefID": "${carrier_apt.appointment_reference?json_string}${carrier_apt.physical_depot?json_string}${carrier_apt.year_number}${carrier_apt.appointment_number}",
<#else>
"RefID": "${carrier_apt.physical_depot?json_string}${carrier_apt.year_number}${carrier_apt.appointment_number}",
</#if>
</#if>
"RefDate": {
"DateTime": "${ref_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"CustomFields": [
{
"Key": "depot",
"Value": "${carrier_apt.physical_depot?json_string}"
},
{
"Key": "year",
"Value": "${carrier_apt.year_number?json_string}"
},
{
"Key": "number",
"Value": "${carrier_apt.appointment_number?json_string}"
},
{
"Key": "reference",
"Value": "${carrier_apt.appointment_reference?json_string}"
},
{
"Key": "carrier",
"Value": "${carrier_apt.planned_carrier?json_string}"
}
]
},
"Payload":{
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}"
}
}
]

View File

@ -27,36 +27,63 @@
<#case "CommissionsUpdated"> <#case "CommissionsUpdated">
<#assign appointment = eventRP.data /> <#assign appointment = eventRP.data />
[ [
<#if appointment.appointmentCustomFields?? && appointment.appointmentCustomFields?has_content>
{ {
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_association> <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number>
"apiRestReflexID" : "${apiRestReflexID}", "apiRestReflexID" : "${apiRestReflexID}",
"datas" : "datas" :
<#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociation.ftl"> <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl">
} }
<#else>
{
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_ref>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRefID.ftl">
}
</#if>
] ]
<#break> <#break>
<#-- *********************************************** Action = SlotUpdated ******************** --> <#-- *********************************************** Action = SlotUpdated ******************** -->
<#case "SlotUpdated"> <#case "SlotUpdated">
<#assign appointment = eventRP.data /> <#assign appointment = eventRP.data />
[ [
<#if appointment.appointmentCustomFields?? && appointment.appointmentCustomFields?has_content>
{ {
<#assign apiRestReflexID = ApiRestReflexID.appointment_put_update> <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_number>
"apiRestReflexID" : "${apiRestReflexID}", "apiRestReflexID" : "${apiRestReflexID}",
"datas" : "datas" :
<#include "RPtoRFX_CarrierAppointmentSlotUpdated.ftl"> <#include "RPtoRFX_CarrierAppointmentSlotUpdatedByNumber.ftl">
} }
<#else>
{
<#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_ref>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_CarrierAppointmentSlotUpdatedByRef.ftl">
}
</#if>
] ]
<#break> <#break>
<#-- *********************************************** Action = SlotUpdated ******************** --> <#-- *********************************************** Action = SlotUpdated ******************** -->
<#case "Canceled"> <#case "Canceled">
<#assign appointment = eventRP.data /> <#assign appointment = eventRP.data />
[ [
<#if appointment.appointmentCustomFields?? && appointment.appointmentCustomFields?has_content>
{ {
<#assign apiRestReflexID = ApiRestReflexID.appointment_put_update> <#assign apiRestReflexID = ApiRestReflexID.appointment_put_status_by_number>
"apiRestReflexID" : "${apiRestReflexID}", "apiRestReflexID" : "${apiRestReflexID}",
"datas" : "datas" :
<#include "RPtoRFX_CarrierAppointmentCanceled.ftl"> <#include "RPtoRFX_CarrierAppointmentCanceledByNumber.ftl">
} }
<#else>
{
<#assign apiRestReflexID = ApiRestReflexID.appointment_put_status_by_ref>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_CarrierAppointmentCanceledByRef.ftl">
}
</#if>
] ]
<#break> <#break>
<#default> <#default>

View File

@ -1,32 +0,0 @@
{
"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" :
{
<#switch appointment.AppointmentType>
<#case "APPOINTMENT_TYPE_LOADING">
"unloading_appointment" : "false",
"load_appointment" : "true",
"planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(appointment.Slot.StartDateTime,time_zone_rfx)}",
"planned_load_end_datetime": "${AddSecondsToDatetime(appointment.Slot.StartDateTime?datetime.iso,appointment.Slot.DurationInSeconds?number)?iso_nz(time_zone_rfx)}",
<#break>
<#case "APPOINTMENT_TYPE_UNLOADING">
"unloading_appointment" : "true",
"load_appointment" : "false",
"planned_unloading_start_datetime" : "${DateTimeUTCtoRfxLocale(appointment.Slot.StartDateTime,time_zone_rfx)}",
"planned_unloading_end_datetime": "${AddSecondsToDatetime(appointment.Slot.StartDateTime?datetime.iso,appointment.Slot.DurationInSeconds?number)?iso_nz(time_zone_rfx)}",
<#break>
<#default>
<#stop "appointment.AppointmentType not implemented" >
</#switch>
"status": {
"status_code": "999",
"cancellation_reason_code": "ACS"
}
}
}

View File

@ -0,0 +1,17 @@
{
"id" : {"refid" : "${eventRP.refid?json_string}"},
"route" : "rest/public/v1/physical_depots/{physical_depot_code}/appointment_years/{appointment_year}/appointment_numbers/{appointment_number}/status",
"method" : "PUT",
"uri_substitutions": {
"physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}",
"appointment_year":"${appointment.appointmentCustomFields.year?json_string}",
"appointment_number":"${appointment.appointmentCustomFields.number?json_string}"
},
"payload" :
{
"status": {
"status_code": "999",
"cancellation_reason_code": "ACS"
}
}
}

View File

@ -0,0 +1,16 @@
{
"id" : {"refid" : "${eventRP.refid?json_string}"},
"route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments/{appointment_reference}/status",
"method" : "PUT",
"uri_substitutions": {
"physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}",
"appointment_reference":"${eventRP.refid?json_string}"
},
"payload" :
{
"status": {
"status_code": "999",
"cancellation_reason_code": "ACS"
}
}
}

View File

@ -0,0 +1,33 @@
{
"id" : {"refid" : "${eventRP.refid?json_string}"},
"route" : "rest/public/v1/physical_depots/{physical_depot_code}/appointment_years/{appointment_year}/appointment_numbers/{appointment_number}/physical_receipt_associations",
"method" : "POST",
"uri_substitutions": {
"physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}",
"appointment_year":"${appointment.appointmentCustomFields.year?json_string}",
"appointment_number":"${appointment.appointmentCustomFields.number?json_string}"
},
"payload" :
{
<#if appointment.Commissions??>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING">
"physical_receipt_list": [
<#list eventRP.executionflowCustomFields.entrySet() as custom>
{
"receipt_activity": "${custom.value.activity_code?json_string}",
"originator_code": "${custom.value.originator_code?json_string}",
"physical_receipt_reference": "${custom.value.reference?json_string}",
"receipt_year": "${custom.value.order_year?json_string}",
"receipt_number": "${custom.value.order_number?json_string}"
}
<#sep>,</#sep>
</#list>
]
<#else>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING">
"appointment_designation":"LOADING"
</#if>
</#if>
</#if>
}
}

View File

@ -0,0 +1,32 @@
{
"id" : {"refid" : "${eventRP.refid?json_string}"},
"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":"${appointment.appointmentCustomFields.year?json_string}",
"appointment_number":"${appointment.appointmentCustomFields.number?json_string}"
},
"payload" :
{
<#switch appointment.AppointmentType>
<#case "APPOINTMENT_TYPE_LOADING">
"unloading_appointment" : "false",
"load_appointment" : "true",
"planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(appointment.Slot.StartDateTime,time_zone_rfx)}",
"planned_load_end_datetime": "${AddSecondsToDatetime(appointment.Slot.StartDateTime?datetime.iso,appointment.Slot.DurationInSeconds?number)?iso_nz(time_zone_rfx)}"
<#break>
<#case "APPOINTMENT_TYPE_UNLOADING">
"unloading_appointment" : "true",
"load_appointment" : "false",
"planned_unloading_start_datetime" : "${DateTimeUTCtoRfxLocale(appointment.Slot.StartDateTime,time_zone_rfx)}",
"planned_unloading_end_datetime": "${AddSecondsToDatetime(appointment.Slot.StartDateTime?datetime.iso,appointment.Slot.DurationInSeconds?number)?iso_nz(time_zone_rfx)}"
<#break>
<#default>
<#stop "appointment.AppointmentType not implemented" >
</#switch>
}
}