From 07d7b1b77ca46a59ffd3abd0f132ddcd32ffde97 Mon Sep 17 00:00:00 2001 From: Lee Delarm Date: Wed, 10 Apr 2024 18:33:29 -0400 Subject: [PATCH 1/6] Add scour function, add test, fix other test --- db/schema.rb | 245 +++++++++--------- .../app/services/check_in/map/client.rb | 27 +- .../spec/services/check_in/map/client_spec.rb | 36 ++- 3 files changed, 183 insertions(+), 125 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 8e301b213f5..5a2f15301f9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -22,13 +22,13 @@ create_table "account_login_stats", force: :cascade do |t| t.bigint "account_id", null: false - t.datetime "idme_at" - t.datetime "myhealthevet_at" - t.datetime "dslogon_at" + t.datetime "idme_at", precision: nil + t.datetime "myhealthevet_at", precision: nil + t.datetime "dslogon_at", precision: nil t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "current_verification" - t.datetime "logingov_at" + t.datetime "logingov_at", precision: nil t.index ["account_id"], name: "index_account_login_stats_on_account_id", unique: true t.index ["current_verification"], name: "index_account_login_stats_on_current_verification" t.index ["dslogon_at"], name: "index_account_login_stats_on_dslogon_at" @@ -42,8 +42,8 @@ t.string "idme_uuid" t.string "icn" t.string "edipi" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "sec_id" t.string "logingov_uuid" t.index ["icn"], name: "index_accounts_on_icn" @@ -197,7 +197,7 @@ t.string "record_type", null: false t.bigint "record_id", null: false t.bigint "blob_id", null: false - t.datetime "created_at", null: false + t.datetime "created_at", precision: nil, null: false t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true end @@ -209,7 +209,7 @@ t.text "metadata" t.bigint "byte_size", null: false t.string "checksum", null: false - t.datetime "created_at", null: false + t.datetime "created_at", precision: nil, null: false t.string "service_name", null: false t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true end @@ -258,8 +258,8 @@ create_table "appeals_api_higher_level_reviews", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "status", default: "pending", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "code" t.string "detail" t.string "source" @@ -296,7 +296,7 @@ t.string "to" t.string "statusable_type" t.string "statusable_id" - t.datetime "status_update_time" + t.datetime "status_update_time", precision: nil t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "code" @@ -330,8 +330,8 @@ t.string "status" t.string "transaction_id" t.string "transaction_status" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "metadata_ciphertext" t.text "encrypted_kms_key" t.uuid "user_account_id" @@ -359,8 +359,8 @@ t.jsonb "feedback" t.jsonb "access" t.string "fingerprint" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.geography "location", limit: {:srid=>4326, :type=>"st_point", :geographic=>true} t.boolean "mobile" t.string "active_status" @@ -381,8 +381,8 @@ create_table "claims_api_auto_established_claims", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "status" t.integer "evss_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "md5" t.string "source" t.string "flashes", default: [], array: true @@ -435,8 +435,8 @@ t.string "status" t.string "current_poa" t.string "md5" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "vbms_new_document_version_ref_id" t.string "vbms_document_series_ref_id" t.string "vbms_error_message" @@ -453,8 +453,8 @@ end create_table "claims_api_supporting_documents", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.uuid "auto_established_claim_id" t.text "file_data_ciphertext" t.text "encrypted_kms_key" @@ -491,8 +491,8 @@ t.string "email_confirmation_id" t.string "enrollment_id" t.string "batch_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "raw_form_data_ciphertext" t.text "eligibility_info_ciphertext" t.text "form_data_ciphertext" @@ -506,8 +506,8 @@ create_table "covid_vaccine_registration_submissions", id: :serial, force: :cascade do |t| t.string "sid" t.uuid "account_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "expanded", default: false, null: false t.boolean "sequestered", default: false, null: false t.string "email_confirmation_id" @@ -555,8 +555,8 @@ t.integer "code", null: false t.string "medical_term", null: false t.string "lay_term" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["code"], name: "index_disability_contentions_on_code", unique: true t.index ["lay_term"], name: "index_disability_contentions_on_lay_term", opclass: :gin_trgm_ops, using: :gin t.index ["medical_term"], name: "index_disability_contentions_on_medical_term", opclass: :gin_trgm_ops, using: :gin @@ -567,19 +567,19 @@ t.string "unit" t.geography "polygon", limit: {:srid=>4326, :type=>"st_polygon", :geographic=>true}, null: false t.string "vha_facility_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "min" t.integer "max" - t.datetime "vssc_extract_date", default: "2001-01-01 00:00:00" + t.datetime "vssc_extract_date", precision: nil, default: "2001-01-01 00:00:00" t.index ["polygon"], name: "index_drivetime_bands_on_polygon", using: :gist end create_table "education_benefits_claims", id: :serial, force: :cascade do |t| - t.datetime "submitted_at" - t.datetime "processed_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "submitted_at", precision: nil + t.datetime "processed_at", precision: nil + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "regional_processing_office", null: false t.string "form_type", default: "1990" t.integer "saved_claim_id", null: false @@ -592,8 +592,8 @@ create_table "education_benefits_submissions", id: :serial, force: :cascade do |t| t.string "region", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "chapter33", default: false, null: false t.boolean "chapter30", default: false, null: false t.boolean "chapter1606", default: false, null: false @@ -619,8 +619,8 @@ t.datetime "updated_at", null: false t.boolean "poa" t.integer "remaining_entitlement" - t.datetime "denial_email_sent_at" - t.datetime "confirmation_email_sent_at" + t.datetime "denial_email_sent_at", precision: nil + t.datetime "confirmation_email_sent_at", precision: nil t.text "auth_headers_json_ciphertext" t.text "encrypted_kms_key" t.uuid "user_account_id" @@ -632,8 +632,8 @@ create_table "evss_claims", id: :serial, force: :cascade do |t| t.integer "evss_id", null: false t.json "data", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "user_uuid", null: false t.json "list_data", default: {}, null: false t.boolean "requested_decision", default: false, null: false @@ -650,8 +650,8 @@ t.string "gate_name" t.string "value" t.string "user" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["feature_name"], name: "index_feature_toggle_events_on_feature_name" end @@ -664,12 +664,13 @@ t.datetime "updated_at", null: false t.datetime "flagged_value_updated_at" t.index ["ip_address", "representative_id", "flag_type", "flagged_value_updated_at"], name: "index_unique_constraint_fields", unique: true + t.index ["ip_address", "representative_id", "flag_type"], name: "index_unique_flagged_veteran_representative", unique: true end create_table "flipper_features", force: :cascade do |t| t.string "key", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["key"], name: "index_flipper_features_on_key", unique: true end @@ -677,14 +678,14 @@ t.string "feature_key", null: false t.string "key", null: false t.text "value" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true end create_table "form1010cg_submissions", force: :cascade do |t| t.string "carma_case_id", limit: 18, null: false - t.datetime "accepted_at", null: false + t.datetime "accepted_at", precision: nil, null: false t.json "metadata" t.json "attachments" t.datetime "created_at", null: false @@ -711,7 +712,7 @@ t.string "status", null: false t.string "error_class" t.string "error_message" - t.datetime "updated_at", null: false + t.datetime "updated_at", precision: nil, null: false t.jsonb "bgjob_errors", default: {} t.index ["bgjob_errors"], name: "index_form526_job_statuses_on_bgjob_errors", using: :gin t.index ["form526_submission_id"], name: "index_form526_job_statuses_on_form526_submission_id" @@ -723,8 +724,8 @@ t.integer "saved_claim_id", null: false t.integer "submitted_claim_id" t.boolean "workflow_complete", default: false, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "multiple_birls", comment: "*After* a SubmitForm526 Job fails, a lookup is done to see if the veteran has multiple BIRLS IDs. This field gets set to true if that is the case. If the initial submit job succeeds, this field will remain false whether or not the veteran has multiple BIRLS IDs --so this field cannot technically be used to sum all Form526 veterans that have multiple BIRLS. This field /can/ give us an idea of how often having multiple BIRLS IDs is a problem." t.text "auth_headers_json_ciphertext" t.text "form_json_ciphertext" @@ -756,8 +757,8 @@ end create_table "form_attachments", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.uuid "guid", null: false t.string "type", null: false t.text "file_data_ciphertext" @@ -799,9 +800,9 @@ t.string "edipi", null: false t.string "first_name", null: false t.string "last_name", null: false - t.datetime "dob", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "dob", precision: nil, null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "ssn_ciphertext" t.text "encrypted_kms_key" t.index ["edipi"], name: "index_gibs_not_found_users_on_edipi" @@ -823,15 +824,15 @@ t.integer "msa", null: false t.string "msa_name" t.integer "version", null: false - t.datetime "created", null: false - t.datetime "updated" + t.datetime "created", precision: nil, null: false + t.datetime "updated", precision: nil t.string "created_by" t.string "updated_by" end create_table "health_care_applications", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "state", default: "pending", null: false t.string "form_submission_id_string" t.string "timestamp" @@ -853,18 +854,18 @@ create_table "id_card_announcement_subscriptions", id: :serial, force: :cascade do |t| t.string "email", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["email"], name: "index_id_card_announcement_subscriptions_on_email", unique: true end create_table "in_progress_forms", id: :serial, force: :cascade do |t| t.string "user_uuid", null: false t.string "form_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.json "metadata" - t.datetime "expires_at" + t.datetime "expires_at", precision: nil t.text "form_data_ciphertext" t.text "encrypted_kms_key" t.uuid "user_account_id" @@ -883,19 +884,19 @@ create_table "invalid_letter_address_edipis", id: :serial, force: :cascade do |t| t.string "edipi", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["edipi"], name: "index_invalid_letter_address_edipis_on_edipi" end create_table "maintenance_windows", id: :serial, force: :cascade do |t| t.string "pagerduty_id" t.string "external_service" - t.datetime "start_time" - t.datetime "end_time" + t.datetime "start_time", precision: nil + t.datetime "end_time", precision: nil t.string "description" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["end_time"], name: "index_maintenance_windows_on_end_time" t.index ["pagerduty_id"], name: "index_maintenance_windows_on_pagerduty_id" t.index ["start_time"], name: "index_maintenance_windows_on_start_time" @@ -930,8 +931,8 @@ t.uuid "handle", null: false t.uuid "user_account_id", null: false t.string "hashed_refresh_token", null: false - t.datetime "refresh_expiration", null: false - t.datetime "refresh_creation", null: false + t.datetime "refresh_expiration", precision: nil, null: false + t.datetime "refresh_creation", precision: nil, null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.bigint "user_verification_id", null: false @@ -967,10 +968,10 @@ t.uuid "guid" t.string "type" t.string "form_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "saved_claim_id" - t.datetime "completed_at" + t.datetime "completed_at", precision: nil t.text "file_data_ciphertext" t.text "encrypted_kms_key" t.index ["guid"], name: "index_persistent_attachments_on_guid", unique: true @@ -981,8 +982,8 @@ create_table "personal_information_logs", id: :serial, force: :cascade do |t| t.jsonb "data", null: false t.string "error_class", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_at"], name: "index_personal_information_logs_on_created_at" t.index ["error_class"], name: "index_personal_information_logs_on_error_class" end @@ -994,7 +995,7 @@ t.bigint "query_hash" t.float "total_time" t.bigint "calls" - t.datetime "captured_at" + t.datetime "captured_at", precision: nil t.index ["database", "captured_at"], name: "index_pghero_query_stats_on_database_and_captured_at" end @@ -1003,7 +1004,7 @@ t.text "schema" t.text "relation" t.bigint "size" - t.datetime "captured_at" + t.datetime "captured_at", precision: nil t.index ["database", "captured_at"], name: "index_pghero_space_stats_on_database_and_captured_at" end @@ -1012,22 +1013,22 @@ t.string "application_uuid" t.string "return_description", null: false t.integer "return_code" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["application_uuid"], name: "index_preneed_submissions_on_application_uuid", unique: true t.index ["tracking_number"], name: "index_preneed_submissions_on_tracking_number", unique: true end create_table "saved_claims", id: :serial, force: :cascade do |t| - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.string "form_id" t.uuid "guid", null: false t.string "type" t.text "form_ciphertext" t.text "encrypted_kms_key" - t.string "uploaded_forms", default: [], array: true - t.datetime "itf_datetime" + t.string "uploaded_forms", array: true + t.datetime "itf_datetime", precision: nil t.index ["created_at", "type"], name: "index_saved_claims_on_created_at_and_type" t.index ["guid"], name: "index_saved_claims_on_guid", unique: true t.index ["id", "type"], name: "index_saved_claims_on_id_and_type" @@ -1060,7 +1061,7 @@ t.integer "rpo" t.integer "number_of_submissions" t.string "filename" - t.datetime "successful_at" + t.datetime "successful_at", precision: nil t.integer "retry_attempt", default: 0 t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -1073,8 +1074,8 @@ t.string "description", null: false t.integer "state_id", null: false t.integer "version", null: false - t.datetime "created", null: false - t.datetime "updated" + t.datetime "created", precision: nil, null: false + t.datetime "updated", precision: nil t.string "created_by" t.string "updated_by" end @@ -1094,7 +1095,7 @@ t.integer "add_ninety_day_hospital_copay" t.integer "outpatient_basic_care_copay" t.integer "outpatient_specialty_copay" - t.datetime "threshold_effective_date" + t.datetime "threshold_effective_date", precision: nil t.integer "aid_and_attendance_threshold" t.integer "outpatient_preventive_copay" t.integer "medication_copay" @@ -1105,8 +1106,8 @@ t.integer "inpatient_per_diem" t.string "description" t.integer "version", null: false - t.datetime "created", null: false - t.datetime "updated" + t.datetime "created", precision: nil, null: false + t.datetime "updated", precision: nil t.string "created_by" t.string "updated_by" end @@ -1117,8 +1118,8 @@ t.integer "fips_code", null: false t.integer "country_id", null: false t.integer "version", null: false - t.datetime "created", null: false - t.datetime "updated" + t.datetime "created", precision: nil, null: false + t.datetime "updated", precision: nil t.string "created_by" t.string "updated_by" end @@ -1130,8 +1131,8 @@ t.integer "state_id", null: false t.integer "county_number", null: false t.integer "version", null: false - t.datetime "created", null: false - t.datetime "updated" + t.datetime "created", precision: nil, null: false + t.datetime "updated", precision: nil t.string "created_by" t.string "updated_by" end @@ -1147,8 +1148,8 @@ create_table "test_user_dashboard_tud_account_availability_logs", force: :cascade do |t| t.string "account_uuid" - t.datetime "checkout_time" - t.datetime "checkin_time" + t.datetime "checkout_time", precision: nil + t.datetime "checkin_time", precision: nil t.boolean "has_checkin_error" t.boolean "is_manual_checkin" t.datetime "created_at", null: false @@ -1162,12 +1163,12 @@ t.string "middle_name" t.string "last_name" t.string "gender" - t.datetime "birth_date" + t.datetime "birth_date", precision: nil t.integer "ssn" t.string "phone" t.string "email" t.string "password" - t.datetime "checkout_time" + t.datetime "checkout_time", precision: nil t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "services" @@ -1180,8 +1181,8 @@ end create_table "user_acceptable_verified_credentials", force: :cascade do |t| - t.datetime "acceptable_verified_credential_at" - t.datetime "idme_verified_credential_at" + t.datetime "acceptable_verified_credential_at", precision: nil + t.datetime "idme_verified_credential_at", precision: nil t.uuid "user_account_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -1212,7 +1213,7 @@ t.string "logingov_uuid" t.string "mhv_uuid" t.string "dslogon_uuid" - t.datetime "verified_at" + t.datetime "verified_at", precision: nil t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "backing_idme_uuid" @@ -1234,15 +1235,15 @@ t.date "last_revision_on" t.integer "pages" t.string "sha256" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "valid_pdf", default: false t.text "form_usage" t.text "form_tool_intro" t.string "form_tool_url" t.string "form_type" t.string "language" - t.datetime "deleted_at" + t.datetime "deleted_at", precision: nil t.string "related_forms", array: true t.jsonb "benefit_categories" t.string "form_details_url" @@ -1289,8 +1290,8 @@ t.string "status", default: "pending", null: false t.string "code" t.string "detail" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "s3_deleted" t.string "consumer_name" t.uuid "consumer_id" @@ -1318,8 +1319,8 @@ t.string "name" t.string "phone" t.string "state", limit: 2 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "address_type" t.string "city" t.string "country_code_iso3" @@ -1349,8 +1350,8 @@ t.string "last_name" t.string "email" t.string "phone" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "poa_codes", default: [], array: true t.string "user_types", default: [], array: true t.text "ssn_ciphertext" @@ -1384,8 +1385,8 @@ end create_table "vic_submissions", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "state", default: "pending", null: false t.uuid "guid", null: false t.json "response" @@ -1415,10 +1416,10 @@ create_table "vye_awards", force: :cascade do |t| t.integer "user_info_id" t.string "cur_award_ind" - t.datetime "award_begin_date" - t.datetime "award_end_date" + t.datetime "award_begin_date", precision: nil + t.datetime "award_end_date", precision: nil t.integer "training_time" - t.datetime "payment_date" + t.datetime "payment_date", precision: nil t.decimal "monthly_rate" t.string "begin_rsn" t.string "end_rsn" @@ -1455,7 +1456,7 @@ t.text "ssn_ciphertext" t.string "claim_no_ciphertext" t.string "doc_type" - t.datetime "queue_date" + t.datetime "queue_date", precision: nil t.string "rpo" t.text "encrypted_kms_key" t.datetime "created_at", null: false @@ -1481,9 +1482,9 @@ t.text "stub_nm_ciphertext" t.string "mr_status" t.string "rem_ent" - t.datetime "cert_issue_date" - t.datetime "del_date" - t.datetime "date_last_certified" + t.datetime "cert_issue_date", precision: nil + t.datetime "del_date", precision: nil + t.datetime "date_last_certified", precision: nil t.integer "rpo_code" t.string "fac_code" t.decimal "payment_amt" @@ -1513,8 +1514,8 @@ t.string "change_flag" t.integer "rpo_code" t.boolean "rpo_flag" - t.datetime "act_begin" - t.datetime "act_end" + t.datetime "act_begin", precision: nil + t.datetime "act_end", precision: nil t.string "source_ind" t.datetime "created_at", null: false t.datetime "updated_at", null: false diff --git a/modules/check_in/app/services/check_in/map/client.rb b/modules/check_in/app/services/check_in/map/client.rb index d85a99d96ac..3d0c60493af 100644 --- a/modules/check_in/app/services/check_in/map/client.rb +++ b/modules/check_in/app/services/check_in/map/client.rb @@ -28,17 +28,40 @@ def initialize @settings = Settings.check_in.map_api end + def deep_analyze_and_modify(obj) + case obj + when Hash + obj.each do |key, value| + if key == "system" && value.is_a?(String) + obj[key] = value.gsub("https://va.gov", "") + else + deep_analyze_and_modify(value) + end + end + when Array + obj.each do |value| + deep_analyze_and_modify(value) + end + end + end + ## # HTTP GET call to get the appointment data from MAP # # @return [Faraday::Response] # def appointments(token:, patient_icn:, query_params:) - connection.post("/vaos/v1/patients/#{patient_icn}/appointments?#{query_params}") do |req| + response = connection.post("/vaos/v1/patients/#{patient_icn}/appointments?#{query_params}") do |req| req.headers = default_headers.merge('X-VAMF-JWT' => token) end + deep_analyze_and_modify(response) + response rescue => e - Faraday::Response.new(body: e.original_body, status: e.original_status) + if e.respond_to?(:original_body) && e.respond_to?(:original_status) + Faraday::Response.new(body: e.original_body, status: e.original_status) + else + raise e + end end private diff --git a/modules/check_in/spec/services/check_in/map/client_spec.rb b/modules/check_in/spec/services/check_in/map/client_spec.rb index 0c0c8ebe46b..49ac9a46635 100644 --- a/modules/check_in/spec/services/check_in/map/client_spec.rb +++ b/modules/check_in/spec/services/check_in/map/client_spec.rb @@ -36,7 +36,7 @@ id: '180765', identifier: [ { - system: 'Appointment/', + system: 'https://va.gov/Appointment/', value: '413938333130383735' } ], @@ -68,6 +68,40 @@ end end + context 'when appointments service returns success response takes out https://va.gov' do + let(:appointments_response) do + { + data: [ + { + id: '180765', + identifier: [ + { + system: 'https://va.gov/Appointment/', + value: '413938333130383735' + } + ], + # ... rest of the response ... + } + ] + } + end + + before do + allow_any_instance_of(Faraday::Connection).to receive(:post).with(anything).and_return(appointments_response) + subject.deep_analyze_and_modify(appointments_response) + end + + it 'strips https://va.gov from any system property in the response' do + response = subject.appointments(token: jwt_token, patient_icn: icn, query_params:) + response[:data].each do |appointment| + appointment[:identifier].each do |identifier| + puts identifier[:system] + expect(identifier[:system]).not_to start_with('https://va.gov') + end + end + end + end + context 'when appointments service returns a 500 error response' do let(:error_msg) do { From bbeab69734cc1d9159ab8ff290e0a796af8d7974 Mon Sep 17 00:00:00 2001 From: Lee Delarm Date: Thu, 11 Apr 2024 16:22:08 -0400 Subject: [PATCH 2/6] Fixed test and function Fixed test and fixed function --- .../check_in/app/services/check_in/map/client.rb | 2 +- .../spec/services/check_in/map/client_spec.rb | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/check_in/app/services/check_in/map/client.rb b/modules/check_in/app/services/check_in/map/client.rb index 3d0c60493af..6ff5fe9275f 100644 --- a/modules/check_in/app/services/check_in/map/client.rb +++ b/modules/check_in/app/services/check_in/map/client.rb @@ -32,7 +32,7 @@ def deep_analyze_and_modify(obj) case obj when Hash obj.each do |key, value| - if key == "system" && value.is_a?(String) + if key == :system && value.is_a?(String) obj[key] = value.gsub("https://va.gov", "") else deep_analyze_and_modify(value) diff --git a/modules/check_in/spec/services/check_in/map/client_spec.rb b/modules/check_in/spec/services/check_in/map/client_spec.rb index 49ac9a46635..16aa5e6092e 100644 --- a/modules/check_in/spec/services/check_in/map/client_spec.rb +++ b/modules/check_in/spec/services/check_in/map/client_spec.rb @@ -80,7 +80,19 @@ value: '413938333130383735' } ], - # ... rest of the response ... + kind: 'clinic', + status: 'booked', + serviceType: 'amputation', + patientIcn: :icn, + locationId: '983GC', + clinic: '1081', + start: '2023-11-02T17:12:30.174Z', + end: '2023-12-12T17:12:30.174Z', + minutesDuration: 30, + extension: { + preCheckinAllowed: true, + eCheckinAllowed: true + } } ] } @@ -88,7 +100,6 @@ before do allow_any_instance_of(Faraday::Connection).to receive(:post).with(anything).and_return(appointments_response) - subject.deep_analyze_and_modify(appointments_response) end it 'strips https://va.gov from any system property in the response' do From 0c112642dbc6f9f9dda91b4a623765d8b66b698d Mon Sep 17 00:00:00 2001 From: Lee Delarm Date: Thu, 11 Apr 2024 16:43:54 -0400 Subject: [PATCH 3/6] Rubocop fix Rubocop fix --- modules/check_in/app/services/check_in/map/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/check_in/app/services/check_in/map/client.rb b/modules/check_in/app/services/check_in/map/client.rb index 6ff5fe9275f..316e473b264 100644 --- a/modules/check_in/app/services/check_in/map/client.rb +++ b/modules/check_in/app/services/check_in/map/client.rb @@ -33,7 +33,7 @@ def deep_analyze_and_modify(obj) when Hash obj.each do |key, value| if key == :system && value.is_a?(String) - obj[key] = value.gsub("https://va.gov", "") + obj[key] = value.gsub('https://va.gov', '') else deep_analyze_and_modify(value) end From e7b4f994c8f21b38d5b02cf0aff2147975a62e9f Mon Sep 17 00:00:00 2001 From: Lee Delarm Date: Mon, 15 Apr 2024 09:29:51 -0400 Subject: [PATCH 4/6] Revert schema Revert schema --- db/schema.rb | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 8c2ce40c1f4..d72a088a805 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[7.1].define(version: 2024_04_10_212727) do +ActiveRecord::Schema[7.1].define(version: 2024_04_11_235242) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "pg_stat_statements" @@ -818,6 +818,23 @@ t.index ["va_profile_id", "dismissed"], name: "show_onsite_notifications_index" end + create_table "pega_tables", force: :cascade do |t| + t.uuid "uuid" + t.string "veteranfirstname" + t.string "veteranmiddlename" + t.string "veteranlastname" + t.string "applicantfirstname" + t.string "applicantmiddlename" + t.string "applicantlastname" + t.jsonb "response" + t.string "filenumber" + t.string "doctype" + t.datetime "date_created" + t.datetime "date_completed" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "pension_ipf_notifications", force: :cascade do |t| t.text "payload_ciphertext" t.text "encrypted_kms_key" @@ -843,8 +860,8 @@ create_table "personal_information_logs", id: :serial, force: :cascade do |t| t.jsonb "data", null: false t.string "error_class", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "data_ciphertext" t.text "encrypted_kms_key" t.index ["created_at"], name: "index_personal_information_logs_on_created_at" @@ -1454,4 +1471,4 @@ add_foreign_key "user_verifications", "user_accounts" add_foreign_key "va_notify_in_progress_reminders_sent", "user_accounts" add_foreign_key "veteran_device_records", "devices" -end +end \ No newline at end of file From ff1e4cdfd21104cf4ecd38ed889b8c8569495582 Mon Sep 17 00:00:00 2001 From: Lee Delarm Date: Mon, 15 Apr 2024 09:36:29 -0400 Subject: [PATCH 5/6] Reverting changes to schema.rb --- db/schema.rb | 268 ++++++++++++++++++++++++--------------------------- 1 file changed, 124 insertions(+), 144 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index d72a088a805..40dce50a476 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[7.1].define(version: 2024_04_11_235242) do +ActiveRecord::Schema[7.1].define(version: 2024_04_10_212727) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "pg_stat_statements" @@ -22,13 +22,13 @@ create_table "account_login_stats", force: :cascade do |t| t.bigint "account_id", null: false - t.datetime "idme_at", precision: nil - t.datetime "myhealthevet_at", precision: nil - t.datetime "dslogon_at", precision: nil + t.datetime "idme_at" + t.datetime "myhealthevet_at" + t.datetime "dslogon_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "current_verification" - t.datetime "logingov_at", precision: nil + t.datetime "logingov_at" t.index ["account_id"], name: "index_account_login_stats_on_account_id", unique: true t.index ["current_verification"], name: "index_account_login_stats_on_current_verification" t.index ["dslogon_at"], name: "index_account_login_stats_on_dslogon_at" @@ -42,8 +42,8 @@ t.string "idme_uuid" t.string "icn" t.string "edipi" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "sec_id" t.string "logingov_uuid" t.index ["icn"], name: "index_accounts_on_icn" @@ -58,7 +58,7 @@ t.string "record_type", null: false t.bigint "record_id", null: false t.bigint "blob_id", null: false - t.datetime "created_at", precision: nil, null: false + t.datetime "created_at", null: false t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true end @@ -70,7 +70,7 @@ t.text "metadata" t.bigint "byte_size", null: false t.string "checksum", null: false - t.datetime "created_at", precision: nil, null: false + t.datetime "created_at", null: false t.string "service_name", null: false t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true end @@ -119,8 +119,8 @@ create_table "appeals_api_higher_level_reviews", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "status", default: "pending", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "code" t.string "detail" t.string "source" @@ -157,7 +157,7 @@ t.string "to" t.string "statusable_type" t.string "statusable_id" - t.datetime "status_update_time", precision: nil + t.datetime "status_update_time" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "code" @@ -191,8 +191,8 @@ t.string "status" t.string "transaction_id" t.string "transaction_status" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.text "metadata_ciphertext" t.text "encrypted_kms_key" t.uuid "user_account_id" @@ -220,8 +220,8 @@ t.jsonb "feedback" t.jsonb "access" t.string "fingerprint" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.geography "location", limit: {:srid=>4326, :type=>"st_point", :geographic=>true} t.boolean "mobile" t.string "active_status" @@ -242,8 +242,8 @@ create_table "claims_api_auto_established_claims", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "status" t.integer "evss_id" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "md5" t.string "source" t.string "flashes", default: [], array: true @@ -296,8 +296,8 @@ t.string "status" t.string "current_poa" t.string "md5" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "vbms_new_document_version_ref_id" t.string "vbms_document_series_ref_id" t.string "vbms_error_message" @@ -314,8 +314,8 @@ end create_table "claims_api_supporting_documents", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.uuid "auto_established_claim_id" t.text "file_data_ciphertext" t.text "encrypted_kms_key" @@ -352,8 +352,8 @@ t.string "email_confirmation_id" t.string "enrollment_id" t.string "batch_id" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.text "raw_form_data_ciphertext" t.text "eligibility_info_ciphertext" t.text "form_data_ciphertext" @@ -367,8 +367,8 @@ create_table "covid_vaccine_registration_submissions", id: :serial, force: :cascade do |t| t.string "sid" t.uuid "account_id" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "expanded", default: false, null: false t.boolean "sequestered", default: false, null: false t.string "email_confirmation_id" @@ -416,8 +416,8 @@ t.integer "code", null: false t.string "medical_term", null: false t.string "lay_term" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["code"], name: "index_disability_contentions_on_code", unique: true t.index ["lay_term"], name: "index_disability_contentions_on_lay_term", opclass: :gin_trgm_ops, using: :gin t.index ["medical_term"], name: "index_disability_contentions_on_medical_term", opclass: :gin_trgm_ops, using: :gin @@ -428,19 +428,19 @@ t.string "unit" t.geography "polygon", limit: {:srid=>4326, :type=>"st_polygon", :geographic=>true}, null: false t.string "vha_facility_id", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "min" t.integer "max" - t.datetime "vssc_extract_date", precision: nil, default: "2001-01-01 00:00:00" + t.datetime "vssc_extract_date", default: "2001-01-01 00:00:00" t.index ["polygon"], name: "index_drivetime_bands_on_polygon", using: :gist end create_table "education_benefits_claims", id: :serial, force: :cascade do |t| - t.datetime "submitted_at", precision: nil - t.datetime "processed_at", precision: nil - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "submitted_at" + t.datetime "processed_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "regional_processing_office", null: false t.string "form_type", default: "1990" t.integer "saved_claim_id", null: false @@ -453,8 +453,8 @@ create_table "education_benefits_submissions", id: :serial, force: :cascade do |t| t.string "region", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "chapter33", default: false, null: false t.boolean "chapter30", default: false, null: false t.boolean "chapter1606", default: false, null: false @@ -480,8 +480,8 @@ t.datetime "updated_at", null: false t.boolean "poa" t.integer "remaining_entitlement" - t.datetime "denial_email_sent_at", precision: nil - t.datetime "confirmation_email_sent_at", precision: nil + t.datetime "denial_email_sent_at" + t.datetime "confirmation_email_sent_at" t.text "auth_headers_json_ciphertext" t.text "encrypted_kms_key" t.uuid "user_account_id" @@ -493,8 +493,8 @@ create_table "evss_claims", id: :serial, force: :cascade do |t| t.integer "evss_id", null: false t.json "data", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "user_uuid", null: false t.json "list_data", default: {}, null: false t.boolean "requested_decision", default: false, null: false @@ -511,8 +511,8 @@ t.string "gate_name" t.string "value" t.string "user" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["feature_name"], name: "index_feature_toggle_events_on_feature_name" end @@ -525,13 +525,12 @@ t.datetime "updated_at", null: false t.datetime "flagged_value_updated_at" t.index ["ip_address", "representative_id", "flag_type", "flagged_value_updated_at"], name: "index_unique_constraint_fields", unique: true - t.index ["ip_address", "representative_id", "flag_type"], name: "index_unique_flagged_veteran_representative", unique: true end create_table "flipper_features", force: :cascade do |t| t.string "key", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["key"], name: "index_flipper_features_on_key", unique: true end @@ -539,14 +538,14 @@ t.string "feature_key", null: false t.string "key", null: false t.text "value" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true end create_table "form1010cg_submissions", force: :cascade do |t| t.string "carma_case_id", limit: 18, null: false - t.datetime "accepted_at", precision: nil, null: false + t.datetime "accepted_at", null: false t.json "metadata" t.json "attachments" t.datetime "created_at", null: false @@ -573,7 +572,7 @@ t.string "status", null: false t.string "error_class" t.string "error_message" - t.datetime "updated_at", precision: nil, null: false + t.datetime "updated_at", null: false t.jsonb "bgjob_errors", default: {} t.index ["bgjob_errors"], name: "index_form526_job_statuses_on_bgjob_errors", using: :gin t.index ["form526_submission_id"], name: "index_form526_job_statuses_on_form526_submission_id" @@ -585,8 +584,8 @@ t.integer "saved_claim_id", null: false t.integer "submitted_claim_id" t.boolean "workflow_complete", default: false, null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "multiple_birls", comment: "*After* a SubmitForm526 Job fails, a lookup is done to see if the veteran has multiple BIRLS IDs. This field gets set to true if that is the case. If the initial submit job succeeds, this field will remain false whether or not the veteran has multiple BIRLS IDs --so this field cannot technically be used to sum all Form526 veterans that have multiple BIRLS. This field /can/ give us an idea of how often having multiple BIRLS IDs is a problem." t.text "auth_headers_json_ciphertext" t.text "form_json_ciphertext" @@ -618,8 +617,8 @@ end create_table "form_attachments", id: :serial, force: :cascade do |t| - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.uuid "guid", null: false t.string "type", null: false t.text "file_data_ciphertext" @@ -661,9 +660,9 @@ t.string "edipi", null: false t.string "first_name", null: false t.string "last_name", null: false - t.datetime "dob", precision: nil, null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "dob", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.text "ssn_ciphertext" t.text "encrypted_kms_key" t.index ["edipi"], name: "index_gibs_not_found_users_on_edipi" @@ -685,15 +684,15 @@ t.integer "msa", null: false t.string "msa_name" t.integer "version", null: false - t.datetime "created", precision: nil, null: false - t.datetime "updated", precision: nil + t.datetime "created", null: false + t.datetime "updated" t.string "created_by" t.string "updated_by" end create_table "health_care_applications", id: :serial, force: :cascade do |t| - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "state", default: "pending", null: false t.string "form_submission_id_string" t.string "timestamp" @@ -715,18 +714,18 @@ create_table "id_card_announcement_subscriptions", id: :serial, force: :cascade do |t| t.string "email", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["email"], name: "index_id_card_announcement_subscriptions_on_email", unique: true end create_table "in_progress_forms", id: :serial, force: :cascade do |t| t.string "user_uuid", null: false t.string "form_id", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.json "metadata" - t.datetime "expires_at", precision: nil + t.datetime "expires_at" t.text "form_data_ciphertext" t.text "encrypted_kms_key" t.uuid "user_account_id" @@ -745,19 +744,19 @@ create_table "invalid_letter_address_edipis", id: :serial, force: :cascade do |t| t.string "edipi", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["edipi"], name: "index_invalid_letter_address_edipis_on_edipi" end create_table "maintenance_windows", id: :serial, force: :cascade do |t| t.string "pagerduty_id" t.string "external_service" - t.datetime "start_time", precision: nil - t.datetime "end_time", precision: nil + t.datetime "start_time" + t.datetime "end_time" t.string "description" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["end_time"], name: "index_maintenance_windows_on_end_time" t.index ["pagerduty_id"], name: "index_maintenance_windows_on_pagerduty_id" t.index ["start_time"], name: "index_maintenance_windows_on_start_time" @@ -792,8 +791,8 @@ t.uuid "handle", null: false t.uuid "user_account_id", null: false t.string "hashed_refresh_token", null: false - t.datetime "refresh_expiration", precision: nil, null: false - t.datetime "refresh_creation", precision: nil, null: false + t.datetime "refresh_expiration", null: false + t.datetime "refresh_creation", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.bigint "user_verification_id", null: false @@ -818,23 +817,6 @@ t.index ["va_profile_id", "dismissed"], name: "show_onsite_notifications_index" end - create_table "pega_tables", force: :cascade do |t| - t.uuid "uuid" - t.string "veteranfirstname" - t.string "veteranmiddlename" - t.string "veteranlastname" - t.string "applicantfirstname" - t.string "applicantmiddlename" - t.string "applicantlastname" - t.jsonb "response" - t.string "filenumber" - t.string "doctype" - t.datetime "date_created" - t.datetime "date_completed" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - create_table "pension_ipf_notifications", force: :cascade do |t| t.text "payload_ciphertext" t.text "encrypted_kms_key" @@ -846,10 +828,10 @@ t.uuid "guid" t.string "type" t.string "form_id" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "saved_claim_id" - t.datetime "completed_at", precision: nil + t.datetime "completed_at" t.text "file_data_ciphertext" t.text "encrypted_kms_key" t.index ["guid"], name: "index_persistent_attachments_on_guid", unique: true @@ -860,10 +842,8 @@ create_table "personal_information_logs", id: :serial, force: :cascade do |t| t.jsonb "data", null: false t.string "error_class", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.text "data_ciphertext" - t.text "encrypted_kms_key" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["created_at"], name: "index_personal_information_logs_on_created_at" t.index ["error_class"], name: "index_personal_information_logs_on_error_class" end @@ -875,7 +855,7 @@ t.bigint "query_hash" t.float "total_time" t.bigint "calls" - t.datetime "captured_at", precision: nil + t.datetime "captured_at" t.index ["database", "captured_at"], name: "index_pghero_query_stats_on_database_and_captured_at" end @@ -884,7 +864,7 @@ t.text "schema" t.text "relation" t.bigint "size" - t.datetime "captured_at", precision: nil + t.datetime "captured_at" t.index ["database", "captured_at"], name: "index_pghero_space_stats_on_database_and_captured_at" end @@ -893,22 +873,22 @@ t.string "application_uuid" t.string "return_description", null: false t.integer "return_code" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["application_uuid"], name: "index_preneed_submissions_on_application_uuid", unique: true t.index ["tracking_number"], name: "index_preneed_submissions_on_tracking_number", unique: true end create_table "saved_claims", id: :serial, force: :cascade do |t| - t.datetime "created_at", precision: nil - t.datetime "updated_at", precision: nil + t.datetime "created_at" + t.datetime "updated_at" t.string "form_id" t.uuid "guid", null: false t.string "type" t.text "form_ciphertext" t.text "encrypted_kms_key" - t.string "uploaded_forms", array: true - t.datetime "itf_datetime", precision: nil + t.string "uploaded_forms", default: [], array: true + t.datetime "itf_datetime" t.index ["created_at", "type"], name: "index_saved_claims_on_created_at_and_type" t.index ["guid"], name: "index_saved_claims_on_guid", unique: true t.index ["id", "type"], name: "index_saved_claims_on_id_and_type" @@ -941,7 +921,7 @@ t.integer "rpo" t.integer "number_of_submissions" t.string "filename" - t.datetime "successful_at", precision: nil + t.datetime "successful_at" t.integer "retry_attempt", default: 0 t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -954,8 +934,8 @@ t.string "description", null: false t.integer "state_id", null: false t.integer "version", null: false - t.datetime "created", precision: nil, null: false - t.datetime "updated", precision: nil + t.datetime "created", null: false + t.datetime "updated" t.string "created_by" t.string "updated_by" end @@ -975,7 +955,7 @@ t.integer "add_ninety_day_hospital_copay" t.integer "outpatient_basic_care_copay" t.integer "outpatient_specialty_copay" - t.datetime "threshold_effective_date", precision: nil + t.datetime "threshold_effective_date" t.integer "aid_and_attendance_threshold" t.integer "outpatient_preventive_copay" t.integer "medication_copay" @@ -986,8 +966,8 @@ t.integer "inpatient_per_diem" t.string "description" t.integer "version", null: false - t.datetime "created", precision: nil, null: false - t.datetime "updated", precision: nil + t.datetime "created", null: false + t.datetime "updated" t.string "created_by" t.string "updated_by" end @@ -998,8 +978,8 @@ t.integer "fips_code", null: false t.integer "country_id", null: false t.integer "version", null: false - t.datetime "created", precision: nil, null: false - t.datetime "updated", precision: nil + t.datetime "created", null: false + t.datetime "updated" t.string "created_by" t.string "updated_by" end @@ -1011,8 +991,8 @@ t.integer "state_id", null: false t.integer "county_number", null: false t.integer "version", null: false - t.datetime "created", precision: nil, null: false - t.datetime "updated", precision: nil + t.datetime "created", null: false + t.datetime "updated" t.string "created_by" t.string "updated_by" end @@ -1028,8 +1008,8 @@ create_table "test_user_dashboard_tud_account_availability_logs", force: :cascade do |t| t.string "account_uuid" - t.datetime "checkout_time", precision: nil - t.datetime "checkin_time", precision: nil + t.datetime "checkout_time" + t.datetime "checkin_time" t.boolean "has_checkin_error" t.boolean "is_manual_checkin" t.datetime "created_at", null: false @@ -1043,12 +1023,12 @@ t.string "middle_name" t.string "last_name" t.string "gender" - t.datetime "birth_date", precision: nil + t.datetime "birth_date" t.integer "ssn" t.string "phone" t.string "email" t.string "password" - t.datetime "checkout_time", precision: nil + t.datetime "checkout_time" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "services" @@ -1061,8 +1041,8 @@ end create_table "user_acceptable_verified_credentials", force: :cascade do |t| - t.datetime "acceptable_verified_credential_at", precision: nil - t.datetime "idme_verified_credential_at", precision: nil + t.datetime "acceptable_verified_credential_at" + t.datetime "idme_verified_credential_at" t.uuid "user_account_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -1093,7 +1073,7 @@ t.string "logingov_uuid" t.string "mhv_uuid" t.string "dslogon_uuid" - t.datetime "verified_at", precision: nil + t.datetime "verified_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "backing_idme_uuid" @@ -1115,15 +1095,15 @@ t.date "last_revision_on" t.integer "pages" t.string "sha256" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "valid_pdf", default: false t.text "form_usage" t.text "form_tool_intro" t.string "form_tool_url" t.string "form_type" t.string "language" - t.datetime "deleted_at", precision: nil + t.datetime "deleted_at" t.string "related_forms", array: true t.jsonb "benefit_categories" t.string "form_details_url" @@ -1170,8 +1150,8 @@ t.string "status", default: "pending", null: false t.string "code" t.string "detail" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "s3_deleted" t.string "consumer_name" t.uuid "consumer_id" @@ -1199,8 +1179,8 @@ t.string "name" t.string "phone" t.string "state", limit: 2 - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "address_type" t.string "city" t.string "country_code_iso3" @@ -1230,8 +1210,8 @@ t.string "last_name" t.string "email" t.string "phone" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "poa_codes", default: [], array: true t.string "user_types", default: [], array: true t.text "ssn_ciphertext" @@ -1265,8 +1245,8 @@ end create_table "vic_submissions", id: :serial, force: :cascade do |t| - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "state", default: "pending", null: false t.uuid "guid", null: false t.json "response" @@ -1296,10 +1276,10 @@ create_table "vye_awards", force: :cascade do |t| t.integer "user_info_id" t.string "cur_award_ind" - t.datetime "award_begin_date", precision: nil - t.datetime "award_end_date", precision: nil + t.datetime "award_begin_date" + t.datetime "award_end_date" t.integer "training_time" - t.datetime "payment_date", precision: nil + t.datetime "payment_date" t.decimal "monthly_rate" t.string "begin_rsn" t.string "end_rsn" @@ -1336,7 +1316,7 @@ t.text "ssn_ciphertext" t.string "claim_no_ciphertext" t.string "doc_type" - t.datetime "queue_date", precision: nil + t.datetime "queue_date" t.string "rpo" t.text "encrypted_kms_key" t.datetime "created_at", null: false @@ -1362,9 +1342,9 @@ t.text "stub_nm_ciphertext" t.string "mr_status" t.string "rem_ent" - t.datetime "cert_issue_date", precision: nil - t.datetime "del_date", precision: nil - t.datetime "date_last_certified", precision: nil + t.datetime "cert_issue_date" + t.datetime "del_date" + t.datetime "date_last_certified" t.integer "rpo_code" t.string "fac_code" t.decimal "payment_amt" @@ -1394,8 +1374,8 @@ t.string "change_flag" t.integer "rpo_code" t.boolean "rpo_flag" - t.datetime "act_begin", precision: nil - t.datetime "act_end", precision: nil + t.datetime "act_begin" + t.datetime "act_end" t.string "source_ind" t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -1471,4 +1451,4 @@ add_foreign_key "user_verifications", "user_accounts" add_foreign_key "va_notify_in_progress_reminders_sent", "user_accounts" add_foreign_key "veteran_device_records", "devices" -end \ No newline at end of file +end From 278a4d650a90cb6097a272ba38e65636b10fc931 Mon Sep 17 00:00:00 2001 From: Lee Delarm Date: Mon, 15 Apr 2024 09:38:11 -0400 Subject: [PATCH 6/6] Match updated schema Match updated schema --- db/schema.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/schema.rb b/db/schema.rb index 40dce50a476..92987f8f693 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -844,6 +844,8 @@ t.string "error_class", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.text "data_ciphertext" + t.text "encrypted_kms_key" t.index ["created_at"], name: "index_personal_information_logs_on_created_at" t.index ["error_class"], name: "index_personal_information_logs_on_error_class" end