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

check create_renewals_on_date_change RR configs to display warning #4555

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

vkghub
Copy link
Contributor

@vkghub vkghub commented Sep 24, 2024

PR Checklist

Please check if your PR fulfills the following requirements

  • The title follows our guidelines
  • Tests for the changes have been added (for bugfixes/features), they use let helpers and before blocks
  • For all UI changes, there is cucumber coverage
  • Any endpoint touched in the PR has an appropriate Pundit policy. For open endpoints, reasoning is documented in PR and code
  • Any endpoint modified in the PR only responds to the expected MIME types.
  • For all scripts or rake tasks, how to run it is documented on both the PR and in the code
  • There are no inline styles added
  • There are no inline javascript added
  • There is no hard coded text added/updated in helpers/views/Javascript. New/updated translation strings do not include markup/styles, unless there is supporting documentation
  • Code does not use .html_safe
  • All images added/updated have alt text
  • Doesn’t bypass rubocop rules in any way

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (requires Feature flag)
  • Data fix or migration (inert code, no impact until run)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • CI related changes
  • Dependency updates (e.g., add a new gem or update to a version)

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:

  • DC
  • ME

Additional Context

Include any additional context that may be relevant to the peer review process.

@vkghub vkghub marked this pull request as ready for review September 24, 2024 13:02
@vkghub vkghub requested review from ymhari and mdkaraman September 24, 2024 13:02
@vkghub vkghub self-assigned this Sep 24, 2024
Copy link
Contributor

@mdkaraman mdkaraman left a 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
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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?
Copy link
Contributor

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!

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