{
  "meta": {
    "$_GET": [
      {
        "type": "text",
        "name": "sort"
      },
      {
        "type": "text",
        "name": "dir"
      },
      {
        "type": "text",
        "name": "target_id"
      }
    ]
  },
  "exec": {
    "steps": [
      {
        "name": "",
        "module": "auth",
        "action": "restrict",
        "options": {
          "provider": "security",
          "permissions": [
            "Active"
          ]
        }
      },
      {
        "name": "list",
        "module": "dbconnector",
        "action": "paged",
        "options": {
          "connection": "db",
          "sql": {
            "type": "SELECT",
            "columns": [
              {
                "table": "target_transaction",
                "column": "target_id"
              },
              {
                "table": "target_transaction",
                "column": "credit"
              },
              {
                "table": "target_transaction",
                "column": "debit"
              },
              {
                "table": "target_transaction",
                "column": "created_on"
              },
              {
                "table": "tm",
                "column": "name"
              }
            ],
            "params": [
              {
                "operator": "equal",
                "type": "expression",
                "name": ":P1",
                "value": "{{$_GET.target_id}}",
                "test": ""
              }
            ],
            "table": {
              "name": "target_transaction"
            },
            "primary": "id",
            "joins": [
              {
                "table": "target_master",
                "column": "*",
                "alias": "tm",
                "type": "LEFT",
                "clauses": {
                  "condition": "AND",
                  "rules": [
                    {
                      "table": "tm",
                      "column": "id",
                      "operator": "equal",
                      "operation": "=",
                      "value": {
                        "table": "target_transaction",
                        "column": "target_id",
                        "type": "number"
                      }
                    }
                  ]
                },
                "primary": "id"
              }
            ],
            "orders": [
              {
                "table": "target_transaction",
                "column": "created_on",
                "direction": "DESC",
                "recid": 1
              }
            ],
            "query": "select `target_transaction`.`target_id`, `target_transaction`.`credit`, `target_transaction`.`debit`, `target_transaction`.`created_on`, `tm`.`name` from `target_transaction` left join `target_master` as `tm` on `tm`.`id` = `target_transaction`.`target_id` where `tm`.`status` <> ? and (`target_transaction`.`target_id` = ?) order by `target_transaction`.`created_on` DESC limit ?",
            "limit": 10,
            "wheres": {
              "condition": "AND",
              "rules": [
                {
                  "id": "tm.status",
                  "field": "tm.status",
                  "type": "string",
                  "operator": "not_equal",
                  "value": "Completed",
                  "data": {
                    "table": "tm",
                    "column": "status",
                    "type": "text",
                    "columnObj": {
                      "type": "enum",
                      "enumValues": [
                        "Not Started",
                        "In Progress",
                        "Completed"
                      ],
                      "default": "'Not Started'",
                      "maxLength": 11,
                      "primary": false,
                      "nullable": true,
                      "name": "status"
                    }
                  },
                  "operation": "<>"
                },
                {
                  "condition": "AND",
                  "rules": [
                    {
                      "id": "target_transaction.target_id",
                      "field": "target_transaction.target_id",
                      "type": "double",
                      "operator": "equal",
                      "value": "{{$_GET.target_id}}",
                      "data": {
                        "table": "target_transaction",
                        "column": "target_id",
                        "type": "number",
                        "columnObj": {
                          "type": "reference",
                          "primary": false,
                          "nullable": false,
                          "references": "id",
                          "inTable": "target_master",
                          "referenceType": "integer",
                          "onUpdate": "NO ACTION",
                          "onDelete": "NO ACTION",
                          "name": "target_id"
                        }
                      },
                      "operation": "="
                    }
                  ],
                  "conditional": "{{$_GET.target_id}}"
                }
              ],
              "conditional": null,
              "valid": true
            }
          }
        },
        "output": true,
        "meta": [
          {
            "name": "offset",
            "type": "number"
          },
          {
            "name": "limit",
            "type": "number"
          },
          {
            "name": "total",
            "type": "number"
          },
          {
            "name": "page",
            "type": "object",
            "sub": [
              {
                "name": "offset",
                "type": "object",
                "sub": [
                  {
                    "name": "first",
                    "type": "number"
                  },
                  {
                    "name": "prev",
                    "type": "number"
                  },
                  {
                    "name": "next",
                    "type": "number"
                  },
                  {
                    "name": "last",
                    "type": "number"
                  }
                ]
              },
              {
                "name": "current",
                "type": "number"
              },
              {
                "name": "total",
                "type": "number"
              }
            ]
          },
          {
            "name": "data",
            "type": "array",
            "sub": [
              {
                "type": "number",
                "name": "target_id"
              },
              {
                "type": "number",
                "name": "credit"
              },
              {
                "type": "number",
                "name": "debit"
              },
              {
                "type": "datetime",
                "name": "created_on"
              },
              {
                "type": "text",
                "name": "name"
              }
            ]
          }
        ],
        "outputType": "object",
        "type": "dbconnector_paged_select",
        "collapsed": true
      }
    ]
  }
}