-
Notifications
You must be signed in to change notification settings - Fork 19
/
schema.rb
1519 lines (1431 loc) · 107 KB
/
schema.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_07_15_144822) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "uuid-ossp"
create_table "advance_on_docket_motions", force: :cascade do |t|
t.datetime "created_at", null: false
t.boolean "granted", comment: "Whether VLJ has determined that there is sufficient cause to fast-track an appeal, i.e. grant or deny the motion to AOD."
t.bigint "person_id", comment: "Appellant ID"
t.string "reason", comment: "VLJ's rationale for their decision on motion to AOD."
t.datetime "updated_at", null: false
t.bigint "user_id"
t.index ["granted"], name: "index_advance_on_docket_motions_on_granted"
t.index ["person_id"], name: "index_advance_on_docket_motions_on_person_id"
t.index ["updated_at"], name: "index_advance_on_docket_motions_on_updated_at"
t.index ["user_id"], name: "index_advance_on_docket_motions_on_user_id"
end
create_table "allocations", force: :cascade do |t|
t.float "allocated_days", null: false
t.datetime "created_at", null: false
t.string "regional_office", null: false
t.bigint "schedule_period_id", null: false
t.datetime "updated_at", null: false
t.index ["schedule_period_id"], name: "index_allocations_on_schedule_period_id"
t.index ["updated_at"], name: "index_allocations_on_updated_at"
end
create_table "annotations", id: :serial, force: :cascade do |t|
t.string "comment", null: false
t.datetime "created_at"
t.integer "document_id", null: false
t.integer "page"
t.date "relevant_date"
t.datetime "updated_at"
t.integer "user_id"
t.integer "x"
t.integer "y"
t.index ["document_id"], name: "index_annotations_on_document_id"
t.index ["user_id"], name: "index_annotations_on_user_id"
end
create_table "api_keys", id: :serial, force: :cascade do |t|
t.string "consumer_name", null: false
t.datetime "created_at"
t.string "key_digest", null: false
t.datetime "updated_at"
t.index ["consumer_name"], name: "index_api_keys_on_consumer_name", unique: true
t.index ["key_digest"], name: "index_api_keys_on_key_digest", unique: true
t.index ["updated_at"], name: "index_api_keys_on_updated_at"
end
create_table "api_views", id: :serial, force: :cascade do |t|
t.integer "api_key_id"
t.datetime "created_at"
t.string "source"
t.datetime "updated_at"
t.string "vbms_id"
end
create_table "appeal_series", id: :serial, force: :cascade do |t|
t.datetime "created_at"
t.boolean "incomplete", default: false
t.integer "merged_appeal_count"
t.datetime "updated_at"
t.index ["updated_at"], name: "index_appeal_series_on_updated_at"
end
create_table "appeal_views", id: :serial, force: :cascade do |t|
t.integer "appeal_id", null: false
t.string "appeal_type", null: false
t.datetime "created_at", null: false
t.datetime "last_viewed_at"
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.index ["appeal_type", "appeal_id", "user_id"], name: "index_appeal_views_on_appeal_type_and_appeal_id_and_user_id", unique: true
end
create_table "appeals", comment: "Decision reviews intaken for AMA appeals to the board (also known as a notice of disagreement).", force: :cascade do |t|
t.string "closest_regional_office", comment: "The code for the regional office closest to the Veteran on the appeal."
t.datetime "created_at"
t.date "docket_range_date", comment: "Date that appeal was added to hearing docket range."
t.string "docket_type", comment: "The docket type selected by the Veteran on their appeal form, which can be hearing, evidence submission, or direct review."
t.datetime "established_at", comment: "Timestamp for when the appeal has successfully been intaken into Caseflow by the user."
t.datetime "establishment_attempted_at", comment: "Timestamp for when the appeal's establishment was last attempted."
t.datetime "establishment_canceled_at", comment: "Timestamp when job was abandoned"
t.string "establishment_error", comment: "The error message if attempting to establish the appeal resulted in an error. This gets cleared once the establishment is successful."
t.datetime "establishment_last_submitted_at", comment: "Timestamp for when the the job is eligible to run (can be reset to restart the job)."
t.datetime "establishment_processed_at", comment: "Timestamp for when the establishment has succeeded in processing."
t.datetime "establishment_submitted_at", comment: "Timestamp for when the the intake was submitted for asynchronous processing."
t.boolean "legacy_opt_in_approved", comment: "Indicates whether a Veteran opted to withdraw matching issues from the legacy process. If there is a matching legacy issue and it is not withdrawn then it is ineligible for the decision review."
t.string "poa_participant_id", comment: "Used to identify the power of attorney (POA) at the time the appeal was dispatched to BVA. Sometimes the POA changes in BGS after the fact, and BGS only returns the current representative."
t.date "receipt_date", comment: "Receipt date of the appeal form. Used to determine which issues are within the timeliness window to be appealed. Only issues decided prior to the receipt date will show up as contestable issues."
t.string "stream_docket_number", comment: "Multiple appeals with the same docket number indicate separate appeal streams, mimicking the structure of legacy appeals."
t.string "stream_type", default: "Original", comment: "When multiple appeals have the same docket number, they are differentiated by appeal stream type, depending on the work being done on each appeal."
t.date "target_decision_date", comment: "If the appeal docket is direct review, this sets the target decision date for the appeal, which is one year after the receipt date."
t.datetime "updated_at"
t.uuid "uuid", default: -> { "uuid_generate_v4()" }, null: false, comment: "The universally unique identifier for the appeal, which can be used to navigate to appeals/appeal_uuid. This allows a single ID to determine an appeal whether it is a legacy appeal or an AMA appeal."
t.string "veteran_file_number", null: false, comment: "The VBA corporate file number of the Veteran for this review. There can sometimes be more than one file number per Veteran."
t.boolean "veteran_is_not_claimant", comment: "Selected by the user during intake, indicates whether the Veteran is the claimant, or if the claimant is someone else such as a dependent. Must be TRUE if Veteran is deceased."
t.index ["docket_type"], name: "index_appeals_on_docket_type"
t.index ["established_at"], name: "index_appeals_on_established_at"
t.index ["updated_at"], name: "index_appeals_on_updated_at"
t.index ["uuid"], name: "index_appeals_on_uuid"
t.index ["veteran_file_number"], name: "index_appeals_on_veteran_file_number"
end
create_table "attorney_case_reviews", id: :serial, force: :cascade do |t|
t.integer "attorney_id"
t.datetime "created_at", null: false
t.string "document_id"
t.string "document_type"
t.text "note"
t.boolean "overtime", default: false
t.integer "reviewing_judge_id"
t.string "task_id"
t.boolean "untimely_evidence", default: false
t.datetime "updated_at", null: false
t.string "work_product"
t.index ["task_id"], name: "index_attorney_case_reviews_on_task_id"
t.index ["updated_at"], name: "index_attorney_case_reviews_on_updated_at"
end
create_table "available_hearing_locations", force: :cascade do |t|
t.string "address", comment: "Full address of the location"
t.integer "appeal_id", comment: "Appeal/LegacyAppeal ID; use as FK to appeals/legacy_appeals"
t.string "appeal_type", comment: "'Appeal' or 'LegacyAppeal'"
t.string "city", comment: "i.e 'New York', 'Houston', etc"
t.string "classification", comment: "The classification for location; i.e 'Regional Benefit Office', 'VA Medical Center (VAMC)', etc"
t.datetime "created_at", null: false, comment: "Automatic timestamp of when hearing location was created"
t.float "distance", comment: "Distance between appellant's location and the hearing location"
t.string "facility_id", comment: "Id associated with the facility; i.e 'vba_313', 'vba_354a', 'vba_317', etc"
t.string "facility_type", comment: "The type of facility; i.e, 'va_benefits_facility', 'va_health_facility', 'vet_center', etc"
t.string "name", comment: "Name of location; i.e 'Chicago Regional Benefit Office', 'Jennings VA Clinic', etc"
t.string "state", comment: "State in abbreviated form; i.e 'NY', 'CA', etc"
t.datetime "updated_at", null: false, comment: "Automatic timestamp of when hearing location was updated"
t.string "veteran_file_number", comment: "The VBA corporate file number of the Veteran for the appeal"
t.string "zip_code"
t.index ["appeal_id", "appeal_type"], name: "index_available_hearing_locations_on_appeal_id_and_appeal_type"
t.index ["updated_at"], name: "index_available_hearing_locations_on_updated_at"
t.index ["veteran_file_number"], name: "index_available_hearing_locations_on_veteran_file_number"
end
create_table "bgs_attorneys", comment: "Cache of unique BGS attorney data — used for adding claimants to cases pulled from POA data", force: :cascade do |t|
t.datetime "created_at", null: false, comment: "Standard created_at/updated_at timestamps"
t.datetime "last_synced_at", comment: "The last time BGS was checked"
t.string "name", null: false, comment: "Name"
t.string "participant_id", null: false, comment: "Participant ID"
t.string "record_type", null: false, comment: "Known types: POA State Organization, POA National Organization, POA Attorney, POA Agent, POA Local/Regional Organization"
t.datetime "updated_at", null: false, comment: "Standard created_at/updated_at timestamps"
t.index ["created_at"], name: "index_bgs_attorneys_on_created_at"
t.index ["last_synced_at"], name: "index_bgs_attorneys_on_last_synced_at"
t.index ["name"], name: "index_bgs_attorneys_on_name"
t.index ["participant_id"], name: "index_bgs_attorneys_on_participant_id", unique: true
t.index ["updated_at"], name: "index_bgs_attorneys_on_updated_at"
end
create_table "bgs_power_of_attorneys", comment: "Power of Attorney (POA) cached from BGS", force: :cascade do |t|
t.string "authzn_change_clmant_addrs_ind", comment: "Authorization for POA to change claimant address"
t.string "authzn_poa_access_ind", comment: "Authorization for POA access"
t.string "claimant_participant_id", null: false, comment: "Claimant participant ID -- use as FK to claimants"
t.datetime "created_at", null: false, comment: "Standard created_at/updated_at timestamps"
t.string "file_number", comment: "Claimant file number"
t.datetime "last_synced_at", comment: "The last time BGS was checked"
t.string "legacy_poa_cd", comment: "Legacy POA code"
t.string "poa_participant_id", null: false, comment: "POA participant ID -- use as FK to people"
t.string "representative_name", null: false, comment: "POA name"
t.string "representative_type", null: false, comment: "POA type"
t.datetime "updated_at", null: false, comment: "Standard created_at/updated_at timestamps"
t.index ["claimant_participant_id", "file_number"], name: "bgs_poa_pid_fn_unique_idx", unique: true
t.index ["claimant_participant_id"], name: "index_bgs_power_of_attorneys_on_claimant_participant_id"
t.index ["created_at"], name: "index_bgs_power_of_attorneys_on_created_at"
t.index ["file_number"], name: "index_bgs_power_of_attorneys_on_file_number"
t.index ["last_synced_at"], name: "index_bgs_power_of_attorneys_on_last_synced_at"
t.index ["poa_participant_id"], name: "index_bgs_power_of_attorneys_on_poa_participant_id"
t.index ["representative_name"], name: "index_bgs_power_of_attorneys_on_representative_name"
t.index ["representative_type"], name: "index_bgs_power_of_attorneys_on_representative_type"
t.index ["updated_at"], name: "index_bgs_power_of_attorneys_on_updated_at"
end
create_table "board_grant_effectuations", comment: "Represents the work item of updating records in response to a granted issue on a Board appeal. Some are represented as contentions on an EP in VBMS. Others are tracked via Caseflow tasks.", force: :cascade do |t|
t.bigint "appeal_id", null: false, comment: "The ID of the appeal containing the granted issue being effectuated."
t.string "contention_reference_id", comment: "The ID of the contention created in VBMS. Indicates successful creation of the contention. If the EP has been rated, this contention could have been connected to a rating issue. That connection is used to map the rating issue back to the decision issue."
t.datetime "created_at"
t.bigint "decision_document_id", comment: "The ID of the decision document which triggered this effectuation."
t.datetime "decision_sync_attempted_at", comment: "When the EP is cleared, an asyncronous job attempts to map the resulting rating issue back to the decision issue. Timestamp representing the time the job was last attempted."
t.datetime "decision_sync_canceled_at", comment: "Timestamp when job was abandoned"
t.string "decision_sync_error", comment: "Async job processing last error message. See description for decision_sync_attempted_at for the decision sync job description."
t.datetime "decision_sync_last_submitted_at", comment: "Timestamp for when the the job is eligible to run (can be reset to restart the job)."
t.datetime "decision_sync_processed_at", comment: "Async job processing completed timestamp. See description for decision_sync_attempted_at for the decision sync job description."
t.datetime "decision_sync_submitted_at", comment: "Async job processing start timestamp. See description for decision_sync_attempted_at for the decision sync job description."
t.bigint "end_product_establishment_id", comment: "The ID of the end product establishment created for this board grant effectuation."
t.bigint "granted_decision_issue_id", null: false, comment: "The ID of the granted decision issue."
t.datetime "last_submitted_at", comment: "Async job processing most recent start timestamp"
t.datetime "updated_at"
t.index ["appeal_id"], name: "index_board_grant_effectuations_on_appeal_id"
t.index ["contention_reference_id"], name: "index_board_grant_effectuations_on_contention_reference_id", unique: true
t.index ["decision_document_id"], name: "index_board_grant_effectuations_on_decision_document_id"
t.index ["end_product_establishment_id"], name: "index_board_grant_effectuations_on_end_product_establishment_id"
t.index ["granted_decision_issue_id"], name: "index_board_grant_effectuations_on_granted_decision_issue_id"
t.index ["updated_at"], name: "index_board_grant_effectuations_on_updated_at"
end
create_table "cached_appeal_attributes", id: false, force: :cascade do |t|
t.integer "appeal_id"
t.string "appeal_type"
t.string "case_type", comment: "The case type, i.e. original, post remand, CAVC remand, etc"
t.string "closest_regional_office_city", comment: "Closest regional office to the veteran"
t.string "closest_regional_office_key", comment: "Closest regional office to the veteran in 4 character key"
t.datetime "created_at"
t.string "docket_number"
t.string "docket_type"
t.boolean "is_aod", comment: "Whether the case is Advanced on Docket"
t.integer "issue_count", comment: "Number of issues on the appeal."
t.string "power_of_attorney_name", comment: "'Firstname Lastname' of power of attorney"
t.string "suggested_hearing_location", comment: "Suggested hearing location in 'City, State (Facility Type)' format"
t.datetime "updated_at"
t.string "vacols_id"
t.string "veteran_name", comment: "'LastName, FirstName' of the veteran"
t.index ["appeal_id", "appeal_type"], name: "index_cached_appeal_attributes_on_appeal_id_and_appeal_type", unique: true
t.index ["case_type"], name: "index_cached_appeal_attributes_on_case_type"
t.index ["closest_regional_office_city"], name: "index_cached_appeal_attributes_on_closest_regional_office_city"
t.index ["closest_regional_office_key"], name: "index_cached_appeal_attributes_on_closest_regional_office_key"
t.index ["docket_type"], name: "index_cached_appeal_attributes_on_docket_type"
t.index ["is_aod"], name: "index_cached_appeal_attributes_on_is_aod"
t.index ["power_of_attorney_name"], name: "index_cached_appeal_attributes_on_power_of_attorney_name"
t.index ["suggested_hearing_location"], name: "index_cached_appeal_attributes_on_suggested_hearing_location"
t.index ["updated_at"], name: "index_cached_appeal_attributes_on_updated_at"
t.index ["vacols_id"], name: "index_cached_appeal_attributes_on_vacols_id", unique: true
t.index ["veteran_name"], name: "index_cached_appeal_attributes_on_veteran_name"
end
create_table "cached_user_attributes", id: false, comment: "VACOLS cached staff table attributes", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "sactive", null: false
t.string "sattyid"
t.string "sdomainid", null: false
t.string "slogid", null: false
t.string "smemgrp", limit: 8
t.string "stafkey", null: false
t.string "stitle", limit: 16
t.string "svlj"
t.datetime "updated_at", null: false
t.index ["sdomainid"], name: "index_cached_user_attributes_on_sdomainid", unique: true
t.index ["updated_at"], name: "index_cached_user_attributes_on_updated_at"
end
create_table "certification_cancellations", id: :serial, force: :cascade do |t|
t.string "cancellation_reason"
t.integer "certification_id"
t.datetime "created_at"
t.string "email"
t.string "other_reason"
t.datetime "updated_at"
t.index ["certification_id"], name: "index_certification_cancellations_on_certification_id", unique: true
t.index ["updated_at"], name: "index_certification_cancellations_on_updated_at"
end
create_table "certifications", id: :serial, force: :cascade do |t|
t.boolean "already_certified"
t.string "bgs_rep_address_line_1"
t.string "bgs_rep_address_line_2"
t.string "bgs_rep_address_line_3"
t.string "bgs_rep_city"
t.string "bgs_rep_country"
t.string "bgs_rep_state"
t.string "bgs_rep_zip"
t.string "bgs_representative_name"
t.string "bgs_representative_type"
t.string "certification_date"
t.string "certifying_office"
t.string "certifying_official_name"
t.string "certifying_official_title"
t.string "certifying_username"
t.datetime "completed_at"
t.datetime "created_at", null: false
t.datetime "form8_started_at"
t.datetime "form9_matching_at"
t.string "form9_type"
t.boolean "hearing_change_doc_found_in_vbms"
t.string "hearing_preference"
t.boolean "loading_data"
t.boolean "loading_data_failed"
t.datetime "nod_matching_at"
t.boolean "poa_correct_in_bgs"
t.boolean "poa_correct_in_vacols"
t.boolean "poa_matches"
t.string "representative_name"
t.string "representative_type"
t.datetime "soc_matching_at"
t.datetime "ssocs_matching_at"
t.boolean "ssocs_required"
t.datetime "updated_at", null: false
t.integer "user_id"
t.boolean "v2"
t.boolean "vacols_data_missing"
t.string "vacols_hearing_preference"
t.string "vacols_id"
t.string "vacols_representative_name"
t.string "vacols_representative_type"
t.index ["updated_at"], name: "index_certifications_on_updated_at"
t.index ["user_id"], name: "index_certifications_on_user_id"
end
create_table "claim_establishments", id: :serial, force: :cascade do |t|
t.datetime "created_at", null: false
t.integer "decision_type"
t.string "email_recipient"
t.string "email_ro_id"
t.string "ep_code"
t.datetime "outcoding_date"
t.integer "task_id"
t.datetime "updated_at", null: false
t.index ["updated_at"], name: "index_claim_establishments_on_updated_at"
end
create_table "claimants", comment: "This table bridges decision reviews to participants when the participant is listed as a claimant on the decision review. A participant can be a claimant on multiple decision reviews.", force: :cascade do |t|
t.datetime "created_at"
t.bigint "decision_review_id", comment: "The ID of the decision review the claimant is on."
t.string "decision_review_type", comment: "The type of decision review the claimant is on."
t.text "notes", comment: "This is a notes field for adding claimant not listed and any supplementary information outside of unlisted claimant."
t.string "participant_id", null: false, comment: "The participant ID of the claimant."
t.string "payee_code", comment: "The payee_code for the claimant, if applicable. payee_code is required when the claim is processed in VBMS."
t.string "type", default: "Claimant", comment: "The class name for the single table inheritance type of Claimant, for example VeteranClaimant, DependentClaimant, AttorneyClaimant, or OtherClaimant."
t.datetime "updated_at"
t.index ["decision_review_type", "decision_review_id"], name: "index_claimants_on_decision_review_type_and_decision_review_id"
t.index ["participant_id"], name: "index_claimants_on_participant_id"
t.index ["updated_at"], name: "index_claimants_on_updated_at"
end
create_table "claims_folder_searches", id: :serial, force: :cascade do |t|
t.integer "appeal_id"
t.string "appeal_type", null: false
t.datetime "created_at"
t.string "query"
t.datetime "updated_at"
t.integer "user_id"
t.index ["appeal_id", "appeal_type"], name: "index_claims_folder_searches_on_appeal_id_and_appeal_type"
t.index ["updated_at"], name: "index_claims_folder_searches_on_updated_at"
t.index ["user_id"], name: "index_claims_folder_searches_on_user_id"
end
create_table "decision_documents", force: :cascade do |t|
t.bigint "appeal_id", null: false
t.string "appeal_type"
t.datetime "attempted_at"
t.datetime "canceled_at", comment: "Timestamp when job was abandoned"
t.string "citation_number", null: false
t.datetime "created_at", null: false
t.date "decision_date", null: false
t.string "error"
t.datetime "last_submitted_at"
t.datetime "processed_at"
t.string "redacted_document_location", null: false
t.datetime "submitted_at"
t.datetime "updated_at", null: false
t.datetime "uploaded_to_vbms_at"
t.index ["appeal_id"], name: "index_decision_documents_on_appeal_id"
t.index ["citation_number"], name: "index_decision_documents_on_citation_number", unique: true
t.index ["updated_at"], name: "index_decision_documents_on_updated_at"
end
create_table "decision_issues", comment: "Issues that represent a decision made on a decision review.", force: :cascade do |t|
t.string "benefit_type", comment: "Classification of the benefit being decided on. Maps 1 to 1 to VA lines of business, and typically used to know which line of business the decision correlates to."
t.date "caseflow_decision_date", comment: "This is a decision date for decision issues where decisions are entered in Caseflow, such as for appeals or for decision reviews with a business line that is not processed in VBMS."
t.datetime "created_at", comment: "Automatic timestamp when row was created."
t.integer "decision_review_id", comment: "ID of the decision review the decision was made on."
t.string "decision_review_type", comment: "Type of the decision review the decision was made on."
t.string "decision_text", comment: "If decision resulted in a change to a rating, the rating issue's decision text."
t.datetime "deleted_at"
t.string "description", comment: "Optional description that the user can input for decisions made in Caseflow."
t.string "diagnostic_code", comment: "If a decision resulted in a rating, this is the rating issue's diagnostic code."
t.string "disposition", comment: "The disposition for a decision issue. Dispositions made in Caseflow and dispositions made in VBMS can have different values."
t.date "end_product_last_action_date", comment: "After an end product gets synced with a status of CLR (cleared), the end product's last_action_date is saved on any decision issues that are created as a result. This is used as a proxy for decision date for non-rating issues that are processed in VBMS because they don't have a rating profile date, and the exact decision date is not available."
t.string "participant_id", null: false, comment: "The Veteran's participant id."
t.string "percent_number", comment: "percent_number from RatingIssue (prcntNo from Rating Profile)"
t.string "rating_issue_reference_id", comment: "Identifies the specific issue on the rating that resulted from the decision issue (a rating can have multiple issues). This is unique per rating issue."
t.datetime "rating_profile_date", comment: "The profile date of the rating that a decision issue resulted in (if applicable). The profile_date is used as an identifier for the rating, and is the date that most closely maps to what the Veteran writes down as the decision date."
t.datetime "rating_promulgation_date", comment: "The promulgation date of the rating that a decision issue resulted in (if applicable). It is used for calculating whether a decision issue is within the timeliness window to be appealed or get a higher level review."
t.text "subject_text", comment: "subject_text from RatingIssue (subjctTxt from Rating Profile)"
t.datetime "updated_at"
t.index ["decision_review_id", "decision_review_type"], name: "index_decision_issues_decision_review"
t.index ["deleted_at"], name: "index_decision_issues_on_deleted_at"
t.index ["disposition"], name: "index_decision_issues_on_disposition"
t.index ["rating_issue_reference_id", "disposition", "participant_id"], name: "decision_issues_uniq_by_disposition_and_ref_id", unique: true
t.index ["updated_at"], name: "index_decision_issues_on_updated_at"
end
create_table "dispatch_tasks", id: :serial, force: :cascade do |t|
t.string "aasm_state"
t.integer "appeal_id", null: false
t.datetime "assigned_at"
t.string "comment"
t.datetime "completed_at"
t.integer "completion_status"
t.datetime "created_at", null: false
t.integer "lock_version"
t.string "outgoing_reference_id"
t.datetime "prepared_at"
t.datetime "started_at"
t.string "type", null: false
t.datetime "updated_at", null: false
t.integer "user_id"
t.index ["updated_at"], name: "index_dispatch_tasks_on_updated_at"
t.index ["user_id"], name: "index_dispatch_tasks_on_user_id"
end
create_table "distributed_cases", force: :cascade do |t|
t.string "case_id"
t.datetime "created_at"
t.integer "distribution_id"
t.string "docket"
t.integer "docket_index"
t.boolean "genpop"
t.string "genpop_query"
t.boolean "priority"
t.datetime "ready_at"
t.integer "task_id"
t.datetime "updated_at"
t.index ["case_id"], name: "index_distributed_cases_on_case_id", unique: true
t.index ["updated_at"], name: "index_distributed_cases_on_updated_at"
end
create_table "distributions", force: :cascade do |t|
t.datetime "completed_at"
t.datetime "created_at", null: false
t.datetime "errored_at", comment: "when the Distribution job suffered an error"
t.integer "judge_id"
t.boolean "priority_push", default: false, comment: "Whether or not this distribution is a priority-appeals-only push to judges via a weekly job (not manually requested)"
t.datetime "started_at", comment: "when the Distribution job commenced"
t.json "statistics"
t.string "status"
t.datetime "updated_at", null: false
t.index ["updated_at"], name: "index_distributions_on_updated_at"
end
create_table "docket_snapshots", id: :serial, force: :cascade do |t|
t.datetime "created_at"
t.integer "docket_count"
t.date "latest_docket_month"
t.datetime "updated_at"
t.index ["updated_at"], name: "index_docket_snapshots_on_updated_at"
end
create_table "docket_tracers", id: :serial, force: :cascade do |t|
t.integer "ahead_and_ready_count"
t.integer "ahead_count"
t.datetime "created_at"
t.integer "docket_snapshot_id"
t.date "month"
t.datetime "updated_at"
t.index ["docket_snapshot_id", "month"], name: "index_docket_tracers_on_docket_snapshot_id_and_month", unique: true
t.index ["updated_at"], name: "index_docket_tracers_on_updated_at"
end
create_table "document_views", id: :serial, force: :cascade do |t|
t.datetime "created_at"
t.integer "document_id", null: false
t.datetime "first_viewed_at"
t.datetime "updated_at"
t.integer "user_id", null: false
t.index ["document_id", "user_id"], name: "index_document_views_on_document_id_and_user_id", unique: true
t.index ["user_id"], name: "index_document_views_on_user_id"
end
create_table "documents", id: :serial, force: :cascade do |t|
t.boolean "category_medical"
t.boolean "category_other"
t.boolean "category_procedural"
t.datetime "created_at"
t.string "description"
t.string "file_number"
t.integer "previous_document_version_id"
t.date "received_at"
t.string "series_id"
t.string "type"
t.datetime "updated_at"
t.date "upload_date"
t.string "vbms_document_id", null: false
t.index ["file_number"], name: "index_documents_on_file_number"
t.index ["series_id"], name: "index_documents_on_series_id"
t.index ["vbms_document_id"], name: "index_documents_on_vbms_document_id", unique: true
end
create_table "documents_tags", id: :serial, force: :cascade do |t|
t.datetime "created_at"
t.integer "document_id", null: false
t.integer "tag_id", null: false
t.datetime "updated_at"
t.index ["document_id", "tag_id"], name: "index_documents_tags_on_document_id_and_tag_id", unique: true
end
create_table "end_product_code_updates", comment: "Caseflow establishes end products in VBMS with specific end product codes. If that code is changed outside of Caseflow, that is tracked here.", force: :cascade do |t|
t.string "code", null: false, comment: "The new end product code, if it has changed since last checked."
t.datetime "created_at", null: false
t.bigint "end_product_establishment_id", null: false
t.datetime "updated_at", null: false
t.index ["end_product_establishment_id"], name: "index_end_product_code_updates_on_end_product_establishment_id"
t.index ["updated_at"], name: "index_end_product_code_updates_on_updated_at"
end
create_table "end_product_establishments", comment: "Represents end products that have been, or need to be established by Caseflow. Used to track the status of those end products as they are processed in VBMS and/or SHARE.", force: :cascade do |t|
t.string "benefit_type_code", comment: "1 if the Veteran is alive, and 2 if the Veteran is deceased. Not to be confused with benefit_type, which is unrelated."
t.date "claim_date", comment: "The claim_date for end product established."
t.string "claimant_participant_id", comment: "The participant ID of the claimant submitted on the end product."
t.string "code", comment: "The end product code, which determines the type of end product that is established. For example, it can contain information about whether it is rating, nonrating, compensation, pension, created automatically due to a Duty to Assist Error, and more."
t.datetime "committed_at", comment: "Timestamp indicating other actions performed as part of a larger atomic operation containing the end product establishment, such as creating contentions, are also complete."
t.datetime "created_at"
t.string "development_item_reference_id", comment: "When a Veteran requests an informal conference with their higher level review, a tracked item is created. This stores the ID of the of the tracked item, it is also used to indicate the success of creating the tracked item."
t.string "doc_reference_id", comment: "When a Veteran requests an informal conference, a claimant letter is generated. This stores the document ID of the claimant letter, and is also used to track the success of creating the claimant letter."
t.datetime "established_at", comment: "Timestamp for when the end product was established."
t.datetime "last_synced_at", comment: "The time that the status of the end product was last synced with BGS. The end product is synced until it is canceled or cleared, meaning it is no longer active."
t.boolean "limited_poa_access", comment: "Indicates whether the limited Power of Attorney has access to view documents"
t.string "limited_poa_code", comment: "The limited Power of Attorney code, which indicates whether the claim has a POA specifically for this claim, which can be different than the Veteran's POA"
t.string "modifier", comment: "The end product modifier. For higher level reviews, the modifiers range from 030-039. For supplemental claims, they range from 040-049. The same modifier cannot be used twice for an active end product per Veteran. Once an end product is no longer active, the modifier can be used again."
t.string "payee_code", null: false, comment: "The payee_code of the claimant submitted for this end product."
t.string "reference_id", comment: "The claim_id of the end product, which is stored after the end product is successfully established in VBMS."
t.bigint "source_id", null: false, comment: "The ID of the source that resulted in this end product establishment."
t.string "source_type", null: false, comment: "The type of source that resulted in this end product establishment."
t.string "station", comment: "The station ID of the end product's station."
t.string "synced_status", comment: "The status of the end product, which is synced by a job. Once and end product is cleared (CLR) or canceled (CAN) the status is final and the end product will not continue being synced."
t.datetime "updated_at"
t.integer "user_id", comment: "The ID of the user who performed the decision review intake."
t.string "veteran_file_number", null: false, comment: "The file number of the Veteran submitted when establishing the end product."
t.index ["source_type", "source_id"], name: "index_end_product_establishments_on_source_type_and_source_id"
t.index ["updated_at"], name: "index_end_product_establishments_on_updated_at"
t.index ["user_id"], name: "index_end_product_establishments_on_user_id"
t.index ["veteran_file_number"], name: "index_end_product_establishments_on_veteran_file_number"
end
create_table "form8s", id: :serial, force: :cascade do |t|
t.string "_initial_appellant_name"
t.string "_initial_appellant_relationship"
t.string "_initial_hearing_requested"
t.date "_initial_increased_rating_notification_date"
t.string "_initial_insurance_loan_number"
t.date "_initial_other_notification_date"
t.string "_initial_representative_name"
t.string "_initial_representative_type"
t.date "_initial_service_connection_notification_date"
t.date "_initial_soc_date"
t.string "_initial_ssoc_required"
t.string "_initial_veteran_name"
t.string "agent_accredited"
t.string "appellant_name"
t.string "appellant_relationship"
t.date "certification_date"
t.integer "certification_id"
t.string "certifying_office"
t.string "certifying_official_name"
t.string "certifying_official_title"
t.string "certifying_official_title_specify_other"
t.string "certifying_username"
t.string "contested_claims_procedures_applicable"
t.string "contested_claims_requirements_followed"
t.datetime "created_at", null: false
t.string "file_number"
t.date "form9_date"
t.string "form_646_not_of_record_explanation"
t.string "form_646_of_record"
t.string "hearing_held"
t.string "hearing_preference"
t.string "hearing_requested"
t.string "hearing_requested_explanation"
t.string "hearing_transcript_on_file"
t.text "increased_rating_for"
t.date "increased_rating_notification_date"
t.string "insurance_loan_number"
t.date "nod_date"
t.text "other_for"
t.date "other_notification_date"
t.string "power_of_attorney"
t.string "power_of_attorney_file"
t.string "record_cf_or_xcf"
t.string "record_clinical_rec"
t.string "record_dental_f"
t.string "record_dep_ed_f"
t.string "record_hospital_cor"
t.string "record_inactive_cf"
t.string "record_insurance_f"
t.string "record_loan_guar_f"
t.string "record_other"
t.text "record_other_explanation"
t.string "record_outpatient_f"
t.string "record_r_and_e_f"
t.string "record_slides"
t.string "record_tissue_blocks"
t.string "record_training_sub_f"
t.string "record_x_rays"
t.text "remarks"
t.string "representative_name"
t.string "representative_type"
t.string "representative_type_specify_other"
t.text "service_connection_for"
t.date "service_connection_notification_date"
t.date "soc_date"
t.date "ssoc_date_1"
t.date "ssoc_date_2"
t.date "ssoc_date_3"
t.string "ssoc_required"
t.datetime "updated_at", null: false
t.string "vacols_id"
t.string "veteran_name"
t.index ["certification_id"], name: "index_form8s_on_certification_id"
end
create_table "global_admin_logins", id: :serial, force: :cascade do |t|
t.string "admin_css_id"
t.datetime "created_at"
t.string "target_css_id"
t.string "target_station_id"
t.datetime "updated_at"
t.index ["updated_at"], name: "index_global_admin_logins_on_updated_at"
end
create_table "hearing_appeal_stream_snapshots", id: false, force: :cascade do |t|
t.integer "appeal_id", comment: "LegacyAppeal ID; use as FK to legacy_appeals"
t.datetime "created_at", null: false, comment: "Automatic timestamp of when snapshot was created"
t.integer "hearing_id", comment: "LegacyHearing ID; use as FK to legacy_hearings"
t.datetime "updated_at", comment: "Automatic timestamp of when snapshot was updated"
t.index ["hearing_id", "appeal_id"], name: "index_hearing_appeal_stream_snapshots_hearing_and_appeal_ids", unique: true
t.index ["updated_at"], name: "index_hearing_appeal_stream_snapshots_on_updated_at"
end
create_table "hearing_days", force: :cascade do |t|
t.string "bva_poc", comment: "Hearing coordinator full name"
t.datetime "created_at", null: false, comment: "Automatic timestamp of when hearing day was created"
t.bigint "created_by_id", null: false, comment: "The ID of the user who created the Hearing Day"
t.datetime "deleted_at", comment: "Automatic timestamp of when hearing day was deleted"
t.integer "judge_id", comment: "User ID of judge who is assigned to the hearing day"
t.boolean "lock", comment: "Determines if the hearing day is locked and can't be edited"
t.text "notes", comment: "Any notes about hearing day"
t.string "regional_office", comment: "Regional office key associated with hearing day"
t.string "request_type", null: false, comment: "Hearing request types for all associated hearings; can be one of: 'T', 'C' or 'V'"
t.string "room", comment: "The room at BVA where the hearing will take place"
t.date "scheduled_for", null: false, comment: "The date when all associated hearings will take place"
t.datetime "updated_at", null: false, comment: "Automatic timestamp of when hearing day was updated"
t.bigint "updated_by_id", null: false, comment: "The ID of the user who most recently updated the Hearing Day"
t.index ["created_by_id"], name: "index_hearing_days_on_created_by_id"
t.index ["deleted_at"], name: "index_hearing_days_on_deleted_at"
t.index ["updated_at"], name: "index_hearing_days_on_updated_at"
t.index ["updated_by_id"], name: "index_hearing_days_on_updated_by_id"
end
create_table "hearing_issue_notes", force: :cascade do |t|
t.boolean "allow", default: false
t.datetime "created_at"
t.boolean "deny", default: false
t.boolean "dismiss", default: false
t.bigint "hearing_id", null: false
t.boolean "remand", default: false
t.boolean "reopen", default: false
t.bigint "request_issue_id", null: false
t.datetime "updated_at"
t.string "worksheet_notes"
t.index ["hearing_id"], name: "index_hearing_issue_notes_on_hearing_id"
t.index ["request_issue_id"], name: "index_hearing_issue_notes_on_request_issue_id"
t.index ["updated_at"], name: "index_hearing_issue_notes_on_updated_at"
end
create_table "hearing_locations", force: :cascade do |t|
t.string "address", comment: "Full address of the location"
t.string "city", comment: "i.e 'New York', 'Houston', etc"
t.string "classification", comment: "The classification for location; i.e 'Regional Benefit Office', 'VA Medical Center (VAMC)', etc"
t.datetime "created_at", null: false, comment: "Automatic timestamp of when hearing location was created"
t.float "distance", comment: "Distance between appellant's location and the hearing location"
t.string "facility_id", comment: "Id associated with the facility; i.e 'vba_313', 'vba_354a', 'vba_317', etc"
t.string "facility_type", comment: "The type of facility; i.e, 'va_benefits_facility', 'va_health_facility', 'vet_center', etc"
t.integer "hearing_id", comment: "Hearing/LegacyHearing ID; use as FK to hearings/legacy_hearings"
t.string "hearing_type", comment: "'Hearing' or 'LegacyHearing'"
t.string "name", comment: "Name of location; i.e 'Chicago Regional Benefit Office', 'Jennings VA Clinic', etc"
t.string "state", comment: "State in abbreviated form; i.e 'NY', 'CA', etc"
t.datetime "updated_at", null: false, comment: "Automatic timestamp of when hearing location was updated"
t.string "zip_code"
t.index ["hearing_id"], name: "index_hearing_locations_on_hearing_id"
t.index ["hearing_type"], name: "index_hearing_locations_on_hearing_type"
t.index ["updated_at"], name: "index_hearing_locations_on_updated_at"
end
create_table "hearing_task_associations", force: :cascade do |t|
t.datetime "created_at", comment: "Automatic timestamp of when association was created"
t.bigint "hearing_id", null: false, comment: "Hearing/LegacyHearing ID; use as FK to hearings/legacy_hearings"
t.bigint "hearing_task_id", null: false, comment: "associated HearingTask ID; use as fk to tasks"
t.string "hearing_type", null: false, comment: "'Hearing' or 'LegacyHearing'"
t.datetime "updated_at", comment: "Automatic timestamp of when association was updated"
t.index ["hearing_task_id"], name: "index_hearing_task_associations_on_hearing_task_id"
t.index ["hearing_type", "hearing_id"], name: "index_hearing_task_associations_on_hearing_type_and_hearing_id"
t.index ["updated_at"], name: "index_hearing_task_associations_on_updated_at"
end
create_table "hearing_views", id: :serial, force: :cascade do |t|
t.datetime "created_at", comment: "Automatic timestamp of when hearing view was created"
t.integer "hearing_id", null: false, comment: "Hearing/LegacyHearing ID; use as FK to hearings/legacy_hearings"
t.string "hearing_type", comment: "'Hearing' or 'LegacyHearing'"
t.datetime "updated_at", comment: "Automatic timestamp of when hearing view was updated"
t.integer "user_id", null: false, comment: "User ID; use as FK to users"
t.index ["hearing_id", "user_id", "hearing_type"], name: "index_hearing_views_on_hearing_id_and_user_id_and_hearing_type", unique: true
end
create_table "hearings", force: :cascade do |t|
t.integer "appeal_id", null: false, comment: "Appeal ID; use as FK to appeals"
t.string "bva_poc", comment: "Hearing coordinator full name"
t.datetime "created_at", comment: "Automatic timestamp when row was created."
t.bigint "created_by_id", comment: "The ID of the user who created the Hearing"
t.string "disposition", comment: "Hearing disposition; can be one of: 'held', 'postponed', 'no_show', or 'cancelled'"
t.boolean "evidence_window_waived", comment: "Determines whether the veteran/appelant has wavied the 90 day evidence hold"
t.integer "hearing_day_id", null: false, comment: "HearingDay ID; use as FK to HearingDays"
t.integer "judge_id", comment: "User ID of judge who will hold the hearing"
t.string "military_service", comment: "Periods and circumstances of military service"
t.string "notes", comment: "Any notes taken prior or post hearing"
t.boolean "prepped", comment: "Determines whether the judge has checked the hearing as prepped"
t.string "representative_name", comment: "Name of Appellant's representative if applicable"
t.string "room", comment: "The room at BVA where the hearing will take place; ported from associated HearingDay"
t.time "scheduled_time", null: false, comment: "Date and Time when hearing will take place"
t.text "summary", comment: "Summary of hearing"
t.boolean "transcript_requested", comment: "Determines whether the veteran/appellant has requested the hearing transcription"
t.date "transcript_sent_date", comment: "Date of when the hearing transcription was sent to the Veteran/Appellant"
t.datetime "updated_at", comment: "Timestamp when record was last updated."
t.bigint "updated_by_id", comment: "The ID of the user who most recently updated the Hearing"
t.uuid "uuid", default: -> { "uuid_generate_v4()" }, null: false
t.string "witness", comment: "Witness/Observer present during hearing"
t.index ["created_by_id"], name: "index_hearings_on_created_by_id"
t.index ["updated_at"], name: "index_hearings_on_updated_at"
t.index ["updated_by_id"], name: "index_hearings_on_updated_by_id"
t.index ["uuid"], name: "index_hearings_on_uuid"
end
create_table "higher_level_reviews", comment: "Intake data for Higher Level Reviews.", force: :cascade do |t|
t.string "benefit_type", comment: "The benefit type selected by the Veteran on their form, also known as a Line of Business."
t.datetime "created_at"
t.datetime "establishment_attempted_at", comment: "Timestamp for the most recent attempt at establishing a claim."
t.datetime "establishment_canceled_at", comment: "Timestamp when job was abandoned"
t.string "establishment_error", comment: "The error captured for the most recent attempt at establishing a claim if it failed. This is removed once establishing the claim succeeds."
t.datetime "establishment_last_submitted_at", comment: "Timestamp for the latest attempt at establishing the End Products for the Decision Review."
t.datetime "establishment_processed_at", comment: "Timestamp for when the End Product Establishments for the Decision Review successfully finished processing."
t.datetime "establishment_submitted_at", comment: "Timestamp for when the Higher Level Review was submitted by a Claims Assistant. This adds the End Product Establishment to a job to finish processing asynchronously."
t.boolean "informal_conference", comment: "Indicates whether a Veteran selected on their Higher Level Review form to have an informal conference. This creates a claimant letter and a tracked item in BGS."
t.boolean "legacy_opt_in_approved", comment: "Indicates whether a Veteran opted to withdraw their Higher Level Review request issues from the legacy system if a matching issue is found. If there is a matching legacy issue and it is not withdrawn, then that issue is ineligible to be a new request issue and a contention will not be created for it."
t.date "receipt_date", comment: "The date that the Higher Level Review form was received by central mail. This is used to determine which issues are eligible to be appealed based on timeliness. Only issues decided prior to the receipt date will show up as contestable issues. It is also the claim date for any associated end products that are established."
t.boolean "same_office", comment: "Whether the Veteran wants their issues to be reviewed by the same office where they were previously reviewed. This creates a special issue on all of the contentions created on this Higher Level Review."
t.datetime "updated_at"
t.uuid "uuid", default: -> { "uuid_generate_v4()" }, null: false, comment: "The universally unique identifier for the Higher Level Review. Can be used to link to the claim after it is completed."
t.string "veteran_file_number", null: false, comment: "The file number of the Veteran that the Higher Level Review is for."
t.boolean "veteran_is_not_claimant", comment: "Indicates whether the Veteran is the claimant on the Higher Level Review form, or if the claimant is someone else like a spouse or a child. Must be TRUE if the Veteran is deceased."
t.index ["updated_at"], name: "index_higher_level_reviews_on_updated_at"
t.index ["uuid"], name: "index_higher_level_reviews_on_uuid"
t.index ["veteran_file_number"], name: "index_higher_level_reviews_on_veteran_file_number"
end
create_table "intakes", id: :serial, comment: "Represents the intake of an form or request made by a veteran.", force: :cascade do |t|
t.string "cancel_other", comment: "Notes added if a user canceled an intake for any reason other than the stock set of options."
t.string "cancel_reason", comment: "The reason the intake was canceled. Could have been manually canceled by a user, or automatic."
t.datetime "completed_at", comment: "Timestamp for when the intake was completed, whether it was successful or not."
t.datetime "completion_started_at", comment: "Timestamp for when the user submitted the intake to be completed."
t.string "completion_status", comment: "Indicates whether the intake was successful, or was closed by being canceled, expired, or due to an error."
t.datetime "created_at"
t.integer "detail_id", comment: "The ID of the record created as a result of the intake."
t.string "detail_type", comment: "The type of the record created as a result of the intake."
t.string "error_code", comment: "If the intake was unsuccessful due to a set of known errors, the error code is stored here. An error is also stored here for RAMP elections that are connected to an active end product, even though the intake is a success."
t.datetime "started_at", comment: "Timestamp for when the intake was created, which happens when a user successfully searches for a Veteran."
t.string "type", comment: "The class name of the intake."
t.datetime "updated_at"
t.integer "user_id", null: false, comment: "The ID of the user who created the intake."
t.string "veteran_file_number", comment: "The VBA corporate file number of the Veteran for this review. There can sometimes be more than one file number per Veteran."
t.index ["type", "veteran_file_number"], name: "unique_index_to_avoid_duplicate_intakes", unique: true, where: "(completed_at IS NULL)"
t.index ["type"], name: "index_intakes_on_type"
t.index ["updated_at"], name: "index_intakes_on_updated_at"
t.index ["user_id"], name: "index_intakes_on_user_id"
t.index ["user_id"], name: "unique_index_to_avoid_multiple_intakes", unique: true, where: "(completed_at IS NULL)"
t.index ["veteran_file_number"], name: "index_intakes_on_veteran_file_number"
end
create_table "job_notes", force: :cascade do |t|
t.datetime "created_at", null: false, comment: "Default created_at/updated_at"
t.bigint "job_id", null: false, comment: "The job to which the note applies"
t.string "job_type", null: false
t.text "note", null: false, comment: "The note"
t.boolean "send_to_intake_user", default: false, comment: "Should the note trigger a message to the job intake user"
t.datetime "updated_at", null: false, comment: "Default created_at/updated_at"
t.bigint "user_id", null: false, comment: "The user who created the note"
t.index ["job_type", "job_id"], name: "index_job_notes_on_job_type_and_job_id"
t.index ["updated_at"], name: "index_job_notes_on_updated_at"
t.index ["user_id"], name: "index_job_notes_on_user_id"
end
create_table "judge_case_reviews", force: :cascade do |t|
t.text "areas_for_improvement", default: [], array: true
t.integer "attorney_id"
t.text "comment"
t.string "complexity"
t.datetime "created_at", null: false
t.text "factors_not_considered", default: [], array: true
t.integer "judge_id"
t.string "location"
t.boolean "one_touch_initiative"
t.text "positive_feedback", default: [], array: true
t.string "quality"
t.string "task_id"
t.datetime "updated_at", null: false
t.index ["updated_at"], name: "index_judge_case_reviews_on_updated_at"
end
create_table "judge_team_roles", comment: "Defines roles for individual members of judge teams", force: :cascade do |t|
t.datetime "created_at", null: false
t.integer "organizations_user_id"
t.string "type"
t.datetime "updated_at", null: false
t.index ["organizations_user_id"], name: "index_judge_team_roles_on_organizations_user_id", unique: true
t.index ["updated_at"], name: "index_judge_team_roles_on_updated_at"
end
create_table "legacy_appeals", force: :cascade do |t|
t.bigint "appeal_series_id"
t.boolean "blue_water", default: false, comment: "Blue Water"
t.boolean "burn_pit", default: false, comment: "Burn Pit"
t.string "closest_regional_office"
t.boolean "contaminated_water_at_camp_lejeune", default: false
t.datetime "created_at"
t.boolean "dic_death_or_accrued_benefits_united_states", default: false
t.string "dispatched_to_station"
t.boolean "education_gi_bill_dependents_educational_assistance_scholars", default: false
t.boolean "foreign_claim_compensation_claims_dual_claims_appeals", default: false
t.boolean "foreign_pension_dic_all_other_foreign_countries", default: false
t.boolean "foreign_pension_dic_mexico_central_and_south_america_caribb", default: false
t.boolean "hearing_including_travel_board_video_conference", default: false
t.boolean "home_loan_guaranty", default: false
t.boolean "incarcerated_veterans", default: false
t.boolean "insurance", default: false
t.boolean "issues_pulled"
t.boolean "manlincon_compliance", default: false
t.boolean "military_sexual_trauma", default: false, comment: "Military Sexual Trauma (MST)"
t.boolean "mustard_gas", default: false
t.boolean "national_cemetery_administration", default: false
t.boolean "no_special_issues", default: false, comment: "Affirmative no special issues; column added belatedly"
t.boolean "nonrating_issue", default: false
t.boolean "pension_united_states", default: false
t.boolean "private_attorney_or_agent", default: false
t.boolean "radiation", default: false
t.boolean "rice_compliance", default: false
t.boolean "spina_bifida", default: false
t.datetime "updated_at"
t.boolean "us_court_of_appeals_for_veterans_claims", default: false, comment: "US Court of Appeals for Veterans Claims (CAVC)"
t.boolean "us_territory_claim_american_samoa_guam_northern_mariana_isla", default: false
t.boolean "us_territory_claim_philippines", default: false
t.boolean "us_territory_claim_puerto_rico_and_virgin_islands", default: false
t.string "vacols_id", null: false
t.boolean "vamc", default: false
t.string "vbms_id"
t.boolean "vocational_rehab", default: false
t.boolean "waiver_of_overpayment", default: false
t.index ["appeal_series_id"], name: "index_legacy_appeals_on_appeal_series_id"
t.index ["updated_at"], name: "index_legacy_appeals_on_updated_at"
t.index ["vacols_id"], name: "index_legacy_appeals_on_vacols_id", unique: true
end
create_table "legacy_hearings", force: :cascade do |t|
t.integer "appeal_id", comment: "LegacyAppeal ID; use as FK to legacy_appeals"
t.datetime "created_at", comment: "Automatic timestamp when row was created."
t.bigint "created_by_id", comment: "The ID of the user who created the Legacy Hearing"
t.bigint "hearing_day_id", comment: "The hearing day the hearing will take place on"
t.string "military_service", comment: "Periods and circumstances of military service"
t.boolean "prepped", comment: "Determines whether the judge has checked the hearing as prepped"
t.text "summary", comment: "Summary of hearing"
t.datetime "updated_at", comment: "Timestamp when record was last updated."
t.bigint "updated_by_id", comment: "The ID of the user who most recently updated the Legacy Hearing"
t.integer "user_id", comment: "User ID of judge who will hold the hearing"
t.string "vacols_id", null: false, comment: "Corresponds to VACOLS’ hearsched.hearing_pkseq"
t.string "witness", comment: "Witness/Observer present during hearing"
t.index ["created_by_id"], name: "index_legacy_hearings_on_created_by_id"
t.index ["hearing_day_id"], name: "index_legacy_hearings_on_hearing_day_id"
t.index ["updated_at"], name: "index_legacy_hearings_on_updated_at"
t.index ["updated_by_id"], name: "index_legacy_hearings_on_updated_by_id"
t.index ["user_id"], name: "index_legacy_hearings_on_user_id"
t.index ["vacols_id"], name: "index_legacy_hearings_on_vacols_id", unique: true
end
create_table "legacy_issue_optins", comment: "When a VACOLS issue from a legacy appeal is opted-in to AMA, this table keeps track of the related request_issue, and the status of processing the opt-in, or rollback if the request issue is removed from a Decision Review.", force: :cascade do |t|
t.datetime "created_at", null: false, comment: "When a Request Issue is connected to a VACOLS issue on a legacy appeal, and the Veteran has agreed to withdraw their legacy appeals, a legacy_issue_optin is created at the time the Decision Review is successfully intaken. This is used to indicate that the legacy issue should subsequently be opted into AMA in VACOLS. "
t.string "error"
t.date "folder_decision_date", comment: "Decision date on case record folder"
t.bigint "legacy_issue_id", comment: "The legacy issue being opted in, which connects to the request issue"
t.datetime "optin_processed_at", comment: "The timestamp for when the opt-in was successfully processed, meaning it was updated in VACOLS as opted into AMA."
t.string "original_disposition_code", comment: "The original disposition code of the VACOLS issue being opted in. Stored in case the opt-in is rolled back."
t.date "original_disposition_date", comment: "The original disposition date of the VACOLS issue being opted in. Stored in case the opt-in is rolled back."
t.date "original_legacy_appeal_decision_date", comment: "The original disposition date of a legacy appeal being opted in"
t.string "original_legacy_appeal_disposition_code", comment: "The original disposition code of legacy appeal being opted in"
t.bigint "request_issue_id", null: false, comment: "The request issue connected to the legacy VACOLS issue that has been opted in."
t.datetime "rollback_created_at", comment: "Timestamp for when the connected request issue is removed from a Decision Review during edit, indicating that the opt-in needs to be rolled back."
t.datetime "rollback_processed_at", comment: "Timestamp for when a rolled back opt-in has successfully finished being rolled back."
t.datetime "updated_at", null: false, comment: "Automatically populated when the record is updated."
t.index ["legacy_issue_id"], name: "index_legacy_issue_optins_on_legacy_issue_id"
t.index ["request_issue_id"], name: "index_legacy_issue_optins_on_request_issue_id"
t.index ["updated_at"], name: "index_legacy_issue_optins_on_updated_at"
end
create_table "legacy_issues", comment: "On an AMA decision review, when a veteran requests to review an issue that is already being contested on a legacy appeal, the legacy issue is connected to the request issue. If the veteran also chooses to opt their legacy issues into AMA and the issue is eligible to be transferred to AMA, the issues are closed in VACOLS through a legacy issue opt-in. This table stores the legacy issues connected to each request issue, and the record for opting them into AMA (if applicable).", force: :cascade do |t|
t.datetime "created_at", null: false, comment: "Default created_at/updated_at"
t.bigint "request_issue_id", null: false, comment: "The request issue the legacy issue is being connected to."
t.datetime "updated_at", null: false, comment: "Default created_at/updated_at"
t.string "vacols_id", null: false, comment: "The VACOLS ID of the legacy appeal that the legacy issue is part of."
t.integer "vacols_sequence_id", null: false, comment: "The sequence ID of the legacy issue on the legacy appeal. The vacols_id and vacols_sequence_id form a composite key to identify a specific legacy issue."
t.index ["request_issue_id"], name: "index_legacy_issues_on_request_issue_id"
end
create_table "messages", force: :cascade do |t|
t.datetime "created_at", null: false
t.integer "detail_id", comment: "ID of the related object"
t.string "detail_type", comment: "Model name of the related object"
t.string "message_type", comment: "The type of event that caused this message to be created"
t.datetime "read_at", comment: "When the message was read"
t.string "text", comment: "The message"
t.datetime "updated_at", null: false
t.integer "user_id", null: false, comment: "The user for whom the message is intended"
t.index ["detail_type", "detail_id"], name: "index_messages_on_detail_type_and_detail_id"
t.index ["updated_at"], name: "index_messages_on_updated_at"
end
create_table "non_availabilities", force: :cascade do |t|
t.datetime "created_at", null: false
t.date "date"
t.string "object_identifier", null: false
t.bigint "schedule_period_id", null: false
t.string "type", null: false
t.datetime "updated_at", null: false
t.index ["schedule_period_id"], name: "index_non_availabilities_on_schedule_period_id"
t.index ["updated_at"], name: "index_non_availabilities_on_updated_at"
end
create_table "organizations", force: :cascade do |t|
t.boolean "accepts_priority_pushed_cases", comment: "Whether a JudgeTeam currently accepts distribution of automatically pushed priority cases"
t.datetime "created_at"
t.string "name"
t.string "participant_id", comment: "Organizations BGS partipant id"
t.string "role", comment: "Role users in organization must have, if present"
t.string "status", default: "active", comment: "Whether organization is active, inactive, or in some other Status."
t.datetime "status_updated_at", comment: "Track when organization status last changed."
t.string "type", comment: "Single table inheritance"
t.datetime "updated_at"
t.string "url", comment: "Unique portion of the organization queue url"
t.index ["accepts_priority_pushed_cases"], name: "index_organizations_on_accepts_priority_pushed_cases"
t.index ["status"], name: "index_organizations_on_status"
t.index ["updated_at"], name: "index_organizations_on_updated_at"
t.index ["url"], name: "index_organizations_on_url", unique: true
end
create_table "organizations_users", force: :cascade do |t|
t.boolean "admin", default: false
t.datetime "created_at"
t.integer "organization_id"
t.datetime "updated_at"
t.integer "user_id"
t.index ["organization_id"], name: "index_organizations_users_on_organization_id"
t.index ["updated_at"], name: "index_organizations_users_on_updated_at"
t.index ["user_id", "organization_id"], name: "index_organizations_users_on_user_id_and_organization_id", unique: true
end
create_table "people", force: :cascade do |t|
t.datetime "created_at", null: false
t.date "date_of_birth"
t.string "email_address", comment: "Person email address, cached from BGS"
t.string "first_name", comment: "Person first name, cached from BGS"
t.string "last_name", comment: "Person last name, cached from BGS"
t.string "middle_name", comment: "Person middle name, cached from BGS"
t.string "name_suffix", comment: "Person name suffix, cached from BGS"
t.string "participant_id", null: false
t.string "ssn", comment: "Person Social Security Number, cached from BGS"
t.datetime "updated_at", null: false
t.index ["participant_id"], name: "index_people_on_participant_id", unique: true
t.index ["ssn"], name: "index_people_on_ssn"
t.index ["updated_at"], name: "index_people_on_updated_at"
end
create_table "post_decision_motions", comment: "Stores the disposition and associated task of post-decisional motions handled by the Litigation Support Team: Motion for Reconsideration, Motion to Vacate, and Clear and Unmistakeable Error.", force: :cascade do |t|
t.bigint "appeal_id"
t.datetime "created_at", null: false
t.string "disposition", comment: "Possible options are Grant, Deny, Withdraw, and Dismiss"
t.bigint "task_id"
t.datetime "updated_at", null: false
t.string "vacate_type", comment: "Granted motion to vacate can be Straight Vacate, Vacate and Readjudication, or Vacate and De Novo."
t.integer "vacated_decision_issue_ids", comment: "When a motion to vacate is partially granted, this includes an array of the appeal's decision issue IDs that were chosen for vacatur in this post-decision motion. For full grant, this includes all prior decision issue IDs.", array: true
t.index ["task_id"], name: "index_post_decision_motions_on_task_id"
t.index ["updated_at"], name: "index_post_decision_motions_on_updated_at"
end
create_table "ramp_closed_appeals", id: :serial, comment: "Keeps track of legacy appeals that are closed or partially closed in VACOLS due to being transitioned to a RAMP election. This data can be used to rollback the RAMP Election if needed.", force: :cascade do |t|
t.datetime "closed_on", comment: "The datetime that the legacy appeal was closed in VACOLS and opted into RAMP."
t.datetime "created_at"