swagger: "2.0"

info:
  version: 1.0.0
  title: API Specifications

schemes:
  - https
host: qa-bff-feature-fm.theorchard.io
paths:
  /hello/:
    get:
      summary: Check the health of the application.
      responses:
        200:
          description: 200 OK
          examples:
            application/json: { "status": "ok" }
  /{account_type}/{account_id}/artists:
    get:
      summary: Get a paginated list of artists for a label or a subaccount
      parameters:
        - in: path
          name: account_type
          required: true
          type: string
          enum:
            - label
            - subaccount
        - in: path
          name: account_id
          required: true
          type: number
        - in: query
          name: token
          required: true
          type: string
        - in: query
          name: timestamp
          required: true
          type: number
        - in: query
          name: page_limit
          required: false
          type: number
        - in: query
          name: page_offset
          required: false
          type: number
      responses:
        200:
          description: 200 OK
          schema:
            type: object
            properties:
              items:
                type: array
                items:
                  $ref: "#/definitions/Artist"
              pagination:
                  $ref: "#/definitions/Pagination"
        400:
          description: 400 Bad Parameters
        500:
          description: 500 Internal server error
  /{account_type}/{account_id}/users/{user_id}:
    get:
      summary: Get a user's information
      parameters:
        - in: path
          name: account_type
          required: true
          type: string
          enum:
            - label
            - subaccount
        - in: path
          name: account_id
          required: true
          type: number
        - in: path
          name: user_id
          required: true
          type: string
        - in: query
          name: token
          required: true
          type: string
        - in: query
          name: timestamp
          required: true
          type: number
      responses:
        200:
          description: 200 OK
          schema:
            $ref: "#/definitions/User"
        400:
          description: 400 Bad Parameters
        500:
          description: 500 Internal server error
  /{account_type}/{account_id}/artists/{artist_id}/products:
    get:
      summary: Get a paginated list of products for an artist
      parameters:
        - in: path
          name: account_type
          required: true
          type: string
          enum:
            - label
            - subaccount
        - in: path
          name: account_id
          required: true
          type: number
        - in: path
          name: artist_id
          required: true
          type: number
        - in: query
          name: token
          required: true
          type: string
        - in: query
          name: timestamp
          required: true
          type: number
        - in: query
          name: page_limit
          required: false
          type: number
        - in: query
          name: page_offset
          required: false
          type: number
      responses:
        200:
          description: 200 OK
          schema:
            type: object
            properties:
              items:
                type: array
                items:
                  $ref: "#/definitions/Release"
              pagination:
                  $ref: "#/definitions/Pagination"
        400:
          description: 400 Bad Parameters
        500:
          description: 500 Internal server error
definitions:
  Pagination:
    type: object
    properties:
      offest:
        type: number
      limit:
        type: number
      total_records:
        type: number
  Artist:
    type: object
    properties:
      id:
        type: number
      name:
        type: string
      artist_type:
        type: string
      country_id:
        type: number
      country_name:
        type: string
      genres:
        type: array
        items:
          type: string
      url:
        type: string
      social_profiles:
        type: object
        properties:
          facebook:
            type: string
          instagram:
            type: string
          spotify:
            type: string
  User:
    type: object
    properties:
      user_id:
        type: string
      first_name:
        type: string
      last_name:
        type: string
      email:
        type: number
      type:
        type: string
      language:
        type: string
      account:
        type: object
        properties:
          vendor_id:
            type: number
          subaccount_id:
            type: number
  Release:
    type: object
    properties:
      release_id:
        type: number
