2020-08-07 12:23:59 +02:00
|
|
|
const express = require("express");
|
|
|
|
const router = express.Router();
|
|
|
|
|
|
|
|
const cronAuth = require("../middleware/cronAuth");
|
|
|
|
|
|
|
|
const ctrlUser = require("../controllers/user");
|
|
|
|
const ctrlPause = require("../controllers/pause");
|
|
|
|
const ctrlQuestionnaire = require("../controllers/questionnaire");
|
2020-10-12 17:51:35 +02:00
|
|
|
const ctrlGroup = require("../controllers/group");
|
2020-08-07 12:23:59 +02:00
|
|
|
const ctrlQuestion = require("../controllers/question");
|
|
|
|
const ctrlIllustration = require("../controllers/illustration");
|
|
|
|
const ctrlSubscription = require("../controllers/subscription");
|
|
|
|
|
|
|
|
// Users
|
|
|
|
router.get("/deleteloginfail/:token", cronAuth, ctrlUser.deleteLoginFail);
|
|
|
|
router.get("/deleteusersjson/:token", cronAuth, ctrlUser.deleteJsonFiles);
|
|
|
|
router.get("/deleteunvalided/:token", cronAuth, ctrlUser.deleteUnvalided);
|
|
|
|
router.get("/deleteinactiveaccounts/:token", cronAuth, ctrlUser.deleteInactiveAccounts);
|
|
|
|
|
|
|
|
// Pauses
|
|
|
|
router.get("/deleteoldpauses/:token", cronAuth, ctrlPause.deleteOldPauses);
|
|
|
|
|
|
|
|
// Subscriptions
|
|
|
|
router.get("/notifyexpirationfreeaccount/:token", cronAuth, ctrlSubscription.notifyExpirationFreeAccount);
|
|
|
|
router.get("/notifyexpirationaccount/:token", cronAuth, ctrlSubscription.notifyExpirationAccount);
|
|
|
|
router.get("/addquestionnairetouser/:token", cronAuth, ctrlSubscription.addNewQuestionnaireUsers);
|
|
|
|
|
|
|
|
// Questionnaires
|
|
|
|
router.get("/deletequestionnairesfiles/:token", cronAuth, ctrlQuestionnaire.deleteJsonFiles);
|
|
|
|
router.get("/deletequestionsfiles/:token", cronAuth, ctrlQuestion.deleteJsonFiles);
|
|
|
|
router.get("/publishquestionnaires/:token", cronAuth, ctrlQuestionnaire.checkQuestionnairesNeedToBePublished);
|
2020-10-12 17:51:35 +02:00
|
|
|
// + Groupes
|
2020-11-02 12:16:31 +01:00
|
|
|
router.get("/deletegroupsfiles/:token", cronAuth, ctrlGroup.cronDeleteJsonFiles);
|
|
|
|
router.get("/publishgroups/:token", cronAuth, ctrlGroup.cronCheckGroupsNeedToBePublished);
|
2020-08-07 12:23:59 +02:00
|
|
|
|
|
|
|
// Illustrations des questionnaires
|
|
|
|
router.get("/deleteoldillustrations/:token", cronAuth, ctrlIllustration.deleteOldFiles);
|
|
|
|
|
|
|
|
module.exports = router;
|