69 lines
2.6 KiB
Java
69 lines
2.6 KiB
Java
{
|
|
"id" : {"refid" : "${eventRP.refid?json_string}"},
|
|
"route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments",
|
|
"method" : "POST",
|
|
"uri_substitutions": {
|
|
"physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}"
|
|
},
|
|
"payload" :
|
|
{
|
|
"appointment_reference": "${eventRP.refid?json_string}",
|
|
|
|
<#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>
|
|
|
|
"planned_carrier" : "ABAN", <#-- "${appointment.CarrierName?json_string}", -->
|
|
|
|
<#if appointment.Commissions??>
|
|
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING">
|
|
<#if appointment.Commissions.OrderID ?? && appointment.Commissions.OrderID!="">
|
|
"physical_receipt_list": [
|
|
<#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.value?? && l.value?has_content) 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>
|
|
"appointment_designation":"${appointment.Reason?json_string}",
|
|
</#if>
|
|
<#else>
|
|
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING">
|
|
<#if appointment.Commissions.OrderID ?? && appointment.Commissions.OrderID!="">
|
|
"appointment_designation":"LOADING",
|
|
<#else>
|
|
"appointment_designation":"${appointment.Reason?json_string}",
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
|
|
</#if>
|
|
"constant_appointment": "false"
|
|
|
|
|
|
}
|
|
}
|