license controller ready

parent e1cadbc7
......@@ -299,6 +299,25 @@ COMMENT="Students information";
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `license`
--
CREATE TABLE IF NOT EXISTS `license` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_stu` int(11) DEFAULT NULL,
`number` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`activation_ts` timestamp(3) NULL,
`duration` int(11) DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `number` (`number`),
KEY `id_stu` (`id_stu`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=19
COMMENT="Student license number";
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `stu_picto`
--
......@@ -509,6 +528,11 @@ ALTER TABLE `student`
ADD CONSTRAINT `student_ibfk_1` FOREIGN KEY (`id_off`) REFERENCES `office` (`id`);
--
-- Filtros para la tabla `license`
--
ALTER TABLE `license`
ADD CONSTRAINT `license_fk_1` FOREIGN KEY (`id_stu`) REFERENCES `student` (`id`);
--
-- Filtros para la tabla `supervisor`
--
ALTER TABLE `supervisor`
......
......@@ -111,6 +111,13 @@ module.exports.policies = {
delete_picto: ['tokenAuth', 'isSupervisorOfStudent']
},
LicenseController: {
/* create: ['tokenAuth', 'isAdmin'],
activate: ['tokenAuth']*/
create: true,
activate: true
},
SupervisorController: {
list: ['tokenAuth', 'isAdmin'],
students: ['tokenAuth'],
......
......@@ -39,6 +39,9 @@ module.exports.routes = {
'POST /instruction/template': 'MetaInstructionController.create',
'DELETE /instruction/template/:id': 'MetaInstructionController.destroy',
'POST /license': 'LicenseController.create',
'PUT /license/:number': 'LicenseController.activate',
'PUT /method/:id': 'MethodController.update',
'POST /method': 'MethodController.create',
'POST /method/new': 'MethodController.newMethod',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment