Skip to content

Commit

Permalink
(fix) formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ojbucao committed Jan 9, 2025
1 parent f12b461 commit 92cd054
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ class PowerOfAttorneyRequestsController < ApplicationController
def index
poa_requests = PowerOfAttorneyRequest.includes(resolution: :resolving).limit(100)
serializer = PowerOfAttorneyRequestSerializer.new(poa_requests)

render json: serializer.serializable_hash, status: :ok
end

def show
poa_request = PowerOfAttorneyRequest.includes(resolution: :resolving).find(params[:id])
serializer = PowerOfAttorneyRequestSerializer.new(poa_request)

render json: serializer.serializable_hash, status: :ok
rescue ActiveRecord::RecordNotFound
render json: { error: 'Record not found' }, status: :not_found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ module ClaimantTypes
private

def set_claimant_type
if power_of_attorney_form.parsed_data['dependent']
self.claimant_type = ClaimantTypes::DEPENDENT
return
end

if power_of_attorney_form.parsed_data['veteran']
self.claimant_type = ClaimantTypes::VETERAN
nil
end
self.claimant_type = if power_of_attorney_form.parsed_data['dependent']
ClaimantTypes::DEPENDENT
elsif power_of_attorney_form.parsed_data['veteran']
ClaimantTypes::VETERAN
end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,60 +1,58 @@
# frozen_string_literal: true

form_data = <<~JSON
{
"authorizations": {
"record_disclosure": true,
"record_disclosure_limitations": [],
"address_change": true
form_data = {
authorizations: {
record_disclosure: true,
record_disclosure_limitations: [],
address_change: true
},
dependent: {
name: {
first: 'John',
middle: 'Middle',
last: 'Doe'
},
"dependent": {
"name": {
"first": "John",
"middle": "Middle",
"last": "Doe"
},
"address": {
"address_line1": "123 Main St",
"address_line2": "Apt 1",
"city": "Springfield",
"state_code": "IL",
"country": "US",
"zip_code": "62704",
"zip_code_suffix": "6789"
},
"date_of_birth": "1980-12-31",
"relationship": "Spouse",
"phone": "1234567890",
"email": "[email protected]"
address: {
address_line1: '123 Main St',
address_line2: 'Apt 1',
city: 'Springfield',
state_code: 'IL',
country: 'US',
zip_code: '62704',
zip_code_suffix: '6789'
},
"veteran": {
"name": {
"first": "John",
"middle": "Middle",
"last": "Doe"
},
"address": {
"address_line1": "123 Main St",
"address_line2": "Apt 1",
"city": "Springfield",
"state_code": "IL",
"country": "US",
"zip_code": "62704",
"zip_code_suffix": "6789"
},
"ssn": "123456789",
"va_file_number": "123456789",
"date_of_birth": "1980-12-31",
"service_number": "123456789",
"service_branch": "ARMY",
"phone": "1234567890",
"email": "[email protected]"
}
date_of_birth: '1980-12-31',
relationship: 'Spouse',
phone: '1234567890',
email: '[email protected]'
},
veteran: {
name: {
first: 'John',
middle: 'Middle',
last: 'Doe'
},
address: {
address_line1: '123 Main St',
address_line2: 'Apt 1',
city: 'Springfield',
state_code: 'IL',
country: 'US',
zip_code: '62704',
zip_code_suffix: '6789'
},
ssn: '123456789',
va_file_number: '123456789',
date_of_birth: '1980-12-31',
service_number: '123456789',
service_branch: 'ARMY',
phone: '1234567890',
email: '[email protected]'
}
JSON
}

FactoryBot.define do
factory :power_of_attorney_form, class: 'AccreditedRepresentativePortal::PowerOfAttorneyForm' do
data { form_data }
data { form_data.to_json }
end
end

0 comments on commit 92cd054

Please sign in to comment.