db/seeds/hearings.rb
def create_veteran(veteran_file_number: nil)
      veteran_fields = {
        first_name: Faker::Name.first_name,
        last_name: Faker::Name.last_name,
        bgs_veteran_record: {
          date_of_birth: Faker::Date.birthday(min_age: 35, max_age: 80).strftime("%m/%d/%Y"),
          date_of_death: nil,
          name_suffix: nil,
          sex: Faker::Gender.binary_type[0],
          address_line1: Faker::Address.street_address,
          country: "USA",
          zip_code: Faker::Address.zip_code,
          state: Faker::Address.state_abbr,
          city: Faker::Address.city
        }
      }
      veteran_fields[:file_number] = veteran_file_number if veteran_file_number.present?

      create(
        :veteran,
        **veteran_fields
      )
    end
# creates fake veteran given a file number
creates fake veteran given a file number
creates fake veteran given a file number
def create_veteran(veteran_file_number: nil)
      veteran_fields = {
        first_name: Faker::Name.first_name,
        last_name: Faker::Name.last_name,
        bgs_veteran_record: {
          date_of_birth: Faker::Date.birthday(min_age: 35, max_age: 80).strftime("%m/%d/%Y"),
          date_of_death: nil,
          name_suffix: nil,
          sex: Faker::Gender.binary_type[0],
          address_line1: Faker::Address.street_address,
          country: "USA",
          zip_code: Faker::Address.zip_code,
          state: Faker::Address.state_abbr,
          city: Faker::Address.city
        }
      }
      veteran_fields[:file_number] = veteran_file_number if veteran_file_number.present?
      create(
        :veteran,
        **veteran_fields
      )
    end
def create_veteran ( veteran_file_number : nil ) veteran_fields = { first_name : Faker :: Name . first_name , last_name : Faker :: Name . last_name , bgs_veteran_record : { date_of_birth : Faker :: Date . birthday ( min_age : 35 , max_age : 80 ) . strftime ( "%m/%d/%Y" ) , date_of_death : nil , name_suffix : nil , sex : Faker :: Gender . binary_type [ 0 ] , address_line1 : Faker :: Address . street_address , country : "USA" , zip_code : Faker :: Address . zip_code , state : Faker :: Address . state_abbr , city : Faker :: Address . city } } veteran_fields [ :file_number ] = veteran_file_number if veteran_file_number . present? create ( :veteran , ** veteran_fields ) end
creates fake veteran given a file number
creates fake veteran given a file number
veteran_file_number