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

Edit EP Claim Labels | Add End Product Update model #15383

Merged
merged 11 commits into from Oct 8, 2020
6 changes: 6 additions & 0 deletions app/models/end_product_update.rb
@@ -0,0 +1,6 @@
# frozen_string_literal: true

# This is for updating the claim label for end products established from Caseflow

class EndProductUpdate < ApplicationRecord
nanotone marked this conversation as resolved.
Show resolved Hide resolved
end
16 changes: 16 additions & 0 deletions db/migrate/20201005190456_create_end_product_update.rb
@@ -0,0 +1,16 @@
class CreateEndProductUpdate < ActiveRecord::Migration[5.2]
Sjones352 marked this conversation as resolved.
Show resolved Hide resolved
nanotone marked this conversation as resolved.
Show resolved Hide resolved
def change
create_table :end_product_updates, comment: "Keeps track of the request issues to update the claim label in Caseflow" do |t|
t.integer :user_id, comment: "The ID of the user who makes an end product update."
nanotone marked this conversation as resolved.
Show resolved Hide resolved
t.bigint :end_product_establishment_id, comment: "This is end product establishment id that Caseflow uses to keep track of the end product that is being updated"
Sjones352 marked this conversation as resolved.
Show resolved Hide resolved
t.bigint :original_decision_review_id, comment: "The original ID of the decision review that this request issue belongs to"
nanotone marked this conversation as resolved.
Show resolved Hide resolved
Sjones352 marked this conversation as resolved.
Show resolved Hide resolved
t.string :status, comment: "This shows whether the attempt to update the end product was successful or whether it resulted in an error"
Sjones352 marked this conversation as resolved.
Show resolved Hide resolved
t.string :error, comment: "The error captured if end product update has failed."
Sjones352 marked this conversation as resolved.
Show resolved Hide resolved
t.string :original_code, comment: "This is an original code before the update was submitted (just in case someone edits an end product twice)"
Sjones352 marked this conversation as resolved.
Show resolved Hide resolved
t.string :new_code, comment: "This is a new end product code the user wants to update to."
t.integer :active_request_issue_ids, null: false, comment: "An array of the active request issue IDs when a user has finished editing a decision review. Used to keep track of which request issues may have been impacted by the update.", array: true
Sjones352 marked this conversation as resolved.
Show resolved Hide resolved

t.timestamps null: false
end
end
end
15 changes: 14 additions & 1 deletion db/schema.rb
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2020_09_29_170305) do
ActiveRecord::Schema.define(version: 2020_10_05_190456) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -583,6 +583,19 @@
t.index ["veteran_file_number"], name: "index_end_product_establishments_on_veteran_file_number"
end

create_table "end_product_updates", comment: "Keeps track of the request issues to update the claim label in Caseflow", force: :cascade do |t|
t.integer "active_request_issue_ids", null: false, comment: "An array of the active request issue IDs when a user has finished editing a decision review. Used to keep track of which request issues may have been impacted by the update.", array: true
t.datetime "created_at", null: false
t.bigint "end_product_establishment_id", comment: "This is end product establishment id that Caseflow uses to keep track of the end product that is being updated"
t.string "error", comment: "The error captured if end product update has failed."
t.string "new_code", comment: "This is a new end product code the user wants to update to."
t.string "original_code", comment: "This is an original code before the update was submitted (just in case someone edits an end product twice)"
t.bigint "original_decision_review_id", comment: "The original ID of the decision review that this request issue belongs to"
t.string "status", comment: "This shows whether the attempt to update the end product was successful or whether it resulted in an error"
t.datetime "updated_at", null: false
t.integer "user_id", comment: "The ID of the user who makes an end product update."
end

create_table "form8s", id: :serial, force: :cascade do |t|
t.string "_initial_appellant_name"
t.string "_initial_appellant_relationship"
Expand Down
9 changes: 9 additions & 0 deletions docs/schema/caseflow.csv
Expand Up @@ -409,6 +409,15 @@ end_product_code_updates,created_at,datetime ∗,x,,,,,
end_product_code_updates,end_product_establishment_id,integer (8) ∗ FK,x,,x,,x,
end_product_code_updates,id,integer (8) PK,x,x,,,,
end_product_code_updates,updated_at,datetime ∗,x,,,,x,
end_product_updates,,,,,,,, "Keeps track of the request issues to update the claim label in Caseflow."
end_product_updates,user_id,integer,"The ID of the user who makes an end product update."
end_product_updates,end_product_establishment_id,bigint,"This is end product establishment id that Caseflow uses to keep track of the end product that is being updated"
end_product_updates,original_decision_review_id,bigint,"The original ID of the decision review that this request issue belongs to"
end_product_updates,status,string,"This shows whether the attempt to update the end product was successful or whether it resulted in an error"
end_product_updates,error,string,"The error captured if end product update has failed."
end_product_updates,original_code,string,"This is an original code before the update was submitted (just in case someone edits an end product twice)."
end_product_updates,new_code,string,"This is a new end product code the user wants to update to"
end_product_updates,active_request_issue_ids,integer,"An array of the active request issue IDs when a user has finished editing a decision review."
end_product_establishments,,,,,,,,"Represents end products that have been, or need to be established by Caseflow. Used to track the status of those end products as they are processed in VBMS and/or SHARE."
end_product_establishments,benefit_type_code,string,,,,,,"1 if the Veteran is alive, and 2 if the Veteran is deceased. Not to be confused with benefit_type, which is unrelated."
end_product_establishments,claim_date,date,,,,,,The claim_date for end product established.
Expand Down