This commit is contained in:
Laurie MONTANT 2025-12-09 08:47:01 +01:00
parent 63a668340d
commit c635353b69
3 changed files with 97 additions and 21 deletions

View File

@ -11,28 +11,51 @@
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
<#switch eventRP.event> <#switch eventRP.event>
<#case "Created"> <#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#case "Created">
<#assign appointment = eventRP.data /> <#assign appointment = eventRP.data />
[ [
{ {
<#assign apiRestReflexID = ApiRestReflexID.appointment_post>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_CarrierAppointmentCreated.ftl">
}
<#--{
<#assign apiRestReflexID = ApiRestReflexID.appointment_post> <#assign apiRestReflexID = ApiRestReflexID.appointment_put>
"apiRestReflexID" : "${apiRestReflexID}", "apiRestReflexID" : "${apiRestReflexID}",
"datas" : "datas" :
<#include "RPtoRFX_CarrierAppointmentCreated.ftl"> <#include "RPtoRFX_CarrierAppointmentUpdated.ftl">
}, }-->
{ ]
<#break>
<#assign apiRestReflexID = ApiRestReflexID.appointment_put> <#-- *********************************************** Action = CommissionsUpdated ******************** -->
"apiRestReflexID" : "${apiRestReflexID}", <#case "CommissionsUpdated">
"datas" : <#assign appointment = eventRP.data />
<#include "RPtoRFX_CarrierAppointmentUpdated.ftl"> [
} {
] <#assign apiRestReflexID = ApiRestReflexID.physical_receipt_associations_post>
<#break> "apiRestReflexID" : "${apiRestReflexID}",
<#default> "datas" :
<#stop > <#include "RPtoRFX_CarrierAppointmentAssociationPhysicalReceipt.ftl">
}
]
<#break>
<#-- *********************************************** Action = SlotUpdated ******************** -->
<#case "SlotUpdated">
<#assign appointment = eventRP.data />
[
{
<#assign apiRestReflexID = ApiRestReflexID.appointment_put>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_CarrierAppointmentSlotUpdated.ftl">
}
]
<#break>
<#default>
<#stop >
</#switch> </#switch>

View File

@ -0,0 +1,26 @@
{
"id" : {"refid" : "${eventRP.refid?json_string}"},
"route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments/{appointment_reference}/physical_receipt_associations",
"method" : "POST",
"uri_substitutions": {
"physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}",
"appointment_reference":"${eventRP.refid?json_string}"
},
"payload" :
{
<#if appointment.Commissions??>
"physical_receipt_list": [
<#list appointment.Commissions as commission>
{
"receipt_activity": "${eventRP.executionflowCustomFields.activity_code?json_string}",
"originator_code": "${eventRP.executionflowCustomFields.originator_code?json_string}",
"physical_receipt_reference": "${eventRP.executionflowCustomFields.reference?json_string}",
"receipt_year": "${eventRP.executionflowCustomFields.order_year?json_string}",
"receipt_number": "${eventRP.executionflowCustomFields.order_number?json_string}"
}
<#sep>,</#sep>
</#list>
],
</#if>
}
}

View File

@ -0,0 +1,27 @@
{
"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" :
{
<#if appointment.Commissions??>
"physical_receipt_list": [
<#list appointment.Commissions as commission>
{
"receipt_activity": "${eventRP.executionflowCustomFields.activity_code?json_string}",
"originator_code": "${eventRP.executionflowCustomFields.originator_code?json_string}",
"physical_receipt_reference": "${eventRP.executionflowCustomFields.reference?json_string}",
"receipt_year": "${eventRP.executionflowCustomFields.order_year?json_string}",
"receipt_number": "${eventRP.executionflowCustomFields.order_number?json_string}"
}
<#sep>,</#sep>
</#list>
]
</#if>
}
}