Skip to content

Commit

Permalink
Merge pull request #906 from Crown-Commercial-Service/BUG/FMFR-1374-l…
Browse files Browse the repository at this point in the history
…s-rates-issue

FMFR-1374 - LS rates issue
  • Loading branch information
tim-s-ccs authored Jun 12, 2023
2 parents 9f13e41 + 9a330c7 commit a169f0a
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class SuppliersController < LegalServices::SuppliersController
private

def fetch_rate_card
@supplier.rates.where(lot_number: params[:lot])
@supplier.rate_card(params[:lot], params[:jurisdiction])
end

def fetch_suppliers
Expand Down
4 changes: 4 additions & 0 deletions app/models/legal_services/rm6240/supplier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def self.set_service_codes(lot_number, service_numbers)

Service.where(lot_number: lot_number, service_number: service_numbers).map(&:service_code)
end

def rate_card(lot_number, jurisdiction)
rates.where(lot_number:, jurisdiction:)
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Feature: Legal services - Central governemnt - Lot 1 - Supplier rates

Scenario Outline: Check the supplier has different rates in different jurisdictions
Given I sign in and navigate to the start page for the 'RM6240' framework in 'legal services'
Then I am on the 'Do you work for central government?' page
And I select 'Yes'
And I click on 'Continue'
Then I am on the 'Do you hold an approval secured from the Government Legal Department (GLD) to use this framework?' page
And I select 'Yes'
And I click on 'Continue'
Then I am on the 'Select the lot you need' page
And I select 'Lot 1 - Full service provision'
And I click on 'Continue'
And I am on the 'Select the legal services you need' page
And the sub title is 'Lot 1 - Full service provision'
Given I check 'Information Technology'
And I click on 'Continue'
Then I am on the 'Select the jurisdiction you need' page
And the sub title is 'Lot 1 - Full service provision'
And I select '<jurisdiction>'
And I click on 'Continue'
Then I am on the 'Supplier results' page
Given I click on 'DUBUQUE-PADBERG'
Then I am on the 'DUBUQUE-PADBERG' page
And the 'Partner' hourly rate is '<partner_rate>'
And the 'Senior Solicitor, Senior Associate' hourly rate is '<senior_solicitor_rate>'
And the 'Solicitor, Associate' hourly rate is '<solicitor_rate>'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is '<nq_solicitor_rate>'
And the 'Trainee' hourly rate is '<trainee_rate>'
And the 'Paralegal, Legal Assistant' hourly rate is '<paralegal_rate>'
And the 'LMP (Legal project manager)' hourly rate is '<lmp_rate>'

Examples:
| jurisdiction | partner_rate | senior_solicitor_rate | solicitor_rate | nq_solicitor_rate | trainee_rate | paralegal_rate | lmp_rate |
| England and Wales | £175.00 | £150.00 | £125.00 | £100.00 | £75.00 | £50.00 | £165.00 |
| Scotland | £210.00 | £180.00 | £150.00 | £120.00 | £90.00 | £60.00 | £192.50 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Feature: Legal services - Central governemnt - Lot 2 - Supplier rates

Scenario Outline: Check the supplier has different rates in different jurisdictions
Given I sign in and navigate to the start page for the 'RM6240' framework in 'legal services'
Then I am on the 'Do you work for central government?' page
And I select 'Yes'
And I click on 'Continue'
Then I am on the 'Do you hold an approval secured from the Government Legal Department (GLD) to use this framework?' page
And I select 'Yes'
And I click on 'Continue'
Then I am on the 'Select the lot you need' page
And I select 'Lot 2 - General service provision'
And I click on 'Continue'
And I am on the 'Select the legal services you need' page
And the sub title is 'Lot 2 - General service provision'
Given I check 'Employment'
And I click on 'Continue'
Then I am on the 'Select the jurisdiction you need' page
And the sub title is 'Lot 2 - General service provision'
And I select '<jurisdiction>'
And I click on 'Continue'
Then I am on the 'Supplier results' page
Given I click on 'WEHNER, STEHR AND KULAS'
Then I am on the 'WEHNER, STEHR AND KULAS' page
And the 'Partner' hourly rate is '<partner_rate>'
And the 'Senior Solicitor, Senior Associate' hourly rate is '<senior_solicitor_rate>'
And the 'Solicitor, Associate' hourly rate is '<solicitor_rate>'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is '<nq_solicitor_rate>'
And the 'Trainee' hourly rate is '<trainee_rate>'
And the 'Paralegal, Legal Assistant' hourly rate is '<paralegal_rate>'
And the 'LMP (Legal project manager)' hourly rate is '<lmp_rate>'

