module Vhcs
  class PbEntityAddress < VhcsRecord

    self.table_name = 'PBEntityAddress'

    alias_attribute :pb_entity_address_key, :PBEntityAddressKey
    alias_attribute :pb_entity_key, :PBEntityKey
    alias_attribute :address_type_id, :AddressTypeID
    alias_attribute :street_line_1, :StreetLine1
    alias_attribute :street_line_2, :StreetLine2
    alias_attribute :city, :City
    alias_attribute :state, :State
    alias_attribute :zip, :Zip
    alias_attribute :country_code, :CountryCode
    alias_attribute :county, :County
    alias_attribute :override_pb_entity_address_key, :OverridePBEntityAddressKey
    alias_attribute :when_last_changed, :WhenLastChanged
    alias_attribute :who_last_changed, :WhoLastChanged
    alias_attribute :full_address_to_use, :FullAddressToUse
    alias_attribute :country_sub_div, :CountrySubDiv
    alias_attribute :full_address, :FullAddress

    def attributes
      rails_like = {
          pb_entity_address_key: self.pb_entity_address_key,
          pb_entity_key: self.pb_entity_key,
          address_type_id: self.address_type_id,
          street_line_1: self.street_line_1,
          street_line_2: self.street_line_2,
          city: self.city,
          state: self.state,
          zip: self.zip,
          country_code: self.country_code,
          county: self.county,
          override_pb_entity_address_key: self.override_pb_entity_address_key,
          when_last_changed: self.when_last_changed,
          who_last_changed: self.who_last_changed,
          full_address_to_use: self.full_address_to_use,
          country_sub_div: self.country_sub_div,
          full_address: self.full_address,
      }
      super.merge(rails_like)
    end


  end
end