new: elixFormsAPI - calcolo ore qeuivalenti corretto

This commit is contained in:
2026-03-06 12:22:26 +01:00
parent e8fdd3c850
commit 75445fbfb5
@@ -0,0 +1,58 @@
info:
name: Calcolo ore IN o OUT servizio
type: http
seq: 25
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: "24829"
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="tipoAttivita" type="string"][TAG]GETVALUEBYTAG,ATTIVITA_TIPO,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR]
[VAR name="oreAttivita" type="string"][TAG]GETVALUEBYTAG,ATTIVITA_ORE,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR]
[VAR name="oreOrarioIn" type="string"][% oreOrarioIn = "0"; %][/VAR]
[VAR name="oreOrarioOut" type="string"][% oreOrarioOut = "0"; %][/VAR]
[IF]
[CONDITION][% tipoAttivita == "in orario di lavoro" %][/CONDITION]
[THEN][% oreOrarioIn = oreAttivita; %][/THEN]
[ELSE][% oreOrarioOut = oreAttivita; %][/ELSE]
[/IF]
[%= oreOrarioIn %]
[%= crlf %]
[%= oreOrarioOut %]
[/EFTL]
`);
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5