reflex-wms-connector/RFXtoRP_HsaSup_ActorCreated.ftl
2025-10-21 16:19:01 +02:00

52 lines
2.2 KiB
Java

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