Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 1130 and 1131 smdb norc tools #689

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

Gbarra9
Copy link
Collaborator

@Gbarra9 Gbarra9 commented Nov 25, 2024

This PR is related to

Reference Derived Variables Rules: https://nih.app.box.com/file/1668730770583?s=kc8ugxvosd9h5z3glinufwr0thvwlpgi


Information of updates

Reset Participant's SSN Survey

    ssnStatusFlag (126331570) - 972455046 (not started num type)
    ssnSurveyStartTime (943232079) - delete
    ssnSurveyCompletedTime (315032037) - delete
    ssnFullGiven (311580100) - no
    ssnPartialGiven (914639140) - no
    ssnFullGivenTime (454067894) - delete
    ssnPartialGivenTime (598680838) - delete

Participant Update Incentive Eligibility Update

130371375.266600170.731498909 (Payment Round, baseline, Eligible for Payment) - 353358909 (Yes)

130371375.266600170.222373868 (Payment Round, baseline, NORC Payment Eligibility) = 353358909 (Yes)

130371375.266600170.787567527 (Payment Round, baseline, auto generated date when payment eligible for payment round) -<Current ISO 8601 Timestamp>


Code changes:

Added new endpoints for dashboard API resetParticipantSurvey, checkParticipantForEligibleIncentive, and updateParticipantIncentiveEligibility

@Gbarra9 Gbarra9 marked this pull request as ready for review November 25, 2024 13:34
@Gbarra9 Gbarra9 linked an issue Nov 25, 2024 that may be closed by this pull request
Copy link
Contributor

@amber-emmes amber-emmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good, but a few comments.

utils/dashboard.js Outdated Show resolved Hide resolved
utils/firestore.js Outdated Show resolved Hide resolved
utils/firestore.js Outdated Show resolved Hide resolved
utils/firestore.js Show resolved Hide resolved
utils/firestore.js Outdated Show resolved Hide resolved
utils/firestore.js Outdated Show resolved Hide resolved
Copy link
Contributor

@amber-emmes amber-emmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

return res.status(405).json(getResponseJSON('Only POST requests are accepted!', 405));
}
let body = req.body;
const { connectId, currentPaymentRound, dateOfEligibility } = body;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does dateOfEligibility need to be null checked?

* @param {string} paymentRound - Payment round to check eligibility for participant
* @returns {object} - Object with isEligibleForIncentive boolean and participantData object
*/
const checkParticipantForEligibleIncentive = async (connectId, currentPaymentRound) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be misunderstanding part of the workflow, but why is this end-point necessary?

* @returns {object} - Object with isEligibleForIncentive boolean and participantData object
*/
const checkParticipantForEligibleIncentive = async (connectId, currentPaymentRound) => {
try {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wanted to try a simpler approach, you might be able to use the existing function that checks for incentive eligible participants (called from incentive.js) and then see if the returned object contains the participant being checked.

Copy link
Collaborator

@anthonypetersen anthonypetersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything looks fine minus the few comments - let's chat when you're back in the office

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.

NORC enable incentive eligible NORC Survey Reset Tool
3 participants