openapi: 3.1.0
info:
  title: AbaNinja Time Tracking API - Corrections
  version: 3.0.0
  x-domain-id: time-tracking
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: time-tracking-corrections
    description: Manage time tracking corrections
    x-displayName: Corrections
security:
  - ApiToken: []
paths:
  /accounts/{accountUuid}/time/v2/employees/{employeeUuid}/time-corrections:
    get:
      tags:
        - time-tracking-corrections
      summary: Get corrections
      description: Get all corrections of an employee
      operationId: time_list_time_corrections
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      title: Correction Resource
                      properties:
                        uuid:
                          type: string
                          format: uuid
                        accountUuid:
                          type: string
                          format: uuid
                        employeeUuid:
                          type: string
                          format: uuid
                        type:
                          description: 1 = Timecorrection, 2 = Holidaycorrection
                          type: integer
                          enum:
                            - 1
                            - 2
                        isClosed:
                          type: boolean
                        bookingDate:
                          type: string
                          format: date
                        bookingQty:
                          type: number
                        bookingUnit:
                          type: string
                          enum:
                            - hrs
                            - day
                        bookingText:
                          type:
                            - string
                            - 'null'
                      type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: b4db589782d4c5689ed2e1082bddc125
      x-required-scopes:
        - time-tracking
    post:
      tags:
        - time-tracking-corrections
      summary: Add correction
      description: Add a correction for an employee
      operationId: time_create_time_corrections
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Add correction
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/time-employee-correction.schema.json
              description: A Schema for creating/updating timetracking employee correction in AbaNinja over API
              type: object
              properties:
                type:
                  type: integer
                  enum:
                    - 1
                    - 2
                  description: 1 = Timecorrection, 2 = Holidaycorrection
                bookingDate:
                  type: string
                  format: date
                bookingQty:
                  type: number
                bookingUnit:
                  type: string
                  enum:
                    - hrs
                    - day
                bookingText:
                  type:
                    - string
                    - 'null'
              required:
                - type
                - bookingDate
                - bookingQty
                - bookingUnit
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Correction Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      accountUuid:
                        type: string
                        format: uuid
                      employeeUuid:
                        type: string
                        format: uuid
                      type:
                        description: 1 = Timecorrection, 2 = Holidaycorrection
                        type: integer
                        enum:
                          - 1
                          - 2
                      isClosed:
                        type: boolean
                      bookingDate:
                        type: string
                        format: date
                      bookingQty:
                        type: number
                      bookingUnit:
                        type: string
                        enum:
                          - hrs
                          - day
                      bookingText:
                        type:
                          - string
                          - 'null'
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 201
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 2564739c9a52416ca615b5a9e97900be
      x-required-scopes:
        - time-tracking
  /accounts/{accountUuid}/time/v2/employees/{employeeUuid}/time-corrections/{correctionUuid}:
    get:
      tags:
        - time-tracking-corrections
      summary: Get correction
      description: Get the correction of an employee
      operationId: time_get_time_corrections
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: correctionUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Correction Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      accountUuid:
                        type: string
                        format: uuid
                      employeeUuid:
                        type: string
                        format: uuid
                      type:
                        description: 1 = Timecorrection, 2 = Holidaycorrection
                        type: integer
                        enum:
                          - 1
                          - 2
                      isClosed:
                        type: boolean
                      bookingDate:
                        type: string
                        format: date
                      bookingQty:
                        type: number
                      bookingUnit:
                        type: string
                        enum:
                          - hrs
                          - day
                      bookingText:
                        type:
                          - string
                          - 'null'
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 799d41d06832f9114f74c907f42a3a79
      x-required-scopes:
        - time-tracking
    patch:
      tags:
        - time-tracking-corrections
      summary: Update correction
      description: Update a correction for an employee
      operationId: time_update_time_corrections
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: correctionUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Update correction
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/time-employee-correction.schema.json
              description: A Schema for creating/updating timetracking employee correction in AbaNinja over API
              type: object
              properties:
                type:
                  type: integer
                  enum:
                    - 1
                    - 2
                  description: 1 = Timecorrection, 2 = Holidaycorrection
                bookingDate:
                  type: string
                  format: date
                bookingQty:
                  type: number
                bookingUnit:
                  type: string
                  enum:
                    - hrs
                    - day
                bookingText:
                  type:
                    - string
                    - 'null'
              required:
                - type
                - bookingDate
                - bookingQty
                - bookingUnit
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Correction Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      accountUuid:
                        type: string
                        format: uuid
                      employeeUuid:
                        type: string
                        format: uuid
                      type:
                        description: 1 = Timecorrection, 2 = Holidaycorrection
                        type: integer
                        enum:
                          - 1
                          - 2
                      isClosed:
                        type: boolean
                      bookingDate:
                        type: string
                        format: date
                      bookingQty:
                        type: number
                      bookingUnit:
                        type: string
                        enum:
                          - hrs
                          - day
                      bookingText:
                        type:
                          - string
                          - 'null'
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: f02c3457e41754a17c098bdee3bb024f
      x-required-scopes:
        - time-tracking
    delete:
      tags:
        - time-tracking-corrections
      summary: Delete correction
      description: Delete a correction for an employee
      operationId: time_delete_time_corrections
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: correctionUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: Successful response
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 236c4ab59a5ca1b2166d6d2febffba0e
      x-required-scopes:
        - time-tracking
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
