const Project_audio_tracksService = require('../services/project_audio_tracks');
const Project_audio_tracksDBApi = require('../db/api/project_audio_tracks');
const { createEntityRouter } = require('../factories/router.factory');

/**
 *  @swagger
 *  components:
 *    schemas:
 *      Project_audio_tracks:
 *        type: object
 *        properties:
 *          source_key:
 *            type: string
 *          name:
 *            type: string
 *          slug:
 *            type: string
 *          url:
 *            type: string
 *          sort_order:
 *            type: integer
 *          volume:
 *            type: number
 */

/**
 *  @swagger
 * tags:
 *   name: Project_audio_tracks
 *   description: The Project_audio_tracks managing API
 */

/**
 *  @swagger
 *  /api/project_audio_tracks:
 *    post:
 *      security:
 *        - bearerAuth: []
 *      tags: [Project_audio_tracks]
 *      summary: Add new item
 *      requestBody:
 *        required: true
 *        content:
 *          application/json:
 *            schema:
 *              properties:
 *                data:
 *                  type: object
 *                  $ref: "#/components/schemas/Project_audio_tracks"
 *      responses:
 *        200:
 *          description: The item was successfully added
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        500:
 *          description: Some server error
 *    get:
 *      security:
 *        - bearerAuth: []
 *      tags: [Project_audio_tracks]
 *      summary: Get all project_audio_tracks
 *      responses:
 *        200:
 *          description: Project_audio_tracks list successfully received
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        500:
 *          description: Some server error
 */

/**
 *  @swagger
 *  /api/project_audio_tracks/{id}:
 *    put:
 *      security:
 *        - bearerAuth: []
 *      tags: [Project_audio_tracks]
 *      summary: Update the selected item
 *      parameters:
 *        - in: path
 *          name: id
 *          required: true
 *          schema:
 *            type: string
 *      requestBody:
 *        required: true
 *        content:
 *          application/json:
 *            schema:
 *              properties:
 *                id:
 *                  type: string
 *                data:
 *                  type: object
 *                  $ref: "#/components/schemas/Project_audio_tracks"
 *      responses:
 *        200:
 *          description: The item was successfully updated
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        404:
 *          description: Item not found
 *        500:
 *          description: Some server error
 *    delete:
 *      security:
 *        - bearerAuth: []
 *      tags: [Project_audio_tracks]
 *      summary: Delete the selected item
 *      parameters:
 *        - in: path
 *          name: id
 *          required: true
 *          schema:
 *            type: string
 *      responses:
 *        200:
 *          description: The item was successfully deleted
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        404:
 *          description: Item not found
 *        500:
 *          description: Some server error
 *    get:
 *      security:
 *        - bearerAuth: []
 *      tags: [Project_audio_tracks]
 *      summary: Get selected item
 *      parameters:
 *        - in: path
 *          name: id
 *          required: true
 *          schema:
 *            type: string
 *      responses:
 *        200:
 *          description: Selected item successfully received
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        404:
 *          description: Item not found
 *        500:
 *          description: Some server error
 */

module.exports = createEntityRouter(
  'project_audio_tracks',
  Project_audio_tracksService,
  Project_audio_tracksDBApi,
);
