Merge branch 'main' of https://gitea.synno-qc.synology.me/UniPR/Bruno-API
This commit is contained in:
+19
-2
@@ -41,10 +41,27 @@ runtime:
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
|
||||
[VAR name="importo" type="number"][TAG]SCHEMAID,709,COL0118,IUQOID, , ,,0.00000[/TAG][/VAR]
|
||||
[VAR name="codiceFiscaleRichiedente" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]
|
||||
[VAR name="ripartizioniIterable" type="iterable"][SPLIT regex="#"][TAG]GETVALUEBYTAG,COPPIE_RIPARTIZIONI,REQUEST,IUQOID,CONCAT,#[/TAG][/SPLIT][/VAR]
|
||||
|
||||
[VAR name="firstItem" type="number"][% firstItem = 0; %][/VAR]
|
||||
[VAR name="secondItem" type="number"][% secondItem = 1; %][/VAR]
|
||||
[VAR name="importoRichiedente" type="number"][% importoRichiedente = 0; %][/VAR]
|
||||
|
||||
[FOR varname="coppia" iterable="ripartizioniIterable"]
|
||||
[VAR name="coppiaiIterable" type="iterable"][SPLIT regex=":"][VALUE_OF varname="coppia" /][/SPLIT][/VAR]
|
||||
[VAR name="codiceFiscale" type="string"][VALUE_OF varname="coppiaiIterable" index="firstItem" /][/VAR]
|
||||
[VAR name="importo" type="number"][VALUE_OF varname="coppiaiIterable" index="secondItem" /][/VAR]
|
||||
|
||||
[IF]
|
||||
[CONDITION][% codiceFiscale == codiceFiscaleRichiedente %][/CONDITION]
|
||||
[THEN][% importoRichiedente = importo; %][/THEN]
|
||||
[/IF]
|
||||
[/FOR]
|
||||
|
||||
[VAR name="fattore" type="number"][TAG]SCHEMAID,709,COL0120,IUQOID, , ,,0.00000[/TAG][/VAR]
|
||||
|
||||
[%= importo * fattore %]
|
||||
[%= importoRichiedente * fattore %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
info:
|
||||
name: Nuovo check richiedente DSAN
|
||||
type: http
|
||||
seq: 19
|
||||
|
||||
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"][% utentePartecipante = "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="coppieRipartizioniProposta" type="string"][TAG]GETVALUEBYTAG,COPPIE_RIPARTIZIONI,REQUEST,IUQOID,CONCAT,#[/TAG][/VAR]
|
||||
[VAR name="exitIf" type="boolean"][% exitIf = false; %][/VAR]
|
||||
|
||||
[!-- Il richiedente non deve essere il RS che ha presentato la Proposta --]
|
||||
[!-- Il richiedente deve comparire fra le ripartizioni --]
|
||||
[!-- Il richiedente deve comparire fra i nominativi ammessi (DEBUG) --]
|
||||
[IF]
|
||||
[CONDITION][IS_EMPTY varname="richiedenteCF" /][/CONDITION]
|
||||
[THEN][% checkUtentePartecipante = "Nessun richiedente trovato"; exitIf = true; %][/THEN]
|
||||
[/IF]
|
||||
|
||||
[IF]
|
||||
[CONDITION][% exitIf == false %][/CONDITION]
|
||||
[THEN]
|
||||
[IF]
|
||||
[CONDITION][% richiedenteCF == richiedentePropostaCF %][/CONDITION]
|
||||
[THEN][% checkUtentePartecipante = "Il Responsabile Scientifico proponente della Proposta non deve compilare la DSAN"; exitIf = true; %][/THEN]
|
||||
[/IF]
|
||||
[/THEN]
|
||||
[/IF]
|
||||
|
||||
[IF]
|
||||
[CONDITION][% exitIf == false %][/CONDITION]
|
||||
[THEN]
|
||||
[IF]
|
||||
[CONDITION][CONTAINS varname="coppieRipartizioniProposta"][VALUE_OF varname="richiedenteCF" /][/CONTAINS][/CONDITION]
|
||||
[THEN][% checkUtentePartecipante = "trovato in coppie"; exitIf = true; %][/THEN]
|
||||
[/IF]
|
||||
[/THEN]
|
||||
[/IF]
|
||||
|
||||
[IF]
|
||||
[CONDITION][% exitIf == false %][/CONDITION]
|
||||
[THEN]
|
||||
[IF]
|
||||
[CONDITION][CONTAINS varname="codiciFiscaliAmmessi"][VALUE_OF varname="richiedenteCF" /][/CONTAINS][/CONDITION]
|
||||
[THEN][% checkUtentePartecipante = "trovato in CF ammessi"; exitIf = true; %][/THEN]
|
||||
[/IF]
|
||||
[/THEN]
|
||||
[/IF]
|
||||
|
||||
[%= checkUtentePartecipante %]
|
||||
[/EFTL]
|
||||
`));
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
Reference in New Issue
Block a user