Skip to content

Commit

Permalink
Add bill type to report
Browse files Browse the repository at this point in the history
I think this is the correct value
  • Loading branch information
jrmhaig committed Jul 11, 2023
1 parent 3650c42 commit b6d1db4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
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,
'TBD - Bill type',
claim.type.gsub('Claim::', ''),
claim.case_type.name,
claim.earliest_representation_order_date,
claim.case_workers.last.name,
Expand Down
2 changes: 1 addition & 1 deletion spec/services/reports/provisional_assessments_new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
it { expect(call.first[1]).to eq(claim.total_including_vat) }
it { expect(call.first[2]).to eq(claim.amount_assessed) }
it { expect(call.first[3]).to eq(claim.total_including_vat - claim.amount_assessed) }
# it { expect(call.first[4]).to eq(Bill type) }
it { expect(call.first[4]).to eq('AdvocateClaim') }
it { expect(call.first[5]).to eq(claim.case_type.name) }
it { expect(call.first[6]).to eq(claim.earliest_representation_order_date) }
it { expect(call.first[7]).to eq(claim.case_workers.last.name) }
Expand Down

0 comments on commit b6d1db4

Please sign in to comment.