openapi: 3.1.0
info:
  title: api-checklist
  contact: {}
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "1.3"
servers:
- url: http://localhost:60422
  description: Generated server url
tags:
- name: Phase resources
  description: Resources for managing the phases that will be used by all checklists
- name: Checklist resources
  description: Resources for managing checklists
- name: Porting resources
  description: Resources for managing import and export of checklists
- name: Communication resources
  description: Resources for managing communication
- name: Task resources
  description: Resources for managing tasks in a phase
- name: Organization resources
  description: Resources for managing organizational units
- name: Custom sort order resources
  description: Resources for managing custom sort order of checklist phases and tasks
- name: Delegation resources
  description: Resources for managing delegations of employee checklists
- name: Employee checklist resources
  description: Resources for managing employee checklists
paths:
  /{municipalityId}/sortorder/{organizationNumber}:
    put:
      tags:
      - Custom sort order resources
      summary: Creates or replaces a custom sort order of checklist components for
        the provided organisation number
      operationId: saveSortorder
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: organizationNumber
        in: path
        description: Organization number to the organization owning the sort order
        required: true
        schema:
          type: integer
          format: int32
        example: 587
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SortorderRequest"
        required: true
      responses:
        "202":
          description: Successful Operation
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/mentor:
    put:
      tags:
      - Employee checklist resources
      summary: Set the mentor
      description: Set the mentor on a specific employee checklist
      operationId: setMentor
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Mentor"
        required: true
      responses:
        "202":
          description: Successful Operation
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Employee checklist resources
      summary: Delete the mentor
      description: Delete the mentor on a specific employee checklist
      operationId: deleteMentor
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/phases:
    get:
      tags:
      - Phase resources
      summary: Fetch all phases
      operationId: fetchChecklistPhases
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Phase"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Phase resources
      summary: Create a new phase
      operationId: createChecklistPhase
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PhaseCreateRequest"
        required: true
      responses:
        "201":
          description: Successful Operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/organizations:
    get:
      tags:
      - Organization resources
      summary: "Fetch all organizations, optionally filtered by organization number(s)"
      description: Fetch all organizations
      operationId: fetchOrganizations
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: organizationFilter
        in: query
        description: Filter response to only include organizations matching provided
          organization numbers
        required: false
        schema:
          type: array
          items:
            type: integer
            format: int32
      - name: applySortFor
        in: query
        description: Optional parameter for using custom sort based on provided organization
          number for response
        required: false
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Organization"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Organization resources
      summary: Create an organization
      description: Create a new organizational unit
      operationId: createOrganization
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationCreateRequest"
        required: true
      responses:
        "201":
          description: Successful Operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "409":
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/import/replace/{organizationNumber}/{organizationName}:
    post:
      tags:
      - Porting resources
      summary: "Import checklist structure for a organization, replacing currently\
        \ CREATED or ACTIVE version"
      description: |
        <h3>Only use this resource if you are aware of the impact the result of the operation has on active and completed employee checklists</h3>
        <i>This method is <b>not safe to use</b> in regard to that existing checklists with lifecycle status <b>ACTIVE</b> or <b>CREATED</b> will be replaced. I.e. employee checklists (ongoing and completed) and checklist drafts <u>will be affected</u>.</i>
        The following rules are applied:
        - If no checklist exists for the organizational unit, a new version based on provided structure will be created with lifecycle status <b>CREATED</b> (to activate, use intended endpoint).
        - If an existing version with lifecycle status <b>CREATED</b> is present, it will be replaced with the provided structure (to activate, use intended endpoint). If a version with lifecycle status <b>ACTIVE</b> exists, it will remain intact and no ongoing employee checklists will be affected. Only the currently created version draft will be replaced.
        - If an existing version with lifecycle status <b>ACTIVE</b> is present and no version with status <b>CREATED</b> is present, the active version will be replaced with the provided structure. <b>Observe that all employee checklists (ongoing and completed) using the currently active version will be affected (resetted). Use with uttermost care!</b>.
      operationId: importAndOverwriteExistingChecklist
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: organizationNumber
        in: path
        description: Organization number
        required: true
        schema:
          type: integer
          format: int32
        example: 53
      - name: organizationName
        in: path
        description: Organization name
        required: true
        schema:
          type: string
        example: Organization ABC
      requestBody:
        content:
          application/json:
            schema:
              type: string
              description: Json checklist structure to import
        required: true
      responses:
        "201":
          description: Successful Operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/import/add/{organizationNumber}/{organizationName}:
    post:
      tags:
      - Porting resources
      summary: Import checklist structure for a organization as a new version with
        lifecycle status CREATED
      description: |
        <i>This method is safe to use in regard to that no existing checklist(s) with lifecycle status <b>ACTIVE</b> or <b>CREATED</b> will be modified. I.e. employees with active or completed checklists will not be affected.</i>
        <br><br>
        The following rules are applied:
        - If no checklist exists for the organizational unit, a new version based on provided structure will be created with lifecycle status <b>CREATED</b> (to activate, use intended endpoint).
        - If an existing version with lifecycle status <b>CREATED</b> is present, an exception will be thrown as there can only be one checklist with created lifecycle status. Remove current version with created status or use the replace endpoint instead.
        - If an existing version with lifecycle status <b>ACTIVE</b> is present, a new version based on provided structure will be created with lifecycle status <b>CREATED</b> (to activate, use intended endpoint). The currently active version will remain intact and employees with active or completed checklists will not be affected.
      operationId: importChecklistAsNewVersion
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: organizationNumber
        in: path
        description: Organization number
        required: true
        schema:
          type: integer
          format: int32
        example: 53
      - name: organizationName
        in: path
        description: Organization name
        required: true
        schema:
          type: string
        example: Organization ABC
      requestBody:
        content:
          application/json:
            schema:
              type: string
              description: Json checklist structure to import
        required: true
      responses:
        "201":
          description: Successful Operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/phases/{phaseId}/customtasks:
    post:
      tags:
      - Employee checklist resources
      summary: Create a custom task
      description: Create a custom task connected to a specific employee checklist
      operationId: createCustomTask
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomTaskCreateRequest"
        required: true
      responses:
        "201":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomTask"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/email:
    post:
      tags:
      - Communication resources
      summary: Send email notification
      description: Send an email notification to the manager for the employee checklist
        that matches provided id
      operationId: sendEmail
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "201":
          description: Successful Operation
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/delegate-to/{email}:
    post:
      tags:
      - Delegation resources
      summary: Delegate an employee checklist
      description: Delegate an employee checklist to a user by email and checklist
        id
      operationId: delegateEmployeeChecklist
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: email
        in: path
        description: Email for person to delegate to
        required: true
        schema:
          type: string
          format: email
        example: delegate.person@noreply.com
      responses:
        "201":
          description: Successful Operation
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "409":
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/update-manager:
    post:
      tags:
      - Employee checklist resources
      summary: Update manager information
      description: Triggers update of ongoing checklists with outdated manager information
      operationId: updateManagerInformation
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: username
        in: query
        description: "Optional username to update. If left out, all active checklists\
          \ will be updated"
        required: false
        schema:
          type: string
        example: usr123
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmployeeChecklistResponse"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/initialize:
    post:
      tags:
      - Employee checklist resources
      summary: Inititalize checklists for new employees
      description: Trigger creation of checklists for all known new employees
      operationId: initiateEmployeeChecklists
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmployeeChecklistResponse"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/initialize/{personId}:
    post:
      tags:
      - Employee checklist resources
      summary: Inititalize checklists for a specific employee
      description: Trigger creation of checklist for employee matching sent in person
        id
      operationId: initiateSpecificEmployeeChecklist
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: personId
        in: path
        description: Person id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmployeeChecklistResponse"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/checklists:
    get:
      tags:
      - Checklist resources
      summary: Get all checklists
      operationId: fetchAllChecklists
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Checklist"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Checklist resources
      summary: Create a new checklist
      operationId: createChecklist
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChecklistCreateRequest"
        required: true
      responses:
        "201":
          description: Successful Operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/checklists/{checklistId}/version:
    post:
      tags:
      - Checklist resources
      summary: Create new version of checklist
      operationId: createNewVersion
      parameters:
      - name: x-issuer
        in: header
        description: User id for the user creating the new version
        required: false
        schema:
          type: string
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "201":
          description: Successful Operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/checklists/{checklistId}/phases/{phaseId}/tasks:
    get:
      tags:
      - Task resources
      summary: Fetch all tasks in a checklist phase
      operationId: fetchChecklistPhaseTasks
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Task"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Task resources
      summary: Create task in checklist phase
      operationId: createChecklistPhaseTask
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaskCreateRequest"
        required: true
      responses:
        "201":
          description: Successful Operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/phases/{phaseId}:
    get:
      tags:
      - Phase resources
      summary: Fetch single phase
      operationId: fetchChecklistPhase
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Phase"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Phase resources
      summary: Delete an existing phase
      operationId: deleteChecklistPhase
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      responses:
        "204":
          description: Successful Operation
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Phase resources
      summary: Update an existing phase
      operationId: updateChecklistPhase
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PhaseUpdateRequest"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Phase"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/organizations/{organizationId}:
    get:
      tags:
      - Organization resources
      summary: Fetch organization by id
      description: Fetch organization that matches provided id
      operationId: fetchOrganizationById
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: organizationId
        in: path
        description: Organization id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: applySortFor
        in: query
        description: Optional parameter for using custom sort based on provided organization
          number for response
        required: false
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Organization"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Organization resources
      summary: Delete organization
      description: Delete an existing organizational unit
      operationId: deleteOrganization
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: organizationId
        in: path
        description: Organization id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "204":
          description: Successful Operation
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "409":
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Organization resources
      summary: Update an organization
      description: Update an existing organizational unit
      operationId: updateOrganization
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: organizationId
        in: path
        description: Organization id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationUpdateRequest"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Organization"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/tasks/{taskId}:
    patch:
      tags:
      - Employee checklist resources
      summary: Update fulfilment of a task
      operationId: updateTaskFulfilment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: taskId
        in: path
        description: Task id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmployeeChecklistTaskUpdateRequest"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmployeeChecklistTask"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/phases/{phaseId}:
    patch:
      tags:
      - Employee checklist resources
      summary: Update of all tasks in a phase
      description: Bulk update of sent in attributes for all tasks in phase
      operationId: updateAllTasksInPhase
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmployeeChecklistPhaseUpdateRequest"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmployeeChecklistPhase"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/customtasks/{taskId}:
    get:
      tags:
      - Employee checklist resources
      summary: Read a custom task
      description: Read a custom task connected to a specific employee checklist
      operationId: readCustomTask
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: taskId
        in: path
        description: Task id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomTask"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Employee checklist resources
      summary: Delete a custom task
      description: Delete a custom task from an employee checklist
      operationId: deleteCustomTask
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: taskId
        in: path
        description: Task id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      responses:
        "204":
          description: Successful Operation
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Employee checklist resources
      summary: Update a custom task
      description: Update a custom task connected to a specific employee checklist
      operationId: updateCustomTask
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: taskId
        in: path
        description: Task id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomTaskUpdateRequest"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomTask"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/checklists/{checklistId}:
    get:
      tags:
      - Checklist resources
      summary: Fetch checklist by id
      operationId: fetchChecklistById
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Checklist"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Checklist resources
      summary: Delete a checklist
      operationId: deleteChecklist
      parameters:
      - name: x-issuer
        in: header
        description: User id for the user responsible for the delete request
        required: false
        schema:
          type: string
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "204":
          description: No Content
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Checklist resources
      summary: Update a checklist
      operationId: updateChecklist
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChecklistUpdateRequest"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Checklist"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/checklists/{checklistId}/phases/{phaseId}/tasks/{taskId}:
    get:
      tags:
      - Task resources
      summary: Fetch task in a checklist phase
      operationId: fetchChecklistPhaseTask
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      - name: taskId
        in: path
        description: Task id
        required: true
        schema:
          type: string
        example: 55904052-0db0-4622-850c-3273ee60def4
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Task resources
      summary: Delete task in checklist phase
      operationId: deleteChecklistPhaseTask
      parameters:
      - name: x-issuer
        in: header
        description: User id for the user responsible for the delete request
        required: false
        schema:
          type: string
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      - name: taskId
        in: path
        description: Task id
        required: true
        schema:
          type: string
        example: 55904052-0db0-4622-850c-3273ee60def4
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Task resources
      summary: Update task in checklist phase
      operationId: updateChecklistPhaseTask
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: phaseId
        in: path
        description: Phase id
        required: true
        schema:
          type: string
        example: 9ee6a504-555f-4db7-bf21-2bb8a96f2b85
      - name: taskId
        in: path
        description: Task id
        required: true
        schema:
          type: string
        example: 55904052-0db0-4622-850c-3273ee60def4
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaskUpdateRequest"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/checklists/{checklistId}/activate:
    patch:
      tags:
      - Checklist resources
      summary: Activate checklist
      operationId: activateChecklist
      parameters:
      - name: x-issuer
        in: header
        description: User id for the user responsible for the activate request
        required: false
        schema:
          type: string
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Checklist"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/export/{organizationNumber}:
    get:
      tags:
      - Porting resources
      summary: Export checklist structure
      description: "Returns complete structure for the checklist matching provided\
        \ organizationNumber. If version if prodvided it will be matched, otherwise\
        \ the latest version will be returned"
      operationId: exportChecklist
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: organizationNumber
        in: path
        description: Organization number
        required: true
        schema:
          type: integer
          format: int32
        example: 53
      - name: version
        in: query
        description: Version
        required: false
        schema:
          type: integer
          format: int32
        example: 2
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: string
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/correspondence:
    get:
      tags:
      - Communication resources
      summary: Fetch correspondence
      description: Fetch the correspondence that has occured for an employee checklist
      operationId: fetchCorrespondence
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Correspondence"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/ongoing:
    get:
      tags:
      - Employee checklist resources
      summary: "Fetches a paginated response of ongoing employee checklists, this\
        \ only contains summarized information about each ongoing employee checklist"
      operationId: fetchAllOngoingEmployeeChecklists
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: pagingBase
        in: query
        description: Pagination model
        required: true
        schema:
          $ref: "#/components/schemas/OngoingEmployeeChecklistParameters"
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OngoingEmployeeChecklists"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/manager/{username}:
    get:
      tags:
      - Employee checklist resources
      summary: Fetch checklists where user acts as manager
      description: Fetch a users checklists where the user has the role of manager
      operationId: fetchChecklistsForManager
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: username
        in: path
        description: Username for user to fetch checklists for
        required: true
        schema:
          type: string
        example: usr123
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/EmployeeChecklist"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/initiationinfo:
    get:
      tags:
      - Employee checklist resources
      summary: Read execution information from last run to initialize checklists for
        new employees
      description: Trigger creation of checklists for all known new employees
      operationId: getInitiationInformation
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: onlyLatest
        in: query
        description: Signal if only last execution or full execution history should
          be returned
        required: false
        schema:
          type: boolean
          default: true
        example: true
      - name: onlyErrors
        in: query
        description: Signal if only posts with errors or both post with successful
          and errors should be returned
        required: false
        schema:
          type: boolean
          default: false
        example: false
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/InitiationInformation"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/employee/{username}:
    get:
      tags:
      - Employee checklist resources
      summary: Fetch checklist where user acts as employee
      description: Fetch a users checklist where the user has the role of employee
      operationId: fetchChecklistForEmployee
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: username
        in: path
        description: Username for user to fetch checklists for
        required: true
        schema:
          type: string
        example: usr123
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmployeeChecklist"
        "204":
          description: No employee checklist found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmployeeChecklist"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/delegated-to/{username}:
    get:
      tags:
      - Delegation resources
      summary: Fetch all employee checklists delegated to a user
      description: Fetch all delegated employee checklists for the user that matches
        sent in userid
      operationId: fetchDelegatedEmployeeChecklists
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: username
        in: path
        description: Username to fetch delegations for
        required: true
        schema:
          type: string
        example: usr123
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DelegatedEmployeeChecklistResponse"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/checklists/{checklistId}/events:
    get:
      tags:
      - Checklist resources
      summary: Get checklist events
      operationId: getChecklistEvents
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: checklistId
        in: path
        description: Checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: page
        in: query
        description: Zero-based page index (0..N)
        required: false
        schema:
          type: integer
          default: 0
          minimum: 0
      - name: size
        in: query
        description: The size of the page to be returned
        required: false
        schema:
          type: integer
          default: 20
          minimum: 1
      - name: sort
        in: query
        description: "Sorting criteria in the format: property,(asc|desc). Default\
          \ sort order is ascending. Multiple sort criteria are supported."
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Events"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "502":
          description: Bad Gateway
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /api-docs:
    get:
      tags:
      - API
      summary: OpenAPI
      operationId: getApiDocs
      responses:
        "200":
          description: OK
          content:
            application/yaml:
              schema:
                type: string
      x-auth-type: None
      x-throttling-tier: Unlimited
      x-wso2-mutual-ssl: Optional
  /{municipalityId}/employee-checklists/{employeeChecklistId}:
    delete:
      tags:
      - Employee checklist resources
      summary: Delete an employee checklist
      description: Delete an employee checklist completely
      operationId: deleteEmployeeChecklist
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      responses:
        "204":
          description: Successful Operation
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/employee-checklists/{employeeChecklistId}/delegated-to/{email}:
    delete:
      tags:
      - Delegation resources
      summary: Remove delegation of employee checklist
      description: Remove the delegation of an employee checklist matching sent in
        email and checklist id
      operationId: deleteEmployeeChecklistDelegation
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: employeeChecklistId
        in: path
        description: Employee checklist id
        required: true
        schema:
          type: string
        example: 85fbcecb-62d9-40c4-9b3d-839e9adcfd8c
      - name: email
        in: path
        description: Email for person to remove delegation from
        required: true
        schema:
          type: string
          format: email
        example: delegate.person@noreply.com
      responses:
        "204":
          description: Successful Operation
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
components:
  schemas:
    PhaseItem:
      type: object
      description: Model for a phase item in the sort order structure
      properties:
        id:
          type: string
          description: The id for the item
          examples:
          - 283cec0f-b6eb-473c-9dbb-d97a959a8144
          writeOnly: true
        position:
          type: integer
          format: int32
          description: The sort order position for the item
          examples:
          - 1
          writeOnly: true
        taskOrder:
          type: array
          description: List containing sort order for the task items connected to
            the phase
          items:
            $ref: "#/components/schemas/TaskItem"
          writeOnly: true
      required:
      - position
    SortorderRequest:
      type: object
      description: Model for custom sort order request
      properties:
        phaseOrder:
          type: array
          description: List containing sort order for phase items
          items:
            $ref: "#/components/schemas/PhaseItem"
          writeOnly: true
    TaskItem:
      type: object
      description: Model for a task item in the sort order structure
      properties:
        id:
          type: string
          description: The id for the item
          examples:
          - 283cec0f-b6eb-473c-9dbb-d97a959a8144
          writeOnly: true
        position:
          type: integer
          format: int32
          description: The sort order position for the item
          examples:
          - 1
          writeOnly: true
      required:
      - position
    Problem:
      type: object
      properties:
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        type:
          type: string
          format: uri
        status:
          type: integer
          format: int32
    ConstraintViolationProblem:
      type: object
      properties:
        type:
          type: string
          format: uri
        status:
          type: integer
          format: int32
        violations:
          type: array
          items:
            $ref: "#/components/schemas/Violation"
        title:
          type: string
        causeAsProblem:
          $ref: "#/components/schemas/ThrowableProblem"
        detail:
          type: string
        instance:
          type: string
          format: uri
    ThrowableProblem:
      type: object
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
          format: int32
        detail:
          type: string
        instance:
          type: string
          format: uri
        causeAsProblem: {}
    Violation:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
    Mentor:
      type: object
      description: Model for a mentor on an employee checklist
      properties:
        userId:
          type: string
          description: The user-id of the mentor
          minLength: 1
        name:
          type: string
          description: The name of the mentor
          minLength: 1
      required:
      - name
      - userId
    Permission:
      type: string
      enum:
      - SUPERADMIN
      - ADMIN
    PhaseCreateRequest:
      type: object
      description: Model for phase create request
      properties:
        name:
          type: string
          description: The name of the phase
          examples:
          - Första veckan
          minLength: 1
          writeOnly: true
        bodyText:
          type: string
          description: The body text of the phase
          examples:
          - Detta är en beskrivning av vad som ska göras under första veckan
          writeOnly: true
        timeToComplete:
          type: string
          description: The time to complete the phase
          examples:
          - P1M
          writeOnly: true
        permission:
          $ref: "#/components/schemas/Permission"
          description: The permission needed to administrate the phase
        sortOrder:
          type: integer
          format: int32
          description: The sort order of the phase
          examples:
          - 1
          writeOnly: true
        createdBy:
          type: string
          description: The id of the user creating the phase
          minLength: 1
      required:
      - createdBy
      - name
      - permission
      - sortOrder
    CommunicationChannel:
      type: string
      enum:
      - EMAIL
      - NO_COMMUNICATION
    OrganizationCreateRequest:
      type: object
      description: Model for organizational unit create request
      properties:
        organizationName:
          type: string
          description: The name of the unit
          examples:
          - Sundsvall Energi
          minLength: 1
          writeOnly: true
        organizationNumber:
          type: integer
          format: int32
          description: The organization number of the unit
          examples:
          - 5345
          writeOnly: true
        communicationChannels:
          type: array
          items:
            $ref: "#/components/schemas/CommunicationChannel"
            description: Valid channels to use when communicating with the organization
            writeOnly: true
          minContains: 1
          uniqueItems: true
      required:
      - organizationName
      - organizationNumber
    CustomTaskCreateRequest:
      type: object
      description: Model for custom task create request
      properties:
        heading:
          type: string
          description: The heading of the task
          examples:
          - Bjud på fika
          minLength: 1
          writeOnly: true
        headingReference:
          type: string
          description: Optional reference to use as value for the headings anchor
            element
          examples:
          - http://www.google.com
          writeOnly: true
        text:
          type: string
          description: The body text of the task
          examples:
          - Detta är en beskrivning av ett uppdrag
          writeOnly: true
        questionType:
          $ref: "#/components/schemas/QuestionType"
          description: The question type of the task
        roleType:
          $ref: "#/components/schemas/RoleType"
          description: The role that shall perform the task
          examples:
          - NEW_EMPLOYEE
        sortOrder:
          type: integer
          format: int32
          description: The sort order for the task
          writeOnly: true
        createdBy:
          type: string
          description: The id of the user creating the custom task
          examples:
          - joe01doe
          minLength: 1
          writeOnly: true
      required:
      - createdBy
      - heading
      - questionType
      - sortOrder
    QuestionType:
      type: string
      enum:
      - YES_OR_NO
      - YES_OR_NO_WITH_TEXT
      - COMPLETED_OR_NOT_RELEVANT
      - COMPLETED_OR_NOT_RELEVANT_WITH_TEXT
    RoleType:
      type: string
      enum:
      - NEW_EMPLOYEE
      - NEW_MANAGER
      - MANAGER_FOR_NEW_EMPLOYEE
      - MANAGER_FOR_NEW_MANAGER
    CustomTask:
      type: object
      description: Model for custom task
      properties:
        id:
          type: string
          description: The id of the task
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        heading:
          type: string
          description: The heading of the task
          examples:
          - Bjud på fika
          readOnly: true
        headingReference:
          type: string
          description: Reference to use as value for the headings anchor element (if
            present)
          examples:
          - http://www.google.com
          readOnly: true
        text:
          type: string
          description: The body text of the task
          examples:
          - Detta är en beskrivning av ett uppdrag
          readOnly: true
        sortOrder:
          type: integer
          format: int32
          description: The sort order for the task
          readOnly: true
        roleType:
          $ref: "#/components/schemas/RoleType"
          description: The role type of the task
        questionType:
          $ref: "#/components/schemas/QuestionType"
          description: The question type of the task
        created:
          type: string
          format: date-time
          description: The date and time the task was created
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The date and time the task was last updated
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        lastSavedBy:
          type: string
          description: The id of the user that last modified the custom task
          examples:
          - joe01doe
          readOnly: true
    DefaultHttpStatusCode:
      allOf:
      - $ref: "#/components/schemas/HttpStatusCode"
    Detail:
      type: object
      description: Model for employee checklist triggering detailed status
      properties:
        status:
          description: Status for action of creating the employee checklist
          oneOf:
          - $ref: "#/components/schemas/DefaultHttpStatusCode"
          - $ref: "#/components/schemas/HttpStatus"
          readOnly: true
        information:
          type: string
          description: Descriptive text for of the creation outcome
          examples:
          - Employee with loginname abc123 processed successfully.
          readOnly: true
    EmployeeChecklistResponse:
      type: object
      description: Model for employee checklist triggering response
      properties:
        summary:
          type: string
          description: Summary for execution
          examples:
          - Successful execution
          readOnly: true
        details:
          type: array
          description: Details for each user specific creation
          items:
            $ref: "#/components/schemas/Detail"
          readOnly: true
    HttpStatus:
      allOf:
      - $ref: "#/components/schemas/HttpStatusCode"
      enum:
      - 100 CONTINUE
      - 101 SWITCHING_PROTOCOLS
      - 102 PROCESSING
      - 103 EARLY_HINTS
      - 200 OK
      - 201 CREATED
      - 202 ACCEPTED
      - 203 NON_AUTHORITATIVE_INFORMATION
      - 204 NO_CONTENT
      - 205 RESET_CONTENT
      - 206 PARTIAL_CONTENT
      - 207 MULTI_STATUS
      - 208 ALREADY_REPORTED
      - 226 IM_USED
      - 300 MULTIPLE_CHOICES
      - 301 MOVED_PERMANENTLY
      - 302 FOUND
      - 303 SEE_OTHER
      - 304 NOT_MODIFIED
      - 307 TEMPORARY_REDIRECT
      - 308 PERMANENT_REDIRECT
      - 400 BAD_REQUEST
      - 401 UNAUTHORIZED
      - 402 PAYMENT_REQUIRED
      - 403 FORBIDDEN
      - 404 NOT_FOUND
      - 405 METHOD_NOT_ALLOWED
      - 406 NOT_ACCEPTABLE
      - 407 PROXY_AUTHENTICATION_REQUIRED
      - 408 REQUEST_TIMEOUT
      - 409 CONFLICT
      - 410 GONE
      - 411 LENGTH_REQUIRED
      - 412 PRECONDITION_FAILED
      - 413 CONTENT_TOO_LARGE
      - 413 PAYLOAD_TOO_LARGE
      - 414 URI_TOO_LONG
      - 415 UNSUPPORTED_MEDIA_TYPE
      - 416 REQUESTED_RANGE_NOT_SATISFIABLE
      - 417 EXPECTATION_FAILED
      - 418 I_AM_A_TEAPOT
      - 421 MISDIRECTED_REQUEST
      - 422 UNPROCESSABLE_CONTENT
      - 422 UNPROCESSABLE_ENTITY
      - 423 LOCKED
      - 424 FAILED_DEPENDENCY
      - 425 TOO_EARLY
      - 426 UPGRADE_REQUIRED
      - 428 PRECONDITION_REQUIRED
      - 429 TOO_MANY_REQUESTS
      - 431 REQUEST_HEADER_FIELDS_TOO_LARGE
      - 451 UNAVAILABLE_FOR_LEGAL_REASONS
      - 500 INTERNAL_SERVER_ERROR
      - 501 NOT_IMPLEMENTED
      - 502 BAD_GATEWAY
      - 503 SERVICE_UNAVAILABLE
      - 504 GATEWAY_TIMEOUT
      - 505 HTTP_VERSION_NOT_SUPPORTED
      - 506 VARIANT_ALSO_NEGOTIATES
      - 507 INSUFFICIENT_STORAGE
      - 508 LOOP_DETECTED
      - 509 BANDWIDTH_LIMIT_EXCEEDED
      - 510 NOT_EXTENDED
      - 511 NETWORK_AUTHENTICATION_REQUIRED
    HttpStatusCode:
      type: object
      properties:
        is4xxClientError:
          type: boolean
        is5xxServerError:
          type: boolean
        is1xxInformational:
          type: boolean
        is2xxSuccessful:
          type: boolean
        is3xxRedirection:
          type: boolean
        error:
          type: boolean
    ChecklistCreateRequest:
      type: object
      description: Model for checklist create request
      properties:
        name:
          type: string
          description: The name of the checklist
          examples:
          - Checklist_A
          minLength: 1
        displayName:
          type: string
          description: The display name of the checklist
          examples:
          - Display name
          minLength: 1
        organizationNumber:
          type: integer
          format: int32
          description: The organization that the checklist is created for
          examples:
          - 11
        createdBy:
          type: string
          description: The id of the user creating the checklist
          minLength: 1
      required:
      - createdBy
      - displayName
      - name
      - organizationNumber
    TaskCreateRequest:
      type: object
      description: Model for task create request
      properties:
        heading:
          type: string
          description: The name of the task
          examples:
          - Name of the task
          minLength: 1
          writeOnly: true
        headingReference:
          type: string
          description: Optional reference to use as value for the headings anchor
            element
          examples:
          - http://www.google.com
          writeOnly: true
        text:
          type: string
          description: The body text of the task
          examples:
          - Body text of the task
          writeOnly: true
        sortOrder:
          type: integer
          format: int32
          description: The sort order of the task
          examples:
          - 1
          writeOnly: true
        roleType:
          $ref: "#/components/schemas/RoleType"
          description: The role type of the task
          examples:
          - NEW_EMPLOYEE
        permission:
          $ref: "#/components/schemas/Permission"
          description: The permission needed to administrate the task
        questionType:
          $ref: "#/components/schemas/QuestionType"
          description: The question type of the task
          examples:
          - YES_OR_NO
        createdBy:
          type: string
          description: The id of the user creating the task
          examples:
          - joe01doe
          minLength: 1
          writeOnly: true
        optional:
          type: boolean
          default: false
          description: Indicates if the task is optional or not
          examples:
          - "true"
      required:
      - createdBy
      - heading
      - permission
      - questionType
      - roleType
      - sortOrder
    PhaseUpdateRequest:
      type: object
      description: Model for phase update request
      properties:
        name:
          type: string
          description: The name of the phase
          examples:
          - Första veckan
          writeOnly: true
        bodyText:
          type: string
          description: The body text of the phase
          examples:
          - Detta är en beskrivning av vad som ska göras under första veckan
          writeOnly: true
        timeToComplete:
          type: string
          description: The time to complete the phase
          examples:
          - P1M
          writeOnly: true
        permission:
          $ref: "#/components/schemas/Permission"
          description: The permission needed to administrate the phase
        sortOrder:
          type: integer
          format: int32
          description: The sort order of the phase
          examples:
          - 1
          writeOnly: true
        updatedBy:
          type: string
          description: The id of the user updating the phase
          minLength: 1
      required:
      - updatedBy
    Phase:
      type: object
      description: Model for a phase
      properties:
        id:
          type: string
          description: The id of the phase
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        name:
          type: string
          description: The name of the phase
          examples:
          - Första veckan
          readOnly: true
        bodyText:
          type: string
          description: The body text of the phase
          examples:
          - Detta är en beskrivning av vad som ska göras under första veckan
          readOnly: true
        timeToComplete:
          type: string
          description: The time to complete the phase
          examples:
          - P1M
          readOnly: true
        permission:
          $ref: "#/components/schemas/Permission"
          description: The permission needed to administrate the phase
        sortOrder:
          type: integer
          format: int32
          description: The sort order of the phase
          examples:
          - 1
          readOnly: true
        tasks:
          type: array
          description: Tasks in the phase
          items:
            $ref: "#/components/schemas/Task"
          readOnly: true
        created:
          type: string
          format: date-time
          description: The created date and time of the phase
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The last update date and time of the phase
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        lastSavedBy:
          type: string
          description: The id of the user that last modified the phase
    Task:
      type: object
      description: Task model
      properties:
        id:
          type: string
          description: The id of the task
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        heading:
          type: string
          description: The heading of the task
          examples:
          - Bjud på fika
          readOnly: true
        headingReference:
          type: string
          description: Reference to use as value for the headings anchor element (if
            present)
          examples:
          - http://www.google.com
          readOnly: true
        text:
          type: string
          description: The body text of the task
          examples:
          - Detta är en beskrivning av ett uppdrag
          readOnly: true
        sortOrder:
          type: integer
          format: int32
          description: The sort order of the task
          examples:
          - 1
          readOnly: true
        roleType:
          $ref: "#/components/schemas/RoleType"
          description: The role type eligible for the task
        questionType:
          $ref: "#/components/schemas/QuestionType"
          description: The question type of the task
        permission:
          $ref: "#/components/schemas/Permission"
          description: The permission needed to administrate the task
        created:
          type: string
          format: date-time
          description: The date and time the task was created
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The date and time the task was last updated
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        lastSavedBy:
          type: string
          description: The id of the user that last modified the task
          examples:
          - joe01doe
          readOnly: true
        optional:
          type: boolean
          description: Indicates if the task is optional or not
          examples:
          - "true"
          readOnly: true
    OrganizationUpdateRequest:
      type: object
      description: Model for organizational unit update request
      properties:
        organizationName:
          type:
          - string
          - "null"
          description: The name of the unit
          examples:
          - Sundsvall Energi
          writeOnly: true
        communicationChannels:
          type: array
          items:
            $ref: "#/components/schemas/CommunicationChannel"
            description: Valid channels to use when communicating with the organization
            writeOnly: true
          uniqueItems: true
    Checklist:
      type: object
      description: Model for checklist
      properties:
        id:
          type: string
          description: The id of the checklist
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        name:
          type: string
          description: The name of the checklist
          examples:
          - Checklist_A
          readOnly: true
        displayName:
          type: string
          description: The display name of the checklist
          examples:
          - Display name
          readOnly: true
        version:
          type: integer
          format: int32
          description: The version of the checklist
          examples:
          - 1
          readOnly: true
        lifeCycle:
          $ref: "#/components/schemas/LifeCycle"
          description: The lifecycle of the checklist
          readOnly: true
        created:
          type: string
          format: date-time
          description: The created date and time of the checklist
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The last update date and time of the checklist
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        lastSavedBy:
          type: string
          description: The id of the user that last modified the checklist
        phases:
          type: array
          description: Phases in the checklist
          items:
            $ref: "#/components/schemas/Phase"
          readOnly: true
    LifeCycle:
      type: string
      enum:
      - CREATED
      - ACTIVE
      - DEPRECATED
      - RETIRED
    Organization:
      type: object
      description: Model for an organizational unit
      properties:
        id:
          type: string
          description: The id of the unit
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        organizationName:
          type: string
          description: The name of the unit
          examples:
          - Sundsvall Energi
          readOnly: true
        organizationNumber:
          type: integer
          format: int32
          description: The organization number of the unit
          examples:
          - 5345
          readOnly: true
        checklists:
          type: array
          items:
            $ref: "#/components/schemas/Checklist"
            description: All checklists connected to the organization
            readOnly: true
        communicationChannels:
          type: array
          items:
            $ref: "#/components/schemas/CommunicationChannel"
            description: Valid channels to use when communicating with the organization
            readOnly: true
          uniqueItems: true
        created:
          type: string
          format: date-time
          description: The date and time the unit was created
          examples:
          - 2023-11-22T15:30:00+02:00
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The date and time the unit was updated
          examples:
          - 2023-11-22T15:30:00+02:00
          readOnly: true
    EmployeeChecklistTaskUpdateRequest:
      type: object
      description: Model for update request of fulfilment for a task
      properties:
        fulfilmentStatus:
          type: "null"
          $ref: "#/components/schemas/FulfilmentStatus"
          description: The status of the task fulfilment
          writeOnly: true
        responseText:
          type:
          - string
          - "null"
          description: The response text for the task fulfilment
          examples:
          - Har bjudit på fika
          writeOnly: true
        updatedBy:
          type: string
          description: Identifier for the person that is performing the update
          examples:
          - joe01doe
          minLength: 1
          writeOnly: true
      required:
      - updatedBy
    FulfilmentStatus:
      type: string
      enum:
      - EMPTY
      - "TRUE"
      - "FALSE"
      - NOT_RELEVANT
    EmployeeChecklistTask:
      type: object
      description: Model for a employee checklist task
      properties:
        id:
          type: string
          description: The id of the task
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        heading:
          type: string
          description: The heading of the task
          examples:
          - Bjud på fika
          readOnly: true
        headingReference:
          type: string
          description: Reference to use as value for the headings anchor element (if
            present)
          examples:
          - http://www.google.com
          readOnly: true
        text:
          type: string
          description: The body text of the task
          examples:
          - Detta är en beskrivning av ett uppdrag
          readOnly: true
        sortOrder:
          type: integer
          format: int32
          description: The sort order for the task
          readOnly: true
        roleType:
          $ref: "#/components/schemas/RoleType"
          description: The role type of the task
        questionType:
          $ref: "#/components/schemas/QuestionType"
          description: The question type of the task
        customTask:
          type: boolean
          description: Tells if the task is only applies to the current checklist
            or not
          readOnly: true
        optional:
          type: boolean
          description: Indicates if the task is optional or not
          examples:
          - "true"
          readOnly: true
        responseText:
          type: string
          description: The task response text
          examples:
          - Jag har bjudit på fika
          readOnly: true
        fulfilmentStatus:
          $ref: "#/components/schemas/FulfilmentStatus"
          description: The status of the task fulfilment
          examples:
          - "TRUE"
        updated:
          type: string
          format: date-time
          description: The date and time the task was last updated
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        updatedBy:
          type: string
          description: Identifier for the person that last updated the task
          examples:
          - joe01doe
          readOnly: true
    EmployeeChecklistPhaseUpdateRequest:
      type: object
      description: Model for update request on an employee checklist phase
      properties:
        tasksFulfilmentStatus:
          type: "null"
          $ref: "#/components/schemas/FulfilmentStatus"
          description: The value to be set on all tasks in the phase
          writeOnly: true
        updatedBy:
          type: string
          description: Identifier for the person that is performing the update
          examples:
          - joe01doe
          minLength: 1
          writeOnly: true
      required:
      - updatedBy
    EmployeeChecklistPhase:
      type: object
      description: Model for a employee checklist phase
      properties:
        id:
          type: string
          description: The id of the phase
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        name:
          type: string
          description: The name of the phase
          examples:
          - Första veckan
          readOnly: true
        bodyText:
          type: string
          description: The body text of the phase
          examples:
          - Detta är en beskrivning av vad som ska göras under första veckan
          readOnly: true
        timeToComplete:
          type: string
          description: The time to complete the phase
          examples:
          - P1M
          readOnly: true
        sortOrder:
          type: integer
          format: int32
          description: The sort order for the phase
          examples:
          - 1
          readOnly: true
        tasks:
          type: array
          description: Tasks in the phase
          items:
            $ref: "#/components/schemas/EmployeeChecklistTask"
          readOnly: true
    CustomTaskUpdateRequest:
      type: object
      description: Model for custom task update request
      properties:
        heading:
          type: string
          description: The heading of the task
          examples:
          - Bjud på fika
          writeOnly: true
        headingReference:
          type: string
          description: Optional reference to use as value for the headings anchor
            element
          examples:
          - http://www.google.com
          writeOnly: true
        text:
          type: string
          description: The body text of the task
          examples:
          - Detta är en beskrivning av ett uppdrag
          writeOnly: true
        questionType:
          $ref: "#/components/schemas/QuestionType"
          description: The question type of the task
        roleType:
          $ref: "#/components/schemas/RoleType"
          description: The role that shall perform the task
          examples:
          - NEW_EMPLOYEE
        sortOrder:
          type: integer
          format: int32
          description: The sort order for the task
          writeOnly: true
        updatedBy:
          type: string
          description: The id of the user updating the custom task
          examples:
          - joe01doe
          minLength: 1
          writeOnly: true
      required:
      - updatedBy
    ChecklistUpdateRequest:
      type: object
      description: Model for checklist update request
      properties:
        displayName:
          type: string
          description: The name of the checklist
          examples:
          - New display name
        updatedBy:
          type: string
          description: The id of the user updating the checklist
          minLength: 1
      required:
      - updatedBy
    TaskUpdateRequest:
      type: object
      description: Model for task update request
      properties:
        heading:
          type: string
          description: The name of the task
          writeOnly: true
        headingReference:
          type: string
          description: Optional reference to use as value for the headings anchor
            element
          examples:
          - http://www.google.com
          writeOnly: true
        text:
          type: string
          description: The body text of the task
          writeOnly: true
        sortOrder:
          type: integer
          format: int32
          description: The sort order of the task
          examples:
          - 1
          writeOnly: true
        roleType:
          $ref: "#/components/schemas/RoleType"
          description: The role type of the task
        permission:
          $ref: "#/components/schemas/Permission"
          description: The permission needed to administrate the task
        questionType:
          $ref: "#/components/schemas/QuestionType"
          description: The question type of the task
        updatedBy:
          type: string
          description: The id of the user updating the task
          examples:
          - joe01doe
          minLength: 1
          writeOnly: true
        optional:
          type: boolean
          description: Indicates if the task is optional or not
          examples:
          - "true"
      required:
      - updatedBy
    Correspondence:
      type: object
      description: Model for correspondence
      properties:
        messageId:
          type: string
          description: Id for message
          examples:
          - 3fa85f64-5717-4562-b3fc-2c963f66afa6
          readOnly: true
        recipient:
          type: string
          description: Message recipient
          examples:
          - email.address@noreply.com
          readOnly: true
        attempts:
          type: integer
          format: int32
          description: Attempt count
          examples:
          - 1
          readOnly: true
        correspondenceStatus:
          $ref: "#/components/schemas/CorrespondenceStatus"
          description: Status for correspondence
          readOnly: true
        communicationChannel:
          $ref: "#/components/schemas/CommunicationChannel"
          description: Communicationschannel used for message
          readOnly: true
        sent:
          type: string
          format: date-time
          description: Timestamp when message was sent
          examples:
          - 2023-11-22T15:30:00+02:00
          readOnly: true
    CorrespondenceStatus:
      type: string
      enum:
      - SENT
      - NOT_SENT
      - ERROR
      - WILL_NOT_SEND
    OngoingEmployeeChecklist:
      type: object
      description: Model for summarized information for an ongoing employee checklist
      properties:
        employeeName:
          type: string
          description: The employee first name and last name concatenated
          examples:
          - John Doe
        employeeUsername:
          type: string
          description: The employee username
          examples:
          - johndoe
        managerName:
          type: string
          description: 'The employees managers first name and last name concatenated '
          examples:
          - John Doe
        departmentName:
          type: string
          description: The organization name
          examples:
          - Organization XYZ
        delegatedTo:
          type: array
          description: The names of the person(s) which have been delegated the checklist
          examples:
          - John Doe
          items:
            type: string
        employmentDate:
          type: string
          format: date
          description: The employment date of the employee
          examples:
          - 2021-01-01
        purgeDate:
          type: string
          format: date
          description: The purge date for the checklist
          examples:
          - 2029-01-01
      readOnly: true
    OngoingEmployeeChecklists:
      type: object
      description: Paged model with summarized information for all ongoing employee
        checklists
      properties:
        checklists:
          type: array
          items:
            $ref: "#/components/schemas/OngoingEmployeeChecklist"
            readOnly: true
        _meta:
          $ref: "#/components/schemas/PagingMetaData"
          readOnly: true
      readOnly: true
    PagingMetaData:
      type: object
      description: PagingMetaData model
      properties:
        page:
          type: integer
          format: int32
          description: Current page
          examples:
          - 5
          readOnly: true
        limit:
          type: integer
          format: int32
          description: Displayed objects per page
          examples:
          - 20
          readOnly: true
        count:
          type: integer
          format: int32
          description: Displayed objects on current page
          examples:
          - 13
          readOnly: true
        totalRecords:
          type: integer
          format: int64
          description: Total amount of hits based on provided search parameters
          examples:
          - 98
          readOnly: true
        totalPages:
          type: integer
          format: int32
          description: Total amount of pages based on provided search parameters
          examples:
          - 23
          readOnly: true
    Direction:
      type: string
      enum:
      - ASC
      - DESC
    OngoingEmployeeChecklistParameters:
      type: object
      properties:
        page:
          type: integer
          format: int32
          default: 1
          description: Page number
          examples:
          - 1
          minimum: 1
        limit:
          type: integer
          format: int32
          description: Result size per page. Maximum allowed value is dynamically
            configured
          examples:
          - 15
          minimum: 1
        sortBy:
          type: array
          items:
            type: string
            description: The properties to sort on
            examples:
            - propertyName
        sortDirection:
          $ref: "#/components/schemas/Direction"
          description: The sort order direction
          examples:
          - ASC
        employeeName:
          type: string
    EmployeeChecklist:
      type: object
      description: Model for a employee specific checklist
      properties:
        id:
          type: string
          description: The id of the employee checklist
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        employee:
          $ref: "#/components/schemas/Stakeholder"
          description: The employee connected to the checklist
          readOnly: true
        manager:
          $ref: "#/components/schemas/Stakeholder"
          description: The manager connected to the checklist
          readOnly: true
        completed:
          type: boolean
          description: Signal if all tasks in the checklist has been completed or
            not
          readOnly: true
        locked:
          type: boolean
          description: Signal if the checklist is locked or not
          readOnly: true
        mentor:
          $ref: "#/components/schemas/Mentor"
          description: The mentor on the checklist
          readOnly: true
        delegatedTo:
          type: array
          description: Contains the email to the delegate(s) if the checklist is delegated
          items:
            type: string
          readOnly: true
        phases:
          type: array
          description: Phases in the checklist
          items:
            $ref: "#/components/schemas/EmployeeChecklistPhase"
          readOnly: true
        created:
          type: string
          format: date-time
          description: The created date and time of the checklist
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The last update date and time of the checklist
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        startDate:
          type: string
          format: date
          description: The date when the fulfilment of the checklist was started
          examples:
          - 2023-11-22
          readOnly: true
        endDate:
          type: string
          format: date
          description: The date when the fulfilment of the checklist was finished
          examples:
          - 2023-11-22
          readOnly: true
        expirationDate:
          type: string
          format: date
          description: The expiration date of the checklist
          examples:
          - 2023-11-22
          readOnly: true
    Stakeholder:
      type: object
      description: Model for a stakeholder (employee or manager) to an employee checklist
      properties:
        id:
          type: string
          description: The person id for the stakeholder
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        firstName:
          type: string
          description: The first name for the stakeholder
          examples:
          - John
          readOnly: true
        lastName:
          type: string
          description: The last name for the stakeholder
          examples:
          - Doe
          readOnly: true
        email:
          type: string
          description: The email address for the stakeholder
          examples:
          - email.address@noreply.com
          readOnly: true
        username:
          type: string
          description: The username for the stakeholder
          examples:
          - abc12def
          readOnly: true
        title:
          type: string
          description: The job title for the stakeholder (if applicable)
          examples:
          - Skoladministratör (Sundsvalls kommun)
          readOnly: true
    InitiationInformation:
      type: object
      description: Model for information about the last execution to initiate employee
        checklists
      properties:
        logId:
          type: string
          description: The log id for the execution (used for investigation purpose
            when searching logs in ELK)
          examples:
          - 5a6c3e4e-c320-4006-b448-1fd4121df828
          readOnly: true
        summary:
          type: string
          description: A information summary for the execution
          examples:
          - 4 potential problems occurred when importing 6 employees
          readOnly: true
        executed:
          type: string
          format: date-time
          description: The execution date and time for the initiation
          examples:
          - 2023-11-22T15:30:00+03:00
          readOnly: true
        details:
          type: array
          description: A list with detailed information for each employee checklist
            initiation
          items:
            $ref: "#/components/schemas/Detail"
          readOnly: true
    DelegatedEmployeeChecklistResponse:
      type: object
      description: Model for delegated employee checklist response
      properties:
        employeeChecklists:
          type: array
          description: Delegated employee checklists
          items:
            $ref: "#/components/schemas/EmployeeChecklist"
          readOnly: true
    Event:
      type: object
      description: Model for an event
      properties:
        logKey:
          type: string
        eventType:
          type: string
        municipalityId:
          type: string
        message:
          type: string
        owner:
          type: string
        historyReference:
          type: string
        sourceType:
          type: string
        created:
          type: string
          format: date-time
        expires:
          type: string
          format: date-time
        metadata:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
    Events:
      type: object
      description: Model for a paginated list of events
      properties:
        page:
          type: integer
          format: int32
          description: Current page
          examples:
          - 5
          readOnly: true
        limit:
          type: integer
          format: int32
          description: Displayed objects per page
          examples:
          - 20
          readOnly: true
        count:
          type: integer
          format: int32
          description: Displayed objects on current page
          examples:
          - 13
          readOnly: true
        totalRecords:
          type: integer
          format: int64
          description: Total amount of hits based on provided search parameters
          examples:
          - 98
          readOnly: true
        totalPages:
          type: integer
          format: int32
          description: Total amount of pages based on provided search parameters
          examples:
          - 23
          readOnly: true
        eventList:
          type: array
          items:
            $ref: "#/components/schemas/Event"
    Metadata:
      type: object
      description: "Model for a meta data, key-value pair"
      properties:
        key:
          type: string
        value:
          type: string
  securitySchemes: {}
