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
    email: sigreensupport.industry@siemens.com
  version: v1
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: My Tasks
    description: My Tasks APIs
paths:
  /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
        - 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'
        '204':
          description: No Content.The request is successfully fulfilled, but no additional content is provided in the response.
          content:
            application/json: {}
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                type: string
                example:
                  type: https://developer.siemens.com/sigreen/validation-error.html
                  title: Bad request
                  status: 400
                  traceId: UUID
                  instance: /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-TASK-001
                      pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                type: string
                example:
                  type: https://developer.siemens.com/sigreen/validation-error.html
                  title: UnAuthorised1
                  status: 401
                  traceId: UUID
                  instance: /tasks/inboundPcfRequests
                  errors:
                    - detail: Invalid token, please provide appropriate token to call the API
                      code: SIG-VLD-TASK-008
                      pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                type: string
                example:
                  type: https://developer.siemens.com/sigreen/validation-error.html
                  title: Forbidden
                  status: 403
                  traceId: UUID
                  instance: /tasks/inboundPcfRequests
                  errors:
                    - detail: You are not authorized to perform the current operation
                      code: SIG-VLD-TASK-007
                      pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                type: string
                example:
                  type: https://developer.siemens.com/sigreen/validation-error.html
                  title: Internal Server Error
                  status: 500
                  traceId: UUID
                  instance: /tasks/inboundPcfRequests
                  errors:
                    - detail: Error while parsing standards
                      code: SIG-BUS-TASK-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
        - 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, 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 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 updated 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'
        '204':
          description: No Content.The request is successfully fulfilled, but no additional content is provided in the response.
          content:
            application/json: {}
        '400':
          description: Bad request.
          content:
            application/problem+json:
              schema:
                type: string
                example:
                  type: https://developer.siemens.com/sigreen/validation-error.html
                  title: Bad request
                  status: 400
                  traceId: UUID
                  instance: /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-TASK-001
                      pointer: /data/0/from
        '401':
          description: Unauthorized.
          content:
            application/problem+json:
              schema:
                type: string
                example:
                  type: https://developer.siemens.com/sigreen/validation-error.html
                  title: UnAuthorised1
                  status: 401
                  traceId: UUID
                  instance: /tasks/inboundPcfRequests
                  errors:
                    - detail: Invalid token, please provide appropriate token to call the API
                      code: SIG-VLD-TASK-008
                      pointer: /data/0/from
        '403':
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                type: string
                example:
                  type: https://developer.siemens.com/sigreen/validation-error.html
                  title: Forbidden
                  status: 403
                  traceId: UUID
                  instance: /tasks/inboundPcfRequests
                  errors:
                    - detail: You are not authorized to perform the current operation
                      code: SIG-VLD-TASK-007
                      pointer: /data/0/from
        5XX:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                type: string
                example:
                  type: https://developer.siemens.com/sigreen/validation-error.html
                  title: Internal Server Error
                  status: 500
                  traceId: UUID
                  instance: /tasks/inboundPcfRequests
                  errors:
                    - detail: Error while parsing standards
                      code: SIG-BUS-TASK-003
                      pointer: /data/0/from
components:
  schemas:
    ComponentResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ComponentTaskResponse'
        hasNext:
          type: boolean
          description: true if next page exists (page < totalPages)
          example: true
        hasPrev:
          type: boolean
          description: true if a previous page exists (page > 0)
          example: false
        page:
          type: integer
          description: The current page-number (starts with 0)
          format: int32
          example: 0
        pageNumber:
          type: integer
          description: The current page-number (starts with 1)
          format: int32
          example: 1
        size:
          type: integer
          description: The size of elements in the response
          format: int32
          example: 10
        totalPages:
          type: integer
          description: The total available pages
          format: int32
          example: 120
    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
        taskType:
          type: string
          description: Task types from company.
          example: PCF_REQUEST
          enum:
            - PCF_REQUEST
            - PCF_DATA_SHARE
        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:
      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
            - PACT V1.0.1
            - PACT V2.0.0
            - TfS V1
            - TFS V2
            - Catena-X V2
            - 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'
    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
          description: true if next page exists (page < totalPages)
          example: true
        hasPrev:
          type: boolean
          description: true if a previous page exists (page > 0)
          example: false
        page:
          type: integer
          description: The current page-number (starts with 0)
          format: int32
          example: 0
        pageNumber:
          type: integer
          description: The current page-number (starts with 1)
          format: int32
          example: 1
        size:
          type: integer
          description: The size of elements in the response
          format: int32
          example: 10
        totalPages:
          type: integer
          description: The total available pages
          format: int32
          example: 120
    ProductTaskResponse:
      required:
        - companyName
        - id
        - lastUpdatedTimeStamp
        - pcfData
        - pcfRequestedData
        - productFamily
        - 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: productName.
          example: productName
        companyName:
          type: string
          description: Requester company.
          example: companyName
        type:
          type: string
          description: Received or Sent from company.
          example: Received
          enum:
            - Received
            - Sent
        taskType:
          type: string
          description: task types from company.
          example: PCF_REQUEST
          enum:
            - PCF_REQUEST
            - PCF_DATA_SHARE
        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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
