swagger: '2.0'

info:
  title: API Specifications
  version: 1.0.0

schemes:
  - https
host: qa-ows-product-configuration.theorchard.io
basePath: /
paths:
  /distribution-format-media:
    get:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: >
            HTTP 200 OK.

            --------------------

            JSON object containing list of distribution format media type ids
            and names.
        '400':
          description: |
            HTTP 400 Bad Request
            --------------------
            Request parameter/header validation failure.
      description: Return the full list of distribution format media types
  /distribution-format-media-format:
    get:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: >
            HTTP 200 OK.

            --------------------

            JSON object containing list of distribution format media format ids
            and names.
        '400':
          description: |
            HTTP 400 Bad Request
            --------------------
            Request parameter/header validation failure.
      description: Return the full list of distribution format media formats
  /distribution-formats:
    get:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: |
            HTTP 200 OK.
            --------------------
            JSON object containing list of distribution formats.
        '400':
          description: |
            HTTP 400 Bad Request
            --------------------
            Request parameter/header validation failure.
      description: Return the full list of distribution formats
  /public/distribution-formats:
    get:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: |
            HTTP 200 OK.
            --------------------
            JSON object containing list of distribution formats.
        '400':
          description: |
            HTTP 400 Bad Request
            --------------------
            Request parameter/header validation failure.
      description: Return the full list of distribution formats
  /hello/:
    get:
      responses:
        '200':
          description: 200 OK
      description: Check the health of the application.
  '/supply-chain/{supply_chain_id}/distribution-format/{distribution_format_id}':
    get:
      parameters:
        - in: path
          name: supply_chain_id
          required: true
          type: string
        - in: path
          name: distribution_format_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: >
            HTTP 200 OK.

            --------------------

            JSON object containing supply chain codes for given distribution
            format id.
        '400':
          description: |
            HTTP 400 Bad Request
            --------------------
            Request parameter/header validation failure.
        '404':
          description: |
            HTTP 404 Not Found
            --------------------
            Supply Chain Id does not match any existing supply chain
                                    or
            Distribution Format Id does not match an existing format
      description: Retrieve full list of distribution format ids and supply chain codes
  '/supply-chain/{supply_chain_id}/distribution-formats':
    get:
      parameters:
        - in: path
          name: supply_chain_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: >
            HTTP 200 OK.

            --------------------

            JSON array of objects containing distribution format ids and supply
            chain codes
        '400':
          description: |
            HTTP 400 Bad Request
            --------------------
            Request parameter/header validation failure.
        '404':
          description: |
            HTTP 404 Not Found
            --------------------
            Supply chain id does not match any existing supply chain
      description: Retrieve full list of distribution format ids and supply chain codes
  /supply-chains:
    get:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: >
            HTTP 200 OK.

            --------------------

            JSON array of objects containing supply chain info and configuration
            schema
        '400':
          description: |
            HTTP 400 Bad Request
            --------------------
            Request parameter/header validation failure.
      description: Retrieve full list of supply chains with configuration schemas
  /supply-chains/defaults:
    get:
      description: Retrieve all the supply chain defaults for returnability from the supply_chain_defaults table.
      parameters:
      - name: Correlation-Id
        description: UUID
        in: header
        required: false
        type: string
      - name: Content-Type
        in: header
        required: false
        type: string
        pattern: ^application/json$
      - name: Orchard-User-Id
        description: oa/alw
        in: header
        required: true
        type: string
      responses:
        '200':
          description: >
            HTTP 200 OK.

            --------------------

            JSON object representing store wise defaults
            for the Returnability and Return Disposition.
            example:

            ```json
              {
                738: [
                      {
                           distribution_format_media_id: 5,
                           is_returnable: true,
                           return_disposition: “Keep”
                      },
                      {
                           distribution_format_media_id: 1,
                           is_returnable: false,
                           return_disposition: “Scrap”
                      },
                      {
                           distribution_format_media_id: 2,
                           is_returnable: false,
                           return_disposition: “Scrap”
                      },
                      {
                           distribution_format_media_id: 3,
                           is_returnable: false,
                           return_disposition: “Scrap”
                      }
                     ],
                739: [
                       {
                          distribution_format_media_id: 5,
                          is_returnable: true,
                          return_disposition: “Keep”
                       },
                       {
                          distribution_format_media_id: 1,
                          is_returnable: true,
                          return_disposition: “Keep”
                       },
                       {
                          distribution_format_media_id: 2,
                          is_returnable: true,
                          return_disposition: “Keep”
                       },
                       {
                          distribution_format_media_id: 3,
                          is_returnable: false,
                          return_disposition: “Keep”
                       }
                   ]
              }

            ```
          headers:
            Correlation-Id:
              description: UUID to correlate logs (echoes back correlation_id from request header).
              type: string
            Content-Type:
              description: Content-Type to correlate logs (echoes back content_type from request header).
              type: string
definitions: {}
securityDefinitions: {}
