# /api/v3/days/non_working/{date}
---
get:
  summary: View a non-working day
  operationId: view_non_working_day
  tags:
    - Work Schedule
  description: |-
    Returns the non-working day information for a given date.
  parameters:
    - name: date
      in: path
      required: true
      description: |-
        The date of the non-working day to view in ISO 8601 format.
      schema:
        type: string
        format: date
      example: '2022-05-06'
  responses:
    '200':
      description: |-
        OK
      content:
        application/hal+json:
          schema:
            $ref: '../components/schemas/non_working_day_model.yml'
    '400':
      $ref: "../components/responses/invalid_request_body.yml"
    '404':
      description: |-
        Returned if the given date is not a non-working day.
      content:
        application/hal+json:
          schema:
            $ref: '../components/schemas/error_response.yml'
          example:
            _type: Error
            errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
            message: The requested resource could not be found.

patch:
  summary: Update a non-working day attributes (NOT IMPLEMENTED)
  operationId: update_non_working_day
  tags:
    - Work Schedule
  description: |-
    **(NOT IMPLEMENTED)**
    Update the non-working day information for a given date.
  parameters:
    - name: date
      in: path
      required: true
      description: |-
        The date of the non-working day to view in ISO 8601 format.
      schema:
        type: string
        format: date
      example: '2022-05-06'
  requestBody:
    content:
      application/json:
        schema:
          $ref: ../components/schemas/non_working_day_model.yml
        example:
          _type: NonWorkingDay
          date: '2022-05-01'
          name: 'Labour day'

  responses:
    '200':
      description: |-
        OK
      content:
        application/hal+json:
          schema:
            $ref: '../components/schemas/non_working_day_model.yml'
    '400':
      $ref: "../components/responses/invalid_request_body.yml"
    '404':
      description: |-
        Returned if the given date is not a non-working day.
      content:
        application/hal+json:
          schema:
            $ref: '../components/schemas/error_response.yml'
          example:
            _type: Error
            errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
            message: The requested resource could not be found.
    '406':
      $ref: "../components/responses/missing_content_type.yml"
    '415':
      $ref: "../components/responses/unsupported_media_type.yml"

delete:
  summary: Removes a non-working day (NOT IMPLEMENTED)
  operationId: delete_non_working_day
  tags:
    - Work Schedule
  description: |-
    **(NOT IMPLEMENTED)**
    Removes the non-working day at the given date.

    Note: deleting a non-working day will not affect the start and finish dates
    of work packages but will affect their duration.
  parameters:
    - name: date
      in: path
      required: true
      description: |-
        The date of the non-working day to view in ISO 8601 format.
      schema:
        type: string
        format: date
      example: '2022-05-06'
  responses:
    '204':
      description: |-
        No Content.

        The operation succeeded.
    '400':
      $ref: "../components/responses/invalid_request_body.yml"
    '404':
      description: |-
        Returned if the given date is not a non-working day.
      content:
        application/hal+json:
          schema:
            $ref: '../components/schemas/error_response.yml'
          example:
            _type: Error
            errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
            message: The requested resource could not be found.
    '406':
      $ref: "../components/responses/missing_content_type.yml"
    '415':
      $ref: "../components/responses/unsupported_media_type.yml"
