-
Notifications
You must be signed in to change notification settings - Fork 16
/
representative.rb
51 lines (39 loc) · 1.01 KB
/
representative.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
# frozen_string_literal: true
class Representative < Organization
after_initialize :set_role
def user_has_access?(user)
return false unless user.roles.include?("VSO")
participant_ids = user.vsos_user_represents.map { |poa| poa[:participant_id] }
participant_ids.include?(participant_id)
end
def can_receive_task?(_task)
false
end
def show_reader_link_column?
false
end
def should_write_ihp?(appeal)
ihp_writing_configs.include?(appeal.docket_type) && appeal.representatives.include?(self)
end
def queue_tabs
[
tracking_tasks_tab,
unassigned_tasks_tab,
assigned_tasks_tab,
completed_tasks_tab
]
end
def tracking_tasks_tab
::TrackingTasksTab.new(assignee: self)
end
def ama_task_serializer
WorkQueue::OrganizationTaskSerializer
end
private
def set_role
self.role = "VSO"
end
def ihp_writing_configs
vso_config&.ihp_dockets || [Constants.AMA_DOCKETS.evidence_submission, Constants.AMA_DOCKETS.direct_review]
end
end