-
Notifications
You must be signed in to change notification settings - Fork 7
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
AP 663 Proceed to substantive application #593
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.
Nice work on the Bank holidays. Would be an ideal candidate for a gem.
app/models/bank_holiday.rb
Outdated
|
||
def self.dates | ||
BankHolidayUpdateWorker.perform_in 10.seconds | ||
instance = by_updated_at.last || create |
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.
create!
with an exclamation mark?
😃
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.
Damn! I was so pleased with myself for using save!
in the worker. I even did a quick "Check for non-bang save methods before Julien's spots them" check.
end | ||
|
||
def save | ||
super && model.provider_used_delegated_functions! |
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'm a bit uneasy by putting the change of state here because I think that for all the other states it's done in the controller.
So for consistency sake, it would be better to follow the same pattern.
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.
And it would mean the overloading of save
would no longer be necessary. Nice one.
def dates(group) | ||
return if data.empty? | ||
|
||
data.dig(group, 'events')&.map { |details| details['date'] } |
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.
would .pluck('date')
work instead of .map { |details| details['date'] }
?
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.
Yes - it might well do.
d0d73c2
to
11c86c8
Compare
11c86c8
to
ae130bb
Compare
AP-663
Main change
Adds a page to the providers journey (after
used_delegated_functions
if the provider selects "Yes") that allows the provider to choose between continuing with a substantive application, or returning later.Knock on change
If the provider chooses to return later they are prompted with a date in the future by which they should complete the application. That date is "the current day plus 10 working days". To work that out I needed to:
WorkingDayCalculator
). This uses thebusiness
gemBankHolidayRetriever
and stored in a modelBankHoliday
BankHolidayUpdateWorker
) is triggered on callingBankHoliday.dates
that:updated_at
of theBankHoliday
instance holding that data.BankHoliday
instance to store the data