feature/IO-2979-DST-Handling
- Checkpoint Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -63,6 +63,7 @@ services:
|
|||||||
retries: 10
|
retries: 10
|
||||||
|
|
||||||
# LocalStack: Used to emulate AWS services locally, currently setup for SES
|
# LocalStack: Used to emulate AWS services locally, currently setup for SES
|
||||||
|
# Notes: Set the ENV Debug to 1 for additional logging
|
||||||
localstack:
|
localstack:
|
||||||
image: localstack/localstack
|
image: localstack/localstack
|
||||||
container_name: localstack
|
container_name: localstack
|
||||||
@@ -74,10 +75,13 @@ services:
|
|||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
environment:
|
environment:
|
||||||
- SERVICES=ses
|
- SERVICES=ses
|
||||||
- DEBUG=1
|
- DEBUG=0
|
||||||
- AWS_ACCESS_KEY_ID=test
|
- AWS_ACCESS_KEY_ID=test
|
||||||
- AWS_SECRET_ACCESS_KEY=test
|
- AWS_SECRET_ACCESS_KEY=test
|
||||||
- AWS_DEFAULT_REGION=ca-central-1
|
- AWS_DEFAULT_REGION=ca-central-1
|
||||||
|
- EXTRA_CORS_ALLOWED_HEADERS=Authorization,Content-Type
|
||||||
|
- EXTRA_CORS_ALLOWED_ORIGINS=*
|
||||||
|
- EXTRA_CORS_EXPOSE_HEADERS=Authorization,Content-Type
|
||||||
ports:
|
ports:
|
||||||
- "4566:4566"
|
- "4566:4566"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|||||||
35
nodemon.json
Normal file
35
nodemon.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"watch": [
|
||||||
|
"server.js",
|
||||||
|
"server"
|
||||||
|
],
|
||||||
|
"ignore": [
|
||||||
|
"client",
|
||||||
|
".circleci",
|
||||||
|
".platform",
|
||||||
|
".idea",
|
||||||
|
".vscode",
|
||||||
|
"_reference",
|
||||||
|
"firebase",
|
||||||
|
"hasura",
|
||||||
|
"logs",
|
||||||
|
"redis",
|
||||||
|
".dockerignore",
|
||||||
|
".ebignore",
|
||||||
|
".editorconfig",
|
||||||
|
".env.development",
|
||||||
|
".env.development.rome",
|
||||||
|
".eslintrc.json",
|
||||||
|
".gitignore",
|
||||||
|
".npmmrc",
|
||||||
|
".prettierrc.js",
|
||||||
|
"bodyshop_translations.babel",
|
||||||
|
"Dockerfile",
|
||||||
|
"ecosystem.config.js",
|
||||||
|
"job-totals-testing-util.js",
|
||||||
|
"nodemon.json",
|
||||||
|
"package.json",
|
||||||
|
"package-lock.json",
|
||||||
|
"setadmin.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -28,22 +28,4 @@ let transporter = nodemailer.createTransport({
|
|||||||
SES: { ses, aws }
|
SES: { ses, aws }
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isLocal) {
|
|
||||||
// Wrap the sendMail function to log the email contents to the console in local environment
|
|
||||||
const originalSendMail = transporter.sendMail.bind(transporter);
|
|
||||||
transporter.sendMail = async (mailOptions) => {
|
|
||||||
try {
|
|
||||||
const result = await originalSendMail(mailOptions);
|
|
||||||
console.log(
|
|
||||||
`Email sent successfully - From: ${result?.envelope?.from} - To: ${result?.envelope?.to} - MessageID ${result.messageId} - Check LocalStack to see message`
|
|
||||||
);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Failed to send email:", error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = transporter;
|
module.exports = transporter;
|
||||||
|
|||||||
@@ -324,6 +324,29 @@ const tasksRemindEmail = async (req, res) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Note: Uncomment this to test locally, it will call the remind_at email check every 20 seconds
|
||||||
|
// const callTaskRemindEmailInternally = () => {
|
||||||
|
// const req = {
|
||||||
|
// body: {
|
||||||
|
// // You can mock any request data here if needed
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// const res = {
|
||||||
|
// status: (code) => {
|
||||||
|
// return {
|
||||||
|
// json: (data) => {
|
||||||
|
// console.log(`Response Status: ${code}`, data);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// // Call the taskRemindEmail function with mock req and res
|
||||||
|
// tasksRemindEmail(req, res);
|
||||||
|
// };
|
||||||
|
// setInterval(callTaskRemindEmailInternally, 20000);
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
taskAssignedEmail,
|
taskAssignedEmail,
|
||||||
tasksRemindEmail,
|
tasksRemindEmail,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const taskEmailQueue = () =>
|
|||||||
console.log("Processing reminds for taskIds: ", taskIds.join(", "));
|
console.log("Processing reminds for taskIds: ", taskIds.join(", "));
|
||||||
|
|
||||||
// Set the remind_at_sent to the current time.
|
// Set the remind_at_sent to the current time.
|
||||||
const now = moment().toISOString();
|
const now = moment.utc().toISOString();
|
||||||
|
|
||||||
client
|
client
|
||||||
.request(UPDATE_TASKS_REMIND_AT_SENT, { taskIds, now })
|
.request(UPDATE_TASKS_REMIND_AT_SENT, { taskIds, now })
|
||||||
|
|||||||
Reference in New Issue
Block a user