structured adress on actors

This commit is contained in:
Laure Pascal 2023-09-13 12:06:06 +02:00
parent d81489d59f
commit da36927874
4 changed files with 91 additions and 40 deletions

View File

@ -17,19 +17,32 @@
<#--
<#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">,
-->
"Address":
{
"Name": "${carrier.carrier_structured_address.name_or_company}",
"StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO}",
"StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data}",
"PostalCode" : "${carrier.carrier_structured_address.postal_code}",
"City" : "${carrier.carrier_structured_address.post_code_area_name}",
"CountryCode" : "${carrier.carrier_structured_address.country_code}",
"ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code}",
"State": "${carrier.carrier_structured_address.country_designation}"
<#-- if Reflex WMS address is structured -->
<#if carrier.carrier_structured_address?? >
"Name": "${carrier.carrier_structured_address.name_or_company}",
"StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO}",
"StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data}",
"PostalCode" : "${carrier.carrier_structured_address.postal_code}",
"City" : "${carrier.carrier_structured_address.post_code_area_name}",
"CountryCode" : "${carrier.carrier_structured_address.country_code}",
"ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code}",
"State": "${carrier.carrier_structured_address.country_designation}"
<#-- if Reflex WMS address is not structured -->
<#else>
"Name": "${carrier.address.company_name}",
"StreetAddressOne" : "${carrier.address.address_1}",
"StreetAddressTwo" : "${carrier.address.address_2}",
"StreetAddressThree" : "${carrier.address.address_3}"
</#if>
},
"Phones": ["${carrier.address.telephone}",
"Phones": ["${carrier.address.telephone}",
"${carrier.address.other_number}"
],
"Typology": "TYPOLOGY_CARRIER"

View File

@ -17,9 +17,13 @@
<#--
<#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">,
-->
"Address":
{
<#-- if Reflex WMS is structured -->
<#if actor.consignee_structured_address??>
"Address":
{
"Name": "${actor.consignee_structured_address.name_or_company}",
"StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO}",
"StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data}",
@ -27,12 +31,23 @@
"City" : "${actor.consignee_structured_address.post_code_area_name}",
"CountryCode" : "${actor.consignee_structured_address.country_code}",
"ProvinceCode": "${actor.consignee_structured_address.territorial_div_code}",
"State": "${actor.consignee_structured_address.country_designation}"
},
"Phones": ["${actor.address.telephone}",
"${actor.address.other_number}"
],
"Typology": "TYPOLOGY_UNKNOWN"
"State": "${actor.consignee_structured_address.country_designation}"
<#-- if Reflex WMS is not structured -->
<#else>
"Name": "${actor.address.company_name}",
"StreetAddressOne" : "${actor.address.address_1}",
"StreetAddressTwo" : "${actor.address.address_2}",
"StreetAddressThree" : "${actor.address.address_3}",
</#if>
},
"Phones": ["${actor.address.telephone}",
"${actor.address.other_number}"
],
"Typology": "TYPOLOGY_UNKNOWN"
}
}
]

View File

@ -20,14 +20,26 @@
"Address":
{
"Name": "${actor.supplier_structured_address.name_or_company}",
"StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO}",
"StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data}",
"PostalCode" : "${actor.supplier_structured_address.postal_code}",
"City" : "${actor.supplier_structured_address.post_code_area_name}",
"CountryCode" : "${actor.supplier_structured_address.country_code}",
"ProvinceCode": "${actor.supplier_structured_address.territorial_div_code}",
"State": "${actor.supplier_structured_address.country_designation}"
<#-- if Reflex WMS address is structured -->
<#if actor.supplier_structured_address?? >
"Name": "${actor.supplier_structured_address.name_or_company}",
"StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO}",
"StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data}",
"PostalCode" : "${actor.supplier_structured_address.postal_code}",
"City" : "${actor.supplier_structured_address.post_code_area_name}",
"CountryCode" : "${actor.supplier_structured_address.country_code}",
"ProvinceCode": "${actor.supplier_structured_address.territorial_div_code}",
"State": "${actor.supplier_structured_address.country_designation}"
<#-- if Reflex WMS address is not structured -->
<#else>
"Name": "${actor.optional_attributes.company_name}",
"StreetAddressOne" : "${actor.optional_attributes.address_1}",
"StreetAddressTwo" : "${actor.optional_attributes.address_2}",
"StreetAddressThree" : "${actor.optional_attributes.address_3}"
</#if>
},
"Phones": ["${actor.optional_attributes.telephone}",
"${actor.optional_attributes.other_number}"

View File

@ -18,22 +18,33 @@
<#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl">,
-->
"Address":
"Address":
{
"StreetAddressOne" : "${depot.physical_depot_address.address_1}",
"StreetAddressTwo" : "${depot.physical_depot_address.address_2}",
<#-- if Reflex WMS address is structured -->
<#if depot.physical_depot_structured_address?? >
<#if depot.physical_depot_address.address_3?length &lt; 10>
"PostalCode" : "${depot.physical_depot_address.address_3?trim}",
<#else>
"PostalCode" : "${depot.physical_depot_address.address_3?substring(0,9)?trim}",
</#if>
<#if depot.physical_depot_address.address_4?length &lt; 14>
"CountryCode" : ""
<#else>
"CountryCode" : "${depot.physical_depot_address.address_4?substring(10,13)?trim}"
</#if>
}
"Name": "${depot.physical_depot_structured_address.name_or_company}",
"StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO}",
"StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data}",
"PostalCode" : "${depot.physical_depot_structured_address.postal_code}",
"City" : "${depot.physical_depot_structured_address.post_code_area_name}",
"CountryCode" : "${depot.physical_depot_structured_address.country_code}",
"ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code}",
"State": "${depot.physical_depot_structured_address.country_designation}"
<#-- if Reflex WMS address is not structured -->
<#else>
"Name": "${depot.physical-depot_address.company_name}",
"StreetAddressOne" : "${depot.physical-depot_address.address_1}",
"StreetAddressTwo" : "${depot.physical-depot_address.address_2}",
"StreetAddressThree" : "${depot.physical-depot_address.address_3}"
</#if>
},
"Phones": ["${depot.physical-depot_address.telephone}",
"${depot.physical-depot_address.other_number}"
],
"Typology": "TYPOLOGY_UNKNOWN"
}
}
]