diff --git a/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_resolution.rb b/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_resolution.rb index eb30747c085..413bef9fa91 100644 --- a/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_resolution.rb +++ b/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_resolution.rb @@ -12,18 +12,18 @@ class PowerOfAttorneyRequestResolution < ApplicationRecord ].freeze delegated_type :resolving, - types: RESOLVING_TYPES, - inverse_of: :resolution + types: RESOLVING_TYPES, + inverse_of: :resolution module Resolving extend ActiveSupport::Concern included do has_one :resolution, - as: :resolving, - inverse_of: :resolving, - class_name: 'PowerOfAttorneyRequestResolution', - required: true + as: :resolving, + inverse_of: :resolving, + class_name: 'PowerOfAttorneyRequestResolution', + required: true end end diff --git a/modules/accredited_representative_portal/lib/tasks/seed.rake b/modules/accredited_representative_portal/lib/tasks/seed.rake index c6147f3293b..da9cd05b6df 100644 --- a/modules/accredited_representative_portal/lib/tasks/seed.rake +++ b/modules/accredited_representative_portal/lib/tasks/seed.rake @@ -20,6 +20,7 @@ namespace :accredited_representative_portal do end end +# rubocop:disable Metrics/MethodLength, Metrics/ModuleLength, Rails/SkipsModelValidations module AccreditedRepresentativePortal ## # Representative records derived from here: @@ -31,17 +32,17 @@ module AccreditedRepresentativePortal ActiveRecord::Base.transaction do insert_all( Records::ATTORNEYS, - factory: [ - :accredited_individual, - :attorney + factory: %i[ + accredited_individual + attorney ] ) insert_all( Records::CLAIMS_AGENTS, - factory: [ - :accredited_individual, - :claims_agent + factory: %i[ + accredited_individual + claims_agent ] ) @@ -56,9 +57,9 @@ module AccreditedRepresentativePortal insert_all( Records::REPRESENTATIVES, - factory: [ - :accredited_individual, - :representative + factory: %i[ + accredited_individual + representative ] ) do |representative| representative @@ -76,9 +77,9 @@ module AccreditedRepresentativePortal factory: [ :accreditation ], - unique_by: [ - :accredited_organization_id, - :accredited_individual_id + unique_by: %i[ + accredited_organization_id + accredited_individual_id ] ) @@ -186,7 +187,7 @@ module AccreditedRepresentativePortal def insert_all(records, factory:, unique_by: nil) records = - records.map.with_index do |record, i| + records.map.with_index do |record, _i| yield(record) if block_given? FactoryBot @@ -206,9 +207,9 @@ module AccreditedRepresentativePortal end RESOLUTION_HISTORY_CYCLE = - [:expiration, :declination, :acceptance] - .permutation - .cycle + %i[expiration declination acceptance] + .permutation + .cycle RESOLVED_TIME_TRAVELER = Enumerator.new do |yielder| @@ -219,9 +220,9 @@ module AccreditedRepresentativePortal # These 3 entries spread are here because we are making 3 POA # requests per claimant in a row. # - yielder << time + 0.days - yielder << time + 10.days - yielder << time + 20.days + yielder << (time + 0.days) + yielder << (time + 10.days) + yielder << (time + 20.days) time += 6.hours end end @@ -238,3 +239,4 @@ module AccreditedRepresentativePortal end end end +# rubocop:enable Metrics/MethodLength, Metrics/ModuleLength, Rails/SkipsModelValidations diff --git a/modules/accredited_representative_portal/lib/tasks/seed/records.rb b/modules/accredited_representative_portal/lib/tasks/seed/records.rb index 5ce49992492..de2b60b2226 100644 --- a/modules/accredited_representative_portal/lib/tasks/seed/records.rb +++ b/modules/accredited_representative_portal/lib/tasks/seed/records.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +# rubocop:disable Metrics/ModuleLength module AccreditedRepresentativePortal module Seed module Records @@ -113,9 +114,9 @@ module Records last_name: 'Representative', id: 'd9d7e941-7156-4eca-827c-bcabe731d7ea', registration_number: '10000', - organization_ids: [ - '23563963-e31c-4797-a259-e26b727072e1', - '41d36596-67d1-4b23-ab58-927447e88d07' + organization_ids: %w[ + 23563963-e31c-4797-a259-e26b727072e1 + 41d36596-67d1-4b23-ab58-927447e88d07 ] }, { @@ -123,10 +124,10 @@ module Records last_name: 'Lowe', id: '3f47a6c7-ce14-4ab5-9567-6e3803336fe1', registration_number: '10001', - organization_ids: [ - '23563963-e31c-4797-a259-e26b727072e1', - '83b7de4d-a2cd-4b15-9e32-af48804c3e31', - '31f61e0f-8993-4c57-86f2-7f22e9ca9e68' + organization_ids: %w[ + 23563963-e31c-4797-a259-e26b727072e1 + 83b7de4d-a2cd-4b15-9e32-af48804c3e31 + 31f61e0f-8993-4c57-86f2-7f22e9ca9e68 ] }, { @@ -134,11 +135,11 @@ module Records last_name: 'Lowe', id: '90e83d10-8ce1-482b-8f06-45bea0cc7f3c', registration_number: '10002', - organization_ids: [ - '41d36596-67d1-4b23-ab58-927447e88d07', - '83b7de4d-a2cd-4b15-9e32-af48804c3e31', - '31f61e0f-8993-4c57-86f2-7f22e9ca9e68', - '4e21e4b2-02e5-4a96-ace3-8b56b97a275c' + organization_ids: %w[ + 41d36596-67d1-4b23-ab58-927447e88d07 + 83b7de4d-a2cd-4b15-9e32-af48804c3e31 + 31f61e0f-8993-4c57-86f2-7f22e9ca9e68 + 4e21e4b2-02e5-4a96-ace3-8b56b97a275c ] }, { @@ -146,12 +147,12 @@ module Records last_name: 'Armstrong', id: 'a1e66cea-bd2d-4997-8b08-42770fc0ebce', registration_number: '10003', - organization_ids: [ - '23563963-e31c-4797-a259-e26b727072e1', - '41d36596-67d1-4b23-ab58-927447e88d07', - '83b7de4d-a2cd-4b15-9e32-af48804c3e31', - '31f61e0f-8993-4c57-86f2-7f22e9ca9e68', - '4e21e4b2-02e5-4a96-ace3-8b56b97a275c' + organization_ids: %w[ + 23563963-e31c-4797-a259-e26b727072e1 + 41d36596-67d1-4b23-ab58-927447e88d07 + 83b7de4d-a2cd-4b15-9e32-af48804c3e31 + 31f61e0f-8993-4c57-86f2-7f22e9ca9e68 + 4e21e4b2-02e5-4a96-ace3-8b56b97a275c ] }, { @@ -159,9 +160,9 @@ module Records last_name: 'Cruickshank', id: '96dc6994-1949-4f83-a6ad-a3bd9fd728e0', registration_number: '10004', - organization_ids: [ - '23563963-e31c-4797-a259-e26b727072e1', - '83b7de4d-a2cd-4b15-9e32-af48804c3e31' + organization_ids: %w[ + 23563963-e31c-4797-a259-e26b727072e1 + 83b7de4d-a2cd-4b15-9e32-af48804c3e31 ] }, { @@ -178,9 +179,9 @@ module Records last_name: 'Representative', id: 'c50410bb-7341-4d95-9a2f-aed22178ff08', registration_number: '10006', - organization_ids: [ - '31f61e0f-8993-4c57-86f2-7f22e9ca9e68', - '4e21e4b2-02e5-4a96-ace3-8b56b97a275c' + organization_ids: %w[ + 31f61e0f-8993-4c57-86f2-7f22e9ca9e68 + 4e21e4b2-02e5-4a96-ace3-8b56b97a275c ] }, { @@ -188,11 +189,11 @@ module Records last_name: 'Trust', id: '595e4651-4bd0-4094-8007-f3711001efe5', registration_number: '10007', - organization_ids: [ - '23563963-e31c-4797-a259-e26b727072e1', - '83b7de4d-a2cd-4b15-9e32-af48804c3e31', - '31f61e0f-8993-4c57-86f2-7f22e9ca9e68', - '4e21e4b2-02e5-4a96-ace3-8b56b97a275c' + organization_ids: %w[ + 23563963-e31c-4797-a259-e26b727072e1 + 83b7de4d-a2cd-4b15-9e32-af48804c3e31 + 31f61e0f-8993-4c57-86f2-7f22e9ca9e68 + 4e21e4b2-02e5-4a96-ace3-8b56b97a275c ] }, { @@ -200,9 +201,9 @@ module Records last_name: 'Good', id: 'c3063f49-f751-4b94-9d18-4a98f08c2926', registration_number: '10008', - organization_ids: [ - '83b7de4d-a2cd-4b15-9e32-af48804c3e31', - '31f61e0f-8993-4c57-86f2-7f22e9ca9e68' + organization_ids: %w[ + 83b7de4d-a2cd-4b15-9e32-af48804c3e31 + 31f61e0f-8993-4c57-86f2-7f22e9ca9e68 ] }, { @@ -210,12 +211,12 @@ module Records last_name: 'Kertzmann', id: '9e68bca2-10e1-48cc-be75-b1ce64d07ef4', registration_number: '10009', - organization_ids: [ - '23563963-e31c-4797-a259-e26b727072e1', - '41d36596-67d1-4b23-ab58-927447e88d07', - '83b7de4d-a2cd-4b15-9e32-af48804c3e31', - '31f61e0f-8993-4c57-86f2-7f22e9ca9e68', - '4e21e4b2-02e5-4a96-ace3-8b56b97a275c' + organization_ids: %w[ + 23563963-e31c-4797-a259-e26b727072e1 + 41d36596-67d1-4b23-ab58-927447e88d07 + 83b7de4d-a2cd-4b15-9e32-af48804c3e31 + 31f61e0f-8993-4c57-86f2-7f22e9ca9e68 + 4e21e4b2-02e5-4a96-ace3-8b56b97a275c ] }, { @@ -223,12 +224,12 @@ module Records last_name: 'Roob', id: 'c6999376-28ca-45b9-a840-40c6c7c4edef', registration_number: '10010', - organization_ids: [ - '23563963-e31c-4797-a259-e26b727072e1', - '41d36596-67d1-4b23-ab58-927447e88d07', - '83b7de4d-a2cd-4b15-9e32-af48804c3e31', - '31f61e0f-8993-4c57-86f2-7f22e9ca9e68', - '4e21e4b2-02e5-4a96-ace3-8b56b97a275c' + organization_ids: %w[ + 23563963-e31c-4797-a259-e26b727072e1 + 41d36596-67d1-4b23-ab58-927447e88d07 + 83b7de4d-a2cd-4b15-9e32-af48804c3e31 + 31f61e0f-8993-4c57-86f2-7f22e9ca9e68 + 4e21e4b2-02e5-4a96-ace3-8b56b97a275c ] }, { @@ -236,11 +237,11 @@ module Records last_name: 'Schultz', id: '0ea9df23-a0b9-42bc-9629-b6ad66704825', registration_number: '10011', - organization_ids: [ - '41d36596-67d1-4b23-ab58-927447e88d07', - '4e21e4b2-02e5-4a96-ace3-8b56b97a275c' + organization_ids: %w[ + 41d36596-67d1-4b23-ab58-927447e88d07 + 4e21e4b2-02e5-4a96-ace3-8b56b97a275c ] - }, + } ].freeze CLAIMANTS = [ @@ -412,3 +413,4 @@ module Records end end end +# rubocop:enable Metrics/ModuleLength diff --git a/modules/accredited_representative_portal/spec/factories/power_of_attorney_form.rb b/modules/accredited_representative_portal/spec/factories/power_of_attorney_form.rb index e79264ce272..58fe7c54621 100644 --- a/modules/accredited_representative_portal/spec/factories/power_of_attorney_form.rb +++ b/modules/accredited_representative_portal/spec/factories/power_of_attorney_form.rb @@ -60,11 +60,11 @@ { authorizations: { record_disclosure: Faker::Boolean.boolean, - record_disclosure_limitations: [ - "ALCOHOLISM", - "DRUG_ABUSE", - "HIV", - "SICKLE_CELL" + record_disclosure_limitations: %w[ + ALCOHOLISM + DRUG_ABUSE + HIV + SICKLE_CELL ].select { rand < 0.5 }, address_change: Faker::Boolean.boolean }, @@ -80,7 +80,7 @@ address_line2: nil, city: Faker::Address.city, state_code: Faker::Address.state_abbr, - country: "US", + country: 'US', zip_code: Faker::Address.zip_code, zip_code_suffix: nil }, @@ -88,15 +88,15 @@ va_file_number: Faker::Number.number(digits: 9).to_s, date_of_birth: Faker::Date.birthday(min_age: 21, max_age: 100).to_s, service_number: Faker::Number.number(digits: 9).to_s, - service_branch: [ - "ARMY", - "NAVY", - "AIR_FORCE", - "MARINE_CORPS", - "COAST_GUARD", - "SPACE_FORCE", - "NOAA", - "USPHS" + service_branch: %w[ + ARMY + NAVY + AIR_FORCE + MARINE_CORPS + COAST_GUARD + SPACE_FORCE + NOAA + USPHS ].sample, phone: Faker::PhoneNumber.phone_number, email: Faker::Internet.email diff --git a/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_decision_spec.rb b/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_decision_spec.rb index e6bed5c77ae..1ac79793ee3 100644 --- a/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_decision_spec.rb +++ b/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_decision_spec.rb @@ -10,8 +10,7 @@ expect(decision).not_to be_valid expect(decision.errors.full_messages).to eq( [ - 'Type is not included in the list', - 'Resolution is invalid' + 'Type is not included in the list' ] ) end diff --git a/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_resolution_spec.rb b/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_resolution_spec.rb index 5dafde688a2..ac42f489359 100644 --- a/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_resolution_spec.rb +++ b/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_resolution_spec.rb @@ -14,8 +14,7 @@ expect(resolution_b).not_to be_valid expect(resolution_b.errors.full_messages).to eq( [ - 'Power of attorney request has already been taken', - 'Resolving is invalid' + 'Power of attorney request has already been taken' ] ) end diff --git a/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_spec.rb b/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_spec.rb index 491cabdcd5b..5064dd33404 100644 --- a/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_spec.rb +++ b/modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_spec.rb @@ -16,7 +16,6 @@ expect(poa_request).not_to be_valid expect(poa_request.errors.full_messages).to eq( [ - 'Power of attorney form is invalid', 'Claimant type is not included in the list' ] )