Minor refactoring + move hardcoded template names and handling based mustache variables into a const collection for ease of modification/access

This commit is contained in:
Tina_Azure
2023-05-02 17:44:23 +02:00
parent a800fb07d4
commit 4720ffdad5
5 changed files with 112 additions and 62 deletions

View File

@ -0,0 +1,56 @@
#ifndef TEMPLATE_CONST_COLLECTION_CPP
#define TEMPLATE_CONST_COLLECTION_CPP
#include <string>
namespace TemplateConstCollection {
//Template Names
const static std::string TEMPLATE_ALIAS_REDIRECT = "alias_Redirect.html";
//Customer Templates
const static std::string TEMPLATE_CUSTOMER_INDEX_FREELANCER_LISTING = "customerIndex_FreelancerListing.html";
const static std::string TEMPLATE_CUSTOMER_FREELANCER_LISTING = "customer_FreelancerListing.html";
const static std::string TEMPLATE_CUSTOMER_FREELANCER_LISTING_NOT_FOUND = "customer_FreelancerListing_NOTFOUND.html";
const static std::string TEMPLATE_CUSTOMER_FREELANCER_TEMPLATE = "customer_Freelancer_Template.html";
const static std::string TEMPLATE_CUSTOMER_FREELANCER_TEMPLATE_REQUEST = "customer_Freelancer_Template_Request.html";
const static std::string TEMPLATE_CUSTOMER_FREELANCER_TEMPLATE_REQUEST_FULFILMENT = "customer_Freelancer_Template_Request_Fulfilment.html";
const static std::string TEMPLATE_CUSTOMER_FREELANCER_TEMPLATE_REQUEST_FULFILMENT_ERROR = "customer_Freelancer_Template_Request_Fulfilment_ERROR.html";
//Freelancer Templates
const static std::string TEMPLATE_FREELANCER_SIGN_UP = "freelancer_Signup.html";
const static std::string TEMPLATE_FREELANCER_SIGN_UP_FULFILMENT = "freelancer_Signup_Fulfilment.html";
const static std::string TEMPLATE_FREELANCER_LOGIN = "freelancer_Login.html";
const static std::string TEMPLATE_FREELANCER_LOGIN_FULFILMENT = "freelancer_Login_Fulfilment.html";
const static std::string TEMPLATE_FREELANCER_LOGIN_PASSWORD_RESET = "freelancer_Login_PasswordReset.html";
const static std::string TEMPLATE_FREELANCER_LOGIN_PASSWORD_RESET_FULFILMENT = "freelancer_Login_PasswordReset_Fulfilment.html";
const static std::string TEMPLATE_PASSWORD_RESET = "passwordReset.html";
const static std::string TEMPLATE_PASSWORD_RESET_FULFILMENT = "passwordReset_Fulfilment.html";
const static std::string TEMPLATE_FREELANCER_REDIRECT_PROFILE = "freelancer_Redirect_Profile.html";
const static std::string TEMPLATE_FREELANCER_PROFILE = "freelancer_Profile.html";
//Mustache Error/Success variable names
const static std::string MUSTACHE_ERROR_COMMISSIONS_CLOSED = "ERROR_COMMISSIONS_CLOSED";
const static std::string MUSTACHE_ERROR_TEMPLATE_NOT_FOUND = "ERROR_TEMPLATE_NOT_FOUND";
const static std::string MUSTACHE_ERROR_UNABLE_TO_CREATE_REQUEST = "ERROR_UNABLE_TO_CREATE_REQUEST";
const static std::string MUSTACHE_REQUEST_NOT_FILLED = "REQUEST_NOT_FILLED";
const static std::string MUSTACHE_LOGIN_ERROR = "LOGIN_ERROR";
const static std::string MUSTACHE_LOGIN_ERROR_EMAIL_PASS_NOT_FILLED = "LOGIN_ERROR_EMAIL_PASS_NOT_FILLED";
const static std::string MUSTACHE_LOGIN_ERROR_LOGIN_DATA_INVALID = "LOGIN_ERROR_LOGIN_DATA_INVALID";
const static std::string MUSTACHE_PASSWORD_EMPTY = "PASSWORD_EMPTY";
const static std::string MUSTACHE_PASSWORD_RESET_DOES_NOT_EXIST = "PASSWORD_RESET_DOES_NOT_EXIST";
const static std::string MUSTACHE_PASSWORD_RESET_EXPIRED = "PASSWORD_RESET_EXPIRED";
const static std::string MUSTACHE_PASSWORD_RESET_PASS_CONFIRMATION = "PASSWORD_RESET_PASS_CONFIRMATION";
const static std::string MUSTACHE_REGISTRATION_ERROR = "REGISTRATION_ERROR";
const static std::string MUSTACHE_REGISTRATION_ERROR_CRITICAL = "REGISTRATION_ERROR_CRITICAL";
const static std::string MUSTACHE_REGISTRATION_ERROR_EMAIL_ALREADY_IN_USE = "REGISTRATION_ERROR_EMAIL_ALREADY_IN_USE";
const static std::string MUSTACHE_REGISTRATION_ERROR_EMAIL_NAME_PASS_NOT_FILLED = "REGISTRATION_ERROR_EMAIL_NAME_PASS_NOT_FILLED";
const static std::string MUSTACHE_REGISTRATION_ERROR_PASS_CONFIRMATION = "REGISTRATION_ERROR_PASS_CONFIRMATION";
const static std::string MUSTACHE_REGISTRATION_ERROR_QUERY = "REGISTRATION_ERROR_QUERY";
const static std::string MUSTACHE_RESET_ERROR = "RESET_ERROR";
const static std::string MUSTACHE_RESET_ERROR_CRITICAL = "RESET_ERROR_CRITICAL";
const static std::string MUSTACHE_RESET_ERROR_QUERY = "RESET_ERROR_QUERY";
const static std::string MUSTACHE_REGISTRATION_SUCCESS = "REGISTRATION_SUCCESS";
const static std::string MUSTACHE_RESET_SUCCESS = "RESET_SUCCESS";
const static std::string MUSTACHE_LOGIN_SUCCESS = "LOGIN_SUCCESS";
//Mustache Cookie variable names
const static std::string MUSTACHE_COOKIE_LOGGED_IN = "COOKIE_LOGGED_IN";
}
#endif