From 6a8e3f1c8407ab54fe3b8b2e91b70e738b8b2572 Mon Sep 17 00:00:00 2001 From: Jonathan Hoang Date: Wed, 12 Apr 2023 10:49:44 -0500 Subject: [PATCH 1/8] migration to add mst and pact status to request_issues --- db/migrate/20230412154615_add_mst_pact_to_request_issues.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20230412154615_add_mst_pact_to_request_issues.rb diff --git a/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb b/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb new file mode 100644 index 00000000000..148093adbe6 --- /dev/null +++ b/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb @@ -0,0 +1,6 @@ +class AddMstPactToRequestIssues < ActiveRecord::Migration[5.2] + def change + add_column :request_issues, :mst_status, :boolean, comment: "Indicates if issue is related to Military Sexual Trauam (MST)" + add_column :request_issues, :pact_status, :boolean, comment: "Indicates if issue is related to Promise to Address Comprehensive Toxics (PACT) Act" + end +end From 0d5df1a9b176b5b1e5fff5141d27b09bd3164376 Mon Sep 17 00:00:00 2001 From: Jonathan Hoang Date: Thu, 13 Apr 2023 13:32:01 -0500 Subject: [PATCH 2/8] schema update --- db/schema.rb | 65 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index fa16b38510e..1fd81a522e5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_03_17_164013) do +ActiveRecord::Schema.define(version: 2023_04_12_154615) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -91,7 +91,7 @@ t.boolean "appeal_docketed", default: false, null: false, comment: "When true, appeal has been docketed" t.bigint "appeal_id", null: false, comment: "AMA or Legacy Appeal ID" t.string "appeal_type", null: false, comment: "Appeal Type (Appeal or LegacyAppeal)" - t.datetime "created_at", null: false, comment: "Date and Time the record was inserted into the table" + t.datetime "created_at", null: false t.bigint "created_by_id", null: false, comment: "User id of the user that inserted the record" t.boolean "decision_mailed", default: false, null: false, comment: "When true, appeal has decision mail request complete" t.boolean "hearing_postponed", default: false, null: false, comment: "When true, appeal has hearing postponed and no hearings scheduled" @@ -100,7 +100,7 @@ t.boolean "privacy_act_complete", default: false, null: false, comment: "When true, appeal has a privacy act request completed" t.boolean "privacy_act_pending", default: false, null: false, comment: "When true, appeal has a privacy act request still open" t.boolean "scheduled_in_error", default: false, null: false, comment: "When true, hearing was scheduled in error and none scheduled" - t.datetime "updated_at", comment: "Date and time the record was last updated" + t.datetime "updated_at" t.bigint "updated_by_id", comment: "User id of the last user that updated the record" t.boolean "vso_ihp_complete", default: false, null: false, comment: "When true, appeal has a VSO IHP request completed" t.boolean "vso_ihp_pending", default: false, null: false, comment: "When true, appeal has a VSO IHP request pending" @@ -152,6 +152,19 @@ t.index ["veteran_file_number"], name: "index_appeals_on_veteran_file_number" end + create_table "appellant_substitution_histories", force: :cascade do |t| + t.bigint "appellant_substitution_id", comment: "Appellant substitution id of the last user that updated the CAVC record" + t.datetime "created_at", null: false + t.bigint "created_by_id", comment: "Current user who created Appellant substitution" + t.string "current_appellant_substitute_participant_id", comment: "Current Appellant Substitute participant Id" + t.string "current_appellant_veteran_participant_id", comment: "Current Appellant Veteran participant Id" + t.string "original_appellant_substitute_participant_id", comment: "Original Appellant Substitute participant Id" + t.string "original_appellant_veteran_participant_id", comment: "Original Appeallant Veteran Participant Id" + t.date "substitution_date", comment: "Timestamp of substitution granted date" + t.datetime "updated_at", null: false + t.index ["appellant_substitution_id"], name: "index_appellant_sub_histories_on_appellant_substitution_id" + end + create_table "appellant_substitutions", comment: "Store appellant substitution form data", force: :cascade do |t| t.string "claimant_type", null: false, comment: "Claimant type of substitute; needed to create Claimant record" t.datetime "created_at", null: false, comment: "Standard created_at/updated_at timestamps" @@ -406,6 +419,24 @@ t.index ["source_appeal_id"], name: "index_cavc_remands_on_source_appeal_id" end + create_table "cavc_remands_appellant_substitutions", force: :cascade do |t| + t.bigint "appellant_substitution_id", comment: "Appellant Substitution this is tied to" + t.bigint "cavc_remand_id", comment: "Cavc Remand this is tied to" + t.datetime "created_at", null: false + t.bigint "created_by_id", comment: "Current user who created substitution" + t.boolean "is_appellant_substituted", comment: "Y/N Boolean for active substitution" + t.string "participant_id", comment: "Claimant Participant Id" + t.string "remand_source", comment: "Source of Remand - From Add or Edit" + t.string "substitute_participant_id", comment: "Appellant Substitute participant Id" + t.date "substitution_date", comment: "Timestamp of substitution" + t.datetime "updated_at", null: false + t.bigint "updated_by_id", comment: "Current user who updated substitution" + t.index ["appellant_substitution_id"], name: "index_on_appellant_substitution_id" + t.index ["cavc_remand_id"], name: "index_on_cavc_remand_id" + t.index ["participant_id"], name: "index_on_participant_id" + t.index ["substitute_participant_id"], name: "index_on_substitute_participant_id" + end + create_table "cavc_selection_bases", force: :cascade do |t| t.string "basis_for_selection" t.string "category" @@ -1163,6 +1194,20 @@ t.index ["request_issue_id"], name: "index_legacy_issues_on_request_issue_id" end + create_table "membership_requests", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "decided_at", comment: "The date and time when the deider user made a decision about the membership request" + t.bigint "decider_id", comment: "The user who decides the status of the membership request" + t.string "note", comment: "A note that provides additional context from the requestor about their request for access to the organization" + t.bigint "organization_id", comment: "The organization that the membership request is asking to join" + t.bigint "requestor_id", comment: "The User that is requesting access to the organization" + t.string "status", default: "assigned", null: false, comment: "The status of the membership request at any given point of time" + t.datetime "updated_at", null: false + t.index ["organization_id"], name: "index_membership_requests_on_organization_id" + t.index ["requestor_id"], name: "index_membership_requests_on_requestor_id" + t.index ["status", "organization_id", "requestor_id"], name: "index_membership_requests_on_status_and_association_ids", unique: true, where: "((status)::text = 'assigned'::text)" + end + create_table "messages", force: :cascade do |t| t.datetime "created_at", null: false t.integer "detail_id", comment: "ID of the related object" @@ -1218,7 +1263,7 @@ t.string "appeals_type", null: false, comment: "Type of Appeal" t.datetime "created_at", comment: "Timestamp of when Noticiation was Created" t.boolean "email_enabled", default: true, null: false - t.text "email_notification_content", comment: "Full Email Text Content of Notification" + t.string "email_notification_content", comment: "Full Email Text Content of Notification" t.string "email_notification_external_id", comment: "VA Notify Notification Id for the email notification send through their API " t.string "email_notification_status", comment: "Status of the Email Notification" t.date "event_date", null: false, comment: "Date of Event" @@ -1229,7 +1274,7 @@ t.string "participant_id", comment: "ID of Participant" t.string "recipient_email", comment: "Participant's Email Address" t.string "recipient_phone_number", comment: "Participants Phone Number" - t.text "sms_notification_content", comment: "Full SMS Text Content of Notification" + t.string "sms_notification_content", comment: "Full SMS Text Content of Notification" t.string "sms_notification_external_id", comment: "VA Notify Notification Id for the sms notification send through their API " t.string "sms_notification_status", comment: "Status of SMS/Text Notification" t.datetime "updated_at", comment: "TImestamp of when Notification was Updated" @@ -1424,9 +1469,11 @@ t.string "ineligible_reason", comment: "The reason for a Request Issue being ineligible. If a Request Issue has an ineligible_reason, it is still captured, but it will not get a contention in VBMS or a decision." t.boolean "is_predocket_needed", comment: "Indicates whether or not an issue has been selected to go to the pre-docket queue opposed to normal docketing." t.boolean "is_unidentified", comment: "Indicates whether a Request Issue is unidentified, meaning it wasn't found in the list of contestable issues, and is not a new nonrating issue. Contentions for unidentified issues are created on a rating End Product if processed in VBMS but without the issue description, and someone is required to edit it in Caseflow before proceeding with the decision." + t.boolean "mst_status", comment: "Indicates if issue is related to Military Sexual Trauam (MST)" t.string "nonrating_issue_category", comment: "The category selected for nonrating request issues. These vary by business line." t.string "nonrating_issue_description", comment: "The user entered description if the issue is a nonrating issue" t.text "notes", comment: "Notes added by the Claims Assistant when adding request issues. This may be used to capture handwritten notes on the form, or other comments the CA wants to capture." + t.boolean "pact_status", comment: "Indicates if issue is related to Promise to Address Comprehensive Toxics (PACT) Act" t.string "ramp_claim_id", comment: "If a rating issue was created as a result of an issue intaken for a RAMP Review, it will be connected to the former RAMP issue by its End Product's claim ID." t.datetime "rating_issue_associated_at", comment: "Timestamp when a contention and its contested rating issue are associated in VBMS." t.string "split_issue_status", comment: "If a request issue is part of a split, on_hold status applies to the original request issues while active are request issues on splitted appeals" @@ -1532,7 +1579,6 @@ t.boolean "national_cemetery_administration", default: false t.boolean "no_special_issues", default: false, comment: "Affirmative no special issues, added belatedly" t.boolean "nonrating_issue", default: false - t.boolean "pact_act", default: false, comment: "The Sergeant First Class (SFC) Heath Robinson Honoring our Promise to Address Comprehensive Toxics (PACT) Act" t.boolean "pension_united_states", default: false t.boolean "private_attorney_or_agent", default: false t.boolean "radiation", default: false @@ -1926,6 +1972,10 @@ add_foreign_key "cavc_remands", "appeals", column: "source_appeal_id" add_foreign_key "cavc_remands", "users", column: "created_by_id" add_foreign_key "cavc_remands", "users", column: "updated_by_id" + add_foreign_key "cavc_remands_appellant_substitutions", "appellant_substitutions" + add_foreign_key "cavc_remands_appellant_substitutions", "cavc_remands" + add_foreign_key "cavc_remands_appellant_substitutions", "users", column: "created_by_id" + add_foreign_key "cavc_remands_appellant_substitutions", "users", column: "updated_by_id" add_foreign_key "certification_cancellations", "certifications" add_foreign_key "certifications", "users" add_foreign_key "claim_establishments", "dispatch_tasks", column: "task_id" @@ -1976,6 +2026,9 @@ add_foreign_key "legacy_issue_optins", "legacy_issues" add_foreign_key "legacy_issue_optins", "request_issues" add_foreign_key "legacy_issues", "request_issues" + add_foreign_key "membership_requests", "organizations" + add_foreign_key "membership_requests", "users", column: "decider_id" + add_foreign_key "membership_requests", "users", column: "requestor_id" add_foreign_key "messages", "users" add_foreign_key "mpi_update_person_events", "api_keys" add_foreign_key "nod_date_updates", "appeals" From 6d7e09652b430fbad8befe29cc44820e7114afb8 Mon Sep 17 00:00:00 2001 From: Jonathan Hoang Date: Thu, 13 Apr 2023 13:55:51 -0500 Subject: [PATCH 3/8] typo in migration --- db/migrate/20230412154615_add_mst_pact_to_request_issues.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb b/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb index 148093adbe6..659f53fb4c5 100644 --- a/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb +++ b/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb @@ -1,6 +1,6 @@ class AddMstPactToRequestIssues < ActiveRecord::Migration[5.2] def change - add_column :request_issues, :mst_status, :boolean, comment: "Indicates if issue is related to Military Sexual Trauam (MST)" + add_column :request_issues, :mst_status, :boolean, comment: "Indicates if issue is related to Military Sexual Trauma (MST)" add_column :request_issues, :pact_status, :boolean, comment: "Indicates if issue is related to Promise to Address Comprehensive Toxics (PACT) Act" end end From 9a74e6ee66cc835fba82082c1f7c50fb9e313fde Mon Sep 17 00:00:00 2001 From: Jonathan Hoang Date: Thu, 13 Apr 2023 13:57:18 -0500 Subject: [PATCH 4/8] typo in schema --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index 1fd81a522e5..fe2d0cf9c8b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1469,7 +1469,7 @@ t.string "ineligible_reason", comment: "The reason for a Request Issue being ineligible. If a Request Issue has an ineligible_reason, it is still captured, but it will not get a contention in VBMS or a decision." t.boolean "is_predocket_needed", comment: "Indicates whether or not an issue has been selected to go to the pre-docket queue opposed to normal docketing." t.boolean "is_unidentified", comment: "Indicates whether a Request Issue is unidentified, meaning it wasn't found in the list of contestable issues, and is not a new nonrating issue. Contentions for unidentified issues are created on a rating End Product if processed in VBMS but without the issue description, and someone is required to edit it in Caseflow before proceeding with the decision." - t.boolean "mst_status", comment: "Indicates if issue is related to Military Sexual Trauam (MST)" + t.boolean "mst_status", comment: "Indicates if issue is related to Military Sexual Trauma (MST)" t.string "nonrating_issue_category", comment: "The category selected for nonrating request issues. These vary by business line." t.string "nonrating_issue_description", comment: "The user entered description if the issue is a nonrating issue" t.text "notes", comment: "Notes added by the Claims Assistant when adding request issues. This may be used to capture handwritten notes on the form, or other comments the CA wants to capture." From 2e32a46c6a3c99778814be6ebbd041935ede267c Mon Sep 17 00:00:00 2001 From: Jonathan Hoang Date: Thu, 13 Apr 2023 15:48:24 -0500 Subject: [PATCH 5/8] set default status --- db/migrate/20230412154615_add_mst_pact_to_request_issues.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb b/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb index 659f53fb4c5..dd273f0b176 100644 --- a/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb +++ b/db/migrate/20230412154615_add_mst_pact_to_request_issues.rb @@ -1,6 +1,6 @@ class AddMstPactToRequestIssues < ActiveRecord::Migration[5.2] def change - add_column :request_issues, :mst_status, :boolean, comment: "Indicates if issue is related to Military Sexual Trauma (MST)" - add_column :request_issues, :pact_status, :boolean, comment: "Indicates if issue is related to Promise to Address Comprehensive Toxics (PACT) Act" + add_column :request_issues, :mst_status, :boolean, default: false, comment: "Indicates if issue is related to Military Sexual Trauma (MST)" + add_column :request_issues, :pact_status, :boolean, default: false ,comment: "Indicates if issue is related to Promise to Address Comprehensive Toxics (PACT) Act" end end From d435bb028158c1b3ab2a10082685dcf819e132c1 Mon Sep 17 00:00:00 2001 From: youfoundmanesh Date: Thu, 13 Apr 2023 16:52:21 -0400 Subject: [PATCH 6/8] Revert "schema update" This reverts commit 0d5df1a9b176b5b1e5fff5141d27b09bd3164376. --- db/schema.rb | 64 +++++----------------------------------------------- 1 file changed, 6 insertions(+), 58 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index fe2d0cf9c8b..e209de98305 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_04_12_154615) do +ActiveRecord::Schema.define(version: 2023_03_17_164013) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -91,7 +91,7 @@ t.boolean "appeal_docketed", default: false, null: false, comment: "When true, appeal has been docketed" t.bigint "appeal_id", null: false, comment: "AMA or Legacy Appeal ID" t.string "appeal_type", null: false, comment: "Appeal Type (Appeal or LegacyAppeal)" - t.datetime "created_at", null: false + t.datetime "created_at", null: false, comment: "Date and Time the record was inserted into the table" t.bigint "created_by_id", null: false, comment: "User id of the user that inserted the record" t.boolean "decision_mailed", default: false, null: false, comment: "When true, appeal has decision mail request complete" t.boolean "hearing_postponed", default: false, null: false, comment: "When true, appeal has hearing postponed and no hearings scheduled" @@ -100,7 +100,7 @@ t.boolean "privacy_act_complete", default: false, null: false, comment: "When true, appeal has a privacy act request completed" t.boolean "privacy_act_pending", default: false, null: false, comment: "When true, appeal has a privacy act request still open" t.boolean "scheduled_in_error", default: false, null: false, comment: "When true, hearing was scheduled in error and none scheduled" - t.datetime "updated_at" + t.datetime "updated_at", comment: "Date and time the record was last updated" t.bigint "updated_by_id", comment: "User id of the last user that updated the record" t.boolean "vso_ihp_complete", default: false, null: false, comment: "When true, appeal has a VSO IHP request completed" t.boolean "vso_ihp_pending", default: false, null: false, comment: "When true, appeal has a VSO IHP request pending" @@ -152,19 +152,6 @@ t.index ["veteran_file_number"], name: "index_appeals_on_veteran_file_number" end - create_table "appellant_substitution_histories", force: :cascade do |t| - t.bigint "appellant_substitution_id", comment: "Appellant substitution id of the last user that updated the CAVC record" - t.datetime "created_at", null: false - t.bigint "created_by_id", comment: "Current user who created Appellant substitution" - t.string "current_appellant_substitute_participant_id", comment: "Current Appellant Substitute participant Id" - t.string "current_appellant_veteran_participant_id", comment: "Current Appellant Veteran participant Id" - t.string "original_appellant_substitute_participant_id", comment: "Original Appellant Substitute participant Id" - t.string "original_appellant_veteran_participant_id", comment: "Original Appeallant Veteran Participant Id" - t.date "substitution_date", comment: "Timestamp of substitution granted date" - t.datetime "updated_at", null: false - t.index ["appellant_substitution_id"], name: "index_appellant_sub_histories_on_appellant_substitution_id" - end - create_table "appellant_substitutions", comment: "Store appellant substitution form data", force: :cascade do |t| t.string "claimant_type", null: false, comment: "Claimant type of substitute; needed to create Claimant record" t.datetime "created_at", null: false, comment: "Standard created_at/updated_at timestamps" @@ -419,24 +406,6 @@ t.index ["source_appeal_id"], name: "index_cavc_remands_on_source_appeal_id" end - create_table "cavc_remands_appellant_substitutions", force: :cascade do |t| - t.bigint "appellant_substitution_id", comment: "Appellant Substitution this is tied to" - t.bigint "cavc_remand_id", comment: "Cavc Remand this is tied to" - t.datetime "created_at", null: false - t.bigint "created_by_id", comment: "Current user who created substitution" - t.boolean "is_appellant_substituted", comment: "Y/N Boolean for active substitution" - t.string "participant_id", comment: "Claimant Participant Id" - t.string "remand_source", comment: "Source of Remand - From Add or Edit" - t.string "substitute_participant_id", comment: "Appellant Substitute participant Id" - t.date "substitution_date", comment: "Timestamp of substitution" - t.datetime "updated_at", null: false - t.bigint "updated_by_id", comment: "Current user who updated substitution" - t.index ["appellant_substitution_id"], name: "index_on_appellant_substitution_id" - t.index ["cavc_remand_id"], name: "index_on_cavc_remand_id" - t.index ["participant_id"], name: "index_on_participant_id" - t.index ["substitute_participant_id"], name: "index_on_substitute_participant_id" - end - create_table "cavc_selection_bases", force: :cascade do |t| t.string "basis_for_selection" t.string "category" @@ -1194,20 +1163,6 @@ t.index ["request_issue_id"], name: "index_legacy_issues_on_request_issue_id" end - create_table "membership_requests", force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "decided_at", comment: "The date and time when the deider user made a decision about the membership request" - t.bigint "decider_id", comment: "The user who decides the status of the membership request" - t.string "note", comment: "A note that provides additional context from the requestor about their request for access to the organization" - t.bigint "organization_id", comment: "The organization that the membership request is asking to join" - t.bigint "requestor_id", comment: "The User that is requesting access to the organization" - t.string "status", default: "assigned", null: false, comment: "The status of the membership request at any given point of time" - t.datetime "updated_at", null: false - t.index ["organization_id"], name: "index_membership_requests_on_organization_id" - t.index ["requestor_id"], name: "index_membership_requests_on_requestor_id" - t.index ["status", "organization_id", "requestor_id"], name: "index_membership_requests_on_status_and_association_ids", unique: true, where: "((status)::text = 'assigned'::text)" - end - create_table "messages", force: :cascade do |t| t.datetime "created_at", null: false t.integer "detail_id", comment: "ID of the related object" @@ -1263,7 +1218,7 @@ t.string "appeals_type", null: false, comment: "Type of Appeal" t.datetime "created_at", comment: "Timestamp of when Noticiation was Created" t.boolean "email_enabled", default: true, null: false - t.string "email_notification_content", comment: "Full Email Text Content of Notification" + t.text "email_notification_content", comment: "Full Email Text Content of Notification" t.string "email_notification_external_id", comment: "VA Notify Notification Id for the email notification send through their API " t.string "email_notification_status", comment: "Status of the Email Notification" t.date "event_date", null: false, comment: "Date of Event" @@ -1274,7 +1229,7 @@ t.string "participant_id", comment: "ID of Participant" t.string "recipient_email", comment: "Participant's Email Address" t.string "recipient_phone_number", comment: "Participants Phone Number" - t.string "sms_notification_content", comment: "Full SMS Text Content of Notification" + t.text "sms_notification_content", comment: "Full SMS Text Content of Notification" t.string "sms_notification_external_id", comment: "VA Notify Notification Id for the sms notification send through their API " t.string "sms_notification_status", comment: "Status of SMS/Text Notification" t.datetime "updated_at", comment: "TImestamp of when Notification was Updated" @@ -1473,7 +1428,6 @@ t.string "nonrating_issue_category", comment: "The category selected for nonrating request issues. These vary by business line." t.string "nonrating_issue_description", comment: "The user entered description if the issue is a nonrating issue" t.text "notes", comment: "Notes added by the Claims Assistant when adding request issues. This may be used to capture handwritten notes on the form, or other comments the CA wants to capture." - t.boolean "pact_status", comment: "Indicates if issue is related to Promise to Address Comprehensive Toxics (PACT) Act" t.string "ramp_claim_id", comment: "If a rating issue was created as a result of an issue intaken for a RAMP Review, it will be connected to the former RAMP issue by its End Product's claim ID." t.datetime "rating_issue_associated_at", comment: "Timestamp when a contention and its contested rating issue are associated in VBMS." t.string "split_issue_status", comment: "If a request issue is part of a split, on_hold status applies to the original request issues while active are request issues on splitted appeals" @@ -1579,6 +1533,7 @@ t.boolean "national_cemetery_administration", default: false t.boolean "no_special_issues", default: false, comment: "Affirmative no special issues, added belatedly" t.boolean "nonrating_issue", default: false + t.boolean "pact_act", default: false, comment: "The Sergeant First Class (SFC) Heath Robinson Honoring our Promise to Address Comprehensive Toxics (PACT) Act" t.boolean "pension_united_states", default: false t.boolean "private_attorney_or_agent", default: false t.boolean "radiation", default: false @@ -1972,10 +1927,6 @@ add_foreign_key "cavc_remands", "appeals", column: "source_appeal_id" add_foreign_key "cavc_remands", "users", column: "created_by_id" add_foreign_key "cavc_remands", "users", column: "updated_by_id" - add_foreign_key "cavc_remands_appellant_substitutions", "appellant_substitutions" - add_foreign_key "cavc_remands_appellant_substitutions", "cavc_remands" - add_foreign_key "cavc_remands_appellant_substitutions", "users", column: "created_by_id" - add_foreign_key "cavc_remands_appellant_substitutions", "users", column: "updated_by_id" add_foreign_key "certification_cancellations", "certifications" add_foreign_key "certifications", "users" add_foreign_key "claim_establishments", "dispatch_tasks", column: "task_id" @@ -2026,9 +1977,6 @@ add_foreign_key "legacy_issue_optins", "legacy_issues" add_foreign_key "legacy_issue_optins", "request_issues" add_foreign_key "legacy_issues", "request_issues" - add_foreign_key "membership_requests", "organizations" - add_foreign_key "membership_requests", "users", column: "decider_id" - add_foreign_key "membership_requests", "users", column: "requestor_id" add_foreign_key "messages", "users" add_foreign_key "mpi_update_person_events", "api_keys" add_foreign_key "nod_date_updates", "appeals" From 61e008776db779c7e20073c2537402f75bdb4e5e Mon Sep 17 00:00:00 2001 From: youfoundmanesh Date: Thu, 13 Apr 2023 16:53:07 -0400 Subject: [PATCH 7/8] Revert "typo in schema" This reverts commit 9a74e6ee66cc835fba82082c1f7c50fb9e313fde. --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index e209de98305..eaa3faf0d63 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1424,7 +1424,7 @@ t.string "ineligible_reason", comment: "The reason for a Request Issue being ineligible. If a Request Issue has an ineligible_reason, it is still captured, but it will not get a contention in VBMS or a decision." t.boolean "is_predocket_needed", comment: "Indicates whether or not an issue has been selected to go to the pre-docket queue opposed to normal docketing." t.boolean "is_unidentified", comment: "Indicates whether a Request Issue is unidentified, meaning it wasn't found in the list of contestable issues, and is not a new nonrating issue. Contentions for unidentified issues are created on a rating End Product if processed in VBMS but without the issue description, and someone is required to edit it in Caseflow before proceeding with the decision." - t.boolean "mst_status", comment: "Indicates if issue is related to Military Sexual Trauma (MST)" + t.boolean "mst_status", comment: "Indicates if issue is related to Military Sexual Trauam (MST)" t.string "nonrating_issue_category", comment: "The category selected for nonrating request issues. These vary by business line." t.string "nonrating_issue_description", comment: "The user entered description if the issue is a nonrating issue" t.text "notes", comment: "Notes added by the Claims Assistant when adding request issues. This may be used to capture handwritten notes on the form, or other comments the CA wants to capture." From 293bc89620b010687dd019d5df7d706ba432703a Mon Sep 17 00:00:00 2001 From: youfoundmanesh Date: Thu, 13 Apr 2023 16:54:47 -0400 Subject: [PATCH 8/8] +1 --- db/schema.rb | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index eaa3faf0d63..b6faace638b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_03_17_164013) do +ActiveRecord::Schema.define(version: 2023_04_12_154615) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -152,6 +152,19 @@ t.index ["veteran_file_number"], name: "index_appeals_on_veteran_file_number" end + create_table "appellant_substitution_histories", force: :cascade do |t| + t.bigint "appellant_substitution_id", comment: "Appellant substitution id of the last user that updated the CAVC record" + t.datetime "created_at", null: false + t.bigint "created_by_id", comment: "Current user who created Appellant substitution" + t.string "current_appellant_substitute_participant_id", comment: "Current Appellant Substitute participant Id" + t.string "current_appellant_veteran_participant_id", comment: "Current Appellant Veteran participant Id" + t.string "original_appellant_substitute_participant_id", comment: "Original Appellant Substitute participant Id" + t.string "original_appellant_veteran_participant_id", comment: "Original Appeallant Veteran Participant Id" + t.date "substitution_date", comment: "Timestamp of substitution granted date" + t.datetime "updated_at", null: false + t.index ["appellant_substitution_id"], name: "index_appellant_sub_histories_on_appellant_substitution_id" + end + create_table "appellant_substitutions", comment: "Store appellant substitution form data", force: :cascade do |t| t.string "claimant_type", null: false, comment: "Claimant type of substitute; needed to create Claimant record" t.datetime "created_at", null: false, comment: "Standard created_at/updated_at timestamps" @@ -406,6 +419,24 @@ t.index ["source_appeal_id"], name: "index_cavc_remands_on_source_appeal_id" end + create_table "cavc_remands_appellant_substitutions", force: :cascade do |t| + t.bigint "appellant_substitution_id", comment: "Appellant Substitution this is tied to" + t.bigint "cavc_remand_id", comment: "Cavc Remand this is tied to" + t.datetime "created_at", null: false + t.bigint "created_by_id", comment: "Current user who created substitution" + t.boolean "is_appellant_substituted", comment: "Y/N Boolean for active substitution" + t.string "participant_id", comment: "Claimant Participant Id" + t.string "remand_source", comment: "Source of Remand - From Add or Edit" + t.string "substitute_participant_id", comment: "Appellant Substitute participant Id" + t.date "substitution_date", comment: "Timestamp of substitution" + t.datetime "updated_at", null: false + t.bigint "updated_by_id", comment: "Current user who updated substitution" + t.index ["appellant_substitution_id"], name: "index_on_appellant_substitution_id" + t.index ["cavc_remand_id"], name: "index_on_cavc_remand_id" + t.index ["participant_id"], name: "index_on_participant_id" + t.index ["substitute_participant_id"], name: "index_on_substitute_participant_id" + end + create_table "cavc_selection_bases", force: :cascade do |t| t.string "basis_for_selection" t.string "category" @@ -1163,6 +1194,20 @@ t.index ["request_issue_id"], name: "index_legacy_issues_on_request_issue_id" end + create_table "membership_requests", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "decided_at", comment: "The date and time when the deider user made a decision about the membership request" + t.bigint "decider_id", comment: "The user who decides the status of the membership request" + t.string "note", comment: "A note that provides additional context from the requestor about their request for access to the organization" + t.bigint "organization_id", comment: "The organization that the membership request is asking to join" + t.bigint "requestor_id", comment: "The User that is requesting access to the organization" + t.string "status", default: "assigned", null: false, comment: "The status of the membership request at any given point of time" + t.datetime "updated_at", null: false + t.index ["organization_id"], name: "index_membership_requests_on_organization_id" + t.index ["requestor_id"], name: "index_membership_requests_on_requestor_id" + t.index ["status", "organization_id", "requestor_id"], name: "index_membership_requests_on_status_and_association_ids", unique: true, where: "((status)::text = 'assigned'::text)" + end + create_table "messages", force: :cascade do |t| t.datetime "created_at", null: false t.integer "detail_id", comment: "ID of the related object" @@ -1424,10 +1469,11 @@ t.string "ineligible_reason", comment: "The reason for a Request Issue being ineligible. If a Request Issue has an ineligible_reason, it is still captured, but it will not get a contention in VBMS or a decision." t.boolean "is_predocket_needed", comment: "Indicates whether or not an issue has been selected to go to the pre-docket queue opposed to normal docketing." t.boolean "is_unidentified", comment: "Indicates whether a Request Issue is unidentified, meaning it wasn't found in the list of contestable issues, and is not a new nonrating issue. Contentions for unidentified issues are created on a rating End Product if processed in VBMS but without the issue description, and someone is required to edit it in Caseflow before proceeding with the decision." - t.boolean "mst_status", comment: "Indicates if issue is related to Military Sexual Trauam (MST)" + t.boolean "mst_status", default: false, comment: "Indicates if issue is related to Military Sexual Trauma (MST)" t.string "nonrating_issue_category", comment: "The category selected for nonrating request issues. These vary by business line." t.string "nonrating_issue_description", comment: "The user entered description if the issue is a nonrating issue" t.text "notes", comment: "Notes added by the Claims Assistant when adding request issues. This may be used to capture handwritten notes on the form, or other comments the CA wants to capture." + t.boolean "pact_status", default: false, comment: "Indicates if issue is related to Promise to Address Comprehensive Toxics (PACT) Act" t.string "ramp_claim_id", comment: "If a rating issue was created as a result of an issue intaken for a RAMP Review, it will be connected to the former RAMP issue by its End Product's claim ID." t.datetime "rating_issue_associated_at", comment: "Timestamp when a contention and its contested rating issue are associated in VBMS." t.string "split_issue_status", comment: "If a request issue is part of a split, on_hold status applies to the original request issues while active are request issues on splitted appeals" @@ -1927,6 +1973,10 @@ add_foreign_key "cavc_remands", "appeals", column: "source_appeal_id" add_foreign_key "cavc_remands", "users", column: "created_by_id" add_foreign_key "cavc_remands", "users", column: "updated_by_id" + add_foreign_key "cavc_remands_appellant_substitutions", "appellant_substitutions" + add_foreign_key "cavc_remands_appellant_substitutions", "cavc_remands" + add_foreign_key "cavc_remands_appellant_substitutions", "users", column: "created_by_id" + add_foreign_key "cavc_remands_appellant_substitutions", "users", column: "updated_by_id" add_foreign_key "certification_cancellations", "certifications" add_foreign_key "certifications", "users" add_foreign_key "claim_establishments", "dispatch_tasks", column: "task_id" @@ -1977,6 +2027,9 @@ add_foreign_key "legacy_issue_optins", "legacy_issues" add_foreign_key "legacy_issue_optins", "request_issues" add_foreign_key "legacy_issues", "request_issues" + add_foreign_key "membership_requests", "organizations" + add_foreign_key "membership_requests", "users", column: "decider_id" + add_foreign_key "membership_requests", "users", column: "requestor_id" add_foreign_key "messages", "users" add_foreign_key "mpi_update_person_events", "api_keys" add_foreign_key "nod_date_updates", "appeals"