From 0a0121c020f054320b371c7341b3d96ab7aa86f9 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Wed, 11 Sep 2024 14:59:45 +0200 Subject: [PATCH] modifs --- RFXtoRP_HsaDispute.ftl | 5 +- RFXtoRP_HsaDispute_Created.ftl | 46 ++++++++++++------- ...oRP_HsaDispute_ReasonCodeToClaimTypeID.ftl | 13 ++++++ Table.ftl | 9 ++++ 4 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 RFXtoRP_HsaDispute_ReasonCodeToClaimTypeID.ftl create mode 100644 Table.ftl diff --git a/RFXtoRP_HsaDispute.ftl b/RFXtoRP_HsaDispute.ftl index 55ee386..b2a538b 100644 --- a/RFXtoRP_HsaDispute.ftl +++ b/RFXtoRP_HsaDispute.ftl @@ -16,13 +16,16 @@ <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dispute = JsonUtil.jsonToMap(dataRfx)> [ - + <#if dispute.dispute_closed == true > { <#assign apiReflexPlatformID = ApiReflexPlatformID.ClaimCreated> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaDispute_Created.ftl"> } + <#else> + <#stop> + ] <#break> diff --git a/RFXtoRP_HsaDispute_Created.ftl b/RFXtoRP_HsaDispute_Created.ftl index 243ad4b..8673859 100644 --- a/RFXtoRP_HsaDispute_Created.ftl +++ b/RFXtoRP_HsaDispute_Created.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "Table.ftl"> [ { "Header": { @@ -7,7 +8,7 @@ }, "ID": { <#if dispute.dispute_preparation??> - "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?trim?json_string}${dispute.dispute_preparation.preparation_activity_code?trim?json_string}${dispute.dispute_preparation.preparation_order_list.preparation_order_contractor_code?trim?json_string}${dispute.dispute_year_number?trim?json_string}${dispute.dispute_number?trim?json_string}" + "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?trim?json_string}${dispute.dispute_preparation.preparation_activity_code?trim?json_string}${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_code?trim?json_string}${dispute.dispute_year_number?trim?json_string}${dispute.dispute_number?trim?json_string}" <#else> <#if dispute.dispute_reception??> "RefID": "${dispute.dispute_reception.reception_physical_depot_code?trim?json_string}${dispute.dispute_reception.reception_activity_code?trim?json_string}${dispute.dispute_reception.reception_contractor_code?trim?json_string}${dispute.dispute_year_number?trim?json_string}${dispute.dispute_number?trim?json_string}" @@ -16,22 +17,35 @@ }, "Payload": { - <#-- Case of dispute on preparation --> - <#if dispute.dispute_type_code=="050" > - "EntityID":"${dispute.dispute_preparation.preparation_order_list.preparation_order_contractor_reference}", - <#if dispute.dispute_reason_code == "001"> <#--Enter your Reflex Reason code and mappe it with Platform reason code--> - "ClaimTypeID":"CLAIMTYPE_${projectRP}_ORDER_RETARDLIV" - - <#else> - <#-- Case of dispute on receipt --> - <#if dispute.dispute_type_code=="070" || dispute.dispute_type_code=="030" > - "EntityID":"${dispute.dispute_reception.reception_reference}", - <#if dispute.dispute_reason_code == "M1"> <#--Enter your Reflex Reason code and mappe it with Platform reason code--> - "ClaimTypeID":"CLAIMTYPE_${projectRP}_ORDER_RETARDLIV" - - - + <#if dispute.dispute_reference?? && dispute.dispute_reference!=""> + "Title":"${dispute.dispute_reference?trim?json_string}", + <#else> + "Title":"", + "Amount": { + <#-- "Currency": "${TableCurrency[dispute.dispute_amount_unit]}",--> + "Currency":"EUR", + "Value": "${dispute.dispute_amount}" + }, + <#if dispute.dispute_type_code=="050" > + "EntityID":"${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_reference?trim?json_string}", + <#else> + <#if dispute.dispute_type_code=="070" || dispute.dispute_type_code=="030" > + "EntityID":"${dispute.dispute_reception.reception_reference?trim?json_string}", + <#else> + <#stop "Type not supported" > + + + <#-- To configure --> + <#include "RFXtoRP_HsaDispute_ReasonCode.ftl"> + + <#if TableReasonCode[dispute.dispute_reason_code]??> + "ClaimTypeID":"${TableReasonCode[dispute.dispute_reason_code]}" + <#else> + <#stop "Claim reason code not supported" > + + + } } ] diff --git a/RFXtoRP_HsaDispute_ReasonCodeToClaimTypeID.ftl b/RFXtoRP_HsaDispute_ReasonCodeToClaimTypeID.ftl new file mode 100644 index 0000000..b95564d --- /dev/null +++ b/RFXtoRP_HsaDispute_ReasonCodeToClaimTypeID.ftl @@ -0,0 +1,13 @@ +<#-- Specify table for reason code --> +<#-- <#assign TableReasonCode = { + "001":"CLAIMTYPE_${projectRP}_ORDER_Delay", + "M1":"CLAIMTYPE_${projectRP}_ORDER_casse", + "XXX":"CLAIMTYPE_${projectRP}_ACTOR_claimtype", + "XXX":"CLAIMTYPE_${projectRP}_HANDLINGUNIT_claimtype", + "XXX":"CLAIMTYPE_${projectRP}_MOVEMENT_claimtype" + }/>--> + + + + + diff --git a/Table.ftl b/Table.ftl new file mode 100644 index 0000000..b61f611 --- /dev/null +++ b/Table.ftl @@ -0,0 +1,9 @@ +<#-- Table criticality --> +<#assign TableCriticality = { + "1": "CLAIM_CRITICALITY_LOW", + "2":"CLAIM_CRITICALITY_MEDIUM", + "3":"CLAIM_CRITICALITY_HIGH", + "4":"CLAIM_CRITICALITY_BLOCKING" + }> + +