Skip to content

Commit

Permalink
framing up year end #95
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jun 9, 2022
1 parent d4eaeaa commit 9670ae1
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handlers/admin-get/yearEnd.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { RequestHandler } from "express";
export declare const handler: RequestHandler;
export default handler;
6 changes: 6 additions & 0 deletions handlers/admin-get/yearEnd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const handler = async (_request, response) => {
response.render("admin-yearEnd", {
headTitle: "Year-End Process"
});
};
export default handler;
11 changes: 11 additions & 0 deletions handlers/admin-get/yearEnd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { RequestHandler } from "express";

export const handler: RequestHandler = async (_request, response) => {

response.render("admin-yearEnd", {
headTitle: "Year-End Process"
});
};


export default handler;
Empty file.
2 changes: 2 additions & 0 deletions public-typescript/admin-yearEnd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(() => {
})();
5 changes: 5 additions & 0 deletions public-typescript/admin-yearEnd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable unicorn/filename-case, unicorn/prefer-module */

(() => {

})();
Empty file.
5 changes: 5 additions & 0 deletions routes/admin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Router } from "express";
import * as permissionHandlers from "../handlers/permissions.js";
import * as configFunctions from "../helpers/functions.config.js";
import handler_licenceCategories from "../handlers/admin-get/licenceCategories.js";
import handler_doGetLicenceCategories from "../handlers/admin-post/doGetLicenceCategories.js";
import handler_doGetLicenceCategory from "../handlers/admin-post/doGetLicenceCategory.js";
Expand All @@ -21,6 +22,7 @@ import handler_doAddLicenceCategoryAdditionalFee from "../handlers/admin-post/do
import handler_doUpdateLicenceCategoryAdditionalFee from "../handlers/admin-post/doUpdateLicenceCategoryAdditionalFee.js";
import handler_doMoveLicenceCategoryAdditionalFee from "../handlers/admin-post/doMoveLicenceCategoryAdditionalFee.js";
import handler_doDeleteLicenceCategoryAdditionalFee from "../handlers/admin-post/doDeleteLicenceCategoryAdditionalFee.js";
import handler_yearEnd from "../handlers/admin-get/yearEnd.js";
export const router = Router();
router.get("/licenceCategories", permissionHandlers.adminGetHandler, handler_licenceCategories);
router.post("/doGetLicenceCategories", permissionHandlers.adminPostHandler, handler_doGetLicenceCategories);
Expand All @@ -43,4 +45,7 @@ router.post("/doAddLicenceCategoryAdditionalFee", permissionHandlers.adminPostHa
router.post("/doUpdateLicenceCategoryAdditionalFee", permissionHandlers.adminPostHandler, handler_doUpdateLicenceCategoryAdditionalFee);
router.post("/doMoveLicenceCategoryAdditionalFee", permissionHandlers.adminPostHandler, handler_doMoveLicenceCategoryAdditionalFee);
router.post("/doDeleteLicenceCategoryAdditionalFee", permissionHandlers.adminPostHandler, handler_doDeleteLicenceCategoryAdditionalFee);
if (configFunctions.getProperty("settings.includeYearEnd")) {
router.get("/yearEnd", permissionHandlers.adminGetHandler, handler_yearEnd);
}
export default router;
15 changes: 15 additions & 0 deletions routes/admin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Router } from "express";

import * as permissionHandlers from "../handlers/permissions.js";
import * as configFunctions from "../helpers/functions.config.js";

import handler_licenceCategories from "../handlers/admin-get/licenceCategories.js";

Expand Down Expand Up @@ -29,6 +30,8 @@ import handler_doUpdateLicenceCategoryAdditionalFee from "../handlers/admin-post
import handler_doMoveLicenceCategoryAdditionalFee from "../handlers/admin-post/doMoveLicenceCategoryAdditionalFee.js";
import handler_doDeleteLicenceCategoryAdditionalFee from "../handlers/admin-post/doDeleteLicenceCategoryAdditionalFee.js";

import handler_yearEnd from "../handlers/admin-get/yearEnd.js";

export const router = Router();


Expand Down Expand Up @@ -126,4 +129,16 @@ router.post("/doDeleteLicenceCategoryAdditionalFee",
permissionHandlers.adminPostHandler,
handler_doDeleteLicenceCategoryAdditionalFee);

/*
* Year-End
*/

if (configFunctions.getProperty("settings.includeYearEnd")) {

router.get("/yearEnd",
permissionHandlers.adminGetHandler,
handler_yearEnd);
}


export default router;
46 changes: 46 additions & 0 deletions views/admin-yearEnd.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<%- include('_header'); -%>

<nav class="breadcrumb" aria-label="Breadcrumb">
<ol>
<li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
<li><a href="#">Admin</a></li>
<li class="is-active"><a href="#" aria-current="page">
<span class="icon is-small"><i class="fas fa-calendar" aria-hidden="true"></i></span>
<span>Year-End Process</span>
</a></li>
</ol>
</nav>

<h1 class="title is-1">
Year-End Process
</h1>

<div class="panel">
<h2 class="panel-heading">
Step 1: Backup Current <%= configFunctions.getProperty("settings.licenceAliasPlural") %>
</h2>
<div class="panel-block is-block">
<div class="message is-warning">
<div class="message-body">
<p class="has-text-weight-bold">Please consider backing up your database before proceeding.</p>
<p>A backup can make rolling back a lot easier in the event of an error.</p>
</div>
</div>
</div>
<div class="panel-block is-block">
<div class="columns">
<div class="column">
<h3 class="title is-4">Reports</h3>
</div>
<div class="column">
<h3 class="title is-4">Backup</h3>
</div>
</div>
</div>
</div>

<%- include('_footerA'); -%>

<script src="<%= urlPrefix %>/javascripts/admin-yearEnd.min.js"></script>

<%- include('_footerB'); -%>

0 comments on commit 9670ae1

Please sign in to comment.