diff --git a/RFXtoRP_HsaLstCarSta.ftl b/RFXtoRP_HsaLstCarSta.ftl index 87c97eb..c1bbfbc 100644 --- a/RFXtoRP_HsaLstCarSta.ftl +++ b/RFXtoRP_HsaLstCarSta.ftl @@ -22,29 +22,47 @@ [ { <#switch carrier_apt_status.status.carrier_status_code> - <#case "010"> <#-- Transporteur attendu --> + <#case "010"> <#-- Carrier Expected --> <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierExpected> <#-- à revoir --> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaLstCarSta_CarrierExpected.ftl"> <#break> - <#case "020"> <#-- Transporteur arrivé sur site--> + <#case "020"> <#-- Carrier Arrived--> <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierArrived> <#-- à revoir --> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaLstCarSta_CarrierArrived.ftl"> <#break> - <#case "040"> <#-- Déchargement commencé --> + <#case "040"> <#-- Unloading Started --> <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentUnloadingStarted> <#-- à revoir --> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaLstCarSta_UnloadingStarted.ftl"> <#break> - <#case "050"> <#-- Déchargement terminé--> - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentUnloadingStarted> <#-- à revoir --> + <#case "050"> <#-- Unloading Completed--> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentUnloadingCompleted> <#-- à revoir --> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsaLstCarSta_UnloadingStarted.ftl"> + <#include "RFXtoRP_HsaLstCarSta_UnloadingCompleted.ftl"> + <#break> + <#case "060"> <#-- Loading Started--> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentLoadingStarted> <#-- à revoir --> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaLstCarSta_LoadingStarted.ftl"> + <#break> + <#case "070"> <#-- Loading Completed--> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentLoadingCompleted> <#-- à revoir --> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaLstCarSta_LoadingCompleted.ftl"> + <#break> + <#case "090"> <#-- Carrier Departed--> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierDeparted> <#-- à revoir --> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaLstCarSta_CarrierDeparted.ftl"> <#break> <#default> diff --git a/RFXtoRP_HsaLstCarSta_CarrierArrived.ftl b/RFXtoRP_HsaLstCarSta_CarrierArrived.ftl index 6426fbe..256ab68 100644 --- a/RFXtoRP_HsaLstCarSta_CarrierArrived.ftl +++ b/RFXtoRP_HsaLstCarSta_CarrierArrived.ftl @@ -5,14 +5,15 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if (!carrier_apt_status.appointment_reference?? || carrier_apt_status.appointment_reference == "")> - <#stop "appointment_reference is not valid or empty" > - - "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", - "RefDate": { + <#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)}" diff --git a/RFXtoRP_HsaLstCarSta_CarrierDeparted.ftl b/RFXtoRP_HsaLstCarSta_CarrierDeparted.ftl index 6426fbe..c39c0c3 100644 --- a/RFXtoRP_HsaLstCarSta_CarrierDeparted.ftl +++ b/RFXtoRP_HsaLstCarSta_CarrierDeparted.ftl @@ -5,14 +5,15 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if (!carrier_apt_status.appointment_reference?? || carrier_apt_status.appointment_reference == "")> - <#stop "appointment_reference is not valid or empty" > - - "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + <#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)}" diff --git a/RFXtoRP_HsaLstCarSta_CarrierExpected.ftl b/RFXtoRP_HsaLstCarSta_CarrierExpected.ftl index 6426fbe..c39c0c3 100644 --- a/RFXtoRP_HsaLstCarSta_CarrierExpected.ftl +++ b/RFXtoRP_HsaLstCarSta_CarrierExpected.ftl @@ -5,14 +5,15 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if (!carrier_apt_status.appointment_reference?? || carrier_apt_status.appointment_reference == "")> - <#stop "appointment_reference is not valid or empty" > - - "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + <#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)}" diff --git a/RFXtoRP_HsaLstCarSta_LoadingCompleted.ftl b/RFXtoRP_HsaLstCarSta_LoadingCompleted.ftl new file mode 100644 index 0000000..c39c0c3 --- /dev/null +++ b/RFXtoRP_HsaLstCarSta_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_HsaLstCarSta_LoadingStarted.ftl b/RFXtoRP_HsaLstCarSta_LoadingStarted.ftl new file mode 100644 index 0000000..c39c0c3 --- /dev/null +++ b/RFXtoRP_HsaLstCarSta_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_HsaLstCarSta_UnloadingCompleted.ftl b/RFXtoRP_HsaLstCarSta_UnloadingCompleted.ftl index 6426fbe..c39c0c3 100644 --- a/RFXtoRP_HsaLstCarSta_UnloadingCompleted.ftl +++ b/RFXtoRP_HsaLstCarSta_UnloadingCompleted.ftl @@ -5,14 +5,15 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if (!carrier_apt_status.appointment_reference?? || carrier_apt_status.appointment_reference == "")> - <#stop "appointment_reference is not valid or empty" > - - "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + <#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)}" diff --git a/RFXtoRP_HsaLstCarSta_UnloadingStarted.ftl b/RFXtoRP_HsaLstCarSta_UnloadingStarted.ftl index 07b6b85..c39c0c3 100644 --- a/RFXtoRP_HsaLstCarSta_UnloadingStarted.ftl +++ b/RFXtoRP_HsaLstCarSta_UnloadingStarted.ftl @@ -5,14 +5,15 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if (!carrier_apt_status.appointment_reference?? || carrier_apt_status.appointment_reference == "")> - <#stop "appointment_reference is not valid or empty" > - - "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + <#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)}"