openapi: 3.0.1
info:
  title: TASK-DATA-SERVICE
  description: >-
    This API specification serves as reference within SiGREEN project for how to
    design and specify HTTPs-based APIs.
  contact:
    name: SiGREEN API Support
    url: https://api.sigreen-dev.siemens.cloud/
    email: sigreensupport.industry@siemens.com
  version: 1.16.0
servers:
  - url: https://app.sigreen.siemens.com/api
    description: SiGREEN Production Server
  - url: https://app-uat.sigreen-playground.siemens.cloud/api
    description: SiGREEN User Acceptance Test (UAT) Server
security:
  - bearerAuth: []
tags:
  - name: Component Tasks
    description: >-
      ![remote](https://developer.siemens.com/sigreen/images/api-package-remote-red.svg)
      Component Tasks API
  - name: Task Comments
    description: >-
      ![remote](https://developer.siemens.com/sigreen/images/api-package-remote-red.svg)
      Task Comment APIs
  - name: Product Tasks
    description: >-
      ![remote](https://developer.siemens.com/sigreen/images/api-package-remote-red.svg)
      Product Tasks API
paths:
  /tasks/{id}/sharePcf/{pcfId}:
    put:
      tags:
        - Product Tasks
      summary: Share the pcf data with the given task.
      description: >-
        Share the pcf data for the given task with a linked product. The pcf
        data must match the product.
      operationId: sharePcf
      parameters:
        - name: id
          in: path
          description: >-
            UUID of the Task to identify the product task of the company in
            SiGREEN
          required: true
          schema:
            maxLength: 36
            minLength: 0
            type: string
            example: C98BE31E-3698-412D-91E3-8270102CC7D5
        - name: pcfId
          in: path
          description: >-
            UUID of the of PCF to identify the pcf data of the company in
            SiGREEN.
          required: true
          schema:
            maxLength: 36
            minLength: 0
            type: string
            example: C98BE31E-3698-412D-91E3-8270102CC7D5
      responses:
        '204':
          description: No content.
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Bad request
                status: 400
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid Date Format. Please send valid date format (for
                      eg: yyyy-MM-dd'T'HH:mm:ss'Z')
                    code: SIG-VLD-001
                    pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: UnAuthorised
                status: 401
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid token, please provide appropriate token to call
                      the API
                    code: SIG-VLD-008
                    pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Forbidden
                status: 403
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: You are not authorized to perform the current operation
                    code: SIG-VLD-007
                    pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Internal Server Error
                status: 500
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: Error while parsing
                    code: SIG-VLD-003
                    pointer: /data/0/from
  /tasks/{id}/linkProduct/{productId}:
    put:
      tags:
        - Product Tasks
      summary: Link product to the task.
      description: >-
        Link an existing Product to the given Task. Only one product can be
        linked to a task at a time. If will fail, if a product is already linked
        to the task.
      operationId: linkProductToTask
      parameters:
        - name: id
          in: path
          description: >-
            UUID of the Task to identify the product task of the company in
            SiGREEN
          required: true
          schema:
            type: string
        - name: productId
          in: path
          description: >-
            UUID of the Product to identify the product of the company in
            SiGREEN.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No content, Product successfully linked to the task
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
      security:
        - bearerAuth: []
    delete:
      tags:
        - Product Tasks
      summary: Delete link between product and task.
      description: >-
        Delete link between product and task. Only possible before the task
        status is changed to 'PCF Shared'.
      operationId: deleteLinkedProductFromTask
      parameters:
        - name: id
          in: path
          description: >-
            UUID of the Task to identify the product task of the company in
            SiGREEN
          required: true
          schema:
            type: string
        - name: productId
          in: path
          description: >-
            UUID of the Product to identify the product of the company in
            SiGREEN.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No content, Product successfully unlinked from the task
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
      security:
        - bearerAuth: []
  /tasks/{id}/comments/{commentId}:
    put:
      tags:
        - Task Comments
      summary: Update a comment to the given task in SiGREEN.
      description: >-
        Modify an own created comment (indicated by the flag isEditable=true) to
        the given task in SiGREEN.
      operationId: updateComment
      parameters:
        - name: id
          in: path
          description: UUID of the Task to identify the task of the company in SiGREEN
          required: true
          schema:
            type: string
        - name: commentId
          in: path
          description: UUID of the Comment to identify the comment
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentDTO'
        required: true
      responses:
        '204':
          description: No content, Comment is updated.
          content:
            application/json: {}
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Bad request
                status: 400
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid Date Format. Please send valid date format (for
                      eg: yyyy-MM-dd'T'HH:mm:ss'Z')
                    code: SIG-VLD-001
                    pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: UnAuthorised
                status: 401
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid token, please provide appropriate token to call
                      the API
                    code: SIG-VLD-008
                    pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Forbidden
                status: 403
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: You are not authorized to perform the current operation
                    code: SIG-VLD-007
                    pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Internal Server Error
                status: 500
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: Error while parsing
                    code: SIG-VLD-003
                    pointer: /data/0/from
    delete:
      tags:
        - Task Comments
      summary: Delete a comment to the given task in SiGREEN.
      description: >-
        Delete an own created comment (indicated by the flag isEditable=true) to
        the given task in SiGREEN.
      operationId: deleteComment
      parameters:
        - name: id
          in: path
          description: UUID of the Task to identify the task of the company in SiGREEN
          required: true
          schema:
            type: string
        - name: commentId
          in: path
          description: UUID of the Comment to identify the comment
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content, Comment deleted.
          content:
            application/json: {}
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Bad request
                status: 400
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid Date Format. Please send valid date format (for
                      eg: yyyy-MM-dd'T'HH:mm:ss'Z')
                    code: SIG-VLD-001
                    pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: UnAuthorised
                status: 401
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid token, please provide appropriate token to call
                      the API
                    code: SIG-VLD-008
                    pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Forbidden
                status: 403
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: You are not authorized to perform the current operation
                    code: SIG-VLD-007
                    pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Internal Server Error
                status: 500
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: Error while parsing
                    code: SIG-VLD-003
                    pointer: /data/0/from
  /tasks/{id}/pcf/reject:
    patch:
      tags:
        - Component Tasks
      summary: reject proof recived to the task in SiGREEN.
      description: reject proof recived to the task in SiGREEN.
      operationId: rejectProof
      parameters:
        - name: id
          in: path
          description: >-
            UUID of the Task to identify the product task of the company in
            SiGREEN
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectProofDTO'
        required: true
      responses:
        '202':
          description: reject proof is performed.
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Bad request
                status: 400
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid Date Format. Please send valid date format (for
                      eg: yyyy-MM-dd'T'HH:mm:ss'Z')
                    code: SIG-VLD-001
                    pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: UnAuthorised
                status: 401
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid token, please provide appropriate token to call
                      the API
                    code: SIG-VLD-008
                    pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Forbidden
                status: 403
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: You are not authorized to perform the current operation
                    code: SIG-VLD-007
                    pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Internal Server Error
                status: 500
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: Error while parsing
                    code: SIG-VLD-003
                    pointer: /data/0/from
  /tasks/{id}/pcf/accept:
    patch:
      tags:
        - Component Tasks
      summary: accept proof received to the task in SiGREEN.
      description: accept proof received to the task in SiGREEN.
      operationId: acceptProof
      parameters:
        - name: id
          in: path
          description: >-
            UUID of the Task to identify the product task of the company in
            SiGREEN
          required: true
          schema:
            type: string
      responses:
        '202':
          description: accept proof is performed.
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Bad request
                status: 400
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid Date Format. Please send valid date format (for
                      eg: yyyy-MM-dd'T'HH:mm:ss'Z')
                    code: SIG-VLD-001
                    pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: UnAuthorised
                status: 401
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid token, please provide appropriate token to call
                      the API
                    code: SIG-VLD-008
                    pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Forbidden
                status: 403
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: You are not authorized to perform the current operation
                    code: SIG-VLD-007
                    pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Internal Server Error
                status: 500
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: Error while parsing
                    code: SIG-VLD-003
                    pointer: /data/0/from
  /tasks/outboundPcfRequests:
    get:
      tags:
        - Component Tasks
      summary: >-
        GET the outbound pcf requests of my company. it is recommended to make
        use of the "status" query parameter as follows
        /tasks/outboundPcfRequests?status=NEW,PCF_RECEIVED,COMPLETED.
      description: GET the outbound requests sent for company in SiGREEN.
      operationId: getAllComponentTasks
      parameters:
        - name: searchText
          in: query
          description: >-
            Free text search for outbound pcf requests that will look in the
            attribute of Task ID,component name,supplierName of a company in
            SiGREEN.
          required: false
          schema:
            type: string
        - name: componentName
          in: query
          description: Component name of the company in SiGREEN
          required: false
          schema:
            type: string
        - name: taskId
          in: query
          description: >-
            Task Id for identifying the outbound pcf request of the company in
            SiGREEN
          required: false
          schema:
            type: string
            example: T0001
        - name: id
          in: query
          description: >-
            UUID of the Task for identifying the outbound pcf request of the
            company in SiGREEN
          required: false
          schema:
            type: string
            example: C98BE31E-3698-412D-91E3-8270102CC7D5
        - name: supplierId
          in: query
          description: SupplierId of the supplier company
          required: false
          schema:
            type: string
        - name: supplierName
          in: query
          description: Name of the supplier company
          required: false
          schema:
            type: string
        - name: pcfId
          in: query
          description: Id for identifying the pcf data received in my company
          required: false
          schema:
            type: string
        - name: materialCategory
          in: query
          description: MaterialCategory of the component my company
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: >-
            Outbound pcf request status. Multiple fields could be used separated
            by commas (e.g. "PCF_RECEIVED","UNDER_REVIEW"). Available values :
            NEW, PCF_RECEIVED, UNDER_REVIEW, WITHDRAWN, COMPLETED, REJECTED_PCF,
            DENIED, CANCELLED
          required: false
          schema:
            type: string
        - name: from
          in: query
          description: >-
            The start date of the date range when the task was created or
            updated in SiGREEN.DateTime (ISO 8601; UTC Timezone)
          required: false
          schema:
            type: string
            format: date-time
            example: '2022-11-20T08:30:00.000Z'
        - name: to
          in: query
          description: >-
            The end date of the date range when the task was created or update
            in SiGREEN.DateTime (ISO 8601; UTC Timezone)
          required: false
          schema:
            type: string
            format: date-time
            example: '2022-11-20T08:30:00.000Z'
        - name: sort
          in: query
          description: >-
            The order of returned elements.sort supporting
            fields(taskId,componentName,supplierName,supplierId,requestTimeStamp)
            in outbound pcf requests.Descending order could be requested by
            appending '-' ,ascending '+' at the prefix of parameter.(e.g.
            '+taskId)'
          required: false
          schema:
            type: integer
            example: +taskId
        - name: page
          in: query
          description: >-
            This is an integer representing the page-number to fetch. 0 would be
            the first page.(e.g 'page=0')
          required: false
          schema:
            type: integer
            default: 0
        - name: size
          in: query
          description: This is used for the requested maximum page size.(e.g. 'size=10')
          required: false
          schema:
            type: string
            default: '10'
      responses:
        '200':
          description: Get outbound pcf requests for company in SiGREEN
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComponentResponse'
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Bad request
                status: 400
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid Date Format. Please send valid date format (for
                      eg: yyyy-MM-dd'T'HH:mm:ss'Z')
                    code: SIG-VLD-001
                    pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: UnAuthorised
                status: 401
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid token, please provide appropriate token to call
                      the API
                    code: SIG-VLD-008
                    pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Forbidden
                status: 403
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: You are not authorized to perform the current operation
                    code: SIG-VLD-007
                    pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Internal Server Error
                status: 500
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: Error while parsing
                    code: SIG-VLD-003
                    pointer: /data/0/from
      servers:
        - url: /tasks
  /tasks/inboundPcfRequests:
    get:
      tags:
        - Product Tasks
      summary: >-
        GET the incoming pcf requests  of my company. it is recommended to make
        use of the "status" query parameter as follows
        /tasks/inboundPcfRequests?status=NEW,PCF_SHARED,COMPLETED.
      description: GET the incoming pcf requests received for company in SiGREEN.
      operationId: getAllProductTasks
      parameters:
        - name: searchText
          in: query
          description: >-
            Free text search for incoming pcf requests that will look in the
            attribute of Task ID, Product name, Company Name(Requester company
            name) of a company in SiGREEN
          required: false
          schema:
            type: string
        - name: productName
          in: query
          description: Product name of the company in SiGREEN
          required: false
          schema:
            type: string
        - name: taskId
          in: query
          description: >-
            Task Id for identifying the incoming pcf request of the company in
            SiGREEN
          required: false
          schema:
            type: string
            example: T0001
        - name: id
          in: query
          description: >-
            UUID of the Task for identifying the incoming pcf request of the
            company in SiGREEN
          required: false
          schema:
            type: string
            example: C98BE31E-3698-412D-91E3-8270102CC7D5
        - name: companyName
          in: query
          description: Name of the customer company
          required: false
          schema:
            type: string
        - name: pcfId
          in: query
          description: Id for identifying the pcf data shared in my company
          required: false
          schema:
            type: string
        - name: productFamily
          in: query
          description: Product family name of the product my company
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: >-
            Inbound pcf request task status. Multiple fields could be used
            separated by commas (e.g. "NEW","PCF_SHARED").. Available values :
            NEW, ASSIGNED, PCF_SHARED, WITHDRAWN, COMPLETED, REJECTED_PCF,
            DENIED, CANCELLED
          required: false
          schema:
            type: string
        - name: from
          in: query
          description: >-
            The start date of the date range during which the task was last
            modified in SiGREEN. DateTime (ISO 8601; UTC Timezone)
          required: false
          schema:
            type: string
            format: date-time
            example: '2022-11-20T08:30:00.000Z'
        - name: to
          in: query
          description: >-
            The end date of the date range during which the task was last
            modified in SiGREEN. DateTime (ISO 8601; UTC Timezone)
          required: false
          schema:
            type: string
            format: date-time
            example: '2022-11-20T08:30:00.000Z'
        - name: sort
          in: query
          description: >-
            The order of returned elements.sort supporting
            fields(taskId,productName,companyName) for inbound pcf
            requests.Descending order could be requested by appending '-'
            ,ascending '+' at the prefix of parameter.(e.g. '+taskId)'
          required: false
          schema:
            type: string
            example: '-taskId'
        - name: page
          in: query
          description: >-
            This is an integer representing the page-number to fetch. 0 would be
            the first page.(e.g 'page=0')
          required: false
          schema:
            type: integer
            default: 0
        - name: size
          in: query
          description: This is used for the requested maximum page size. (e.g 'size=10')
          required: false
          schema:
            type: integer
            default: 10
      responses:
        '200':
          description: Get incoming pcf requests for company in SiGREEN
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Bad request
                status: 400
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid Date Format. Please send valid date format (for
                      eg: yyyy-MM-dd'T'HH:mm:ss'Z')
                    code: SIG-VLD-001
                    pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: UnAuthorised
                status: 401
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: >-
                      Invalid token, please provide appropriate token to call
                      the API
                    code: SIG-VLD-008
                    pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Forbidden
                status: 403
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: You are not authorized to perform the current operation
                    code: SIG-VLD-007
                    pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://developer.siemens.com/sigreen/validation-error.html
                title: Internal Server Error
                status: 500
                traceId: UUID
                instance: /api/tasks/inboundPcfRequests
                errors:
                  - detail: Error while parsing
                    code: SIG-VLD-003
                    pointer: /data/0/from
components:
  schemas:
    Errors:
      type: object
      properties:
        code:
          type: string
          description: >-
            An application-specific error code, expressed as a string value,
            mostly is this used for validation errors. The format and type of
            code representation MUST be harmonized across all services within
            SiGREEN. The code focuses on programs and doesn’t have to be
            human-readable.
          example: SIG_VLD-092
        detail:
          type: string
          description: >-
            Developer friendly, human-readable, detailed description specific to
            the occurrence of the problem.
          example: >-
            Invalid Date Format. Please send valid date format (for eg:
            yyyy-MM-dd'T'HH:mm:ss'Z')
        pointer:
          type: string
          description: >-
            String with a generated pointer to the wrong value; Collections
            integrated as an integer, starts with 0
          example: /data/0/from
      description: >-
        Extended error array to include descriptions about errors like
        validation errors.
    Problem:
      type: object
      properties:
        type:
          type: string
          description: >-
            A URI reference that identifies the problem type. This should be a
            human-redable documentation for the problem type (e.g. list of
            SiGREEN Validation errors). When this member is not present, its
            value is assumed to be 'about:blank'.
          example: https://developer.siemens.com/sigreen/validation-error.html
        title:
          type: string
          description: >-
            Developer friendly, human-readable description or summary that
            SHOULD NOT change from occurrence to occurrence of the problem. In
            case of using a custom HTTP status codes in the status field of the
            error object, the title MUST provide a concise description of the
            HTTP error code (for example: status: '599', title: 'Network
            Connection Timeout').
          example: Bad request
        status:
          type: integer
          description: Numeric HTTP status code for the specific error.
          format: int32
          example: 400
        instance:
          type: string
          description: >-
            A URI reference that points to the specific resource where the
            problem was identified (for example: points to the api resource
            /api/v1/products/{productId}).
          example: /api/v1/products/{productId}
        traceId:
          type: string
          description: >-
            A unique string identifier (UUID), representing a flow through the
            system.
          example: UUID
        errors:
          type: array
          description: List of detailed error objects
          items:
            $ref: '#/components/schemas/Errors'
    ErrorsDTO:
      type: object
      properties:
        detail:
          type: string
          description: >-
            Developer friendly, human-readable, detailed description specific to
            the occurrence of the problem.
          example: >-
            Invalid Date Format. Please send valid date format (for eg:
            yyyy-MM-dd'T'HH:mm:ss'Z')
        code:
          type: string
          description: >-
            trueString with a generated pointer to the wrong value; Collections
            integrated as an integer, starts with 0.
          example: SIG_VLD-092
        pointer:
          type: string
          description: >-
            An application-specific error code, expressed as a string value,
            mostly is this used for validation errors. The format and type of
            code representation MUST be harmonized across all services within
            SiGREEN. The code focuses on programs and doesn’t have to be
            human-readable.
          example: /data/0/from
    ProblemDTO:
      type: object
      properties:
        traceId:
          type: string
        type:
          type: string
        title:
          type: string
        status:
          type: integer
          format: int32
        instance:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorsDTO'
    CommentDTO:
      type: object
      properties:
        comment:
          type: string
          description: Content of the comment.
          example: comment
      description: Comment to be updated to the task
    RejectProofDTO:
      required:
        - reason
      type: object
      properties:
        reason:
          type: string
          description: deny reason.
          example: reason.
      description: Reason for rejecting the proof
    ComponentResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ComponentTaskResponse'
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
        page:
          type: integer
          format: int32
        pageNumber:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
    ComponentTaskResponse:
      type: object
      properties:
        id:
          type: string
          description: >-
            task system generated id to identify the task of the company in
            SiGREEN.
          example: UUID
        taskId:
          type: string
          description: task id.
          example: T001
        pcfRequestedData:
          $ref: '#/components/schemas/PcfRequestedData'
        pcfData:
          $ref: '#/components/schemas/PcfData'
        componentName:
          type: string
          description: componentName.
          example: componentName
        supplierName:
          type: string
          description: supplier company name.
          example: supplier Name
        type:
          type: string
          description: Received or Sent from company.
          example: Received
          enum:
            - Received
            - Sent
            - OUTBOUND
            - INBOUND
        taskType:
          type: string
          description: Task types from company.
          example: PCF_REQUEST
          enum:
            - CATENAX_PCF_DATA_SHARE
            - PACT_PCF_DATA_SHARE
            - CATENAX_PCF_REQUEST
            - PACT_PCF_REQUEST
            - PCF_DATA_SHARE
            - PCF_REQUEST
        status:
          type: string
          description: task status.
          example: NEW
          enum:
            - NEW
            - COMPLETED
            - DENIED
            - COMPLETED_WITHDRAWN
            - PCF_RECEIVED
            - REJECTED_PCF
            - WITHDRAWN
            - UNDER_REVIEW
            - CANCELLED
        requestTimeStamp:
          type: string
          description: Pcf Request created DateTime.DateTime (ISO 8601; UTC Timezone)
          example: 2022-11-20T08:30Z
        lastUpdatedTimeStamp:
          type: string
          description: Last update DateTime.DateTime (ISO 8601; UTC Timezone)
          example: 2022-11-20T08:30Z
        materialCategory:
          type: string
          description: materialCategory of the component
          example: materialCategory
        supplierId:
          type: string
          description: supplier id
          example: supplier id
    Identifier:
      type: object
      properties:
        type:
          maxLength: 100
          minLength: 0
          type: string
          description: MLFB.
          example: MLFB
        value:
          maxLength: 100
          minLength: 0
          type: string
          description: ABC-UVW-1234.
          example: ABC-UVW-1234
      description: >-
        Additional product identifiers gives more information regarding the 
        product pcf data to be shared.
      example:
        - type: ean
          value: '4667'
    PcfData:
      type: object
      properties:
        pcfId:
          type: string
          description: pcfId of PCF data.
          example: pcfId
        standards:
          type: array
          description: Pcf format or standards of the pcf data shared.
          example:
            - TFS V2
            - PACT V2.0.0
          items:
            type: string
            description: Pcf format or standards of the pcf data shared.
            example: '["TFS V2","PACT V2.0.0"]'
    PcfRequestedData:
      required:
        - productName
        - supplierProductId
      type: object
      properties:
        location:
          maxLength: 100
          minLength: 0
          type: string
          description: Expecting pcf data for the declared location.
          example: location
        declaredUnit:
          type: string
          description: Expecting pcf data for the declared unit.
          example: kg
        standards:
          type: string
          description: Expecting pcf data for the declared pcf format or standards.
          example: TFS V2
          enum:
            - ISO 14067
            - Together for Sustainability
            - Catena-X
            - Catena X
            - Unspecified
            - WBCSD Pathfinder v1
            - Catena-X V2
            - PACT V1.0.1
            - PACT V2.0.0
            - PACT V2.2.0
            - TfS V1
            - TFS V2
            - Catena-X V2.2
            - EPD Style
            - Catena-X V1
            - Not specified
        message:
          maxLength: 300
          minLength: 0
          type: string
          description: >-
            Requesting pcf data with message, which gives more information
            regarding the  product pcf data to be shared.
          example: PCF request message
        identifiers:
          type: array
          description: >-
            Additional product identifiers gives more information regarding the 
            product pcf data to be shared.
          example:
            - type: ean
              value: '4667'
          items:
            $ref: '#/components/schemas/Identifier'
        supplierProductId:
          type: string
          description: supplierProductId for the task
          example: supplierProductId
        productName:
          type: string
          description: Supplier Product Name regarding the product pcf data to be shared.
          example: Simatics PL7
        geographySubRegion:
          type: string
          description: Expecting pcf data for the declared geography sub region.
          example: geographySubRegion
    ProductPcfData:
      required:
        - pcfId
      type: object
      properties:
        pcfId:
          type: string
          description: pcfId of PCF data.
          example: pcfId
    ProductResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ProductTaskResponse'
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
        page:
          type: integer
          format: int32
        pageNumber:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
    ProductTaskResponse:
      required:
        - companyName
        - id
        - lastUpdatedTimeStamp
        - pcfData
        - pcfRequestedData
        - productFamily
        - productId
        - productName
        - requestTimeStamp
        - status
        - taskId
        - taskType
        - type
      type: object
      properties:
        id:
          type: string
          description: >-
            task system generated id to identify the task of the company in
            SiGREEN.
          example: UUID
        taskId:
          type: string
          description: task id.
          example: T001
        pcfRequestedData:
          $ref: '#/components/schemas/PcfRequestedData'
        pcfData:
          $ref: '#/components/schemas/ProductPcfData'
        productName:
          type: string
          description: Linked Product, Name of the Product
          example: productName
        companyName:
          type: string
          description: Requester company.
          example: companyName
        type:
          type: string
          description: Received or Sent from company.
          example: Received
          enum:
            - Received
            - Sent
            - OUTBOUND
            - INBOUND
        taskType:
          type: string
          description: task types from company.
          example: PCF_REQUEST
          enum:
            - CATENAX_PCF_DATA_SHARE
            - PACT_PCF_DATA_SHARE
            - CATENAX_PCF_REQUEST
            - PACT_PCF_REQUEST
            - PCF_DATA_SHARE
            - PCF_REQUEST
        status:
          type: string
          description: task status.
          example: NEW
          enum:
            - NEW
            - COMPLETED
            - DENIED
            - COMPLETED_WITHDRAWN
            - PCF_SHARED
            - REJECTED_PCF
            - WITHDRAWN
            - CANCELLED
            - ASSIGNED
        requestTimeStamp:
          type: string
          description: Pcf Request created DateTime.DateTime (ISO 8601; UTC Timezone)
          example: 2022-11-20T08:30Z
        lastUpdatedTimeStamp:
          type: string
          description: Last update DateTime.DateTime (ISO 8601; UTC Timezone)
          example: 2022-11-20T08:30Z
        productFamily:
          type: string
          description: productFamily of the product
          example: productFamily
        productId:
          type: string
          description: >-
            Linked Product, UUID to identify the product of the company in
            SiGREEN
          example: productId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
