diff --git a/backend/index.js b/backend/index.js
index 6a549189..05c8778a 100644
--- a/backend/index.js
+++ b/backend/index.js
@@ -8,6 +8,7 @@ const learningPathsEnrolmentRoute = require('./views/routes/LearningPathEnrolmen
const logoutRoutes = require('./views/routes/Users');
const sequelize = require('sequelize');
const extractStudentsRoutes = require('./views/routes/Extract');
+const registrationPeriod = require('./views/routes/RegistrationPeriod')
require("dotenv").config();
const app = express();
@@ -21,6 +22,7 @@ app.use('/learningpath', learningPathRoute);
app.use('/api', logoutRoutes);
app.use('/send-file', extractStudentsRoutes);
app.use('/learningpathenrolment', learningPathsEnrolmentRoute);
+app.use('/registration-period', registrationPeriod)
let test = process.env.DB_USERNAME;
diff --git a/backend/migrations/registrationPeriod.js b/backend/migrations/registrationPeriod.js
index 5ee75fa7..f01e01a9 100644
--- a/backend/migrations/registrationPeriod.js
+++ b/backend/migrations/registrationPeriod.js
@@ -10,15 +10,8 @@ module.exports = {
await queryInterface.createTable(register, {
co_registration_period: { type: Sequelize.INTEGER, autoIncrement: true, primaryKey: true },
ds_is_open: { type: Sequelize.BOOLEAN, defaultValue: false, allowNull: false},
- ds_name: { type: Sequelize.TEXT, allowNull: false},
- ds_start: { type: Sequelize.DATE, allowNull: false,
- set(value) {
- this.setDataValue('ds_start', value ? new Date(value) : null);
- }},
- ds_end: { type: Sequelize.DATE, allowNull: false,
- set(value) {
- this.setDataValue('ds_end', value ? new Date(value) : null);
- }},
+ ds_start: { type: Sequelize.STRING, allowNull: false},
+ ds_end: { type: Sequelize.STRING, allowNull: false},
})
await transaction.commit()
}catch (e) {
diff --git a/backend/models/schemas/RegistrationPeriod.js b/backend/models/schemas/RegistrationPeriod.js
index 3e59fe24..ffe6f106 100644
--- a/backend/models/schemas/RegistrationPeriod.js
+++ b/backend/models/schemas/RegistrationPeriod.js
@@ -6,11 +6,6 @@ module.exports = (sequelize, DataTypes) => {
primaryKey: true,
autoIncrement: true
},
- name: {
- field: "ds_name",
- type: DataTypes.TEXT,
- allowNull: false
- },
isOpen: {
field: "ds_is_open",
type: DataTypes.BOOLEAN,
diff --git a/backend/views/routes/RegistrationPeriod.js b/backend/views/routes/RegistrationPeriod.js
new file mode 100644
index 00000000..6bff088c
--- /dev/null
+++ b/backend/views/routes/RegistrationPeriod.js
@@ -0,0 +1,7 @@
+const express = require('express');
+const router = express.Router();
+const RegistrationPeriodController = require('../../controllers/SuperuserController');
+
+router.post("/create", RegistrationPeriodController.openRegistrationPeriod);
+
+module.exports = router;
diff --git a/frontend/src/pages/RegistrationPeriod/index.js b/frontend/src/pages/RegistrationPeriod/index.js
new file mode 100644
index 00000000..77fef995
--- /dev/null
+++ b/frontend/src/pages/RegistrationPeriod/index.js
@@ -0,0 +1,99 @@
+import React from "react";
+import { Container, Flex, FormControl, FormLabel, Input, FormHelperText, Text, Center} from "@chakra-ui/react";
+import ButtonCadastrar from "../../components/Button";
+import { useFormik } from "formik";
+import * as yup from "yup";
+import axios from "axios";
+import { useToast } from "@chakra-ui/react";
+import * as C from "./styles";
+import Header from "../../components/Header/index.js";
+import Footer from "../../components/Footer/index.js";
+import { ChakraProvider } from "@chakra-ui/react";
+
+import { Link } from "react-router-dom";
+
+
+
+const RegistrationPeriod = () => {
+ const navigate = useNavigate();
+ const toast = useToast();
+
+ const [showAlert, setShowAlert] = useState(false);
+ const [isLoading, setIsLoading] = useState(true);
+
+
+ return (
+
+
+
+
+
+
+
+ PERÍODO DE MATRÍCULA
+
+
+
+
+ Data de Início
+
+
+ Hora de Ínicio
+
+
+ Data de Fim
+
+
+ Hora de Fim
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default RegistrationPeriod;
diff --git a/frontend/src/pages/RegistrationPeriod/styles.js b/frontend/src/pages/RegistrationPeriod/styles.js
new file mode 100644
index 00000000..b7a9cba7
--- /dev/null
+++ b/frontend/src/pages/RegistrationPeriod/styles.js
@@ -0,0 +1,10 @@
+import styled from "styled-components";
+
+export const titulo = styled.div`
+ font-size: 150%;
+ font-weight: 600;
+ color: #243A69;
+ margin-left: 20px;
+ margin-top: 20px;
+ align: center;
+`;
\ No newline at end of file
diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js
index db0e7db5..a8b643e2 100644
--- a/frontend/src/routes/index.js
+++ b/frontend/src/routes/index.js
@@ -12,6 +12,7 @@ import CreateTrilhas from "../pages/CreateTrilhas";
import ExclusionTrilhas from "../pages/ExclusionTrilhas";
import Recommendations from "../pages/Recommendations";
import SendStudent from "../pages/SendStudents";
+import RegistrationPeriod from "../pages/RegistrationPeriod"
const RoutesApp = () => {
const { isAuthenticated, isSuperUser } = useAuth();
@@ -23,7 +24,7 @@ const RoutesApp = () => {
} />
} />
- {!isSuperUser() ? (
+ {isSuperUser() ? (
<>
{
!isAuthenticated() ? :
}
/>
+ :
+ }
+ />
>
) : (