Examples:
| jurisdiction | partner_rate | senior_solicitor_rate | solicitor_rate | nq_solicitor_rate | trainee_rate | paralegal_rate | lmp_rate |
| Scotland | £175.00 | £150.00 | £125.00 | £100.00 | £75.00 | £50.00 | £165.00 |
| Northern Ireland | £210.00 | £180.00 | £150.00 | £120.00 | £90.00 | £60.00 | £137.50 |
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Feature: Legal services - Central governemnt - Lot 2 - Suppliers
Given I click on 'WEHNER, STEHR AND KULAS'
Then I am on the 'WEHNER, STEHR AND KULAS ' page
Then the supplier 'is' an SME
And the 'Partner' hourly rate is 175.00'
And the 'Senior Solicitor, Senior Associate' hourly rate is 150.00'
And the 'Solicitor, Associate' hourly rate is 125.00'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is 100.00'
And the 'Trainee' hourly rate is 75.00'
And the 'Paralegal, Legal Assistant' hourly rate is 50.00'
And the 'LMP (Legal project manager)' hourly rate is 165.00'
And the 'Partner' hourly rate is 210.00'
And the 'Senior Solicitor, Senior Associate' hourly rate is 180.00'
And the 'Solicitor, Associate' hourly rate is 150.00'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is 120.00'
And the 'Trainee' hourly rate is 90.00'
And the 'Paralegal, Legal Assistant' hourly rate is 60.00'
And the 'LMP (Legal project manager)' hourly rate is 137.50'
And the contact details for the supplier are:
| stehr.wehner.kulas.and@crona.net |
| 1-118-604-7899 x39161 |
Expand All @@ -47,13 +47,13 @@ Feature: Legal services - Central governemnt - Lot 2 - Suppliers
Given I click on 'TREUTEL, GERLACH AND SPORER'
Then I am on the 'TREUTEL, GERLACH AND SPORER' page
Then the supplier 'is not' an SME
And the 'Partner' hourly rate is 210.00'
And the 'Senior Solicitor, Senior Associate' hourly rate is 180.00'
And the 'Solicitor, Associate' hourly rate is 150.00'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is 120.00'
And the 'Trainee' hourly rate is 90.00'
And the 'Paralegal, Legal Assistant' hourly rate is 60.00'
And there is no LMP (Legal project manager) hourly rate
And the 'Partner' hourly rate is 245.00'
And the 'Senior Solicitor, Senior Associate' hourly rate is 210.00'
And the 'Solicitor, Associate' hourly rate is 175.00'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is 140.00'
And the 'Trainee' hourly rate is 105.00'
And the 'Paralegal, Legal Assistant' hourly rate is 70.00'
And the 'LMP (Legal project manager)' hourly rate is '£192.50'
And the contact details for the supplier are:
| and_gerlach_sporer_treutel@osinski.org |
| (428) 979-0794 x788 |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Feature: Legal services - Non central governemnt - Lot 1 - Supplier rates

Scenario Outline: Check the supplier has different rates in different jurisdictions
Given I sign in and navigate to the start page for the 'RM6240' framework in 'legal services'
Then I am on the 'Do you work for central government?' page
And I select 'No'
And I click on 'Continue'
Then I am on the 'Select the lot you need' page
And I select 'Lot 1 - Full service provision'
And I click on 'Continue'
And I am on the 'Select the legal services you need' page
And the sub title is 'Lot 1 - Full service provision'
When I check the following items:
| Children and Vulnerable Adults |
| Corporate Law |
And I click on 'Continue'
Then I am on the 'Select the jurisdiction you need' page
And the sub title is 'Lot 1 - Full service provision'
And I select '<jurisdiction>'
And I click on 'Continue'
Then I am on the 'Supplier results' page
Given I click on 'WILLIAMSON-BERGSTROM'
Then I am on the 'WILLIAMSON-BERGSTROM' page
And the 'Partner' hourly rate is '<partner_rate>'
And the 'Senior Solicitor, Senior Associate' hourly rate is '<senior_solicitor_rate>'
And the 'Solicitor, Associate' hourly rate is '<solicitor_rate>'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is '<nq_solicitor_rate>'
And the 'Trainee' hourly rate is '<trainee_rate>'
And the 'Paralegal, Legal Assistant' hourly rate is '<paralegal_rate>'

Examples:
| jurisdiction | partner_rate | senior_solicitor_rate | solicitor_rate | nq_solicitor_rate | trainee_rate | paralegal_rate |
| England and Wales | £210.00 | £180.00 | £150.00 | £120.00 | £90.00 | £60.00 |
| Northern Ireland | £245.00 | £210.00 | £175.00 | £140.00 | £105.00 | £70.00 |
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Feature: Legal services - Non central governemnt - Lot 1 - Suppliers
Given I click on 'ZIEME GROUP'
Then I am on the 'ZIEME GROUP' page
Then the supplier 'is' an SME
And the 'Partner' hourly rate is 210.00'
And the 'Senior Solicitor, Senior Associate' hourly rate is 180.00'
And the 'Solicitor, Associate' hourly rate is 150.00'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is 120.00'
And the 'Trainee' hourly rate is 90.00'
And the 'Paralegal, Legal Assistant' hourly rate is 60.00'
And the 'LMP (Legal project manager)' hourly rate is '137.50'
And the 'Partner' hourly rate is 245.00'
And the 'Senior Solicitor, Senior Associate' hourly rate is 210.00'
And the 'Solicitor, Associate' hourly rate is 175.00'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is 140.00'
And the 'Trainee' hourly rate is 105.00'
And the 'Paralegal, Legal Assistant' hourly rate is 70.00'
And the 'LMP (Legal project manager)' hourly rate is '£192.50'
And the contact details for the supplier are:
| group.zieme@gerlach.io |
| 1-202-833-7874 |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Feature: Legal services - Non central governemnt - Lot 2 - Supplier rates

