Renamed variables to describe purpose.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
const db = require("../../models/index");
|
||||
const sequelize = require("sequelize");
|
||||
const Op = sequelize.Op;
|
||||
const { CHECK_UP_DAYS } = require("../../config/appConfig");
|
||||
const { NO_CHECK_UP_DAYS } = require("../../config/appConfig");
|
||||
|
||||
const findRealEstatesForSearchRequest = async searchRequestId => {
|
||||
const query = {
|
||||
@@ -45,9 +45,9 @@ const findNotNotifiedMatches = async () => {
|
||||
};
|
||||
const findAllRequestsForCheckUp = async () => {
|
||||
//First we find IDs of search request that don't need to be emailed for check up - to EXCLUDE
|
||||
//The ones that received notification for real estate CHECK_UP_DAYS days from now
|
||||
//The ones that received notification for real estate NO_CHECK_UP_DAYS days from now
|
||||
const date = new Date();
|
||||
const checkUpDate = date.getDate() - CHECK_UP_DAYS;
|
||||
const checkUpDate = date.getDate() - NO_CHECK_UP_DAYS;
|
||||
date.setDate(checkUpDate);
|
||||
const dateQuery = {
|
||||
createdAt: {
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
const {
|
||||
MAX_REAL_ESTATES_IN_EMAIL,
|
||||
APP_URL,
|
||||
STAGING
|
||||
USE_KIVI_ENVIRONMENT_TAG
|
||||
} = require("../config/appConfig");
|
||||
const { AD_CATEGORY, AD_TYPE, EMAIL_FREQUENCY } = require("../common/enums");
|
||||
|
||||
//Tag to recognize staging from development
|
||||
const stagingTag = STAGING ? "[STAGING] " : "";
|
||||
//Tag to recognize staging from development if needed
|
||||
const stagingTag = USE_KIVI_ENVIRONMENT_TAG ? "[STAGING] " : "";
|
||||
|
||||
const generateEmailFooter = (searchRequestId, emailFrequencyTitle) => {
|
||||
return ` <div>Trenutno ste prijavljeni da obavještenja o novim nekretninama primate <strong>${emailFrequencyTitle.toLowerCase()} </strong>.</div>
|
||||
|
||||
Reference in New Issue
Block a user