# This API defines the external endpoints provided by KrakenD
#
# KrakenD will need to call our internal API endpoints which are specified in comments
#
# Our internal endpoints need an Authorization header as such:
# Authorization: Bearer <service token>
#
# You can get the swagger JSON for services by starting the service and going to this link
# http://localhost:8080/v3/api-docs?group=full-api
#
# You can download the swagger YAML for services by starting the service and going to this link
# http://localhost:8080/v3/api-docs.yaml
#
# Edit this YAML via https://editor.swagger.io/
#
openapi: 3.0.1
info:
  title: Workcloud Sync
  description: OpenApi Documentation for Workcloud Sync
  version:  1.0.26106
  x-krakend:
    namespace: task
servers:
  - url: https://kag-prod-zwseuprod01p.pp.zebra.com 
    description: EU Prod     
  - url: https://kag-prod-zwsusprod01p.pp.zebra.com
    description: US Prod
  - url: https://kag-uat-zwsusnpuat01t.pp.zebra.com
    description: UAT   
security:
  - Bearer: []
paths:
  /api/sync/v1/announcements:
    post:
      x-krakend:
        backend: /manage/api/v1/announcements/create
        service: task-manage
      tags:
        - Announcement APIs
      summary: Create an announcement
      description: |
        This API will create an Announcement in DRAFT state. This API will provide a id value for the announcement created.
        This id value can be used to either update the details for announcement or use the Launch API to launch the announcement.
        
        The following parameters are mandatory to create an announcement:-
        1) Title: Max limit is 222 characters
        2) Start Date: Default value is Current Timestamp. The date can be in the future but not in past. The time should be in UTC
        3) Due Date: The date cannot be in past. The time should be in UTC 
        4) Priority: Default value is STANDARD. Other values are IMPORTANT or URGENT.
        5) Status: Value has to be set as DRAFT.
        6) Recipients: 
        
        The other optional parameters are:-
        1) Description: Max 2000 characters.
        2) sendNow: This parameter can be used to tell the API if the announcement needs to be sent immediately or not. Boolean value accepted: true or false.
        3) expiryLimitInDays: Default is 90 days. Value can be from 1 to 90 days.
        
        The other parameters such as taskType Id can be ignored. The value for this parameter is
        ANNOUNCEMENT.
        
        Permission required: announcements which depends on wcc-chat(base)

      operationId: CreateAnnouncement
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AnnouncementPlatformRequestDTO"
        required: true
      responses:
        "200":
          description: Announcement Created Successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AnnouncementResponseDTO"
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request

  /api/sync/v1/announcements/{announcementId}:
    put:
      x-krakend:
        backend: /manage/api/v1/announcements/update/{announcementId}
        service: task-manage
      tags:
        - Announcement APIs
      summary: Update an announcement
      description: |
        This API will update an Announcement in DRAFT state. The user needs to pass the id value generated from the CREATE API.This API will provide a id value for the announcement created.
        
        
         The following parameters can be updated:-
         1) Title: Max limit is 222 characters
         2) Start Date: Default value is Current Timestamp. The date can be in the future but not in past. The time should be in UTC.
         3) Due Date: The date cannot be in past. The time should be in UTC. 
         4) Priority: Default value is STANDARD. Other values are IMPORTANT or URGENT.
         5) Recipients
         6) Description: Max 2000 characters.
         7) sendNow: This parameter can be used to tell the API if the announcement needs to be send immediately or not. Boolean value accepted: true or false.
         8) expiryLimitInDays: Default is 90 days. Value can be from 1 to 90 days.
        
         Th Status param would still need to be set as DRAFT.
        
         The other parameters such as taskType Id can be ignored. The value for this parameter is
         ANNOUNCEMENT.
        
         Permission required: announcements which depends on wcc-chat(base)
      

      operationId: UpdateAnnouncement
      parameters:
        - name: announcementId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
          description: Announcement Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AnnouncementPlatformRequestDTO"
        required: true
      responses:
        "200":
          description: Announcement Updated Successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AnnouncementResponseDTO"
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
    delete:
      x-krakend:
        backend: /manage/api/v1/announcements/delete/{announcementId}
        service: task-manage
      tags:
        - Announcement APIs
      summary: Deletes an announcement
      description: |
        This API deletes an announcement by accepting the announcement ID in the request.
        You can obtain the announcement ID from the Announcement Listing API response.

        Permission required: only creator can delete announcement
      operationId: deleteAnnouncement
      parameters:
        - name: announcementId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
          description: Announcement Id
      responses:
        "500":
          description: Internal server error
        "400":
          description: Bad request
        "404":
          description: Announcement not found
        "200":
          description: Announcement deleted successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AnnouncementResponseDTO"

  /api/sync/v1/announcements/launch:
    post:
      x-krakend:
        backend: /manage/api/v1/announcements/launch
        service: task-manage
      tags:
        - Announcement APIs
      summary: Launches an announcement
      description: |
        This API can be used to launch a DRAFT announcement by providing the announcement id generated from CREATE API. The user can also update the sendNow value and this will be taken as the final value for the announcement whether it would be launched to the recipeints immediately or not.
        
        The announcement will be launched with a LAUNCHED status. 
        
        
        Permission required: announcements which depends on wcc-chat(base)

      operationId: launchAnnouncement
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AnnouncementLaunchRequestDto"
        required: true
      responses:
        "500":
          description: Internal server error
        "400":
          description: Bad request
        "404":
          description: Announcement not found
        "200":
          description: Announcement launched successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AnnouncementResponseDTO"

  /api/sync/v1/todos:
    post:
      x-krakend:
        backend: /manage/api/v2/todos/create
        service: task-manage
      tags:
        - To-Do APIs
      summary: Create a To-Do
      description: |
        This API will create a to-do in DRAFT state. This API will provide a id value for the to-do created. This id value can be used to either update the details for to-do or use the Launch API to launch the to-do.
        
          - This version allows a task creator to assign it to a recipient at any site within their line of sight.
          - This API uses fileHash for attachments instead of fileuri. Hash will be output of the FIle upload API.
        
        The following parameters are mandatory to create a to-do:-
        1) Title: Max limit is 120 characters
        2) Start Date: Default value is Current Timestamp. The date can be in the future but not in past. The time should be in UTC
        3) Due Date: The date cannot be in past. The time should be in UTC 
        4) Priority: Default value is NONE. Other values are URGENT or HIGH or LOW.
        5) Status: Value has to be set as DRAFT.
        6) Recipients: It allows the user to pass in the platform userid , or the platform role id, platform department id to be marked as recipients of the to-do. The platform siteid should be passed along with each of the parameters.
        7) Repeat: This parameter is used to set a repeating to-do and create occurrences based on a set schedule.
           - DEFAULT is DO_NOT_REPEAT. If this value is passed: rest of the params for repeat key are not required.
           - But if WEEKLY, DAILY, MONTHLY are passed, then the scheduleEndDate should be passed.
           - If WEEKLY is passed, additional scheduleDayofWeek should be passed which have the values as [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY]
           - If MONTHLY is passed, additional scheduleDayofMonth should be passed which have the values as days of the month (1-31). For scheduling last day of the month, put 31 as the value in every case.
           - Also, the start date's value should match the scheduleDayofWeek value or ScheduleDayofMonth value.
        
        The other optional parameters are:-
        1) Description: Max 2000 characters.
        2) expiryLimitInDays: Default is 90 days. Value can be from 1 to 90 days.
        3) attachments: Array of file metadata using fileHash. The file upload is done through a FILE UPLOAD API
        4) tags:Add specific tags to a to-do
        5) startDateNotSet : ToDo Start Date
        
        Permission Required:
        1) task-creation	
        2) task-creation-checklist	
        3) task-creation-instore
      operationId: CreateTodoV2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToDoCreateRequestV2Dto'
        required: true
      responses:
        '200':
          description: Task Created Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreateResponseDTO'
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
        "422":
          description: Unprocessable Entity
        "403":
          description: Forbidden

  /api/sync/v1/todos/{todoId}:
    put:
      x-krakend:
        backend: /manage/api/v2/todos/update/{todoId}
        service: task-manage
      tags:
        - To-Do APIs
      summary: Update a To-Do
      description: |
        This API will update an to-do in DRAFT state. This API will provide a id value for the to-do updated. This id value can be used to either update the details for to-do or use the Launch API to launch the to-do.
        
         - This version allows a task creator to assign it to a recipient at any site within their line of sight.
         - This API uses fileHash for attachments instead of fileuri. Hash will be output of the File Upload API.
        
        The following parameters are mandatory to update a to-do:-
        1) Title: Max limit is 120 characters
        2) Start Date: Default value is Current Timestamp. The date can be in the future but not in past. The time should be in UTC
        3) Due Date: The date cannot be in past. The time should be in UTC 
        4) Priority: Default value is NONE. Other values are URGENT or HIGH or LOW.
        5) Status: Value has to be set as DRAFT.
        6) Recipients: It allows the user to pass in the platform userid , or the platform role id, platform department id to be marked as recipients of the to-do. The platform siteid should be passed along with each of the parameters.
        7) Repeat: This parameter is used to set a repeating to-do and create occurrences based on a set schedule.
           - DEFAULT is DO_NOT_REPEAT. If this value is passed: rest of the params for repeat key are not required.
           - But if WEEKLY, DAILY, MONTHLY are passed, then the scheduleEndDate should be passed.
           - If WEEKLY is passed, additional scheduleDayofWeek should be passed which have the values as [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY]
           - If MONTHLY is passed, additional scheduleDayofMonth should be passed which have the values as days of the month (1-31). For scheduling last day of the month, put 31 as the value in every case.
           - Also, the start date's value should match the scheduleDayofWeek value or ScheduleDayofMonth value. 
        
        The other optional parameters are:-
        1) Description: Max 2000 characters.
        2) expiryLimitInDays: Default is 90 days. Value can be from 1 to 90 days.
        3) attachments: Array of file metadata using fileHash (V2 format). The file upload is done through a FILE UPLOAD API
        4) tags:Add specific tags to a to-do
        5) startDateNotSet : ToDo Start Date
        
        Permission Required:
        1) task-creation	
        2) task-creation-checklist	
        3) task-creation-instore

      operationId: UpdateTodoV4
      parameters:
        - name: todoId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
          description: Identifier of a To-Do
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToDoCreateRequestV2Dto'
        required: true
      responses:
        '200':
          description: To-Do Updated Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskUpdateResponseDTO'
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
        "422":
          description: Unprocessable Entity
        "404":
          description: Task Not Found
    get:
      x-krakend:
        backend: /manage/api/v1/todos/{todoId}
        service: task-manage
      tags:
        - To-Do APIs
      summary: Gets To-Do details
      description: |
        This API will provide details for an specific to-do or an assignment created for a recipient provided during the CREATE or UPDATE to-do APIs. When only a to-do Id is provided, the API provides details for the to-do created by the creator and will check if the user was that creator or not. If the assignment Id is provided along with the to-do Id, the API checks for permission whether the user is an assignee of the assignment or has a task-view-all permission and they belong to the same site as the recipient/creator of the to-do/assignment.

          The details of the to-do or assignment will provide platform based names for the user, role, department and site with rest of the details.

          The valid status for a to-do that can be seen: DRAFT, LAUNCHED, RECALLED
          The valid status for an assignment of a to-do that can be seen: NEW, READ, COMPLETED

          If the assignment has been recalled, the assignment details will not shared, it will throw an error message. If the to-do is recalled, the details will be still shared to the creator.

          Permissions Required:
          1) For To-Do details: - Creator of the to-do
          2) For Assignment details: - Assignee of the assignment or have task-view-all	and access to that site where the assignment is created.

      operationId: FetchTodoDetailsAsPerRole
      parameters:
        - name: todoId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
          description: Identifier of a To-Do
        - name: assignmentId
          in: query
          required: false
          schema:
            type: integer
            format: int32
          description: Assignment Id
      responses:
        '200':
          description: To-Do Details Retrieved Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskDetailPlatformResponse'
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
        "403":
          description: Forbidden
    delete:
      x-krakend:
        backend: /manage/api/v1/todos/delete/{todoId}
        service: task-manage
      tags:
        - To-Do APIs
      summary: Delete a draft To-Do
      description: |
        This API deletes a to-do created using CREATE API when in DRAFT state. The API takes in undo parameter which is optional and by default is false. If the deletion for the DRAFT to-do needs to be reverted, use the API with the to-do ID and undo value true, to make the DRAFT to-do active again.

        Permissions Required:
        1) Creator of the draft to-do
      operationId: deleteTodo
      parameters:
        - name: todoId
          in: path
          required: true
          schema:
            type: integer
            format: int32
        - name: undo
          in: query
          required: false
          schema:
            type: boolean
          description: whether to make deleted To-Do active
      responses:
        "200":
          description: Draft To-Do deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskDeleteResponseDTO'
        '400':
          description: Bad request
        '404':
          description: To-Do not found
        '500':
          description: Internal server error

  /api/sync/v1/todos/launch:
    post:
      x-krakend:
        backend: /manage/api/v1/todos/launch
        service: task-manage
      tags:
        - To-Do APIs
      summary: Launches a To-Do
      description: |
        This API can be used to launch a DRAFT to-do by providing the to-do id generated from CREATE API. 
        The to-do will be launched with a LAUNCHED status. 
        
        Permission Required:
        1) task-creation	
        2) task-creation-checklist	
        3) task-creation-instore

      operationId: launchTodo
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MsgLaunchRequestDto"
        required: true
      responses:
        "500":
          description: Internal server error
        "200":
          description: To-Do launched successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TaskLaunchResponseDTO"
        "400":
          description: Bad request
        "404":
          description: To-Do not found

  /api/sync/v1/todos/createdTasks:
    post:
      x-krakend:
        backend: /manage/api/v1/platform/todos/created
        service: task-manage
      tags:
        - To-Do APIs
      summary: Fetch To-Dos created by user
      description: |
        The API will provide a list of to-do's created by the specific user whose bearer service account token is passed in the header. The API returns paginated results based on page and pageSize parameters.
        
        The following parameters are mandatory:
        1) fromDate:  It should be in UTC format.
        2) sortBy: Values can be PRIORITY, DUE_DATE or CREATED_AT.
        3) sortDir: Values can be ASC or DESC.
        
        The following parameters are optional:
        1) toDate: It should be in UTC format.
        2) statusId: Values can be [1 for DRAFT,4 for LAUNCHED, 13 for COMPLETED, 14 for RECALLED]. Multiple values are accepted. If empty[] is passed, it returns DRAFT and LAUNCHED status to-dos by default.
        3) priorityId: Values can be [1 for URGENT, 2 for HIGH, 3 for MEDIUM, 4 for LOW]. Multiple values are accepted. If empty [] is passed, all priorities are considered.
        4) viewFilter: Values can be ["ALL" OR "WATCHING"]. It returns the ALL the to-dos or if WATCHING is passed, it returns only the to-dos which are being watched by the creator. Default is ALL.
        5) taskTypeIds: Values can be [1 for STANDARD to-dos or 4 for CHECKLIST to-dos]. Multiple values accepted. if empty [] is passed, then both type of to-dos are returned
        6) page
        7) pageSize
        8) siteFilterEnum: Values can be ["CURRENT_SITE" | "ALL_SITES" | FILTER_SITES].  
        If value is sent as  "CURRENT_SITE" then Todos which are created by current user only in current site will be returned.
        If value is "ALL_SITES" server will fetch all todos created by current user for all sites. 
        If value is "FILTER_SITES" then server expects array of siteId in filterSiteIdList field and only Todos from those sites will be returned.
        9) filterSiteIdList : Array of siteIds in case siteFilterEnum is set to FILTER_SITES
        
        Permission Required:
        1) Need to be creator of the to-dos to see list of to-dos

      operationId: createdTodoList
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskFollowingPlatformRequestDTO'
        required: true
      responses:
        '200':
          description: Task List
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskListResponseDTO'
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
        "422":
          description: Unprocessable Entity
        "403":
          description: Forbidden
  /api/sync/v1/todos/edit/{todoId}:
    post:
      x-krakend:
        backend: /manage/api/v2/todos/clone/{todoId}
        service: task-manage
      tags:
        - To-Do APIs
      summary: Creates a clone for a given To-Do for editing
      description: |
        The API creates a clone for a Launched to-do. This API can be used to make changes to already LAUNCHED to-do. The user provides a to-do Id for which the clone needs to be created. It checks if the to-do is created by the same user. It will create a copy of the LAUNCHED to-do, if the condition passes and it will return the clone to-do ID and the details of the clone to-do with DRAFT status.
        
        If there is already a clone to-do for a LAUNCHED to-do, then another clone to-do cannot be created. It either needs to be discarded using the DISCARD to-do API or merge the clone with the original to-do using the LAUNCH API. The details can be updated using the UPDATE to-do API. 
        
        Once the clone to-do is merged with original to-do, the clone to-do is marked inactive. To make more changes to the LAUNCHED to-do, CLONE API needs to be used again.

      operationId: cloneTodoV2
      parameters:
        - name: todoId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: Task Cloned Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreateResponseDTO'
        '400':
          description: Bad Request
        '401':
          description: Unauthorised Access
        '500':
          description: Internal Server Error

  /api/sync/v1/todos/edit/{editToDoId}:
    delete:
      x-krakend:
        backend: /manage/api/v1/todos/discard/{editToDoId}
        service: task-manage
      tags:
        - To-Do APIs
      summary: Discards a To-Do Edit
      description: |
        This API can be used to discard the changes made in the clone to-do created using the CLONE API. This API allows the user to create another clone of the LAUNCHED to-do; if the existing clone has wrong changes and it needs to be discarded. 

        Only the active clone to-do where the changes are being still done, can be discarded using this API. Once the clone to-do is merged with original to-do, the DISCARD API cannot be used for removing the changes from that clone to-do.
      operationId: discardClonedTodo
      parameters:
        - name: editToDoId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: To-Do discarded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreateResponseDTO'
        '400':
          description: Bad request
        '404':
          description: Original Todo not found
        '500':
          description: Internal server error

  /api/sync/v1/todos/history:
    post:
      x-krakend:
        backend: /manage/api/v1/todos/created/history/list
        service: task-manage
      tags:
        - To-Do APIs
      summary: Fetch the history list for the specified To-Do ID
      description: |
        Retrieves a paginated list of history records for the given to-do.
        The response includes records such as TASK_CREATED, TASK_LAUNCHED, and TASK_EDIT_CONTENT.
        
        Results are paginated based on the page and pageSize parameters.
        
        The following parameters are mandatory:  
        1)taskId  
        2)isWatcher
      
      

      operationId: taskHistoryList
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaskHistoryRequestDto"
        required: true
      responses:
        "200":
          description: To-Dos history fetched
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoryListResponseDto'
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
        "422":
          description: Unprocessable Entity
        "403":
          description: Forbidden

  /api/sync/v1/todos/history/{historyId}:
    get:
      x-krakend:
        backend: /manage/api/v1/todos/created/history/{historyId}
        service: task-manage
      tags:
        - To-Do APIs
      summary: Fetch history details for the given history ID
      description: |
        This API will provide history details for the given history ID.  
        To get history_id you can use following APIs
        
          1) /api/sync/v1/todos/history  
          2) /api/sync/v1/todos/assigned/history
        
          Both APIs will return list of history records which will have summary and history_Id.
          Then you can use this history_id in this API to fetch all details of that record.
        
        The following parameters are mandatory:  
        1)historyId

      operationId: historyDetails
      parameters:
        - name: historyId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: questionDisplayTypeFilter
          in: query
          description: 'Comma-separated display types to filter by (e.g. CHECKBOX,RADIO,DROPDOWN).
           Default: CHECKBOX'
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - INPUTBOX
                - DATEPICKER
                - NUMBER_SCROLLER
                - DROPDOWN
                - MULTISELECT
                - CHECKBOX
                - RADIO
                - CONFIRM_WITH_PHOTO
      responses:
        "200":
          description: History Details Fetch Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoryDetailsResponseDTO'
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
        "422":
          description: Unprocessable Entity
        "403":
          description: Forbidden
  /api/sync/v1/todos/duplicate:
    post:
      x-krakend:
        backend: /manage/api/v1/todos/duplicate
        service: task-manage
      tags:
        - To-Do APIs
      summary: Create a draft copy of an existing To-Do
      description: |
        This API creates a clone of the specified to-do (original to-do) including its attachments, 
        tags, attributes, and related data.
        
        status of cloned to-do will be DRAFT.
        
        if repeatingTask field value is sent as true in request and original to-do is a repeating to-do
        then the clone which is created will be a repeating to-do else it will be a non repeating to-do.
        
        if cloned to-do is a repeating to-do and is WEEKLY or MONTHLY then start date of cloned to-do will 
        be calculated accordingly as per the next occurrence else start date of cloned to-do will be current
        date
        
        due date of cloned to-do will be calculated by adding difference of start date and due date from 
        original to-do to the start date of cloned to-do. 
        
        assignees will be copied if site id is same as of creator
        
        The following parameters are mandatory:
        1)taskId
        
        Permissions Required:
        1) user should be the creator of the given to-do.
           (the token we are passing in request should be of
           the creator of to-do)

      operationId: duplicateTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaskDuplicateRequestDto"
        required: true
      responses:
        "200":
          description: To-Do Duplicated Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskDuplicateResponseDTO'
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
        "422":
          description: Unprocessable Entity
        "403":
          description: Forbidden

  /api/sync/v1/todos/assigned/history:
    post:
      x-krakend:
        backend: /execution/api/v1/todos/assigned/history/list
        service: task-execution
      tags:
        - To-Do Execution APIs
      summary: Fetch the history list for the specified assignment ID
      description: |
        This API retrieves a paginated list of history records for the specified assignment.
        The response includes all changes made to the assignment.
        Results are paginated using the page and pageSize parameters.
        
        The following parameters are mandatory:  
        1)assignmentId  

      operationId: assignmentHistoryList
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignmentHistoryRequestDto"
        required: true
      responses:
        "200":
          description: To-Do's history fetched
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoryListResponseDto'
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
        "422":
          description: Unprocessable Entity
        "403":
          description: Forbidden

  /api/sync/v1/todos/assignedTasks:
    post:
      x-krakend:
        backend: /execution/api/v1/platform/todos/assigned
        service: task-execution
      tags:
        - To-Do Execution APIs
      summary: Fetch To-Dos assigned to a user
      description: |
        The API will provide a list of to-do's assigned to the specific user whose bearer service account token is passed in the header. The API returns paginated results based on page and pageSize parameters.
        
        The following parameters are mandatory:
        1)fromDate: It should be in UTC format.
        2)page
        3)pageSize
        
        
        The following parameters are optional:
        1) toDate: It should be in UTC format.
        2) statusId: Values can be [8 for NEW,10 for READ, 10 for COMPLETED(Assignments), 12 for EXPIRED, 18 for COMPLETED LATE]. Multiple values are accepted. If empty[] is passed, by default only NEW and READ status assignments are shown.
        3) priorityId: Values can be [1 for URGENT, 2 for HIGH, 3 for MEDIUM, 4 for LOW]. Multiple values are accepted.If empty [] is passed, it considers all priority.
        5) taskTypeIds: Values can be [1 for STANDARD to-dos or 4 for CHECKLIST to-dos]. Multiple values accepted. If empty [] is passed; it considers both.
        6) sortBy: Values can be PRIORITY, DUE_DATE or CREATED_AT. Default is by PRIORITY
        7) sortDir: Values can be ASC or DESC. Default is ASC 
        8) siteFilterEnum: Values can be ["CURRENT_SITE" | "ALL_SITES" | FILTER_SITES].  
        If value is sent as  "CURRENT_SITE" then Todos which are created by current user only in current site will be returned.
        If value is "ALL_SITES" server will fetch all todos created by current user for all sites. 
        If value is "FILTER_SITES" then server expects array of siteId in filterSiteIdList field and only Todos from those sites will be returned.
        9) filterSiteIdList : Array of siteIds in case siteFilterEnum is set to FILTER_SITES
        
        Permission Required:
        1) Should be a recipient in the created to-dos to see the list of assignments assigned

      operationId: fetchAssignedTodos
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ToDoListForYouPlatformRequestDto"
        required: true
      responses:
        "400":
          description: Bad Request
        "401":
          description: Unauthorised Access
        "200":
          description: ToDo List
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TaskListResponseDTO"
        "500":
          description: Internal Server Error

  /api/sync/v1/todos/assignments/status:
    put:
      x-krakend:
        backend: /execution/api/v1/todos/status
        service: task-execution
      tags:
        - To-Do Execution APIs
      summary: Update assigned To-Do status
      description: |
        The API can be used to update a particular assignment's status. The API takes in assignment id which can be obtained from the GET ASSIGNMENT LIST APIs. It also take in the status ENUM value which are applicable to the assignments.
        
        Assignment ID and status are mandatory and undo parameter is optional. The undo parameter is used when the status of the Assignment needs to be reverted if the assignment has been completed. It can be undone within the 10 second of the status being marked as COMPLETE.
        
        The valid values for status are READ or COMPLETE. By default,when assignments are created during the LAUNCH of to-do, they are assigned a status with value NEW.
        
        Only the users/roles/department within a site to whom the assignment is assigned to or the users who have task-view-all permission within that site can change the status of the assignment.
        
         Permissions Required:
          2) For Assignment status update: - Assignee of the assignment or have task-view-all	within that site where the assignment is created.
      

      operationId: updateAssignmentStatus
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignmentStatusRequestDto"
        required: true
      responses:
        "200":
          description: Assignment status updated Successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponsePayload"
        "400":
          description: Bad Request
        "401":
          description: Unauthorized Access
        "500":
          description: Internal Server Error
        "412":
          description: Precondition Failed
        "422":
          description: Unprocessable Entity

  /api/sync/v1/surveys:
    post:
      x-krakend:
        backend: /survey/api/v2/survey
        service: task-survey
      tags:
        - Survey APIs
      summary: Create survey
      description: |
        This API will create or edit a survey. It will attach the created survey with the mentioned taskId (id of the to-do generated from CREATE To-Do API).
        
        For Creating a survey, survey Id should not be passed. The taskId for to-do is mandatory. The surveyType value should be CHECKLIST to create a Checklist, which is currently supported.
        
        To edit a survey, both surveyId and taskId are mandatory.
        
        The displayType supported values: CHECKLIST
        value parameter would be the description of the checklist item that needs to be provided
        validation:required parameter would allow the user to mention whether the question is mandatory to complete or not.
        order parameter within questionOptions is mandatory and it should be in a sequence. Questions cannot have the same order.
        Discard value is false or true. if the question is to be removed, set the parameter as true.
        
        Attachment metadata parameters are optional.
        
        language parameter should be set as the language you want the questions to be in. Default language code value is en.
        
        The following parameters should be ignored:
        1) surveyVersion parameters
        2) questionOptions
        3) createdFromQuestionId
      operationId: createOrEditSurvey
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/SurveyCreateDto"
        required: true
      responses:
        '200':
          description: Survey created or edited successfully
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/SurveyCreateDto"
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
  /api/sync/v1/surveys/questions:
    get:
      x-krakend:
        backend: /survey/api/v1/questions
        service: task-survey
      tags:
        - Survey APIs
      description: |
        This API will get questions for a survey attached to the to-do Id. 
        The surveyId and taskId are mandatory fields as query param.

      summary: Fetch questions for survey
      operationId: getQuestionsWithAttachmentsBySurveyId
      parameters:
        - name: surveyId
          in: query
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: taskId
          in: query
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: questionFilterType
          in: query
          description: 'Comma-separated display types to filter by (e.g. CHECKBOX,RADIO,DROPDOWN).
           Default: CHECKBOX'
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - INPUTBOX
                - DATEPICKER
                - NUMBER_SCROLLER
                - DROPDOWN
                - MULTISELECT
                - CHECKBOX
                - RADIO
                - CONFIRM_WITH_PHOTO
      responses:
        '200':
          description: Questions fetched successfully
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ResponsePayload"
        '400':
          description: Bad Request
        '404':
          description: To-Do not found
        '500':
          description: Internal Server Error
  /api/sync/v1/surveys/answers:
    post:
      x-krakend:
        backend: /survey/api/v1/answers/save
        service: task-survey
      tags:
        - Survey APIs
      summary: Update checklist item
      description: |
        This API allows the assigned user or the user with task-view-all permission within the same site to update the survey answers for a particular assignment of a to-do.
        The surveyType currently support is CHECKLIST. So, that value should be entered as a parameter.
        The entityId should be the assignmentId of the specific assignment of a to-do. The list of assignmentIds can be fetched using GET ASSIGNMENT LIST API.
        
        Accepted values for reasonTypeId are 10 (Not Applicable) and 11 (Cannot Do)
        The displayType value should be CHECKLIST for checklist based survey which is currently supported.
        The numeric values for valueNum represent the checklist item status:
        
         0 indicates that the item is not complete 
         1 indicates that the item is marked as complete 
         2 indicates that the item is marked as not applicable
        
        The valueString should not be used for Checklist based survey
        
        Permissions Required:
        1) Assignee of the todo or have task-view-all permission within the same site

      operationId: updateChecklist
      parameters:
        - name: surveyType
          in: query
          required: true
          schema:
            type: string
            enum:
              - SURVEY
              - CHECKLIST
          description: Type of Survey
        - name: entityId
          in: query
          required: true
          schema:
            type: integer
            format: int32
          description: Entity Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AnswerDto"
        required: true
      responses:
        "200":
          description: Answer Submitted successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponsePayload"
        "400":
          description: Bad Request
        "500":
          description: Internal Server Error
    get:
      x-krakend:
        backend: /survey/api/v1/answers
        service: task-survey
      tags:
        - Survey APIs
      description: |
        This API will fetch answers that the assigned user or the user with task-view-all permission within same site as assignee has put in for the questions for a specific assignment of a to-do.
        The surveyId and assignment Id are mandatory fields as query parameters.

        Permissions Required:
        1) Assignee of the to-do or have task-view-all permission within the same site

      summary: fetch answers
      operationId: getSurveyAssignmentAnswers
      parameters:
        - name: surveyId
          in: query
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: assignmentId
          in: query
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: questionFilterType
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - INPUTBOX
                - DATEPICKER
                - NUMBER_SCROLLER
                - DROPDOWN
                - MULTISELECT
                - CHECKBOX
                - RADIO
                - CONFIRM_WITH_PHOTO
      responses:
        '200':
          description: Answers fetched successfully
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ResponsePayload"
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
  /api/sync/v1/todos/comments:
    post:
      x-krakend:
        backend: /comments/api/v3/comments
        service: task-comments
      tags:
        - Comment APIs
      summary: Add a comment to a To-Do
      description: |
        This API adds comments to a specific to-do. The users who are recipients of that to-do or have task-view-all permission can add comments. This API allows to  add a standalone comment or reply to a parent comment. It does not allow to add a reply to a child comment of the main comment.
        
        The record Id is the to-do id here. ParentId is optional and it should be entered only when a reply to that parent comments needs to be added.
        
        The mention parameter allows to tag any user/role to the comment. This an optional parameter which can be ignored.
        
        The API allows to pass on the metadata of the attached files to the comment as file. The actual attachment of files happen through FILE UPLOAD API.
      operationId: addCommentV2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentAddDto'
        required: true
      responses:
        '200':
          description: adding comments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentResponseDTO'
        '400':
          description: Bad Request
        '401':
          description: Unauthorised Access
        '500':
          description: Internal Server Error


  /api/sync/v1/todos/comments/{recordId}:
    get:
      x-krakend:
        backend: /comments/api/v1/todos/{recordId}
        service: task-comments
      tags:
        - Comment APIs
      summary: Gets list of comments
      description: |
        The API allows to fetch a list of comments entered using the ADD COMMENT API. This API is accessible to the recipients of the to-do or the users who have task-view-all permission and are part of that site where the to-do is created.
        
        The API is paginated where the pagesize and offset can be set as query parameters with default value of 10 and 0 respectively
      operationId: fetchCommentList
      parameters:
        - name: recordId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: pageSize
          in: query
          required: false
          schema:
            minimum: 1
            type: integer
            format: int32
            default: 10
        - name: offSet
          in: query
          required: false
          schema:
            minimum: 0
            type: integer
            format: int32
            default: 0
        - name: markerNeeded
          in: query
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Comment List
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentListDTO'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized Access
        '500':
          description: Internal Server Error
        "422":
          description: Unprocessable Entity
        "403":
          description: Forbidden

  /api/sync/v1/todos/comments/{commentId}:
    delete:
      x-krakend:
        backend: /comments/api/v1/delete/{commentId}
        service: task-comments
      tags:
        - Comment APIs
      summary: Deletes the comment for the given comment ID
      description: |
        This API deletes a comment specified by the commentId path parameter.
        The commentId can be obtained from the response of the "/comments/api/v1/todos/{recordId}" GET API.
        
        These fields are mandatory:
         1) commentId
         2) active
        
         delete comment action can be reverted/undo within 15 seconds after deleting.
         if active field's value is false comment will be deleted.
         if active field's value is true comment will become active again.
        
        Permission Required:
        1) WCSTASK_TASK_DELETE_COMMENT OR should be creator of comment
      operationId: deleteComment
      parameters:
        - name: commentId
          in: path
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: active
          in: query
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: Comment List
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteCommentResponseDTO'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized Access
        '500':
          description: Internal Server Error
        "422":
          description: Unprocessable Entity
        "403":
          description: Forbidden

  /api/sync/v1/todos/reassign:
    put:
      x-krakend:
        backend: /execution/api/v1/todos/reassign
        service: task-execution
      tags:
        - To-Do Execution APIs
      summary: Reassign assignment
      description: |
        This API allows to reassign the assignment to other users/role/department within the same site. The user should either be a recipient of the assignment or they should have task-view-all permissions and have access to the same site where the assignments for the to-do were created.
        
        The API accepts platform names for the user/role/department and site. the reassignment can happen either to a role or a user or department. site ID value should be passed if its being reassigned to user/role/department.
        
        Permission Required:
        1) task-reassign
      operationId: ReAssignAssignment
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReassignPlatformRequest'
        required: true
      responses:
        '200':
          description: Re-Assignment done successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsePayload'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized Access
        '500':
          description: Internal Server Error
        "412":
          description: Precondition Failed
        "422":
          description: Unprocessable Entity

  /api/sync/v1/todos/assignments:
    post:
      x-krakend:
        backend: /execution/api/v1/todos/assignments/list
        service: task-execution
      tags:
        - To-Do Recall/Reset APIs
      summary: Get To-Do assignments for Recall or Reset
      description: |
        This API will return a list of  assignments for a to-do eligible based on the process and status mentioned.
        The status param is not mandatory. If status is not provided as input, the API will compute all eligible assignments based on the given to-do Id.
        
        Process : "RECALL", "RESET", "EXECUTION"
          - Process: RECALL; Status: NEW, READ, COMPLETED
          - Process: RESET; Status: READ, COMPLETED
          - Process: EXECUTION; Status: NEW, READ, COMPLETED
        
        groupByEnum : "NONE, SITE"
          - NONE: The API will return a flat list of people, roles, and departments.
          - SITE: The API will return roles and departments grouped by site, along with a flat list of people.
        
        Permission Required:
        1) Creator of the to-do when process is RECALL or RESET
      operationId: getAssignments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignmentListRequestDto'
        required: true
      responses:
        '200':
          description: Assignments fetched Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssignmentPlatformResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized Access
        '500':
          description: Internal Server Error

  /api/sync/v1/todos/reset:
    put:
      x-krakend:
        backend: /execution/api/v1/todos/reset
        service: task-execution
      tags:
        - To-Do Recall/Reset APIs
      summary: Reset a To-Do
      description: |
        This API allows to reset a status of the assignments of the to-do. The assignments with specific status only are allowed to be reset. The assignments with status READ or COMPLETED can be reset. Assignments which are NEW, EXPIRED or OVERDUE cannot be reset.
        
        The user can pass just the taskId and mention the process as RESET which will reset all the eligible assignments for that to-do. If specific assignments need to be reset, a list of assignment ids need to be passed along with to-do Id. The assignment IDs for a to-do can be fetched from GET ASSIGNMENT LIST API.
        
        creatorReason is an optional parameter and assigneeReason parameter can also be ignored.
        
        ReasonTypeId is a required field and supports the following values: [7 for Error in Execution, 8 for To-Do Incomplete or 9 for Other]
        
           Permission Required:
        1) Creator of the to-do

      operationId: resetTodo
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskResetRecallRequest'
        required: true
      responses:
        '200':
          description: Todo Reset Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsePayload'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized Access
        '404':
          description: To-Do Not Found
        '500':
          description: Internal Server Error
        "412":
          description: Precondition Failed
        "403":
          description: Forbidden

  /api/sync/v1/todos/recall:
    put:
      x-krakend:
        backend: /execution/api/v1/todos/recall
        service: task-execution
      tags:
        - To-Do Recall/Reset APIs
      summary: Recall a To-Do
      description: |
        This API allows to recall a status of the assignments of the to-do. The assignments with specific status only are allowed to be recall assignments with status NEW, READ or COMPLETED can be recalled. Assignments which are EXPIRED or OVERDUE cannot be reset.
        
         The user can pass just the taskId and mention the process as RECALL which will recall all the eligible assignments for that to-do. If specific assignments need to be recalled, a list of assignment ids need to be passed along with to-do Id. The assignment IDs for a to-do can be fetched from GET ASSIGNMENT LIST API.
        
         creatorReason is an optional parameter and assigneeReason parameter can also be ignored.
        
         ReasonTypeId is a required field and supports the following values: [4 for Not Applicable, 5 for Duplicate To-Do, 6 for No Longer Required or 12 for Other]
        
           Permission Required:
         1) Creator of the to-do

      operationId: recallTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskResetRecallRequest'
        required: true
      responses:
        '200':
          description: Todo Recalled Successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsePayload'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized Access
        '404':
          description: Todo Not Found
        '500':
          description: Internal Server Error
        "412":
          description: Precondition Failed
        "403":
          description: Forbidden
  /api/sync/v1/todos/watcher:
    put:
      x-krakend:
        backend: /manage/api/v1/manage/watchers/save
        service: task-execution
      tags:
        - Add watcher for a To-Do
      summary: Adds a watcher to a To-Do
      description: |
        This API allows you to add watcher to a to-do. Specify the to-do ID, user ID, and watcher status in the request body.
        Authentication and appropriate permissions are required to add watcher.
      operationId: watchTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskParticipantsRequestDTO'
        required: true
      responses:
        '200':
          description: Watchers added successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsePayload'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized Access
        '404':
          description: Todo Not Found
        '500':
          description: Internal Server Error
        "412":
          description: Precondition Failed
        "403":
          description: Forbidden
