const Tour_pagesService = require('../services/tour_pages');
const Tour_pagesDBApi = require('../db/api/tour_pages');
const { createEntityRouter } = require('../factories/router.factory');

/**
 *  @swagger
 *  components:
 *    schemas:
 *      Tour_pages:
 *        type: object
 *        properties:
 *          source_key:
 *            type: string
 *          name:
 *            type: string
 *          slug:
 *            type: string
 *          background_image_url:
 *            type: string
 *          background_video_url:
 *            type: string
 *          background_audio_url:
 *            type: string
 *          ui_schema_json:
 *            type: string
 *          sort_order:
 *            type: integer
 */

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

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

/**
 *  @swagger
 *  /api/tour_pages/{id}:
 *    put:
 *      security:
 *        - bearerAuth: []
 *      tags: [Tour_pages]
 *      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/Tour_pages"
 *      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: [Tour_pages]
 *      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: [Tour_pages]
 *      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(
  'tour_pages',
  Tour_pagesService,
  Tour_pagesDBApi,
);
