-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
feat(#8633) accept array on schedule.start_from #8639
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Can you also please add an e2e test that has a schedule with multiple fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
I think there are other ways to do it but this is a nice simple solution that solves the problem today. If you can add the e2e test I think we can call this done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of nitpicks inline but I thin we're basically there. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, loving the e2e test, thanks a lot for adding it. I just have one small request inline.
chai.expect(updWithClinic.scheduled_tasks[2]).to.deep.nested.include(expectedMessage4('scheduled')); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need to assert on the due date as well, to make sure that the correct date is picked, not just that the message gets created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've verified that by calculating difference between duedate and start_date and ensuring it matches our offset here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I mean assert on every scheduled task, maybe included the expectedMessage function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you so much for adding an e2e test, I know schedules were not covered at all so this is great addition to see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about edge cases or what could go wrong. What happens if we define start_from as an array of more than two elements? What happens if every field in the start_from array is unavailable?
Does this make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lorerod , sure we can. Some of these were already in integraiton tests. I've added more tests and also added comment and made variable names more explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @1yuv, for this change and for adding an integration test to cover the change. This PR looks excellent!
I left a comment if it makes sense to implement an edge case. But it is definitely not a blocker.
I couldn't find any issue on cht-docs to update the schedule documentation and include this new feature. I can create one and work with you on the change.
Let me know what you think.
Hi @lorerod , medic/cht-docs#1207 is the releated issue for documentation update and has been approved on medic/cht-docs#1208. Also, this change required cht-conf to be updated. Related issue for cht-conf was created here and fixed by this PR. |
Description
Allow start_from on schedule to be configured using arrays as well for fixing #8633
Code review checklist
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.