{
  "meta": {
    "$_GET": [
      {
        "type": "text",
        "name": "description"
      },
      {
        "type": "text",
        "name": "comments"
      },
      {
        "type": "text",
        "name": "partcodeid"
      },
      {
        "type": "text",
        "name": "parttypeid"
      },
      {
        "type": "number",
        "name": "createuserid"
      }
    ]
  },
  "exec": {
    "steps": [
      {
        "name": "api",
        "module": "api",
        "action": "send",
        "options": {
          "url": "{{$_ENV.API_BASEURL+'pns/max'}}",
          "schema": [
            {
              "type": "object",
              "name": "data",
              "sub": [
                {
                  "type": "text",
                  "name": "id"
                },
                {
                  "type": "number",
                  "name": "number"
                }
              ]
            },
            {
              "type": "object",
              "name": "headers",
              "sub": [
                {
                  "type": "text",
                  "name": "connection"
                },
                {
                  "type": "text",
                  "name": "content-length"
                },
                {
                  "type": "text",
                  "name": "content-type"
                },
                {
                  "type": "text",
                  "name": "date"
                }
              ]
            }
          ]
        },
        "output": true,
        "meta": [
          {
            "type": "object",
            "name": "data",
            "sub": [
              {
                "type": "text",
                "name": "id"
              },
              {
                "type": "number",
                "name": "number"
              }
            ]
          },
          {
            "type": "object",
            "name": "headers",
            "sub": [
              {
                "type": "text",
                "name": "connection"
              },
              {
                "type": "text",
                "name": "content-length"
              },
              {
                "type": "text",
                "name": "content-type"
              },
              {
                "type": "text",
                "name": "date"
              }
            ]
          }
        ],
        "outputType": "object"
      },
      {
        "name": "partnumber",
        "module": "core",
        "action": "setvalue",
        "options": {
          "key": "g_partnumber",
          "value": "{{$_GET.parttypeid+'-'+$_GET.partcodeid+'-'+api.data.number}}"
        },
        "meta": [],
        "outputType": "text"
      },
      {
        "name": "insertpn",
        "module": "api",
        "action": "send",
        "options": {
          "url": "{{$_ENV.API_BASEURL+'pns'}}",
          "method": "POST",
          "schema": [
            {
              "type": "object",
              "name": "data",
              "sub": [
                {
                  "type": "number",
                  "name": "id"
                },
                {
                  "type": "number",
                  "name": "number"
                }
              ]
            }
          ],
          "dataType": "json",
          "data": {
            "id": null,
            "number": "{{api.data.number}}"
          }
        },
        "output": true,
        "meta": [
          {
            "type": "object",
            "name": "data",
            "sub": [
              {
                "type": "number",
                "name": "id"
              },
              {
                "type": "number",
                "name": "number"
              }
            ]
          }
        ],
        "outputType": "object"
      },
      {
        "name": "insertpart",
        "module": "api",
        "action": "send",
        "options": {
          "url": "{{$_ENV.API_BASEURL+'partnumbers/alt'}}",
          "method": "POST",
          "dataType": "json",
          "data": {
            "id": null,
            "number": "{{partnumber}}",
            "description": "{{$_GET.description}}",
            "comments": "{{$_GET.comments}}",
            "statusid": 4,
            "parttypeid": "{{$_GET.parttypeid}}",
            "partcodeid": "{{$_GET.partcodeid}}",
            "createuserid": "{{$_GET.createuserid}}"
          },
          "schema": [
            {
              "type": "object",
              "name": "data",
              "sub": [
                {
                  "type": "number",
                  "name": "id"
                },
                {
                  "type": "text",
                  "name": "number"
                },
                {
                  "type": "text",
                  "name": "description"
                },
                {
                  "type": "text",
                  "name": "comments"
                }
              ]
            }
          ]
        },
        "output": true,
        "meta": [
          {
            "type": "object",
            "name": "data",
            "sub": [
              {
                "type": "number",
                "name": "id"
              },
              {
                "type": "text",
                "name": "number"
              },
              {
                "type": "text",
                "name": "description"
              },
              {
                "type": "text",
                "name": "comments"
              }
            ]
          }
        ],
        "outputType": "object"
      }
    ]
  }
}