From 9a330c78b8b1401747e77af17e66d9fcaa53c8ac Mon Sep 17 00:00:00 2001 From: tim-s-ccs Date: Mon, 12 Jun 2023 09:52:14 +0100 Subject: [PATCH] The Legal Services category found an issue with the rates with respect to jurisdiction. In this ticket I have fixed this issue and added tests to make sure my changes work. --- .../rm6240/suppliers_controller.rb | 2 +- app/models/legal_services/rm6240/supplier.rb | 4 + .../lot_1/supplier_rates.feature | 36 +++++++++ .../lot_2/supplier_rates.feature | 36 +++++++++ .../lot_2/suppliers.feature | 28 +++---- .../lot_1/supplier_rates.feature | 34 ++++++++ .../lot_1/suppliers.feature | 14 ++-- .../lot_2/supplier_rates.feature | 35 +++++++++ .../legal_services/rm6240/supplier_spec.rb | 78 +++++++++++++++++++ 9 files changed, 245 insertions(+), 22 deletions(-) create mode 100644 features/services/legal_services/rm6240/journey/central_government/lot_1/supplier_rates.feature create mode 100644 features/services/legal_services/rm6240/journey/central_government/lot_2/supplier_rates.feature create mode 100644 features/services/legal_services/rm6240/journey/non_central_government/lot_1/supplier_rates.feature create mode 100644 features/services/legal_services/rm6240/journey/non_central_government/lot_2/supplier_rates.feature diff --git a/app/controllers/legal_services/rm6240/suppliers_controller.rb b/app/controllers/legal_services/rm6240/suppliers_controller.rb index 7e6cb95c31..e6bf65f274 100644 --- a/app/controllers/legal_services/rm6240/suppliers_controller.rb +++ b/app/controllers/legal_services/rm6240/suppliers_controller.rb @@ -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 diff --git a/app/models/legal_services/rm6240/supplier.rb b/app/models/legal_services/rm6240/supplier.rb index b8317bc4b1..eccaafa357 100644 --- a/app/models/legal_services/rm6240/supplier.rb +++ b/app/models/legal_services/rm6240/supplier.rb @@ -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 diff --git a/features/services/legal_services/rm6240/journey/central_government/lot_1/supplier_rates.feature b/features/services/legal_services/rm6240/journey/central_government/lot_1/supplier_rates.feature new file mode 100644 index 0000000000..a100e36e35 --- /dev/null +++ b/features/services/legal_services/rm6240/journey/central_government/lot_1/supplier_rates.feature @@ -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 '' + 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 '' + And the 'Senior Solicitor, Senior Associate' hourly rate is '' + And the 'Solicitor, Associate' hourly rate is '' + And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is '' + And the 'Trainee' hourly rate is '' + And the 'Paralegal, Legal Assistant' hourly rate is '' + And the 'LMP (Legal project manager)' hourly rate is '' + + 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 | diff --git a/features/services/legal_services/rm6240/journey/central_government/lot_2/supplier_rates.feature b/features/services/legal_services/rm6240/journey/central_government/lot_2/supplier_rates.feature new file mode 100644 index 0000000000..266ab39f3c --- /dev/null +++ b/features/services/legal_services/rm6240/journey/central_government/lot_2/supplier_rates.feature @@ -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 '' + 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 '' + And the 'Senior Solicitor, Senior Associate' hourly rate is '' + And the 'Solicitor, Associate' hourly rate is '' + And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is '' + And the 'Trainee' hourly rate is '' + And the 'Paralegal, Legal Assistant' hourly rate is '' + And the 'LMP (Legal project manager)' hourly rate is '' + + 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 | diff --git a/features/services/legal_services/rm6240/journey/central_government/lot_2/suppliers.feature b/features/services/legal_services/rm6240/journey/central_government/lot_2/suppliers.feature index b0c145fa93..a5641aefbc 100644 --- a/features/services/legal_services/rm6240/journey/central_government/lot_2/suppliers.feature +++ b/features/services/legal_services/rm6240/journey/central_government/lot_2/suppliers.feature @@ -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 | @@ -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 | diff --git a/features/services/legal_services/rm6240/journey/non_central_government/lot_1/supplier_rates.feature b/features/services/legal_services/rm6240/journey/non_central_government/lot_1/supplier_rates.feature new file mode 100644 index 0000000000..c9fdfd86d3 --- /dev/null +++ b/features/services/legal_services/rm6240/journey/non_central_government/lot_1/supplier_rates.feature @@ -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 '' + 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 '' + And the 'Senior Solicitor, Senior Associate' hourly rate is '' + And the 'Solicitor, Associate' hourly rate is '' + And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is '' + And the 'Trainee' hourly rate is '' + And the 'Paralegal, Legal Assistant' hourly rate is '' + + 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 | diff --git a/features/services/legal_services/rm6240/journey/non_central_government/lot_1/suppliers.feature b/features/services/legal_services/rm6240/journey/non_central_government/lot_1/suppliers.feature index 410dbbd828..14e3a49008 100644 --- a/features/services/legal_services/rm6240/journey/non_central_government/lot_1/suppliers.feature +++ b/features/services/legal_services/rm6240/journey/non_central_government/lot_1/suppliers.feature @@ -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 | diff --git a/features/services/legal_services/rm6240/journey/non_central_government/lot_2/supplier_rates.feature b/features/services/legal_services/rm6240/journey/non_central_government/lot_2/supplier_rates.feature new file mode 100644 index 0000000000..05c0824878 --- /dev/null +++ b/features/services/legal_services/rm6240/journey/non_central_government/lot_2/supplier_rates.feature @@ -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 '' + 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 '' + And the 'Senior Solicitor, Senior Associate' hourly rate is '' + And the 'Solicitor, Associate' hourly rate is '' + And the 'NQ Solicitor/Associate, Junior Solicitor/Associate' hourly rate is '' + And the 'Trainee' hourly rate is '' + And the 'Paralegal, Legal Assistant' hourly rate is '' + And the 'LMP (Legal project manager)' hourly rate is '' + + 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 | diff --git a/spec/models/legal_services/rm6240/supplier_spec.rb b/spec/models/legal_services/rm6240/supplier_spec.rb index dc57748a04..81adf085b1 100644 --- a/spec/models/legal_services/rm6240/supplier_spec.rb +++ b/spec/models/legal_services/rm6240/supplier_spec.rb @@ -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