-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Mobile appeal model #18197
Create Mobile appeal model #18197
Changes from 1 commit
b0b359b
9842723
1995058
650ec15
26e52ca
b70f523
ffaaf1c
1cd78f5
9cfd14e
2e1959e
37ee255
a0195c6
c80dae6
8f1f8a1
96bc3f1
15db5da
6351c44
a9a4b98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use a feature flag here since the appeals model has so much too it, i wouldn't be surprised if the error rate went up after enabling the use of the model. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note that I didn't add the appeals model to the index of this controller because it already uses a claim overview model. We could put the appeal model before the claim overview but that doesn't seem like it'd be of any benefit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
module Mobile | ||
module V0 | ||
module Adapters | ||
class Appeal | ||
def parse(appeal) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't depend on instance state (maybe move it to another class?) - UtilityFunction |
||
Mobile::V0::Appeals::Appeal.new( | ||
id: appeal[:id], | ||
appealIds: appeal[:appealIds], | ||
active: appeal[:active], | ||
alerts: appeal[:alerts], | ||
aod: appeal[:aod], | ||
aoj: appeal[:aoj], | ||
description: appeal[:description], | ||
docket: appeal[:docket], | ||
events: appeal[:events].map(&:deep_symbolize_keys), | ||
evidence: appeal[:evidence], | ||
incompleteHistory: appeal[:incompleteHistory], | ||
issues: appeal[:issues].map(&:deep_symbolize_keys), | ||
location: appeal[:location], | ||
programArea: appeal[:programArea], | ||
status: appeal[:status].deep_symbolize_keys, | ||
type: appeal[:type], | ||
updated: appeal[:updated] | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'common/models/resource' | ||
|
||
module Mobile | ||
module V0 | ||
module Appeals | ||
class Alert < Common::Resource | ||
ALERT_TYPES = Types::String.enum( | ||
'form9_needed', | ||
'scheduled_hearing', | ||
'hearing_no_show', | ||
'held_for_evidence', | ||
'cavc_option', | ||
'ramp_eligible', | ||
'ramp_ineligible', | ||
'decision_soon', | ||
'blocked_by_vso', | ||
'scheduled_dro_hearing', | ||
'dro_hearing_no_show' | ||
) | ||
|
||
attribute :type, ALERT_TYPES | ||
attribute :details, Types::Hash | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'common/models/resource' | ||
|
||
module Mobile | ||
module V0 | ||
module Appeals | ||
class Appeal < Common::Resource | ||
AOJ_TYPES = Types::String.enum( | ||
'vba', | ||
'vha', | ||
'nca', | ||
'other' | ||
) | ||
|
||
LOCATION_TYPES = Types::String.enum( | ||
'aoj', | ||
'bva' | ||
) | ||
|
||
PROGRAM_AREA_TYPES = Types::String.enum( | ||
'compensation', | ||
'pension', | ||
'insurance', | ||
'loan_guaranty', | ||
'education', | ||
'vre', | ||
'medical', | ||
'burial', | ||
'bva', | ||
'other', | ||
'multiple' | ||
) | ||
|
||
attribute :id, Types::String | ||
attribute :appealIds, Types::Array.of(Types::String) | ||
attribute :active, Types::Bool | ||
attribute :alerts, Types::Array.of(Appeals::Alert) | ||
attribute :aod, Types::Bool.optional | ||
attribute :aoj, AOJ_TYPES | ||
attribute :description, Types::String | ||
attribute :docket, Appeals::Docket.optional | ||
attribute :events, Types::Array.of(Appeals::Event) | ||
attribute :evidence, Types::Array.of(Appeals::Evidence).optional | ||
attribute :incompleteHistory, Types::Bool | ||
attribute :issues, Types::Array.of(Appeals::Issue) | ||
attribute :location, LOCATION_TYPES | ||
attribute :programArea, PROGRAM_AREA_TYPES | ||
attribute :status, Appeals::Status | ||
attribute :type, Types::String | ||
attribute :updated, Types::DateTime | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'common/models/resource' | ||
|
||
module Mobile | ||
module V0 | ||
module Appeals | ||
class Docket < Common::Resource | ||
attribute :type, Types::String | ||
attribute :month, Types::Date | ||
attribute :switchDueDate, Types::Date | ||
attribute :eligibleToSwitch, Types::Bool | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'common/models/resource' | ||
|
||
module Mobile | ||
module V0 | ||
module Appeals | ||
class Event < Common::Resource | ||
EVENT_TYPES = Types::String.enum( | ||
'claim_decision', | ||
'nod', | ||
'soc', | ||
'form9', | ||
'ssoc', | ||
'certified', | ||
'hearing_held', | ||
'hearing_no_show', | ||
'bva_decision', | ||
'field_grant', | ||
'withdrawn', | ||
'ftr', | ||
'ramp', | ||
'death', | ||
'merged', | ||
'record_designation', | ||
'reconsideration', | ||
'vacated', | ||
'other_close', | ||
'cavc_decision', | ||
'ramp_notice', | ||
'transcript', | ||
'remand_return', | ||
'dro_hearing_held', | ||
'dro_hearing_cancelled', | ||
'dro_hearing_no_show' | ||
) | ||
|
||
attribute :type, EVENT_TYPES | ||
attribute :date, Types::Date | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'common/models/resource' | ||
|
||
module Mobile | ||
module V0 | ||
module Appeals | ||
class Evidence < Common::Resource | ||
attribute :description, Types::String | ||
attribute :date, Types::Date | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'common/models/resource' | ||
|
||
module Mobile | ||
module V0 | ||
module Appeals | ||
class Issue < Common::Resource | ||
LAST_ACTION_TYPES = Types::String.enum( | ||
'field_grant', | ||
'withdrawn', | ||
'allowed', | ||
'denied', | ||
'remand', | ||
'cavc_remand' | ||
) | ||
|
||
attribute :active, Types::Bool | ||
attribute :lastAction, LAST_ACTION_TYPES.optional | ||
attribute :description, Types::String | ||
attribute :diagnosticCode, Types::String.optional | ||
attribute :date, Types::Date | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'common/models/resource' | ||
|
||
module Mobile | ||
module V0 | ||
module Appeals | ||
class Status < Common::Resource | ||
STATUS_TYPES = Types::String.enum( | ||
'scheduled_hearing', | ||
'pending_hearing_scheduling', | ||
'on_docket', | ||
'pending_certification_ssoc', | ||
'pending_certification', | ||
'pending_form9', | ||
'pending_soc', | ||
'stayed', | ||
'at_vso', | ||
'bva_development', | ||
'decision_in_progress', | ||
'bva_decision', | ||
'field_grant', | ||
'withdrawn', | ||
'ftr', | ||
'ramp', | ||
'death', | ||
'reconsideration', | ||
'other_close', | ||
'remand_ssoc', | ||
'remand', | ||
'merged' | ||
) | ||
|
||
attribute :type, STATUS_TYPES | ||
attribute :details, Types::Hash | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type: object | ||
properties: | ||
data: | ||
date: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo |
||
type: string | ||
type: | ||
type: string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's enough being enforced that wasn't before that I think there's a good chance it could cause a rise in error rates. This will keep that from becoming an issue.