Class: Preneeds::Veteran

Inherits:
Base
  • Object
show all
Defined in:
app/models/preneeds/veteran.rb

Overview

Models a veteran from a BurialForm form

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#as_json

Methods included from Vets::Model

#attributes, #initialize, #nested_attributes

Methods included from Vets::Attributes

included

Instance Attribute Details

#addressPreneeds::Address

Returns veteran’s address.

Returns:



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#current_namePreneeds::FullName

Returns veteran’s current name.

Returns:



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#date_of_birthString

Returns veteran’s date of birth.

Returns:

  • (String)

    veteran’s date of birth



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#date_of_deathString

Returns veteran’s date of death.

Returns:

  • (String)

    veteran’s date of death



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#genderString

Returns veteran’s gender.

Returns:

  • (String)

    veteran’s gender



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#is_deceasedString

Returns is veteran deceased? ‘yes’ or ‘no’.

Returns:

  • (String)

    is veteran deceased? ‘yes’ or ‘no’



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#marital_statusString

Returns veteran’s marital status.

Returns:

  • (String)

    veteran’s marital status



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#military_service_numberString

Returns veteran’s military service number.

Returns:

  • (String)

    veteran’s military service number



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#military_statusString

Returns veteran’s military status.

Returns:

  • (String)

    veteran’s military status



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#place_of_birthString

Returns veteran’s place of birth.

Returns:

  • (String)

    veteran’s place of birth



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#service_namePreneeds::FullName

Returns veteran’s name when serving.

Returns:



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#service_recordsArray<Preneeds::ServiceRecord>

Returns veteran’s service records.

Returns:



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#ssnString

Returns veteran’s social security number.

Returns:

  • (String)

    veteran’s social security number



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

#va_claim_numberString

Returns veteran’s VA claim number.

Returns:

  • (String)

    veteran’s VA claim number



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
# File 'app/models/preneeds/veteran.rb', line 35

class Veteran < Preneeds::Base
  attribute :date_of_birth, String
  attribute :date_of_death, String
  attribute :gender, String
  attribute :is_deceased, String
  attribute :marital_status, String
  attribute :military_service_number, String
  attribute :place_of_birth, String
  attribute :ssn, String
  attribute :va_claim_number, String
  attribute :military_status, String

  attribute :race, Preneeds::Race
  attribute :address, Preneeds::Address
  attribute :current_name, Preneeds::FullName
  attribute :service_name, Preneeds::FullName
  attribute :service_records, Preneeds::ServiceRecord, array: true

  # (see Preneeds::BurialForm#as_eoas)
  #
  def as_eoas
    hash = {
      address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
      dateOfDeath: date_of_death, gender:,
      race: race&.as_eoas,
      isDeceased: is_deceased,
      maritalStatus: marital_status, militaryServiceNumber: military_service_number,
      placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
      serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
      militaryStatus: military_status
    }

    %i[
      dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
    ].each { |key| hash.delete(key) if hash[key].blank? }

    hash
  end

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    [
      :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
      :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
      { race: Preneeds::Race.permitted_params,
        address: Preneeds::Address.permitted_params,
        current_name: Preneeds::FullName.permitted_params,
        service_name: Preneeds::FullName.permitted_params,
        service_records: [Preneeds::ServiceRecord.permitted_params] }
    ]
  end
end

Class Method Details

.permitted_paramsArray

List of permitted params for use with Strong Parameters

Returns:

  • (Array)

    array of class attributes as symbols



76
77
78
79
80
81
82
83
84
85
86
# File 'app/models/preneeds/veteran.rb', line 76

def self.permitted_params
  [
    :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status,
    :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status,
    { race: Preneeds::Race.permitted_params,
      address: Preneeds::Address.permitted_params,
      current_name: Preneeds::FullName.permitted_params,
      service_name: Preneeds::FullName.permitted_params,
      service_records: [Preneeds::ServiceRecord.permitted_params] }
  ]
end

Instance Method Details

#as_eoasHash

Converts object attributes to a hash to be used when constructing a SOAP request body. Hash attributes must correspond to XSD ordering or API call will fail

Returns:

  • (Hash)

    object attributes and association objects converted to EOAS service compatible hash



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'app/models/preneeds/veteran.rb', line 55

def as_eoas
  hash = {
    address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth,
    dateOfDeath: date_of_death, gender:,
    race: race&.as_eoas,
    isDeceased: is_deceased,
    maritalStatus: marital_status, militaryServiceNumber: military_service_number,
    placeOfBirth: place_of_birth, serviceName: service_name.as_eoas,
    serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number,
    militaryStatus: military_status
  }

  %i[
    dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber
  ].each { |key| hash.delete(key) if hash[key].blank? }

  hash
end