reflex-wms-connector/RFXtoRP_HsaCons_ActorCreated.ftl
2025-05-13 11:19:35 +02:00

55 lines
2.0 KiB
Java

[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${RFXtoRPprefixConsignee(actor.code?trim?json_string)}"
},
"Payload": {
"Name": "${actor.designation?json_string}",
"IsCarrier": false,
<#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">,
"Address":
{
<#-- if Reflex WMS is structured -->
<#if actor.consignee_structured_address??>
"Name": "${actor.consignee_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data?json_string}",
"PostalCode" : "${actor.consignee_structured_address.postal_code?json_string}",
"City" : "${actor.consignee_structured_address.post_code_area_name?json_string}",
<#assign isCountryCode = JsonUtil.isCountryCode(actor.consignee_structured_address.country_code?upper_case) />
<#if isCountryCode>
"CountryCode" : "${actor.consignee_structured_address.country_code?upper_case?json_string}",
<#else>
"CountryCode" : "",
</#if>
"ProvinceCode": "${actor.consignee_structured_address.territorial_div_code?json_string}",
"State": "${actor.consignee_structured_address.country_designation?json_string}"
<#-- if Reflex WMS is not structured -->
<#else>
<#if actor.address?? >
"Name": "${actor.address.company_name?json_string}",
"StreetAddressOne" : "${actor.address.address_1?json_string}",
"StreetAddressTwo" : "${actor.address.address_2?json_string}",
"StreetAddressThree" : "${actor.address.address_3?json_string}",
"CountryCode" : ""
</#if>
</#if>
},
<#if actor.address?? >
"Phones": ["${actor.address.telephone?json_string}",
"${actor.address.other_number?json_string}"
],
</#if>
"Typology": "TYPOLOGY_UNKNOWN"
}
}
]