Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SeanC/APPEALS-42315 | Create separate Remand table, model and seed data #22220

Merged
merged 15 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/remand.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class Remand < SupplementalClaim
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddTypeColumnAndIndexToSupplementalClaimsForRemandInheritance < Caseflow::Migration
def change
safety_assured do
add_column :supplemental_claims, :type, :string, default: "SupplementalClaim", null: false, comment: "The class name for the single table inheritance type of Supplemental Claim for example Remand"
end

add_safe_index :supplemental_claims, [:type], name: "index_supplemental_claims_on_type"
end
end
4 changes: 3 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_06_13_202232) do
seancva marked this conversation as resolved.
Show resolved Hide resolved
ActiveRecord::Schema.define(version: 2024_07_16_143816) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -1831,11 +1831,13 @@
t.boolean "filed_by_va_gov", comment: "Indicates whether or not this form came from VA.gov"
t.boolean "legacy_opt_in_approved", comment: "Indicates whether a Veteran opted to withdraw their Supplemental Claim request issues from the legacy system if a matching issue is found. If there is a matching legacy issue and it is not withdrawn, then that issue is ineligible to be a new request issue and a contention will not be created for it."
t.date "receipt_date", comment: "The date that the Supplemental Claim form was received by central mail. Only issues decided prior to the receipt date will show up as contestable issues. It is also the claim date for any associated end products that are established. Supplemental Claims do not have the same timeliness restriction on contestable issues as Appeals and Higher Level Reviews."
t.string "type", default: "SupplementalClaim", null: false, comment: "The class name for the single table inheritance type of Supplemental Claim for example Remand"
t.datetime "updated_at"
t.uuid "uuid", default: -> { "uuid_generate_v4()" }, null: false, comment: "The universally unique identifier for the Supplemental Claim. Can be used to link to the claim after it is completed."
t.string "veteran_file_number", null: false, comment: "PII. The file number of the Veteran that the Supplemental Claim is for."
t.boolean "veteran_is_not_claimant", comment: "Indicates whether the Veteran is the claimant on the Supplemental Claim form, or if the claimant is someone else like a spouse or a child. Must be TRUE if the Veteran is deceased."
t.index ["decision_review_remanded_type", "decision_review_remanded_id"], name: "index_decision_issues_on_decision_review_remanded"
t.index ["type"], name: "index_supplemental_claims_on_type"
t.index ["updated_at"], name: "index_supplemental_claims_on_updated_at"
t.index ["uuid"], name: "index_supplemental_claims_on_uuid"
t.index ["veteran_file_number"], name: "index_supplemental_claims_on_veteran_file_number"
Expand Down
11 changes: 11 additions & 0 deletions db/seeds/veterans_health_administration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def create_supplemental_claims
3.times do
CLAIMANT_TYPES.each do |claimant_type|
create_sc_with_claimant(benefit_type, claimant_type)
create_sc_remand(benefit_type, claimant_type)
end
end
end
Expand Down Expand Up @@ -83,6 +84,16 @@ def create_sc_with_claimant(benefit_type, claimant_type)
sc.create_business_line_tasks!
end

def create_sc_remand(benefit_type, claimant_type)
sc = create(
:remand,
benefit_type: benefit_type,
claimant_type: claimant_type,
number_of_claimants: 1
)
sc.create_business_line_tasks!
end

# :reek:NestedIterators
# this method is creating most of the data, but we can't get around it because of how many PO/VISN combos there are
def create_vha_visn_pre_docket_queue
Expand Down
6 changes: 6 additions & 0 deletions spec/factories/supplemental_claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
benefit_type { "compensation" }
uuid { SecureRandom.uuid }
veteran_is_not_claimant { true }
type { SupplementalClaim.name }

transient do
number_of_claimants { nil }
Expand Down Expand Up @@ -282,5 +283,10 @@
decision_review: sc)
end
end

factory :remand, class: Remand do
type { Remand.name }
decision_review_remanded { create(:appeal) }
end
end
end
Loading