diff --git a/RFXtoRP_HsrCarrierApt.ftl b/RFXtoRP_HsrCarrierApt.ftl index e0ae6d3..6d19796 100644 --- a/RFXtoRP_HsrCarrierApt.ftl +++ b/RFXtoRP_HsrCarrierApt.ftl @@ -59,90 +59,24 @@ } ] <#else> - <#if carrier_apt.status?? && carrier_apt.status.status_code=="100"> <#--Carrier Arrived--> + <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0)> [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierArrived> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaLstCarSta_CarrierArrived.ftl"> + <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteWMSUpdateAppointment> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl"> } ] <#else> - <#if carrier_apt.status?? && carrier_apt.status.status_code=="210"> <#--Unloading Started --> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentUnloadingStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaLstCarSta_UnloadingStarted.ftl"> - } - ] - <#else> - <#if carrier_apt.status?? && carrier_apt.status.status_code=="290"><#--Unloading Completed--> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentUnloadingCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaLstCarSta_UnloadingCompleted.ftl"> - } - ] - <#else> - <#if carrier_apt.status?? && carrier_apt.status.status_code=="310"><#--Loading Started--> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentLoadingStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaLstCarSta_LoadingStarted.ftl"> - } - ] - <#else> - <#if carrier_apt.status?? && carrier_apt.status.status_code=="390"><#--Loading Completed--> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentLoadingCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaLstCarSta_LoadingCompleted.ftl"> - } - ] - <#else> - <#if carrier_apt.status?? && carrier_apt.status.status_code=="500"><#--Carrier Departed--> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierDeparted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaLstCarSta_CarrierDeparted.ftl"> - } - ] - <#else> - <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0)> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteWMSUpdateAppointment> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl"> - } - ] - <#else> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceRescheduleAppointment> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl"> - } - ] - - - - - - + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceRescheduleAppointment> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl"> + } + ] ] diff --git a/RFXtoRP_HsrCarrierApt_CarrierArrived.ftl b/RFXtoRP_HsrCarrierApt_CarrierArrived.ftl new file mode 100644 index 0000000..256ab68 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_CarrierArrived.ftl @@ -0,0 +1,22 @@ +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if carrier_apt_status.appointment_reference?? && carrier_apt_status.appointment_reference !=""> + "RefID": "${carrier_apt_status.appointment_reference?json_string}", + <#else> + "RefID": "${carrier_apt_status.physical_depot?json_string}${carrier_apt_status.appointment_year_number?json_string}${carrier_apt_status.appointment_number?json_string}", + + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{ + "ActorID": "${RFXtoRPprefixDepot(carrier_apt_status.physical_depot?json_string)}" + } + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_CarrierDeparted.ftl b/RFXtoRP_HsrCarrierApt_CarrierDeparted.ftl new file mode 100644 index 0000000..c39c0c3 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_CarrierDeparted.ftl @@ -0,0 +1,22 @@ +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if carrier_apt_status.appointment_reference?? && carrier_apt_status.appointment_reference !=""> + "RefID": "${carrier_apt_status.appointment_reference?json_string}", + <#else> + "RefID": "${carrier_apt_status.physical_depot?json_string}${carrier_apt_status.appointment_year_number?json_string}${carrier_apt_status.appointment_number?json_string}", + + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{ + "ActorID": "${RFXtoRPprefixDepot(carrier_apt_status.physical_depot?json_string)}" + } + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_LoadingCompleted.ftl b/RFXtoRP_HsrCarrierApt_LoadingCompleted.ftl new file mode 100644 index 0000000..c39c0c3 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_LoadingCompleted.ftl @@ -0,0 +1,22 @@ +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if carrier_apt_status.appointment_reference?? && carrier_apt_status.appointment_reference !=""> + "RefID": "${carrier_apt_status.appointment_reference?json_string}", + <#else> + "RefID": "${carrier_apt_status.physical_depot?json_string}${carrier_apt_status.appointment_year_number?json_string}${carrier_apt_status.appointment_number?json_string}", + + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{ + "ActorID": "${RFXtoRPprefixDepot(carrier_apt_status.physical_depot?json_string)}" + } + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_LoadingStarted.ftl b/RFXtoRP_HsrCarrierApt_LoadingStarted.ftl new file mode 100644 index 0000000..c39c0c3 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_LoadingStarted.ftl @@ -0,0 +1,22 @@ +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if carrier_apt_status.appointment_reference?? && carrier_apt_status.appointment_reference !=""> + "RefID": "${carrier_apt_status.appointment_reference?json_string}", + <#else> + "RefID": "${carrier_apt_status.physical_depot?json_string}${carrier_apt_status.appointment_year_number?json_string}${carrier_apt_status.appointment_number?json_string}", + + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{ + "ActorID": "${RFXtoRPprefixDepot(carrier_apt_status.physical_depot?json_string)}" + } + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_UnloadingCompleted.ftl b/RFXtoRP_HsrCarrierApt_UnloadingCompleted.ftl new file mode 100644 index 0000000..c39c0c3 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_UnloadingCompleted.ftl @@ -0,0 +1,22 @@ +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if carrier_apt_status.appointment_reference?? && carrier_apt_status.appointment_reference !=""> + "RefID": "${carrier_apt_status.appointment_reference?json_string}", + <#else> + "RefID": "${carrier_apt_status.physical_depot?json_string}${carrier_apt_status.appointment_year_number?json_string}${carrier_apt_status.appointment_number?json_string}", + + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{ + "ActorID": "${RFXtoRPprefixDepot(carrier_apt_status.physical_depot?json_string)}" + } + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_UnloadingStarted.ftl b/RFXtoRP_HsrCarrierApt_UnloadingStarted.ftl new file mode 100644 index 0000000..c39c0c3 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_UnloadingStarted.ftl @@ -0,0 +1,22 @@ +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if carrier_apt_status.appointment_reference?? && carrier_apt_status.appointment_reference !=""> + "RefID": "${carrier_apt_status.appointment_reference?json_string}", + <#else> + "RefID": "${carrier_apt_status.physical_depot?json_string}${carrier_apt_status.appointment_year_number?json_string}${carrier_apt_status.appointment_number?json_string}", + + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{ + "ActorID": "${RFXtoRPprefixDepot(carrier_apt_status.physical_depot?json_string)}" + } + } +] \ No newline at end of file