Skip to content

Conversation

@DiyaWadhwani
Copy link
Contributor

Description

This PR fixes the issue of Blue Square emails not accurately having the User's Job Title.

Related PRS (if any):

None

Main changes explained:

  • Modified code to use the latest snapshot of the user details

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Create a test file (something like src/helpers/test.js) and paste the below code in it:
require('dotenv').config();
const mongoose = require('mongoose');
const userhelper = require('./userHelper')();

(async () => {
  try {
    console.log('Connecting to MongoDB...');
    await mongoose.connect(process.env.MONGO_URI);
    console.log('Connected!');

    console.log('Looking for BS over a year old...');
    const results = await userhelper.assignBlueSquareForTimeNotMet();
  } catch (error) {
    console.error('Error:', error);
  } finally {
    console.log('Closing DB connection...');
    await mongoose.connection.close();
    process.exit(0);
  }
})();
  1. Add a console statement to verify what is returned after the db call. Something like below after line 880:
console.log("Status after adding infringement:", status);
  1. Verify with logs that the job title is being returned accurately. Manually change it in the db for any user to cross-check

@one-community one-community changed the title Diya fix(jobTitle): BS emails - User Job Title Diya 🔥 (jobTitle): BS emails - User Job Title Dec 25, 2025
@one-community one-community merged commit 28e8e6f into development Dec 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants