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

Add method in models to check for active program enrolment #46

Open
Tracked by #1557
mahalakshme opened this issue Jun 30, 2023 · 0 comments
Open
Tracked by #1557

Add method in models to check for active program enrolment #46

mahalakshme opened this issue Jun 30, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Jun 30, 2023

Usecase:
Currently when I want to check when an individual is actively enrolled in a program(say Child program) in say, in report card query, I need to do the below:
enrolment.program.name === 'Child' && _.isNil(enrolment.programExitDateTime) && !enrolment.voided

Instead I would like to have a method, in models like below:

const isActive = (programName) => {
return this.program.name === programName && _.isNil(this.programExitDateTime) && !this.voided
}

Need:

  • This is to prevent missing out checking voided or if the program is exited in rules/report card queries
  • To keep the code in rules and report card queries more concise.
  • Currently the method isActive available doesn't do all the checks.
@mahalakshme mahalakshme converted this from a draft issue Jun 30, 2023
@vinayvenu vinayvenu moved this from Focus Items to Analysis Complete in Avni Product Jun 30, 2023
@mahalakshme mahalakshme added the good first issue Good for newcomers label Mar 18, 2024
@vinayvenu vinayvenu moved this from In Analysis Review to Analysis Complete in Avni Product Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Analysis Complete
Development

No branches or pull requests

1 participant