x-generator: NSwag v13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))
swagger: '2.0'
info:
  title: Product environmental product (PEF)
  version: 1.0.0
host: localhost:54274
schemes:
  - https
produces:
  - text/plain
  - application/json
  - text/json
paths:
  /internal/pef/{productIdentifier}:
    get:
      tags:
        - Pef
      summary: Used to fetch a specific PEF based on a specific product.
      operationId: GetProductEnvironmentalFootprint
      parameters:
        - type: string
          format: guid
          name: productIdentifier
          in: path
          required: true
          x-nullable: false
      responses:
        '200':
          x-nullable: false
          description: OK
          schema:
            $ref: '#/definitions/ProductEnvironmentalFootprint'
        '401':
          description: Unauthorized
        '504':
          description: Endpoint timed out
      security:
        - JWT Token: []
  /internal/pef:
    post:
      tags:
        - Pef
      summary: Used to create a PEF plan for one or multiple products
      operationId: AddProductEnvironmentalFootprintPlan
      consumes:
        - application/json-patch+json
        - application/json
        - text/json
        - application/*+json
      parameters:
        - name: addProductEnvironmentalFootprintPlan
          in: body
          required: true
          schema:
            $ref: '#/definitions/AddProductEnvironmentalFootprintPlan'
          x-nullable: false
      responses:
        '200':
          x-nullable: false
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/ProductEnvironmentalFootprintPlan'
        '401':
          description: Unauthorized
        '504':
          description: Endpoint timed out
      security:
        - JWT Token: []
  /internal/pef/plans:
    get:
      tags:
        - Pef
      summary: Used to retreive the created PEF plans.
      operationId: GetProductEnvironmentalFootprintPlans
      responses:
        '200':
          x-nullable: false
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/ProductEnvironmentalFootprintPlan'
        '401':
          description: Unauthorized
        '504':
          description: Endpoint timed out
      security:
        - JWT Token: []
definitions:
  ProductEnvironmentalFootprint:
    type: object
    required:
      - score
      - productGroup
      - productName
      - stages
    properties:
      score:
        type: number
        format: decimal
      productGroup:
        type: string
      productName:
        type: string
      stages:
        type: array
        description: The various stages that a product has gone through (up to the point of sale).
        items:
          $ref: '#/definitions/ProductEnvironmentalFootprintStage'
  ProductEnvironmentalFootprintStage:
    type: object
    required:
      - id
      - type
      - categories
      - total
    properties:
      id:
        type: string
        format: guid
      type:
        description: Type could be an enum or a database value with it's own id for easy expansion.
        allOf:
          - $ref: '#/definitions/ProductEnvironmentalFootprintStageType'
      categories:
        type: array
        description: The various categories that impacts the product.
        items:
          $ref: '#/definitions/ProductEnvironmentFootprintCategory'
      total:
        type: number
        format: decimal
  ProductEnvironmentalFootprintStageType:
    type: string
    description: ''
    x-enumNames:
      - RawMaterials
      - Cultivation
      - Distribution
      - Storage
      - Auction
      - Retail
      - UseStage
      - EndOfLife
    enum:
      - RawMaterials
      - Cultivation
      - Distribution
      - Storage
      - Auction
      - Retail
      - UseStage
      - EndOfLife
  ProductEnvironmentFootprintCategory:
    type: object
    required:
      - id
      - type
      - numberOfUnits
      - total
    properties:
      id:
        type: string
        format: guid
      type:
        description: Type could be an enum or a database value with it's own id for easy expansion.
        allOf:
          - $ref: '#/definitions/ProductEnvironmentalFootprintCategoryType'
      numberOfUnits:
        type: number
        format: decimal
      total:
        type: number
        format: decimal
  ProductEnvironmentalFootprintCategoryType:
    type: string
    description: ''
    x-enumNames:
      - Acidification
      - ClimateChange
      - EcotoxicityFreshwater
      - ParticulateMatter
      - EutrophicationMarine
      - EutrophicationFreshwater
      - EutrophicationTerrestrial
      - HumanToxicityCancer
      - HumanToxicityNonCancer
      - IonisingRadiation
      - LandUse
      - OzoneDepletion
      - PhotochemicalOzoneFormation
      - ResourceUseFossils
      - ResourceUseMineralsAndMetals
      - WaterUse
    enum:
      - Acidification
      - ClimateChange
      - EcotoxicityFreshwater
      - ParticulateMatter
      - EutrophicationMarine
      - EutrophicationFreshwater
      - EutrophicationTerrestrial
      - HumanToxicityCancer
      - HumanToxicityNonCancer
      - IonisingRadiation
      - LandUse
      - OzoneDepletion
      - PhotochemicalOzoneFormation
      - ResourceUseFossils
      - ResourceUseMineralsAndMetals
      - WaterUse
  ProductEnvironmentalFootprintPlan:
    type: object
    required:
      - id
      - name
      - score
      - productIdentifiers
      - stages
    properties:
      id:
        type: string
        format: guid
      name:
        type: string
      score:
        type: number
        format: decimal
      productIdentifiers:
        type: array
        items:
          type: string
          format: guid
      stages:
        type: array
        description: The various stages that a product has gone through (up to the point of sale).
        items:
          $ref: '#/definitions/ProductEnvironmentalFootprintStage'
  AddProductEnvironmentalFootprintPlan:
    type: object
    required:
      - name
      - productIdentifiers
      - stages
    properties:
      name:
        type: string
      productIdentifiers:
        type: array
        items:
          type: string
          format: guid
      stages:
        type: array
        description: The various stages that a product has gone through (up to the point of sale).
        minItems: 1
        items:
          $ref: '#/definitions/AddProductEnvironmentalFootprintStage'
  AddProductEnvironmentalFootprintStage:
    type: object
    required:
      - type
      - categories
    properties:
      type:
        description: Type could be an enum or a database value with it's own id for easy expansion.
        allOf:
          - $ref: '#/definitions/ProductEnvironmentalFootprintStageType'
      categories:
        type: array
        description: The various categories that impacts the product.
        minItems: 1
        items:
          $ref: '#/definitions/AddProductEnvironmentFootprintCategory'
  AddProductEnvironmentFootprintCategory:
    type: object
    required:
      - type
      - numberOfUnits
    properties:
      type:
        description: Type could be an enum or a database value with it's own id for easy expansion.
        allOf:
          - $ref: '#/definitions/ProductEnvironmentalFootprintCategoryType'
      numberOfUnits:
        type: number
        format: decimal
        minimum: 1
securityDefinitions:
  JWT Token:
    type: apiKey
    description: 'Copy this into the value field: Bearer {token}'
    name: Authorization
    in: header
# Created by Stef Visser