Skip to content

Commit

Permalink
Add new provisional assesment report
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmhaig committed Jul 11, 2023
1 parent 26a48ac commit 67cc7b4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/models/stats/stats_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def updatable?
Report.new(name: :agfs_management_information_statistics, date_required: true),
Report.new(name: :lgfs_management_information_statistics, date_required: true),
Report.new(name: :provisional_assessment),
Report.new(name: :provisional_assessment_new),
Report.new(name: :rejections_refusals),
Report.new(name: :submitted_claims),
Report.new(name: :reports_access_details, hidden: true, updatable: false)].freeze
Expand Down
20 changes: 14 additions & 6 deletions app/services/reports/provisional_assessments_new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ProvisionalAssessmentsNew
}
].freeze

def self.call = new.call
def self.call(...) = new(...).call

def call
Claim::BaseClaim.includes(INCLUDES)
Expand All @@ -31,12 +31,20 @@ def call

private

def format_row(claim)
total = claim.total_including_vat
assessed = claim.amount_assessed
def format_row(claim) = summary_fields(claim) + extended_fields(claim)

def summary_fields(claim)
[
claim.provider.name,
claim.total_including_vat,
claim.amount_assessed,
claim.total_including_vat - claim.amount_assessed
]
end

def extended_fields(claim)
[
claim.provider.name, total, assessed, total - assessed,
claim.type.gsub(/Claim::/, ''),
claim.type.gsub('Claim::', ''),
claim.case_type.name,
claim.earliest_representation_order_date,
claim.case_workers.last.name,
Expand Down
3 changes: 2 additions & 1 deletion app/services/stats/simple_report_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def report_klass
@report_klass ||= {
provisional_assessment: Reports::ProvisionalAssessments,
rejections_refusals: Reports::RejectionsRefusals,
submitted_claims: Reports::SubmittedClaims
submitted_claims: Reports::SubmittedClaims,
provisional_assessment_new: Reports::ProvisionalAssessmentsNew
}[@report.to_sym]
end
end
Expand Down
1 change: 1 addition & 0 deletions config/locales/en/views/management_information.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ en:
management_information_v2_html: |
Management information <strong class="govuk-tag govuk-tag--blue">beta</strong>
provisional_assessment_html: Provisional assessment
provisional_assessment_new_html: Provisional assessment (New)
rejections_refusals_html: 'Rejections/Refusals'
submitted_claims_html: Submitted claims
reports_access_details_html: Reports access details
Expand Down

0 comments on commit 67cc7b4

Please sign in to comment.