Skip to content
Closed
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
44b17ed
Merge pull request #1120 from OneCommunityGlobal/development
Shreyav2000 Sep 27, 2024
ab610cd
code for carrying over additional hours to next week for core team me…
Oct 30, 2024
0aa9302
Jest setup
ArtemisNyx3 Jul 5, 2025
67d9256
starting from scratch
ArtemisNyx3 Jul 18, 2025
43ab008
initial structure for describe
ArtemisNyx3 Jul 18, 2025
c86d861
desdcribed testcases and divivded them into 2 describes
ArtemisNyx3 Jul 18, 2025
c8c625e
added todo and cleaned up dependencies
ArtemisNyx3 Jul 18, 2025
607ab84
mocked mongo server
ArtemisNyx3 Jul 18, 2025
c760f0a
Base test completed <3
ArtemisNyx3 Jul 19, 2025
a7b74e0
fixed testcase to run in mock DB
ArtemisNyx3 Jul 20, 2025
cd2c2ef
fixed mock timeentires to actually be counted
ArtemisNyx3 Jul 20, 2025
42be398
test case 2 created
ArtemisNyx3 Jul 20, 2025
1267922
add tests written
ArtemisNyx3 Jul 20, 2025
0a7362c
added more tests
ArtemisNyx3 Jul 26, 2025
4ec352d
Merge branch 'development' into Nikita-Core-Team-member’s-additional-…
ArtemisNyx3 Aug 30, 2025
02ff47f
Merge branch 'development' into Nikita-Core-Team-member’s-additional-…
ArtemisNyx3 Sep 8, 2025
f70c914
Merge branch 'development' into Nikita-Core-Team-member’s-additional-…
ArtemisNyx3 Nov 2, 2025
11a7908
mocked timezone
ArtemisNyx3 Nov 8, 2025
e3d36d1
Merge branch 'development' into Nikita-Core-Team-member’s-additional-…
ArtemisNyx3 Nov 16, 2025
342fa58
fixed issues with test data
ArtemisNyx3 Nov 16, 2025
a53c221
refactored clunky user creation code to use builder design pattern
ArtemisNyx3 Nov 23, 2025
3469c51
timeentry builder class
ArtemisNyx3 Nov 25, 2025
26df49c
refacatored Edge cases to use the new builder classes
ArtemisNyx3 Nov 25, 2025
52cc6b9
feat: Add lesson plan submission route with file upload support
ArtemisNyx3 Dec 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/helpers/userHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,6 @@ const userHelper = function () {
const assignBlueSquareForTimeNotMet = async () => {
try {
const currentFormattedDate = moment().tz('America/Los_Angeles').format();
moment.tz('America/Los_Angeles').startOf('day').toISOString();

logger.logInfo(
`Job for assigning blue square for commitment not met starting at ${currentFormattedDate}`,
);
Expand All @@ -544,7 +542,6 @@ const userHelper = function () {
.tz('America/Los_Angeles')
.startOf('week')
.subtract(1, 'week');

const pdtEndOfLastWeek = moment().tz('America/Los_Angeles').endOf('week').subtract(1, 'week');

const users = await userProfile.find(
Expand Down Expand Up @@ -999,6 +996,7 @@ const userHelper = function () {
}
};

// Function to calculate carry-forward hours for Core Team
const applyMissedHourForCoreTeam = async () => {
try {
const currentDate = moment().tz('America/Los_Angeles').format();
Expand Down Expand Up @@ -1121,6 +1119,18 @@ const userHelper = function () {
}
};

// Email body generator for Core Team notifications
const generateCoreTeamEmailBody = (user, infringement, additionalHours) => {
return `<p>Dear ${user.firstName},</p>
<p>You have received a new blue square for not meeting the required hours.</p>
<p>Infringement details:</p>
<p>${infringement.description}</p>
<p>Additional hours for next week: ${additionalHours} hours.</p>
<p>Thank you for your continued dedication.</p>
<p>Best regards,</p>
<p>One Community</p>`;
};

const deleteBlueSquareAfterYear = async () => {
const currentFormattedDate = moment().tz('America/Los_Angeles').format();

Expand Down
Loading
Loading