const express = require('express');
const { worldConTickets, buyWorldConTicket } = require('../../controllers/members/world-con-tickets');
const { memberAuth, validation } = require('../../middlewares');
const { body } = require('express-validator');

const router = express.Router();

const postValdation = [
	body('worldConTicketId').exists().withMessage('ticketId is required'),
	body('quantity').isInt({ min: 1 }).withMessage('Quantity must be at least 1'),
	validation,
];

router.get('/', worldConTickets);
router.post('/', memberAuth, postValdation, buyWorldConTicket);

module.exports = router;
