-
Notifications
You must be signed in to change notification settings - Fork 10
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
check create_renewals_on_date_change RR configs to display warning #4555
base: trunk
Are you sure you want to change the base?
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.
Added a couple comments just to share my two cents. Absolutely no blockers on this code tho. Looks good!
|
||
current_hbx = HbxProfile.current_hbx | ||
is_under_open_enrollment = current_hbx.under_open_enrollment? | ||
latest_benefit_coverage_period = current_hbx.benefit_sponsorship.benefit_coverage_periods.last |
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.
Just sharing an opinion here-- I would lean towards the use of an existing method on the model, like current_benefit_coverage_period
on the BenefitSponsorship
. I find the use of .last
as a proxy for "latest" a little fuzzy/brittle, at least in theory. Great variable name, tho; the intention is very clear!
allow(TimeKeeper).to receive(:date_of_record).and_return Date.new(oe_start_on.year,10,27) | ||
And(/^current date is between renewals generation date and open enrollment start on$/) do | ||
oe_start_on = HbxProfile.current_hbx.benefit_sponsorship.benefit_coverage_periods.detect { |bcp| bcp.start_on.year == Date.today.year }.open_enrollment_start_on | ||
allow(TimeKeeper).to receive(:date_of_record).and_return Date.new(oe_start_on.year, 10, 27) |
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.
It seems virtually impossible that the renewals generation date would be after 10/27, but just noting that we have a hardcoded date here and the renewals generation date is env variable driven.
oe_end_on = HbxProfile.current_hbx.benefit_sponsorship.benefit_coverage_periods.last.open_enrollment_end_on | ||
allow(TimeKeeper).to receive(:date_of_record).and_return Date.new(oe_end_on.year,2,15) | ||
allow(TimeKeeper).to receive(:date_of_record).and_return Date.new(oe_end_on.year, 2, 15) |
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.
Similar note as above-- there's probably no chance that the OE end date would be after 2/15, but that date is driven by a setting and this one is hardcoded.
} | ||
end | ||
|
||
def can_display_coverage_update_reminder? |
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 idea adding these helper methods to abstract the logic out of the views!
PR Checklist
Please check if your PR fulfills the following requirements
PR Type
What kind of change does this PR introduce?
What is the ticket # detailing the issue?
Ticket: https://www.pivotaltracker.com/n/projects/2640059/stories/188102453#
A brief description of the changes
Current behavior: The OE warning display logic is tied to the latest benefit coverage period data. This means when prospective year mock data is created, the warning will display even before renewal applications have been generated.
New behavior: The OE warning display is tied to the bulk application renewal trigger date so that the warning only displays when the system date is after the renewals trigger date and not yet in open enrollment.
Feature Flag
For all new feature development, a feature flag is required to control the exposure of the feature to our end users. A feature flag needs a corresponding environment variable to initialize the state of the flag. Please share the name of the environment variable below that would enable/disable the feature and which client(s) it applies to.
Variable name:
Additional Context
Include any additional context that may be relevant to the peer review process.