-
Notifications
You must be signed in to change notification settings - Fork 1
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
Display stalled statements list in financial console #2127
base: main
Are you sure you want to change the base?
Conversation
Review app deployed to https://npq-registration-review-2127-web.test.teacherservices.cloud/ |
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.
Looks great, really nice addition 🙌 I've made a couple of minor points around the scope in the controller inline.
Another request is to add a request spec for the controller - it can be pretty minimal, just verify 200 response for authorised and 401 for unauthorised but it does need to a request spec to be checking the authorization
app/models/statement.rb
Outdated
@@ -1,4 +1,6 @@ | |||
class Statement < ApplicationRecord | |||
AUTHORISATION_GRACE_TIME = 15 * 60 |
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.
This can use rails' period utilities, ie 15.minutes
app/models/statement.rb
Outdated
@@ -41,6 +43,7 @@ class Statement < ApplicationRecord | |||
scope :unpaid, -> { with_state(%w[open payable]) } | |||
scope :paid, -> { with_state("paid") } | |||
scope :next_output_fee_statements, -> { with_state("open").with_output_fee.order(:deadline_date).where("deadline_date >= ?", Date.current) } | |||
scope :with_delayed_authorisations, -> { with_state("payable").where("marked_as_paid_at < ?", AUTHORISATION_GRACE_TIME.seconds.ago) } |
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.
This would then change to AUTHORISATION_GRACE_TIME.ago
@@ -0,0 +1,5 @@ | |||
class NpqSeparation::Admin::Finance::Statements::StaleController < NpqSeparation::AdminController | |||
def index | |||
@statements = Statement.with_delayed_authorisations |
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.
Is there a reason not to use Statements::Query like PaidController
does
Also I'm maybe missing something but you've got the pagination helper in the view but nothing seems to be passing the page into the above scope?
…ication in statement view page
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.
Looks great, but linter and some of the specs are failing?
b4a98ce
to
19aad99
Compare
Quality Gate passedIssues Measures |
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.
LGTM 🙌
* Display stalled statements list in financial console and proper notification in statement view page * Refactor stalled statements display: specs and code
Added:
Context
Ticket: https://dfedigital.atlassian.net/browse/CPDNPQ-2440