{
  "apps": [
    {
      "active": true,
      "color": "#F5FFFA",
      "icon": "election-card",
      "id": "Elections",
      "menuItems": [
        {
          "target": "Candidates",
          "type": "table"
        },
        {
          "target": "Cities",
          "type": "table"
        }
      ],
      "name": "Election",
      "processes": [],
      "roles": {
        "reviewer": {
          "description": "Count the votes.",
          "name": "Reviewer"
        },
        "voter": {
          "description": "Person that votes.",
          "name": "Voter"
        }
      },
      "secrets": [],
      "tables": [
        {
          "data": {
            "first": {
              "age": 27,
              "firstName": "Alonso",
              "identificationDocumentType": "cedula",
              "identificationNumber": 1712345678,
              "lastName": "Vargas"
            },
            "second": {
              "age": 45,
              "firstName": "Florencia",
              "identificationDocumentType": "cedula",
              "identificationNumber": 1912345672,
              "lastName": "Rita"
            }
          },
          "fields": {
            "age": {
              "dbName": "numeric_age",
              "description": "It is the age of the person",
              "label": "Age",
              "required": false,
              "type": "number"
            },
            "firstName": {
              "dbName": "text_firstName",
              "description": "It is the first name of the person",
              "label": "First Name",
              "required": true,
              "type": "text"
            },
            "identificationDocumentType": {
              "dataType": "text",
              "dbName": "text_identificationDocumentType",
              "label": "Document Type",
              "options": {
                "driversLicense": "Driver's License",
                "other": "Other",
                "passport": "Passport"
              },
              "required": true,
              "type": "select"
            },
            "identificationNumber": {
              "dbName": "text_identificationNumber",
              "label": "Document Number",
              "required": true,
              "type": "text"
            },
            "lastName": {
              "dbName": "text_lastName",
              "description": "It is the last name of the person",
              "label": "Last Name",
              "required": true,
              "type": "text"
            },
            "tblTableE": {
               "dbName": "tbl_ff4656a05c",
               "label": "table Field",
               "table": "Cities",
               "tableFullName": "Elections.Cities",
               "referencedFieldName": "parent_ff4656a05c",
               "type": "table"
            }
          },
          "form": {
            "rows": [
              {
                "_title": "Personal Information"
              },
              [
                "text_firstName",
                "text_lastName"
              ],
              [
                "text_identificationDocumentType",
                "text_identificationNumber"
              ],
              {
                "_title": "Other Information"
              },
              "numeric_age"
            ]
          },
          "initialStage": "new",
          "itemName": "Candidate",
          "key": "Candidates",
          "name": "Candidate",
          "permissions": {
            "reviewer": {
              "create": true,
              "delete": {
                "any": false,
                "own": true
              },
              "edit": [
                "*",
                "!text_lastName"
              ],
              "view": true
            },
            "voter": {
              "create": false,
              "delete": {
                "own": true
              },
              "edit": {
                "own": [
                  "text_firstName",
                  "text_lastName",
                  "text_identificationDocumentType"
                ]
              },
              "view": {
                "own": [
                  "*",
                  "!text_firstName"
                ]
              }
            }
          },
          "stages": {
            "approved": {
              "description": "Candidate has been approved",
              "done": true,
              "name": "Approved",
              "successful": true
            },
            "inProcess": {
              "description": "It has entered the process, but no outcome yet defined",
              "name": "In Process"
            },
            "new": {
              "description": "It is a new candidate, hasn't gone through any tests",
              "name": "New"
            },
            "rejected": {
              "description": "Candidate has been rejected definitively",
              "done": true,
              "name": "Rejected",
              "successful": false
            }
          },
          "summary": {
            "subtitle": "${identificationNumber}",
            "title": "${firstName} ${lastName}"
          },
          "testData": {
            "1": {
              "age": 27,
              "firstName": "Pedro",
              "identificationDocumentType": "cedula",
              "identificationNumber": 1712345678,
              "lastName": "Perez"
            },
            "2": {
              "age": 45,
              "firstName": "Joe",
              "identificationDocumentType": "cedula",
              "identificationNumber": 1912345672,
              "lastName": "Does"
            }
          },
          "type": "table"
        },
        {
          "data": {
            "first": {
              "Address": "Quito",
              "CodeZip": 1234444,
              "Description": "Sample description"
            },
            "second": {
              "Address": "Cuenca",
              "CodeZip": 266305,
              "Description": "Sample description"
            }
          },
          "fields": {
            "Address": {
              "dbName": "text_Address",
              "description": "Address of category",
              "label": "Address",
              "required": true,
              "type": "text"
            },
            "CodeZip": {
              "dbName": "numeric_CodeZip",
              "label": "CodeZip",
              "required": false,
              "type": "number"
            },
            "Description": {
              "dbName": "text_Description",
              "label": "Description",
              "required": false,
              "type": "text"
            },
            "parent_ff4656a05c": {
              "dbName": "parent_ff4656a05c",
              "parentTable": "Candidates",
              "parentTableFieldName": "tblTableE",
              "parentTableFullName": "Elections.Candidates",
              "type": "parentTable"
            }
          },
          "itemName": "City",
          "key": "Cities",
          "name": "City",
          "permissions": {
            "reviewer": {
              "create": false,
              "delete": {
                "any": false,
                "own": true
              },
              "edit": [
                "*",
                "!text_Address"
              ],
              "view": true
            },
            "voter": {
              "create": true,
              "delete": false,
              "edit": false,
              "view": false
            }
          },
          "summary": {
            "subtitle": "${name}",
            "title": "${id} - ${code}"
          },
          "type": "table"
        }
      ],
      "templates": [],
      "type": "app"
    },
    {
      "active": false,
      "color": "#F5FFFA",
      "icon": "recruitment-card",
      "id": "Recruitment",
      "menuItems": [
        {
          "target": "Recruiters",
          "type": "table"
        }
      ],
      "name": "Recruitment",
      "processes": [
        {
          "fieldGroups": {
            "summary": {
              "id": "d76cc8702dbeab9181ea8460536ff7fdc1ffe50f",
              "key": "summary",
              "readOnly": true,
              "rows": [
                [
                  "text_identificationDocumentType",
                  "text_fullName"
                ]
              ]
            },
            "summaryWithScores": {
              "id": "7726b4bc9739bb78dc1ec4f5be304b9c9ca257b1",
              "key": "summaryWithScores",
              "readOnly": true,
              "rows": [
                "text_identificationDocumentType"
              ]
            }
          },
          "forms": {
            "fillOutInvitationInformation": {
              "id": "53e68538f4972a3b72a100dcdc590d10cf991b73",
              "key": "fillOutInvitationInformation",
              "name": "Start application",
              "rows": [
                "text_identificationDocumentType",
                "text_fullName"
              ]
            },
            "fillOutScores": {
              "id": "a743ce5f1da3d57ecff6882e79b2899114a274fe",
              "key": "fillOutScores",
              "name": "Fill out scores",
              "rows": [
                {
                  "_group": "summary",
                  "_groupId": "d76cc8702dbeab9181ea8460536ff7fdc1ffe50f"
                },
                {
                  "_title": "Scores"
                },
                {
                  "_statement": "Please enter the candidate scores"
                },
                "text_identificationDocumentType"
              ],
              "title": "Fill out scores for {{text_fullName}}"
            },
            "manualApproval1": {
              "id": "2b040caaa4b7e31c53094f9e5bdf7d07748267a4",
              "key": "manualApproval1",
              "name": "Manual Approval 1",
              "outcomes": {
                "approve": "Approve",
                "reject": {
                  "form": {
                    "rows": [
                      "text_identificationDocumentType"
                    ]
                  },
                  "title": "Reject"
                }
              },
              "rows": [
                {
                  "_group": "summaryWithScores",
                  "_groupId": "7726b4bc9739bb78dc1ec4f5be304b9c9ca257b1"
                },
                "text_identificationDocumentType"
              ]
            }
          },
          "icon": "person",
          "key": "processExample1",
          "mainTable": "Recruiters",
          "mainTableFields": {
            "fullName": {
              "dbName": "text_fullName",
              "description": "It is the first name of the candidate",
              "label": "Full Name",
              "required": true,
              "type": "text"
            },
            "identificationDocumentType": {
              "dataType": "text",
              "dbName": "text_identificationDocumentType",
              "label": "Document Type",
              "options": {
                "driversLicense": "Driver's License",
                "other": "Other",
                "passport": "Passport"
              },
              "required": false,
              "type": "select"
            },
            "identificationNumber": {
              "dbName": "text_identificationNumber",
              "label": "Document Number",
              "required": true,
              "type": "text"
            }
          },
          "name": "Start Recruitment",
          "permissions": {
            "recruiter": true
          },
          "secrets": [
            "mySecret",
            "secretOne",
            "secretFour"
          ],
          "serviceTasks": {
            "calculateScore": {
              "body": {
                "anotherKey": "{{_secrets.secretFour}} {{_vars.mySecret}}",
                "myKey": "myValue"
              },
              "headers": {
                "Authorization": "Bearer {{_secrets.secretOne}}"
              },
              "id": "030cbe042997cb2de7c4224d8f8c915103a1c88e",
              "key": "calculateScore",
              "method": "POST",
              "name": "Calculate score",
              "query": {
                "a": "any text",
                "b": "{{text_fullName}}",
                "d": "{{_secrets.mySecret}}",
                "e": "{{_vars.initiator.id}}",
                "f": "A mix of anything {{_vars.initiator.email}}"
              },
              "mapping": {
                "_vars.response": "{{body}}",
                "candidate.score": "{{body.data.score}}",
                "_vars.expireDate": "{{headers.expires}}",
                "_vars.statusCode": "{{statusCode}}"
              },
              "retries": 3,
              "type": "httpRequest",
              "url": "http://example.com/myEndpoint/{{text_fullName}}"
            }
          },
          "summary": {
            "title": "Process for {{text_fullName}}"
          },
          "type": "process",
          "variables": [
            "initiator",
            "mySecret",
            "response",
            "statusCode",
            "expireDate"
          ]
        }
      ],
      "roles": {
        "interviewer": {
          "description": "Allows to see only the information of the candidates they are interviewing.",
          "name": "Interviewer"
        },
        "recruiter": {
          "description": "Allows the user to perform any operation in this app",
          "name": "Recruiter"
        }
      },
      "secrets": [
        "mySecret",
        "secretOne",
        "secretFour"
      ],
      "tables": [
        {
          "data": {
            "1": {
              "fullName": "Maria Martina Merida Mejias",
              "identificationDocumentType": "cedula",
              "identificationNumber": 302493049
            },
            "2": {
              "fullName": "Jaime Vera",
              "identificationDocumentType": "cedula",
              "identificationNumber": 292493049
            }
          },
          "fields": {
            "fullName": {
              "dbName": "text_fullName",
              "description": "It is the first name of the candidate",
              "label": "Full Name",
              "required": true,
              "type": "text"
            },
            "identificationDocumentType": {
              "dataType": "text",
              "dbName": "text_identificationDocumentType",
              "label": "Document Type",
              "options": {
                "driversLicense": "Driver's License",
                "other": "Other",
                "passport": "Passport"
              },
              "required": false,
              "type": "select"
            },
            "identificationNumber": {
              "dbName": "text_identificationNumber",
              "label": "Document Number",
              "required": true,
              "type": "text"
            }
          },
          "form": {
            "rows": [
              {
                "_title": "Personal Information"
              },
              [
                "text_fullName"
              ]
            ]
          },
          "initialStage": "new",
          "itemName": "Recruiter",
          "key": "Recruiters",
          "name": "Recruiter",
          "permissions": {
            "interviewer": {
              "create": false,
              "delete": {
                "own": true
              },
              "edit": {
                "own": [
                  "text_identificationDocumentType",
                  "text_fullName"
                ]
              },
              "view": {
                "own": [
                  "*",
                  "!text_identificationDocumentType"
                ]
              }
            },
            "recruiter": {
              "create": true,
              "delete": {
                "any": false,
                "own": true
              },
              "edit": [
                "*",
                "!text_identificationDocumentType"
              ],
              "view": true
            }
          },
          "stages": {
            "approved": {
              "description": "Candidate has been approved",
              "done": true,
              "name": "Approved",
              "successful": true
            },
            "inProcess": {
              "description": "It has entered the process, but no outcome yet defined",
              "name": "In Process"
            },
            "longTermPool": {
              "description": "Candidate is not a fit now, and doesn't seem to be a fit in the near future",
              "name": "Long Term Pool",
              "parked": true
            },
            "new": {
              "description": "It is a new candidate, hasn't gone through any tests",
              "name": "New"
            },
            "rejected": {
              "description": "Candidate has been rejected definitively",
              "done": true,
              "name": "Rejected",
              "successful": false
            },
            "shortTermPool": {
              "description": "Candidate is not a fit now, but probably in the near future",
              "name": "Short Term Pool",
              "parked": true
            }
          },
          "summary": {
            "subtitle": "${Recruiter}",
            "title": "${id} - ${Recruiter} ${lastName}"
          },
          "testData": {
            "1": {
              "fullName": "Maria Martina Merida Mejias",
              "identificationDocumentType": "cedula",
              "identificationNumber": 302493049
            },
            "2": {
              "fullName": "Jaime Vera",
              "identificationDocumentType": "cedula",
              "identificationNumber": 292493049
            }
          },
          "type": "table"
        }
      ],
      "templates": [
        {
          "appPath": "/Users/milebetrf/smartmate/sm2-workspace-tools/test/workspace-valid/recruitment",
          "key": "templates/documento.docx",
          "path": "/Users/milebetrf/smartmate/sm2-workspace-tools/test/workspace-valid/recruitment/templates/documento.docx",
          "type": "template"
        },
        {
          "appPath": "/Users/milebetrf/smartmate/sm2-workspace-tools/test/workspace-valid/recruitment",
          "key": "templates/informe.docx",
          "path": "/Users/milebetrf/smartmate/sm2-workspace-tools/test/workspace-valid/recruitment/templates/informe.docx",
          "type": "template"
        }
      ],
      "type": "app"
    }
  ]
}
