From d30862cd0bd53b09f6ff1088c7009f0b4d38a339 Mon Sep 17 00:00:00 2001 From: Pier-Paolo Mammi Date: Thu, 26 Feb 2026 16:20:35 +0100 Subject: [PATCH] fix: elixFormsAPI - check partecipante DSAN --- .../Partecipanti HAS DSAN.yml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Partecipanti HAS DSAN.yml diff --git a/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Partecipanti HAS DSAN.yml b/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Partecipanti HAS DSAN.yml new file mode 100644 index 0000000..4734c0f --- /dev/null +++ b/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Partecipanti HAS DSAN.yml @@ -0,0 +1,68 @@ +info: + name: Partecipanti HAS DSAN + type: http + seq: 23 + +http: + method: POST + url: "{{elixFormsApiUrl}}/eftl/process/v1" + headers: + - name: x-requested-with + value: XMLHttpRequest + - name: x-api-key + value: "{{elixFormsWsAuthenticationToken}}" + - name: x-ef-request-id + value: "24075" + body: + type: json + data: |- + { + "userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script + "userContext": { + "lang": "IT", + "crlf": "\r\n" + } + } + auth: inherit + +runtime: + scripts: + - type: before-request + code: |- + const { prepareEftlDocument } = require("./elixFormsJs.js") + // Copy-pasta your EFTL document below inside the template literals (`) + prepareEftlDocument(String.raw` + [EFTL][HEADER name="trimDocument" value="true" type="boolean" /] + + [VAR name="richiedenteCF" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR] + [VAR name="lastUpdatedNominativo" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTE,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR] + [VAR name="hasDSAN" type="string"][% hasDSAN = "1"; %][/VAR] + + [VAR name="firstItem" type="number"][% firstItem = 0; %][/VAR] + [VAR name="secondItem" type="number"][% secondItem = 1; %][/VAR] + + [VAR name="lastUpdatedNominativoIterable" type="iterable"][SPLIT regex=" \(CF: "][VALUE_OF varname="lastUpdatedNominativo" /][/SPLIT][/VAR] + [VAR name="lastUpdatedNominativoRightIterable" type="iterable"][SPLIT regex=", Qualifica: "][VALUE_OF varname="lastUpdatedNominativoIterable" index="secondItem" /][/SPLIT][/VAR] + [VAR name="lastUpdatedNominativoCF" type="string"][VALUE_OF varname="lastUpdatedNominativoRightIterable" index="firstItem" /][/VAR] + + [!-- + [%= richiedenteCF %] + [%= crlf %] + [%= lastUpdatedNominativoCF %] + [% richiedenteCF = ""; %] + --] + + [IF] + [CONDITION][% lastUpdatedNominativoCF != "" && lastUpdatedNominativoCF == richiedenteCF %][/CONDITION] + [THEN][% hasDSAN = "0"; %][/THEN] + [/IF] + + [%= hasDSAN %] + [/EFTL] + `); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5