# id: It represents the id of the process
# string, required
# allows letters, numbers and underscores only (should start with a letter)
key: processExample2

# type: Should be "process" for processes
# required, string
type: process

# name: Describes the name of the process
# string, required
name: Start Recruitment

# icon: font-awesome icon
# string, optional
icon: person

# mainTable: Describes the table that will affect this process
# string, required
mainTable: Recruiters

summary:
  title: Process for {{fullName}}

# permissions: Defines the permissions for this process. Probably it should be moved to its own schema.
# object, optional
permissions:

  # each permission name must correspond to a valid role
  # it might reference to a role in the same app (e.g. "recruitment"), or a role in another app
  # (e.g. "anotherApp.anotherRole") or a role defined in the commons folder (e.g. "commons.employee")

  # valid values are:
  # - a boolean
  # - an object with the following optional properties:
  #   - start. It is a boolean indicating if the user can start a case of this process.
  #   - pause. Indicates if the user can pause cases. It can be:
  #     - a boolean
  #     - an object with the following optional properties
  #       - own
  #       - assigned
  #       - any
  #   - archive. Indicates if the user can archive cases. Structure is similar to pause option.

  recruiter: false # recruiter can do everything

  interviewer:
    start: false # can start a process
    pause:
      own: true # can pause only own cases
    archive: true # cannot archive any case

# Defines the forms used by this process
# object, optional
forms:

  # The form has an id, which should follow the identification pattern
  fillOutInvitationInformation:

    # name: Determines the name of the form, string, optional. It should follow the guidelines of a name.
    # string, required
    name: Start application

    # rows: Determines the rows to be displayed in the form
    # each element can be an string, an array or an object (use the form schema to validate)
    rows:
      - fullName
      - identificationNumber
      - salary
      - [education, identificationNumber]

  fillOutScores:
    name: Fill out scores

    # title: Determines the title to show to the user when looking at the task
    # It's different to the name that it accepts variables
    title: Fill out scores for {{identificationDocumentType}} {{identificationNumber}} - {{salary}}

    rows:
      # or a _title
      - _title: Scores
      # or a _statement
      - _statement: Please enter the candidate scores
      # or the fields
      - education
      - identificationDocumentType
      - fullName

  manualApproval1:
    name: Manual Approval 1
    rows:
      - salary

    # a form can have outcomes. This is optional
    # object, optional
    outcomes:
      # an action has a key (that should follow the identifier pattern)
      # it can be a string (that should follow the name pattern)
      approve: Approve

      # or it can be an object, with the following attributes:
      reject:
        # title: It should be a name, required
        title: Reject

        # form: It determines the form to show when they choose this option.
        # object, optional
        # it should validate against the form schema.
        form:
          rows:
            - identificationNumber
