info:
  name: Valore ritenuta 2 max formattato
  type: http
  seq: 17

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: "37031"
  body:
    type: json
    data: |-
      {
        "userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
        "userContext": {
          "lang": "IT"
        }
      }
  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="ritenuta2inserita" type="string"][TAG]SCHEMAID,337,COL0017,IUQOID, , [/TAG][/VAR]
        [VAR name="ritenuta2formattata" type="number"][% ritenuta2formattata = 0; %][/VAR]

        [IF]
          [CONDITION][% ritenuta2inserita != "" %][/CONDITION]
          [THEN][% ritenuta2formattata = ritenuta2inserita; %][/THEN]
        [/IF]

        [FORMAT type="number" pattern="#,##0.00"][% ritenuta2formattata %][/FORMAT]
        [/EFTL]
        `);

settings:
  encodeUrl: true
  timeout: 0
  followRedirects: true
  maxRedirects: 5
  forwardAuthorizationHeader: true
