reflex-wms-connector/RFXtoRP_HsrDepot_ActorCreated.ftl
2024-10-10 14:08:43 +02:00

62 lines
2.5 KiB
Java

<#include "ReflexUtils.ftl">
<#include "HfRpConfig.ftl">
<#include "ActorPrefix.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${RFXtoRPprefixDepot(depot.physical_depot_code?trim?json_string)}"
},
"Payload": {
"Name": "${depot.physical_depot_designation?json_string}",
"ManagedStock": true,
"IsCarrier": false,
<#-- ***Partner ID could be added here *** -->
<#-- "PartnerID": "${}", -->
<#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl">,
"Address":
{
<#-- if Reflex WMS address is structured -->
<#if depot.physical_depot_structured_address?? >
"Name": "${depot.physical_depot_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data?json_string}",
"PostalCode" : "${depot.physical_depot_structured_address.postal_code?json_string}",
"City" : "${depot.physical_depot_structured_address.post_code_area_name?json_string}",
<#assign isCountryCode = JsonUtil.isCountryCode(depot.physical_depot_structured_address.country_code?upper_case) />
<#if isCountryCode >
"CountryCode" : "${depot.physical_depot_structured_address.country_code?upper_case?json_string}",
<#else>
"CountryCode" : "",
</#if>
"ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code?json_string}",
"State": "${depot.physical_depot_structured_address.country_designation?json_string}"
<#-- if Reflex WMS address is not structured -->
<#else>
<#if depot.physical_depot_address??>
"Name": "${depot.physical_depot_address.company_name?json_string}",
"StreetAddressOne" : "${depot.physical_depot_address.address_1?json_string}",
"StreetAddressTwo" : "${depot.physical_depot_address.address_2?json_string}",
"StreetAddressThree" : "${depot.physical_depot_address.address_3?json_string}",
"CountryCode" : ""
</#if>
</#if>
},
<#if depot.physical_depot_address??>
"Phones": ["${depot.physical_depot_address.telephone?json_string}",
"${depot.physical_depot_address.other_number?json_string}"
],
</#if>
"Typology": "TYPOLOGY_UNKNOWN"
}
}
]