This commit is contained in:
Laurie MONTANT 2026-01-06 14:37:00 +01:00
parent 955928a754
commit 706c73a530
5 changed files with 106 additions and 37 deletions

View File

@ -26,8 +26,8 @@
<#-- *********************************************** Action = CommissionsUpdated ******************** --> <#-- *********************************************** Action = CommissionsUpdated ******************** -->
<#case "CommissionsUpdated"> <#case "CommissionsUpdated">
<#assign appointment = eventRP.data /> <#assign appointment = eventRP.data />
[ [ <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING">
<#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.value?? && l.value?has_content) as commission> <#if eventRP.addedCommissions?? && eventRP.addedCommissions!="">
<#if eventRP.appointmentCustomFields?has_content> <#if eventRP.appointmentCustomFields?has_content>
{ {
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number> <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number>
@ -43,8 +43,28 @@
<#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl"> <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl">
} }
</#if> </#if>
<#sep>,</#sep> <#else>
</#list> <#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">
}
</#if>
</#if>
</#if>
<#else>
<#stop "Unsupported Appointment Type for Commissions Update">
</#if>
] ]
<#break> <#break>
<#-- *********************************************** Action = SlotUpdated ******************** --> <#-- *********************************************** Action = SlotUpdated ******************** -->

View File

@ -9,22 +9,18 @@
}, },
"payload" : "payload" :
{ {
<#if appointment.Commissions??> <#list eventRP.addedCommissions as addedCommission>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING"> <#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.value?? && l.value?has_content) as CustomFields>
"physical_receipt_list": [ "physical_receipt_list": [
{ {
"receipt_activity": "${commission.value.activity_code?json_string}", "receipt_activity": "${CustomFields.value.activity_code?json_string}",
"originator_code": "${commission.value.originator_code?json_string}", "originator_code": "${CustomFields.value.originator_code?json_string}",
"physical_receipt_reference": "${commission.value.reference?json_string}", "physical_receipt_reference": "${CustomFields.value.reference?json_string}",
"receipt_year": "${commission.value.order_year?json_string}", "receipt_year": "${CustomFields.value.order_year?json_string}",
"receipt_number": "${commission.value.order_number?json_string}" "receipt_number": "${CustomFields.value.order_number?json_string}"
} }
] ]
<#else>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING">
"appointment_designation":"${appointment.Reason!""?json_string}"
</#if>
</#if>
</#if> </#if>
} }
} }

View File

@ -8,8 +8,8 @@
}, },
"payload" : "payload" :
{ {
<#if appointment.Commissions??> <#list eventRP.addedCommissions as addedCommission>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING"> <#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.value?? && l.value?has_content) as CustomFields>
"physical_receipt_list": [ "physical_receipt_list": [
{ {
"receipt_activity": "${commission.value.activity_code?json_string}", "receipt_activity": "${commission.value.activity_code?json_string}",
@ -19,11 +19,5 @@
"receipt_number": "${commission.value.order_number?json_string}" "receipt_number": "${commission.value.order_number?json_string}"
} }
] ]
<#else>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING">
"appointment_designation":"${appointment.Reason!""?json_string}"
</#if>
</#if>
</#if>
} }
} }

View File

@ -0,0 +1,30 @@
{
"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" :
{
<#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}"
</#if>
</#if>
</#if>
}
}

View File

@ -0,0 +1,29 @@
{
"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" :
{
<#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}"
</#if>
</#if>
</#if>
}
}