Files
api-collections/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/DSAN/Richiedente - Check ammesso compilazione.yml
T

72 lines
2.9 KiB
YAML

info:
name: Richiedente - Check ammesso compilazione
type: http
seq: 2
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: "24281"
body:
type: json
data: |-
{
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
"userContext": {
"lang": "IT",
"crlf": "\r\n",
"codiciFiscaliAmmessi": ";;MMMPPL74T17E463A;;"
}
}
auth: inherit
runtime:
scripts:
- type: before-request
code: |-
// Copy-pasta your EFTL document below inside the template literals (`)
var eftlDocumentToBeProcessed = bru.setVar("elixBase64EftlDocument", btoa(String.raw`
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
[VAR name="checkUtentePartecipante" type="string"][% checkUtentePartecipante = "Il richiedente non è ammesso alla compilazione perché non partecipa alle ripartizioni"; %][/VAR]
[VAR name="richiedenteCF" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]
[VAR name="richiedentePropostaCF" type="string"][TAG]GETVALUEBYTAG,PROPOSTA_RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]
[VAR name="ripartizioniDatiCompleti" type="string"][TAG]GETVALUEBYTAG,RIPARTIZIONE_DATI_COMPLETI,REQUEST,IUQOID[/TAG][/VAR]
[!-- ATTENZIONE: gli ELSEIF non rispettano la logica di esclusione dei blocchi! Lasciare le condizioni in questo ordine! --]
[!-- 1. Il richiedente non deve essere vuoto --]
[!-- 2. Il richiedente deve comparire fra le ripartizioni --]
[!-- 3. Il richiedente può eventualmente comparire fra i nominativi ammessi (DEBUG) --]
[!-- 4. Il richiedente non deve essere il RS che ha presentato la Proposta --]
[IF]
[CONDITION][IS_EMPTY varname="richiedenteCF" /][/CONDITION]
[THEN][% checkUtentePartecipante = "Nessun richiedente trovato"; %][/THEN]
[ELSE IF]
[CONDITION][CONTAINS varname="ripartizioniDatiCompleti"];;[VALUE_OF varname="richiedenteCF" /];;[/CONTAINS][/CONDITION]
[THEN][% checkUtentePartecipante = ""; %][/THEN]
[/ELSE IF]
[ELSE IF]
[CONDITION][CONTAINS varname="codiciFiscaliAmmessi"][VALUE_OF varname="richiedenteCF" /][/CONTAINS][/CONDITION]
[THEN][% checkUtentePartecipante = ""; %][/THEN]
[/ELSE IF]
[ELSE IF]
[CONDITION][% richiedenteCF == richiedentePropostaCF %][/CONDITION]
[THEN][% checkUtentePartecipante = "Il Responsabile Scientifico proponente della Proposta non deve compilare la DSAN"; %][/THEN]
[/ELSE IF]
[/IF]
[%= checkUtentePartecipante %]
[/EFTL]
`));
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5