components:
  securitySchemes:
    Bearer: # arbitrary name for the security scheme
      description: >-
        enter the client service token value.
      type: http
      scheme: bearer
  schemas:
    AssignmentListRequestDto:
      required:
        - process
        - taskId
      type: object
      properties:
        taskId:
          minimum: 1
          type: integer
          description: task id on which assignment list is to be fetched
          format: int32
          example: 1
        status:
          $ref: '#/components/schemas/StatusEnum'
        process:
          $ref: '#/components/schemas/ProcessEnum'
        groupByEnum:
          $ref: '#/components/schemas/GroupByEnum'
    TaskParticipantsRequestDTO:
      type: object
      required:
        - taskId
        - userId
        - active
      properties:
        taskId:
          type: integer
          format: int32
          description: ID of the todo/task
          example: 1
        userId:
          type: integer
          format: int32
          description: ID of the watcher user
          example: 1
        active:
          type: boolean
          description: Indicates if the watcher is active
          example: true
    ReassignPlatformRequest:
      required:
        - assignmentId
      type: object
      properties:
        assignmentId:
          minimum: 1
          type: integer
          description: field on which re-assignment is to be done
          format: int32
          example: 1
        platformUserId:
          type: string
          description: user Id that is to be re-assigned, if present
        platformRoleId:
          type: string
          description: role Id that is to be re-assigned, if present
        platformSiteId:
          type: string
          description: site Id that is to be re-assigned, if present
        platformDepartmentId:
          type: string
          description: department Id that is to be re-assigned, if present
        offlineActionTimestamp:
          type: string
          description: >-
            The time when the user acted on the task while the device was
            offline
          format: date-time
    TaskResetRecallRequest:
      required:
        - process
        - taskId
      type: object
      properties:
        taskId:
          minimum: 1
          type: integer
          description: identifier of task for which Reset/Recall is to be done
          format: int32
          example: 1
        process:
          $ref: '#/components/schemas/ProcessEnum'
        creatorReason:
          type: string
          description: creator reason for reset/recall the task.
        assigneeReason:
          type: string
          description: assignee reason for reset/recall the task.
        reasonTypeId:
          minimum: 1
          type: integer
          format: int32
          description: specifies the selectable reasons type Ids.
          items:
            type: integer
            example: ["Reset":{"7-Error in Execution","8-Task Incomplete","9-Other"},"Recall":{"4-Not Applicable","5-Duplicate Task","6-No longer Required","12-Other"}]
        assignmentIds:
          uniqueItems: true
          type: array
          description: list of Assignments to be reset/recall.
          example:
            - 1
            - 2
          items:
            type: integer
            description: list of Assignments
            format: int32
    ProcessEnum:
      type: string
      description: task process
      example: RECALL
      enum:
        - CREATE
        - APPROVAL
        - EXECUTION
        - TASK_EDIT
        - REJECT
        - RECALL
        - RESET
        - SURVEY_ANSWER_REFUSAL
    GroupByEnum:
      type: string
      description: task process
      example: NONE, SITE
      enum:
        - NONE
        - SITE
    CommentDto:
      required:
        - recordId
      type: object
      properties:
        recordId:
          minimum: 1
          type: integer
          description: record Id in which comment to be added
          format: int32
          example: 1
        comment:
          type: string
          description: comment to be added
          example: Comment added to task
        parentId:
          minimum: 1
          type: integer
          description: parent Id of comment for which child comment is added
          format: int32
          example: 1
        mentions:
          $ref: '#/components/schemas/CommentMentions'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/AttachmentCreateRequestDTO'
    CommentAddDto:
      required:
        - recordId
      type: object
      properties:
        recordId:
          minimum: 1
          type: integer
          description: record Id
          format: int32
          example: 1
        comment:
          type: string
          example: Comment added to task
        parentId:
          type: integer
          description: parent Id
          format: int32
          example: 1
        mentions:
          type: array
          items:
            "$ref": "#/components/schemas/CommentMentions"
        attachments:
          type: array
          items:
            "$ref": "#/components/schemas/AttachmentCreateUpdateRequestDTO"
    CommentMentions:
      required:
        - recipientType
      type: object
      properties:
        recipientId:
          maximum: 2147483647
          minimum: 0
          type: integer
          format: int64
        recipientType:
          type: string
          enum:
            - USER
            - ROLE
            - DEPARTMENT
            - EVERYONE
    CommentResponseDTO:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
            - UNPROCESSABLE_ENTITY
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR23-Error while saving comment.","ERROR403_08-You do not have permission to perform this action."]
        messageParams:
          type: array
          items:
            type: string
        commentId:
          type: integer
          format: int32
        data:
          type: object
    CommentListDTO:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
            - UNPROCESSABLE_ENTITY
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR403_09-You do not have permission to perform this action."]
        messageParams:
          type: array
          items:
            type: string
        paginationMap:
          $ref: '#/components/schemas/PaginationMap'
        commentList:
          type: array
          items:
            $ref: '#/components/schemas/CommentDetailsResponseDTO'
        data:
          type: object
    CommentDetailsResponseDTO:
      type: object
      properties:
        id:
          type: integer
          format: int32
        recordId:
          type: integer
          format: int32
        section:
          type: string
        commentText:
          type: string
        parentId:
          type: integer
          format: int32
        commentType:
          type: string
          enum:
            - TASK
            - ASSIGNMENT
        createdAt:
          type: string
          format: date-time
        createdBy:
          $ref: '#/components/schemas/UserResponseDto'
        mentions:
          type: array
          items:
            $ref: '#/components/schemas/CommentMentionsResponseDTO'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/AttachmentDto'
    DeleteCommentResponseDTO:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
            - UNPROCESSABLE_ENTITY
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR-401 user doesn't have authorized permission"]
        messageParams:
          type: array
          items:
            type: string
        id:
          type: integer
          format: int32
        active:
          type: boolean
    CommentMentionsResponseDTO:
      required:
        - departmentId
        - groupId
        - roleId
        - siteId
        - userId
      type: object
      properties:
        userId:
          minimum: 1
          type: integer
          description: user Id
          format: int32
          example: 1
        firstName:
          type: string
        lastName:
          type: string
        employeeId:
          type: string
        profilePhoto:
          type: string
        presence:
          $ref: '#/components/schemas/UserPresence'
        roleId:
          minimum: 1
          type: integer
          description: role Id
          format: int32
          example: 1
        siteId:
          minimum: 1
          type: integer
          description: site Id
          format: int32
          example: 1
        roleName:
          type: string
        alias:
          type: string
        name:
          type: string
        siteName:
          type: string
        roles:
          type: array
          items:
            $ref: '#/components/schemas/RoleDto'
        departmentId:
          minimum: 1
          type: integer
          description: department Id
          format: int32
          example: 1
        groupId:
          minimum: 1
          type: integer
          description: group Id
          format: int32
          example: 1
    AddApproverDTO:
      type: object
      properties:
        userId:
          minimum: 1
          type: integer
          description: user Id
          format: int32
          example: 1
        roleId:
          minimum: 1
          type: integer
          description: role Id
          format: int32
          example: 1
        siteId:
          minimum: 1
          type: integer
          description: site Id
          format: int32
          example: 1
        sequence:
          minimum: 1
          type: integer
          description: sequence
          format: int32
          example: 1
    AssigneeDTO:
      type: object
      properties:
        userIds:
          uniqueItems: true
          type: array
          description: list of Users
          example:
            - 1
            - 2
          items:
            type: integer
            description: list of Users
            format: int32
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleDTO"
    AttachmentCreateRequestDTO:
      required:
        - fileName
        - fileuri
      type: object
      description: attachments assigned to entities
      properties:
        size:
          type: integer
          description: size of file in bytes
          format: int32
          example: 921000
        duration:
          type: integer
          description: duration of audio/video in milliseconds
          format: int32
          example: 120000
        mimetype:
          maxLength: 255
          minLength: 0
          type: string
          description: mime Type of file
          example: image/jpeg
        fileuri:
          type: string
          description: url of file
          example: https://storage.googleapis.com/testbucket/file1.jpeg
        fileName:
          maxLength: 120
          minLength: 0
          type: string
          description: name of file
          example: file1.jpeg
    ParticipantsDTO:
      type: object
      description: participants Dto
      properties:
        userIds:
          uniqueItems: true
          type: array
          description: list of Users
          example:
            - 1
            - 2
          items:
            type: integer
            description: list of Users
            format: int32
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleDTO"
    PlatformRecipientDTO:
      type: object
      properties:
        platformUserId:
          minimum: 1
          type: string
          description: user Id
        platformRoleId:
          minimum: 1
          type: string
          description: role Id
        platformSiteId:
          minimum: 1
          type: string
          description: site Id
        platformDepartmentId:
          minimum: 1
          type: string
          description: department Id
        platformRegionId:
          minimum: 1
          type: string
          description: region Id
    AttachmentPlatformDto:
      required:
        - fileName
        - fileuri
      type: object
      properties:
        size:
          type: integer
          description: size of file in bytes
          format: int32
          example: 921000
        duration:
          type: integer
          description: duration of audio/video in milliseconds
          format: int32
          example: 120000
        mimetype:
          type: string
          description: mime Type of file
          example: image/jpeg
        fileuri:
          type: string
          description: url of file
          example: https://storage.googleapis.com/testbucket/file1.jpeg
        fileName:
          type: string
          description: name of file
          example: file1.jpeg
        id:
          type: integer
          format: int32
        createdAt:
          type: string
          format: date-time
        creatorDetails:
          $ref: "#/components/schemas/PlatformUserResponseDto"
    AssignmentPlatformResponseDTO:
      type: object
      properties:
        platformUserId:
          minimum: 1
          type: string
          description: user Id
        platformRoleId:
          minimum: 1
          type: string
          description: role Id
        platformSiteId:
          minimum: 1
          type: string
          description: site Id
        platformDepartmentId:
          minimum: 1
          type: string
          description: department Id
        platformRegionId:
          minimum: 1
          type: string
          description: region Id
        assignmentId:
          type: integer
          format: int32
          description: assignment Id
        statusId:
          type: integer
          format: int32
          description: status Id
        statusDisplayName:
          type: string
          description: status display name
        statusEnum:
          $ref: '#/components/schemas/StatusEnum'
        presence:
          $ref: "#/components/schemas/UserPresence"
    AssignmentPlatformResponse:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
        messageParams:
          type: array
          items:
            type: string
        data:
          type: object
          properties:
            users:
              type: array
              items:
                $ref: "#/components/schemas/AssignmentPlatformResponseDTO"
            departments:
              type: array
              items:
                $ref: "#/components/schemas/AssignmentPlatformResponseDTO"
            roles:
              type: array
              items:
                $ref: "#/components/schemas/AssignmentPlatformResponseDTO"
    PlatformUserResponseDto:
      type: object
      properties:
        profilePhoto:
          type: string
        presence:
          $ref: "#/components/schemas/UserPresence"
        name:
          type: string
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleDto"
        platformUserId:
          minimum: 1
          type: string
          description: user Id
        platformRoleId:
          minimum: 1
          type: string
          description: role Id
        platformSiteId:
          minimum: 1
          type: string
          description: site Id
        platformDepartmentId:
          minimum: 1
          type: string
          description: department Id
        platformRegionId:
          minimum: 1
          type: string
          description: region Id
    TaskDetailPlatformResponse:
      required:
        - scheduleType
      type: object
      properties:
        taskRecipients:
          items:
            $ref: "#/components/schemas/PlatformRecipientDTO"
        taskAttachments:
          items:
            $ref: "#/components/schemas/AttachmentPlatformDto"
        creatorDetails:
          $ref: "#/components/schemas/PlatformUserResponseDto"
    RepeatScheduleRequestDTO:
      required:
        - scheduleType
      type: object
      properties:
        scheduleType:
          type: string
          description: cron expression for the schedule
          example: "WEEKLY, DO_NOT_REPEAT, MONTHLY, DAILY"
          enum:
            - DO_NOT_REPEAT
            - DAILY
            - WEEKLY
            - MONTHLY
        scheduleEndDate:
          type: string
          description: end date for the schedule
          format: date-time
        scheduleDayOfWeek:
          type: string
          description: day of the week for weekly schedules
          example: MONDAY
          enum:
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
            - SUNDAY
        scheduleDateOfMonth:
          maximum: 31
          minimum: 1
          type: integer
          description: date of the month for monthly schedules
          format: int32
          example: 15
    RoleDTO:
      required:
        - depId
        - roleId
        - siteId
      type: object
      properties:
        siteId:
          minimum: 1
          type: integer
          description: site Id
          format: int32
          example: 1
        depId:
          minimum: 1
          type: integer
          description: department Id
          format: int32
          example: 1
        roleId:
          minimum: 1
          type: integer
          description: role Id
          format: int32
          example: 1
    StatusEnum:
      type: string
      description: status of task
      example: DRAFT
      enum:
        - DRAFT
        - PENDING_APPROVAL
        - REJECTED
        - LAUNCHED
        - APPROVED
        - NEW
        - READ
        - COMPLETED
        - OVERDUE
        - EXPIRED
        - RECALLED
        - PENDING_LAUNCH
        - COMPLETED_LATE
        - ONGOING
        - DISCARDED
        - APPLIED
    TagDTO:
      required:
        - name
      type: object
      properties:
        name:
          maxLength: 50
          minLength: 0
          type: string
          description: name of tag
      description: list of tags
    TaskAttributesRequestDto:
      required:
        - attribute
        - value
      type: object
      properties:
        attribute:
          type: string
          description: attribute Name
          example: CONFIDENTIAL
          enum:
            - SCHEDULE_CRON
            - SCHEDULE_START_DATE
            - SCHEDULE_END_DATE
            - SCHEDULE_EVENT_ID
            - TIME_SENSITIVE
            - TIME_END
            - APPROVE_IN_ORDER
            - APPROVALS_REQUIRED
            - CONFIDENTIAL
            - ORIGINATION_TEMPLATE_TASK_ID
            - RESET_AFTER_EDIT
            - TASK_EXPIRE_DAYS
        value:
          type: string
          description: "based on the attribute, type for value could be text,boolean,date\
            \ or integer"
          example: "true"
    DisplayDate:
      type: object
      properties:
        naturalDay:
          type: string
        weekDay:
          type: string
        overdueTime:
          type: string
        date:
          type: string
        time:
          type: string
    RoleDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
        name:
          type: string
    TaskDTO:
      type: object
      properties:
        id:
          type: integer
          format: int32
          description: identifier of task
        title:
          type: string
          description: title for task
        description:
          type: string
          description: description for task
        overdue:
          type: boolean
          description: flag to indicate if task is overdue
        customerId:
          type: integer
          format: int32
          description: customer Id
        surveyId:
          type: integer
          format: int32
          description: survey Id
        taskTypeId:
          type: integer
          format: int32
          description: task Type Id
        taskType:
          type: string
          enum:
            - TASK
            - PLAIN_TEXT
            - WALK
            - CHECKLIST
            - SURVEY
            - ANNOUNCEMENT
          description: task Type
        priorityId:
          type: integer
          format: int32
          description: priority Id for task
        priority:
          type: string
          description: priority for task
        status:
          type: string
          description: status for Task
        template:
          type: boolean
          description: task template
        createdBy:
          type: integer
          format: int32
          description: task created by user Id
        startDate:
          type: string
          format: date-time
          description: start Date for task
        dueDate:
          type: string
          format: date-time
          description: due date for task
        visibleDate:
          type: string
          format: date-time
          description: visible date for task
        expireDate:
          type: string
          format: date-time
          description: expiry Date for task
        expireDays:
          type: integer
          format: int64
          description: no of days that will be used to calculate expireDate for an todo  by adding it to dueDate
        totalAssignments:
          type: integer
          format: int32
          description: total number of assignements for task
        completedAssignments:
          type: integer
          format: int32
          description: number of completed assignments for task
        creatorDetails:
          $ref: "#/components/schemas/UserResponseDto"
          description: details of task creator
        editedStatus:
          type: boolean
          description: status of edited task
        displayDate:
          $ref: "#/components/schemas/DisplayDate"
          description: display date of task
        isWatching:
          type: boolean
          description: flag to indicate if current user is watching the task
    TaskUpdateResponseDTO:
      type: object
      properties:
        message:
          type: string
          description: response message
        status:
          type: string
          description: response status
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
          description: response status code
        debugErrorMessage:
          type: string
          description: error message
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR60- Error updating To-Do.","ERROR403_03-You do not have permission to perform this action.","ERROR71-To-Do launched, cannot be updated.","ERROR72-To-Do deleted, cannot be updated.","ERROR78-Error while creating task, assignee site should belong to creator current site."]
        messageParams:
          type: array
          items:
            type: string
          description: message parameters
        data:
          type: object
        taskId:
          type: integer
          format: int32
          description: identifier of task
        clonedTask:
          $ref: "#/components/schemas/TaskDTO"
          description: details of cloned task
    UserPresence:
      type: object
      properties:
        state:
          type: integer
          format: int32
          description: state for user
        status:
          type: string
          description: status for user
        updatedAt:
          type: string
          format: date-time
          description: date and time when user information is updated
    UserResponseDto:
      type: object
      properties:
        userId:
          type: integer
          format: int32
        firstName:
          type: string
        lastName:
          type: string
        employeeId:
          type: string
        profilePhoto:
          type: string
        presence:
          $ref: "#/components/schemas/UserPresence"
        roleId:
          type: integer
          format: int32
        siteId:
          type: integer
          format: int32
        roleName:
          type: string
        alias:
          type: string
        name:
          type: string
        siteName:
          type: string
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleDto"
    TaskLaunchResponseDTO:
      type: object
      properties:
        taskId:
          type: integer
          format: int32
          description: identifier of task
        message:
          type: string
          description: response message
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR61- Error launching To-Do.","ERROR73-To-Do has been deleted.","ERROR74-To-Do has been launched.","ERROR76-Recipients not found."]
    AnnouncementPlatformRequestDTO:
      type: object
      properties:
        taskType:
          type: string
          description: task type
          example: ANNOUNCEMENT
          enum:
            - ANNOUNCEMENT
        title:
          maxLength: 222
          minLength: 0
          type: string
          description: title for announcement
          example: Create Purchase Orders
        description:
          type: string
          description: description for announcement
          example: Create Purchase Orders
        startDate:
          type: string
          description: start date for announcement
          format: date-time
        dueDate:
          type: string
          description: due date for announcement
          format: date-time
        priority:
          type: string
          description: priority for announcement
          example: STANDARD
          enum:
            - URGENT
            - IMPORTANT
            - STANDARD
        status:
          $ref: "#/components/schemas/StatusEnum"
        recipients:
          type: array
          items:
            $ref: "#/components/schemas/PlatformRecipientDTO"
        expiryLimitInDays:
          minimum: 1
          type: integer
          description: no of days that will be used to calculate expireDate for an announcement by adding it to dueDate
          format: int32
          example: 10
        sendNow:
          type: boolean
          description: if true announcement will be sent immediately, else announcement will be visible after start date
    AnnouncementResponseDTO:
      type: object
      properties:
        message:
          type: string
          description: response message
        status:
          type: string
          description: response status
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
          description: response status code
        debugErrorMessage:
          type: string
          description: error message
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR62- Error launching announcement.","ERROR44-Error creating announcement.","ERROR45-Error updating announcement.","Error49-Error deleting announcement"]
        messageParams:
          type: array
          items:
            type: string
          description: message parameters
        data:
          type: object
        announcementId:
          type: integer
          format: int32
          description: announcement Id
    Direction:
      type: string
      description: direction of Sort
      example: ASC
      enum:
        - ASC
        - DESC
    TaskSortByEnum:
      type: string
      description: field on which sorting needs to be applied
      example: DEFAULT
      enum:
        - DUE_DATE
        - PRIORITY
        - STATUS
        - START_DATE
        - CREATED_AT
        - TITLE
        - DEFAULT
    ToDoListForYouRequestDto:
      required:
        - fromDate
        - page
        - pageSize
      type: object
      properties:
        fromDate:
          type: string
          description: From Date(must be between visible and expire dates)
          format: date-time
        toDate:
          type: string
          description: To Date(must be between visible and expire dates)
          format: date-time
        statusId:
          uniqueItems: true
          type: array
          description: Status ID's
          example:
            - 1
            - 2
          items:
            type: integer
            description: Status ID's
            format: int32
        priorityId:
          uniqueItems: true
          type: array
          description: Priority ID array
          example:
            - 1
            - 2
          items:
            type: integer
            description: Priority ID array
            format: int32
        page:
          type: integer
          description: page Number
          format: int32
          example: 1
        pageSize:
          type: integer
          description: no of records per page
          format: int32
          example: 10
        sortBy:
          $ref: "#/components/schemas/TaskSortByEnum"
        sortDir:
          $ref: "#/components/schemas/Direction"
        taskTypeIds:
          uniqueItems: true
          type: array
          description: task type ids on which we need to apply filter
          example:
            - 1
            - 4
          items:
            type: integer
            description: task type ids on which we need to apply filter
            format: int32
        allFilterFlag:
          type: string
          description: To Do DropDown Filter Flag
          example: ALL
          enum:
            - ALL
            - TODAY
            - TOMORROW
            - NEXT_7_DAYS
            - NEXT_30_DAYS
            - OVERDUE
            - Overdue
            - All
            - Today
            - Tomorrow
        searchTitle:
          type: string
          description: Search Title Heading
        filterSiteIdList:
          uniqueItems: true
          type: array
          description: List of site IDs to filter tasks when siteFilterEnum is FILTER_SITES
          example:
            - 1
            - 2
            - 3
          items:
            type: integer
            description: List of site IDs to filter tasks when siteFilterEnum is FILTER_SITES
            format: int32
        siteFilterEnum:
          $ref: "#/components/schemas/SiteFilterEnum"
        pageable:
          $ref: "#/components/schemas/PageableObject"
        statusEnumSet:
          uniqueItems: true
          type: array
          items:
            type: string
            enum:
              - DRAFT
              - PENDING_APPROVAL
              - REJECTED
              - LAUNCHED
              - APPROVED
              - NEW
              - READ
              - COMPLETED
              - OVERDUE
              - EXPIRED
              - RECALLED
              - PENDING_LAUNCH
              - COMPLETED_LATE
              - ONGOING
              - DISCARDED
              - APPLIED
    ToDoListRequestCommonDto:
      required:
        - fromDate
        - page
        - pageSize
      type: object
      properties:
        fromDate:
          type: string
          description: from Date (must be between visible and expire dates)
          format: date-time
        toDate:
          type: string
          description: to Date (must be between visible and expire dates)
          format: date-time
        statusId:
          type: array
          description: status ID's
          example:
            - 1
            - 2
          items:
            type: integer
            description: status ID's
            format: int32
        priorityId:
          type: array
          description: priority ID array
          example:
            - 1
            - 2
          items:
            type: integer
            description: priority ID array
            format: int32
        page:
          type: integer
          description: page Number
          format: int32
          example: 1
        pageSize:
          type: integer
          description: number of records per page
          format: int32
          example: 10
        sortBy:
          $ref: "#/components/schemas/TaskSortByEnum"
        sortDir:
          $ref: "#/components/schemas/Direction"
        taskTypeIds:
          type: array
          description: task type ids on which we need to apply filter
          example:
            - 1
            - 4
          items:
            type: integer
            description: task type ids on which we need to apply filter
            format: int32
        allFilterFlag:
          type: string
          enum:
            - ALL
            - TODAY
            - TOMORROW
            - NEXT_7_DAYS
            - NEXT_30_DAYS
            - OVERDUE
    ToDoListForYouPlatformRequestDto:
      required:
        - fromDate
        - page
        - pageSize
      type: object
      properties:
        fromDate:
          type: string
          description: From Date(must be between visible and expire dates)
          format: date-time
        toDate:
          type: string
          description: To Date(must be between visible and expire dates)
          format: date-time
        statusId:
          uniqueItems: true
          type: array
          description: Status ID's
          example:
            - 1
            - 2
          items:
            type: integer
            description: Status ID's
            format: int32
        priorityId:
          uniqueItems: true
          type: array
          description: Priority ID array
          example:
            - 1
            - 2
          items:
            type: integer
            description: Priority ID array
            format: int32
        page:
          type: integer
          description: page Number
          format: int32
          example: 1
        pageSize:
          type: integer
          description: no of records per page
          format: int32
          example: 10
        sortBy:
          $ref: "#/components/schemas/TaskSortByEnum"
        sortDir:
          $ref: "#/components/schemas/Direction"
        taskTypeIds:
          uniqueItems: true
          type: array
          description: task type ids on which we need to apply filter
          example:
            - 1
            - 4
          items:
            type: integer
            description: task type ids on which we need to apply filter
            format: int32
        allFilterFlag:
          type: string
          description: To Do DropDown Filter Flag
          example: ALL
          enum:
            - ALL
            - TODAY
            - TOMORROW
            - NEXT_7_DAYS
            - NEXT_30_DAYS
            - OVERDUE
            - Overdue
            - All
            - Today
            - Tomorrow
        searchTitle:
          type: string
          description: Search Title Heading
        filterSiteIdList:
          uniqueItems: true
          type: array
          description: List of sites to filter tasks when siteFilterEnum is FILTER_SITES
          example: "[SiteA, SiteB, SiteC]"
          items:
            type: string
            description: List of sites to filter tasks when siteFilterEnum is FILTER_SITES
            example: "[SiteA, SiteB, SiteC]"
        siteFilterEnum:
          $ref: "#/components/schemas/SiteFilterEnum"
        pageable:
          $ref: "#/components/schemas/PageableObject"
        statusEnumSet:
          uniqueItems: true
          type: array
          items:
            type: string
            enum:
              - DRAFT
              - PENDING_APPROVAL
              - REJECTED
              - LAUNCHED
              - APPROVED
              - NEW
              - READ
              - COMPLETED
              - OVERDUE
              - EXPIRED
              - RECALLED
              - PENDING_LAUNCH
              - COMPLETED_LATE
              - ONGOING
              - DISCARDED
              - APPLIED
    CustomerPriorityResponseDTO:
      type: object
      properties:
        priorityId:
          type: integer
          format: int32
          description: priority Id
        value:
          type: integer
          format: int32
          description: priority value
        name:
          type: string
          description: name of Priority
        displayName:
          type: string
          description: display Name of Priority
    CustomerStatusResponseDTO:
      type: object
      properties:
        id:
          type: integer
          format: int32
          description: customer status Id
        name:
          type: string
          description: customer status name
        displayName:
          type: string
          description: customer status display name
    ToDoListForYouResponseDto:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
        messageParams:
          type: array
          items:
            type: string
        data:
          type: object
        paginationMap:
          $ref: "#/components/schemas/PaginationMap"
        tasks:
          type: array
          items:
            $ref: "#/components/schemas/ToDoListForYouResultDto"
    ToDoListForYouResultDto:
      type: object
      properties:
        inboxType:
          type: string
          description: inbox Type
        taskId:
          type: integer
          format: int32
          description: task Id
        title:
          type: string
          description: task title
        priority:
          $ref: "#/components/schemas/CustomerPriorityResponseDTO"
          description: priority of Task
        dueDate:
          type: string
          format: date-time
        status:
          $ref: "#/components/schemas/CustomerStatusResponseDTO"
        assignmentId:
          type: integer
          format: int32
        assignmentName:
          type: string
        editedStatus:
          type: boolean
        resetStatus:
          type: boolean
        overdue:
          type: boolean
        surveyId:
          type: integer
          format: int32
        confidential:
          type: boolean
        isTimeSensitive:
          type: boolean
        taskType:
          type: string
    MsgLaunchRequestDto:
      type: object
      required:
        - taskId
      properties:
        taskId:
          minimum: 1
          type: integer
          description: task id which is to be launched.
          format: int32
        resettable:
          type: boolean
          description: flag to add reset after edit task attribute
    AnnouncementLaunchRequestDto:
      type: object
      required:
        - announcementId
      properties:
        announcementId:
          minimum: 1
          type: integer
          description: announcement id which is to be launched.
          format: int32
        sendNow:
          type: boolean
          description: flag to send notifications immediately
    AddTemplatePublishToDTO:
      required:
        - templateTitle
      type: object
      properties:
        userIds:
          type: array
          description: list of Users
          example:
            - 1
            - 2
          items:
            type: integer
            description: list of Users
            format: int32
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleDTO"
        templateTitle:
          type: string
          description: title of the template
          example: Template Title
        size:
          type: integer
          format: int32
    AttachmentCreateUpdateRequestDTO:
      type: object
      description: attachments assigned to entities (V3/V4 format with fileHash)
      properties:
        fileHash:
          type: string
          description: hash of the file (obtained from file upload API)
          example: "abc123def456"
    TaskCreateResponseDTO:
      type: object
      properties:
        message:
          type: string
          description: response message
        status:
          type: string
          description: response status
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
          description: response status code
        debugErrorMessage:
          type: string
          description: error message
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR01- Start date can not be in the past.", "ERROR02-Due date can not be in the past.", "ERROR03-Due date should be after the start date.","ERROR04-Please add an assignee before [launching/submitting] To-Do","ERROR05-Visible date can not be in the past.","ERROR06-Title can not exceed 120 characters.","ERROR07-File name can not exceed 120 characters.","ERROR08-Please select a priority.","ERROR09-Please select a due date.","ERROR403_02-You do not have permission to perform this action.","ERROR403_05-You do not have permission to perform this action.","ERROR403_06-You do not have permission to perform this action.","ERROR40-Error creating To-Do."]
        messageParams:
          type: array
          items:
            type: string
          description: message Parameters
        data:
          type: object
        taskId:
          type: integer
          format: int32
          description: identifier of task
    TaskCloneResponseDTO:
      type: object
      properties:
        clonedTask:
          $ref: "#/components/schemas/TaskResponseDTO"
        message:
          type: string
          description: response message
        status:
          type: string
          description: response status
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
          description: response status code
        debugErrorMessage:
          type: string
          description: error message
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR01- Start date can not be in the past.", "ERROR02-Due date can not be in the past.", "ERROR03-Due date should be after the start date.","ERROR04-Please add an assignee before [launching/submitting] To-Do","ERROR05-Visible date can not be in the past.","ERROR06-Title can not exceed 120 characters.","ERROR07-File name can not exceed 120 characters.","ERROR08-Please select a priority.","ERROR09-Please select a due date.","ERROR403_02-You do not have permission to perform this action.","ERROR403_05-You do not have permission to perform this action.","ERROR403_06-You do not have permission to perform this action.","ERROR40-Error creating To-Do."]
        messageParams:
          type: array
          items:
            type: string
          description: message parameters
        data:
          type: object
        taskId:
          type: integer
          format: int32
          description: identifier of task
    PaginationMap:
      type: object
      properties:
        totalElements:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
        last:
          type: boolean
        first:
          type: boolean
        currentPage:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
    FollowingViewFiltersEnum:
      type: string
      description: view filter that needs to be applied
      example: ALL
      enum:
        - ALL
        - WATCHING
        - CREATED_BY_ME
        - SITE_ID
    TaskFollowingRequestDTO:
      required:
        - fromDate
        - page
        - pageSize
        - sortBy
        - sortDir
      type: object
      properties:
        fromDate:
          type: string
          description: From Date(must be between visible and expire dates)
          format: date-time
        toDate:
          type: string
          description: To Date(must be between visible and expire dates)
          format: date-time
        statusId:
          type: array
          description: Status ID's
          example:
            - 1
            - 2
          items:
            type: integer
            description: Status ID's
            format: int32
        priorityId:
          type: array
          description: Priority ID array
          example:
            - 1
            - 2
          items:
            type: integer
            description: Priority ID array
            format: int32
        page:
          type: integer
          description: page Number
          format: int32
          example: 1
        pageSize:
          type: integer
          description: no of records per page
          format: int32
          example: 10
        sortBy:
          $ref: "#/components/schemas/TaskFollowingSortByEnum"
        sortDir:
          $ref: "#/components/schemas/Direction"
        viewFilter:
          $ref: "#/components/schemas/FollowingViewFiltersEnum"
        taskViewAllPermissions:
          type: boolean
          description: Task View All Permissions
          example: false
        taskTypeIds:
          type: array
          description: task type ids on which we need to apply filter
          example:
            - 1
            - 4
          items:
            type: integer
            description: task type ids on which we need to apply filter
            format: int32
        calendarView:
          type: boolean
        siteFilterEnum:
          $ref: "#/components/schemas/SiteFilterEnum"
        allFilterFlag:
          type: string
          enum:
            - ALL
            - TODAY
            - TOMORROW
            - NEXT_7_DAYS
            - NEXT_30_DAYS
            - OVERDUE
        filterSiteIdList:
          uniqueItems: true
          type: array
          items:
            type: integer
            format: int32
        pageable:
          $ref: "#/components/schemas/PageableObject"
        statusEnumSet:
          uniqueItems: true
          type: array
          items:
            type: string
            enum:
              - DRAFT
              - PENDING_APPROVAL
              - REJECTED
              - LAUNCHED
              - APPROVED
              - NEW
              - READ
              - COMPLETED
              - OVERDUE
              - EXPIRED
              - RECALLED
              - PENDING_LAUNCH
              - COMPLETED_LATE
              - ONGOING
              - DISCARDED
              - APPLIED
    TaskFollowingSortByEnum:
      type: string
      description: field on which sorting needs to be applied
      example: DEFAULT
      enum:
        - DUE_DATE
        - PRIORITY
        - STATUS
        - START_DATE
        - CREATED_AT
        - TITLE
        - UPDATED_AT
        - DEFAULT
    SiteFilterEnum:
      type: string
      description: Filter Site Options
      example: ALL_SITES
      enum:
        - ALL_SITES
        - CURRENT_SITE
        - FILTER_SITES
    PageableObject:
      type: object
      properties:
        offset:
          type: integer
          format: int64
        sort:
          type: array
          items:
            $ref: '#/components/schemas/SortObject'
        paged:
          type: boolean
        pageSize:
          type: integer
          format: int32
        pageNumber:
          type: integer
          format: int32
        unpaged:
          type: boolean
    SortObject:
      type: object
      properties:
        direction:
          type: string
        nullHandling:
          type: string
        ascending:
          type: boolean
        property:
          type: string
        ignoreCase:
          type: boolean
    TaskListResponseDTO:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
            - UNPROCESSABLE_ENTITY
            - CONFLICT
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
        messageParams:
          type: array
          items:
            type: string
        paginationMap:
          $ref: '#/components/schemas/PaginationMap'
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/TaskResponseDTO'
        data:
          type: object
    TaskResponseDTO:
      type: object
      properties:
        taskId:
          type: integer
          format: int32
        title:
          type: string
        description:
          type: string
        priority:
          $ref: "#/components/schemas/CustomerPriorityResponseDTO"
        dueDate:
          type: string
          format: date-time
        status:
          $ref: "#/components/schemas/CustomerStatusResponseDTO"
        assignmentId:
          type: integer
          format: int32
        approvalAssignmentId:
          type: integer
          format: int32
        assignmentName:
          type: string
        watcher:
          type: boolean
        confidential:
          type: boolean
        updatedAt:
          type: string
          format: date-time
        editedStatus:
          type: boolean
        resetStatus:
          type: boolean
        taskType:
          type: string
    ResponsePayload:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR12-To-Do has expired.","ERROR13-To-Do has been recalled.","ERROR14-Complete all checklist items.","ERROR15-Error updating status.","ERROR16-Error fetching assignment.","ERROR55-Error updating status.","ERROR59-To-do is already completed by {name}","ERROR75-To-Do has been Recalled.","ERROR17-To-Do can not be reassigned as it has been completed.","ERROR18-This To-Do is confidential and can not be reassigned.","ERROR19-Error while reassigning.","ERROR36-Current assignee's site id doesn't match","ERROR20-This To-Do can not be recalled as it has not been launched.","ERROR21-Error while recalling To-Do.","ERROR35-Please select a reason type while recalling a task","ERROR58-To-do can not be recalled."]
        messageParams:
          type: array
          items:
            type: string
        data:
          type: object
    AttachmentDto:
      required:
        - fileName
        - fileuri
      type: object
      properties:
        size:
          type: integer
          description: size of file in bytes
          format: int32
          example: 921000
        duration:
          type: integer
          description: duration of audio/video in milliseconds
          format: int32
          example: 120000
        mimetype:
          type: string
          description: mime Type of file
          example: image/jpeg
        fileuri:
          type: string
          description: url of file
          example: https://storage.googleapis.com/testbucket/file1.jpeg
        fileName:
          type: string
          description: name of file
          example: file1.jpeg
        id:
          type: integer
          format: int32
        createdAt:
          type: string
          format: date-time
        creatorDetails:
          $ref: "#/components/schemas/UserResponseDto"
    AssignmentStatusRequestDto:
      required:
        - status
        - assignmentId
      type: object
      properties:
        assignmentId:
          type: integer
          description: assignment id of task on which status is to be updated.
          format: int32
        status:
          type: string
          description: status of task
          example: READ
          enum:
            - DRAFT
            - PENDING_APPROVAL
            - REJECTED
            - LAUNCHED
            - APPROVED
            - NEW
            - READ
            - COMPLETED
            - OVERDUE
            - EXPIRED
            - RECALLED
            - PENDING_LAUNCH
            - COMPLETED_LATE
            - ONGOING
            - DISCARDED
            - APPLIED
        undo:
          type: boolean
          description: undo the status
        offlineActionTimestamp:
          type: string
          description: >-
            The time when the user acted on the task while the device was
            offline
          format: date-time
    AttachmentAddRequestDTO:
      required:
        - fileHash
      type: object
      properties:
        fileHash:
          type: string
          description: Hash of file
          example: f5160b088f2650b1398b5d13e41a42ec6cc36521
        id:
          minimum: 0
          type: integer
          format: int32
    TaskHistoryRequestDto:
      type: object
      required:
        - taskId
        - isWatcher
      properties:
        taskId:
          type: integer
          description: task Id
          format: int32
        page:
          type: integer
          description: current page number
          format: int32
        pageSize:
          type: integer
          description: number of records in one page
          format: int32
        isWatcher:
          type: boolean
          description: whether the current user is a watcher for the given task id
    AssignmentHistoryRequestDto:
      type: object
      required:
        - assignmentId
      properties:
        assignmentId:
          type: integer
          description: assignment Id
          format: int32
        page:
          type: integer
          description: current page number
          format: int32
        pageSize:
          type: integer
          description: number of records in one page
          format: int32
    HistoryListResponseDto:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
        messageParams:
          type: array
          items:
            type: string
        paginationMap:
          $ref: '#/components/schemas/PaginationMap'
        history:
          type: array
          items:
            $ref: "#/components/schemas/HistoryResponseDto"
    HistoryResponseDto:
      type: object
      properties:
        historyTypeId:
          type: integer
          format: int32
        eventTime:
          type: string
          format: date-time
        userId:
          type: integer
          format: int32
        firstName:
          type: string
        lastName:
          type: string
        name:
          type: string
        alias:
          type: string
        employeeId:
          type: string
        profilePhoto:
          type: string
        presence:
          $ref: "#/components/schemas/UserPresence"
        roleId:
          type: integer
          format: int32
        roleName:
          type: string
        siteName:
          type: string
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleDto"
        fromAssign:
          $ref: "#/components/schemas/AssignmentNamesDto"
        toAssign:
          $ref: "#/components/schemas/AssignmentNamesDto"
        reason:
          type: string
        id:
          type: integer
          format: int32
        isResetAfterEdit:
          type: boolean
        isCompleteRecallOrReset:
          type: boolean
    AssignmentNamesDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
          description: id
        siteId:
          type: integer
          format: int32
          description: site Id
        depId:
          type: integer
          format: int32
          description: department Id
        roleId:
          type: integer
          format: int32
          description: role Id
        userId:
          type: integer
          format: int32
          description: user Id
        groupId:
          type: integer
          format: int32
          description: group Id
        siteName:
          type: string
          description: site name
        depName:
          type: string
          description: department Id
        roleName:
          type: string
          description: role Name
        firstName:
          type: string
          description: user first name
        lastName:
          type: string
          description: user last name
        name:
          type: string
          description: user first and last name
        alias:
          type: string
          description: user alias name
        groupName:
          type: string
          description: group name
        employeeId:
          type: string
          description: user employee Id
        userPresence:
          type: integer
          format: int32
          description: user presence Id
        profilePhoto:
          type: string
          description: user profile photo url
        presence:
          $ref: "#/components/schemas/UserPresence"
          description: user Presence
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleDto"
          description: user Roles
    HistoryDetailsResponseDTO:
      type: object
      properties:
        reasonId:
          type: integer
          format: int32
        reason:
          type: string
        comments:
          type: string
        createdAt:
          type: string
          format: date-time
        completedRecallOrReset:
          type: boolean
        historyId:
          type: integer
          format: int32
        historyTypeId:
          type: integer
          format: int32
        creatorDetails:
          $ref: "#/components/schemas/UserResponseDto"
        taskDetailHistory:
          $ref: "#/components/schemas/TaskDetailHistoryDTO"
        assigneeDistributionList:
          $ref: "#/components/schemas/AssigneeDistributionList"
    AssigneeDistributionList:
      type: object
      properties:
        users:
          type: array
          description: list of AssignmentNamesDto
          items:
            $ref: "#/components/schemas/AssignmentNamesDto"
        roles:
          type: array
          description: list of AssignmentNamesDto
          items:
            $ref: "#/components/schemas/RoleResponse"
        departments:
          type: array
          description: list of AssignmentNamesDto
          items:
            $ref: "#/components/schemas/DepartmentResponse"
    RoleResponse:
      type: object
      properties:
        sites:
          type: array
          description: list of SiteResponse
          items:
            $ref: "#/components/schemas/SiteResponse"
        name:
          type: string
          description: role name
          format: int32
          example: 1
        roleId:
          minimum: 1
          type: integer
          description: role Id
          format: int32
          example: 1
    SiteResponse:
      type: object
      properties:
        siteId:
          type: integer
          description: site Id
          format: int32
          example: 1
        name:
          type: string
          description: site name
    DepartmentResponse:
      type: object
      properties:
        depId:
          minimum: 1
          type: integer
          description: department Id
          format: int32
          example: 1
        name:
          type: string
          description: department name
          format: int32
          example: 1
        roles:
          type: array
          description: list of SiteResponse
          items:
            $ref: "#/components/schemas/RoleResponse"
        sites:
          type: array
          description: list of SiteResponse
          items:
            $ref: "#/components/schemas/SiteResponse"
    TaskDetailHistoryDTO:
      type: object
      properties:
        id:
          type: integer
          format: int32
        taskType:
          type: integer
          format: int32
        customerId:
          type: integer
          format: int32
        title:
          type: string
        description:
          type: string
        startDate:
          type: string
          format: date-time
        dueDate:
          type: string
          format: date-time
        visibleDate:
          type: string
          format: date-time
        expireDate:
          type: string
          format: date-time
        priority:
          type: string
        status:
          type: string
        requireAllToComplete:
          type: boolean
        tagsAdded:
          type: array
          items:
            $ref: "#/components/schemas/CustomerTagsEntity"
        tagsRemoved:
          type: array
          items:
            $ref: "#/components/schemas/CustomerTagsEntity"
        recipientsAdded:
          type: array
          items:
            $ref: "#/components/schemas/IAssignmentNamesDto"
        recipientsRemoved:
          type: array
          items:
            $ref: "#/components/schemas/IAssignmentNamesDto"
        attachmentsAdded:
          type: array
          items:
            $ref: "#/components/schemas/AttachmentDto"
        attachmentsRemoved:
          type: array
          items:
            $ref: "#/components/schemas/AttachmentDto"
        attributesAdded:
          type: array
          items:
            $ref: "#/components/schemas/TaskAttributeResponse"
        attributesRemoved:
          type: array
          items:
            $ref: "#/components/schemas/TaskAttributeResponse"
        attributesChanged:
          type: array
          items:
            $ref: "#/components/schemas/TaskAttributeResponse"
    TaskAttributeResponse:
      type: object
      properties:
        id:
          type: integer
          format: int32
        value:
          type: string
        attributeId:
          type: integer
          format: int32
        attribute:
          type: string
          enum:
            - SCHEDULE_CRON
            - SCHEDULE_START_DATE
            - SCHEDULE_END_DATE
            - SCHEDULE_EVENT_ID
            - TIME_SENSITIVE
            - TIME_END
            - APPROVE_IN_ORDER
            - APPROVALS_REQUIRED
            - CONFIDENTIAL
            - ORIGINATION_TEMPLATE_TASK_ID
            - RESET_AFTER_EDIT
            - TASK_EXPIRE_DAYS
        attributeName:
          type: string
    CustomerTagsEntity:
      type: object
      properties:
        id:
          type: integer
          format: int32
        customerId:
          type: integer
          format: int32
        name:
          type: string
    IAssignmentNamesDto:
      type: object
      properties:
        name:
          type: string
          description: user first and last name
        lastName:
          type: string
          description: user last name
        firstName:
          type: string
          description: user first name
        userPresence:
          type: integer
          format: int32
          description: user presence Id
        alias:
          type: string
          description: user alias name
        depName:
          type: string
          description: department name
        siteName:
          type: string
          description: site name
        roleName:
          type: string
          description: role name
        employeeId:
          type: string
          description: user employee Id
        presence:
          $ref: "#/components/schemas/UserPresence"
          description: user presence
        profilePhoto:
          type: string
          description: user profile photo url
        groupName:
          type: string
          description: group name
        id:
          type: integer
          format: int32
          description: id
        userId:
          type: integer
          format: int32
          description: user Id
        siteId:
          type: integer
          format: int32
          description: site Id
        groupId:
          type: integer
          format: int32
          description: group Id
        roleId:
          type: integer
          format: int32
          description: role Id
        depId:
          type: integer
          format: int32
          description: department Id
    TaskDuplicateRequestDto:
      type: object
      required:
        - taskId
      properties:
        taskId:
          minimum: 1
          type: integer
          format: int32
          description: id of task for which copy needs to be created
        repeatingTask:
          type: boolean
    TaskDeleteResponseDTO:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
        debugErrorMessage:
          type: string
        messageCode:
          type: string
        messageParams:
          type: array
          items:
            type: string
        taskId:
          type: integer
          format: int32
        undo:
          type: boolean
    TaskFollowingPlatformRequestDTO:
      required:
        - fromDate
        - page
        - pageSize
        - sortBy
        - sortDir
      type: object
      properties:
        fromDate:
          type: string
          description: From Date(must be between visible and expire dates)
          format: date-time
        toDate:
          type: string
          description: To Date(must be between visible and expire dates)
          format: date-time
        statusId:
          type: array
          description: Status ID's
          example:
            - 1
            - 2
          items:
            type: integer
            description: Status ID's
            format: int32
        priorityId:
          type: array
          description: Priority ID array
          example:
            - 1
            - 2
          items:
            type: integer
            description: Priority ID array
            format: int32
        page:
          type: integer
          description: page Number
          format: int32
          example: 1
        pageSize:
          type: integer
          description: no of records per page
          format: int32
          example: 10
        sortBy:
          $ref: '#/components/schemas/TaskFollowingSortByEnum'
        sortDir:
          $ref: '#/components/schemas/Direction'
        viewFilter:
          $ref: '#/components/schemas/FollowingViewFiltersEnum'
        taskViewAllPermissions:
          type: boolean
          description: Task View All Permissions
          example: false
        taskTypeIds:
          type: array
          description: task type ids on which we need to apply filter
          example:
            - 1
            - 4
          items:
            type: integer
            description: task type ids on which we need to apply filter
            format: int32
        calendarView:
          type: boolean
        siteFilterEnum:
          $ref: '#/components/schemas/SiteFilterEnum'
        allFilterFlag:
          type: string
          enum:
            - ALL
            - TODAY
            - TOMORROW
            - NEXT_7_DAYS
            - NEXT_30_DAYS
            - OVERDUE
        filterSiteIdList:
          uniqueItems: true
          type: array
          items:
            type: string
        statusEnumSet:
          uniqueItems: true
          type: array
          items:
            type: string
            enum:
              - DRAFT
              - PENDING_APPROVAL
              - REJECTED
              - LAUNCHED
              - APPROVED
              - NEW
              - READ
              - COMPLETED
              - OVERDUE
              - EXPIRED
              - RECALLED
              - PENDING_LAUNCH
              - COMPLETED_LATE
              - ONGOING
              - DISCARDED
              - APPLIED
        pageable:
          $ref: '#/components/schemas/PageableObject'
    TaskDuplicateResponseDTO:
      type: object
      properties:
        message:
          type: string
          description: response message
        status:
          type: string
          description: response status
          enum:
            - SUCCESS
            - FAIL
            - BAD_REQUEST
            - NO_CONTENT
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - INTERNAL_SERVER_ERROR
            - UNSUPPORTED_MEDIA_TYPE
        statusCode:
          type: integer
          format: int32
          description: response status code
        debugErrorMessage:
          type: string
          description: error message
        messageCode:
          type: string
          description: message codes
          items:
            type: string
            example: ["ERROR403_10 - User does not met the required permissions to duplicate task"]
        messageParams:
          type: array
          items:
            type: string
          description: message parameters
        data:
          type: object
        taskId:
          type: integer
          format: int32
          description: identifier of task
    SurveyCreateDto:
      required:
        - taskId
      type: object
      properties:
        surveyId:
          minimum: 0
          type: integer
          format: int32
        taskId:
          minimum: 0
          type: integer
          format: int32
        name:
          type: string
        surveyType:
          type: string
          enum:
            - SURVEY
            - CHECKLIST
        questions:
          type: array
          items:
            "$ref": "#/components/schemas/questions"
        deletedQuestionIds:
          uniqueItems: true
          type: array
          items:
            type: integer
            format: int32
        surveyVersion:
          "$ref": "#/components/schemas/SurveyVersionDto"
        language:
          type: string
    questions:
      type: object
      properties:
        id:
          minimum: 0
          type: integer
          format: int32
        dataType:
          type: string
          enum:
            - INTEGER
            - DECIMAL
            - STRING
            - BOOLEAN
            - JSON
            - DATE
            - TIMESTAMP
        displayType:
          type: string
          enum:
            - INPUTBOX
            - DATEPICKER
            - NUMBER_SCROLLER
            - DROPDOWN
            - MULTISELECT
            - CHECKBOX
            - RADIO
            - CONFIRM_WITH_PHOTO
        value:
          type: string
        description:
          type: string
        order:
          minimum: 0
          type: integer
          format: int32
        validation:
          "$ref": "#/components/schemas/QuestionValidationDto"
        questionOptions:
          type: array
          items:
            "$ref": "#/components/schemas/QuestionOptionDto"
        attachments:
          type: array
          items:
            "$ref": "#/components/schemas/AttachmentAddRequestDTO"
        discard:
          type: boolean
        createdFromQuestionId:
          minimum: 0
          type: integer
          format: int32
      description: New version of Question DTO with updated attachment payload
    SurveyVersionDto:
      type: object
      properties:
        surveyVersionId:
          minimum: 0
          type: integer
          format: int32
        surveyId:
          minimum: 0
          type: integer
          format: int32
        version:
          minimum: 0
          type: integer
          format: int32
    QuestionValidationDto:
      type: object
      properties:
        required:
          type: boolean
        min:
          minimum: 1
          type: integer
          format: int32
        max:
          minimum: 1
          type: integer
          format: int32
    QuestionOptionDto:
      type: object
      properties:
        id:
          minimum: 0
          type: integer
          format: int32
        options:
          type: string
        order:
          minimum: 0
          type: integer
          format: int32
        valueNum:
          type: number
        answerId:
          type: integer
          format: int32
        createdFromQuestionId:
          type: integer
          format: int32
    AnswerDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
        questionId:
          type: integer
          format: int32
        questionOptionId:
          type: integer
          format: int32
        displayType:
          type: string
          enum:
            - INPUTBOX
            - DATEPICKER
            - NUMBER_SCROLLER
            - DROPDOWN
            - MULTISELECT
            - CHECKBOX
            - RADIO
            - CONFIRM_WITH_PHOTO
        dataType:
          type: string
          enum:
            - INTEGER
            - DECIMAL
            - STRING
            - BOOLEAN
            - JSON
            - DATE
            - TIMESTAMP
        valueNum:
          type: number
        valueString:
          type: string
        valueDate:
          type: string
          format: date-time
        reason:
          type: string
        reasonTypeId:
          type: integer
          format: int32
        answerAttachments:
          type: array
          items:
            "$ref": "#/components/schemas/AttachmentAddRequestDTO"
        offlineActionTimestamp:
          type: string
          format: date-time
    ToDoCreateRequestV2Dto:
      type: object
      properties:
        title:
          maxLength: 120
          minLength: 0
          type: string
          description: Title for task
          example: Create Purchase Orders
        description:
          type: string
          description: Description for task
          example: Create Purchase Orders
        startDate:
          type: string
          description: start date for task
          format: date-time
        dueDate:
          type: string
          description: due date for task
          format: date-time
        priority:
          type: string
          description: priority for task
          enum:
            - NONE
            - URGENT
            - HIGH
            - MEDIUM
            - LOW
            - IMPORTANT
            - STANDARD
        tags:
          uniqueItems: true
          type: array
          description: List of tags
          items:
            $ref: '#/components/schemas/TagDTO'
        status:
          $ref: '#/components/schemas/StatusEnum'
        expiryLimitInDays:
          minimum: 1
          type: integer
          description: >-
            no of days that will be used to calculate expireDate for a Task by
            adding it to dueDate
          format: int32
          example: 10
        repeat:
          $ref: '#/components/schemas/RepeatScheduleRequestDTO'
        attributes:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/TaskAttributesRequestDto'
        attachments:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/AttachmentCreateUpdateRequestDTO'
        recipients:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/PlatformRecipientDTO'