Scenario Outline: Check the supplier has different rates in different jurisdictions
Given I sign in and navigate to the start page for the 'RM6240' framework in 'legal services'
Then I am on the 'Do you work for central government?' page
And I select 'No'
And I click on 'Continue'
Then I am on the 'Select the lot you need' page
And I select 'Lot 2 - General service provision'
And I click on 'Continue'
And I am on the 'Select the legal services you need' page
And the sub title is 'Lot 2 - General service provision'
When I check the following items:
| Court of Protection |
| Licensing |
And I click on 'Continue'
Then I am on the 'Select the jurisdiction you need' page
And the sub title is 'Lot 2 - General service provision'
And I select '<jurisdiction>'
And I click on 'Continue'
Then I am on the 'Supplier results' page
Given I click on 'GUSIKOWSKI, BOSCO AND CRIST'
Then I am on the 'GUSIKOWSKI, BOSCO AND CRIST' page
And the 'Partner' hourly rate is '<partner_rate>'
And the 'Senior Solicitor, Senior Associate' hourly rate is '<senior_solicitor_rate>'
And the 'Solicitor, Associate' hourly rate is '<solicitor_rate>'
And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is '<nq_solicitor_rate>'
And the 'Trainee' hourly rate is '<trainee_rate>'
And the 'Paralegal, Legal Assistant' hourly rate is '<paralegal_rate>'
And the 'LMP (Legal project manager)' hourly rate is '<lmp_rate>'

Examples:
| jurisdiction | partner_rate | senior_solicitor_rate | solicitor_rate | nq_solicitor_rate | trainee_rate | paralegal_rate | lmp_rate |
| England and Wales | £175.00 | £150.00 | £125.00 | £100.00 | £75.00 | £50.00 | £165.00 |
| Scotland | £175.00 | £150.00 | £125.00 | £100.00 | £75.00 | £50.00 | £137.50 |
78 changes: 78 additions & 0 deletions spec/models/legal_services/rm6240/supplier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,82 @@
expect(LegalServices::RM6240::ServiceOffering.find_by(id: service_offering.id)).to be_nil
end
end

describe '.rate_card' do
let(:result) { supplier.rate_card(lot_number, jurisdiction) }
let(:jurisdiction) { nil }

let(:supplier) { create(:legal_services_rm6240_supplier) }
let!(:rate_1a) { create(:legal_services_rm6240_full_service_provision_rate, supplier:) }
let!(:rate_1b) { create(:legal_services_rm6240_full_service_provision_rate, supplier: supplier, jurisdiction: 'b', rate: 230) }
let!(:rate_1c) { create(:legal_services_rm6240_full_service_provision_rate, supplier: supplier, jurisdiction: 'c', rate: 180) }
let!(:rate_2a) { create(:legal_services_rm6240_general_service_provision_rate, supplier: supplier, jurisdiction: 'a', rate: 310) }
let!(:rate_2b) { create(:legal_services_rm6240_general_service_provision_rate, supplier: supplier, rate: 240) }
let!(:rate_2c) { create(:legal_services_rm6240_general_service_provision_rate, supplier: supplier, jurisdiction: 'c', rate: 190) }
let!(:rate_3) { create(:legal_services_rm6240_transport_rail_rate, supplier: supplier, rate: 290) }

context 'when the lot number is 1' do
let(:lot_number) { '1' }

context 'and the jurisdiction is a' do
let(:jurisdiction) { 'a' }

it 'returns the correct rates' do
expect(result).to eq([rate_1a])
end
end

context 'and the jurisdiction is b' do
let(:jurisdiction) { 'b' }

it 'returns the correct rates' do
expect(result).to eq([rate_1b])
end
end

context 'and the jurisdiction is c' do
let(:jurisdiction) { 'c' }

it 'returns the correct rates' do
expect(result).to eq([rate_1c])
end
end
end

context 'when the lot number is 2' do
let(:lot_number) { '2' }

context 'and the jurisdiction is a' do
let(:jurisdiction) { 'a' }

it 'returns the correct rates' do
expect(result).to eq([rate_2a])
end
end

context 'and the jurisdiction is b' do
let(:jurisdiction) { 'b' }

it 'returns the correct rates' do
expect(result).to eq([rate_2b])
end
end

context 'and the jurisdiction is c' do
let(:jurisdiction) { 'c' }

it 'returns the correct rates' do
expect(result).to eq([rate_2c])
end
end
end

context 'when the lot number is 3' do
let(:lot_number) { '3' }

it 'returns the correct rates' do
expect(result).to eq([rate_3])
end
end
end
end

0 comments on commit a169f0a

Please sign in to comment.