Sha256: adc13f2722c6ee92e6c43a6bdbd0427f30efc7afaea4163e6ed9bf6e51881c0f

Contents?: true

Size: 1.2 KB

Versions: 12

Compression:

Stored size: 1.2 KB

Contents

module Xeroizer
  module Record
    
    class ContactModel < BaseModel
            
      set_permissions :read, :write, :update
      
    end
    
    class Contact < Base
      
      CONTACT_STATUS = {
        'ACTIVE' =>     'Active',
        'DELETED' =>    'Deleted'
      } unless defined?(CONTACT_STATUS)
      
      set_primary_key :contact_id
      set_possible_primary_keys :contact_id, :contact_number
      
      guid      :contact_id
      string    :contact_number
      string    :contact_status
      string    :name
      string    :tax_number
      string    :bank_account_details
      string    :accounts_receivable_tax_type
      string    :accounts_payable_tax_type
      string    :first_name
      string    :last_name
      string    :email_address
      string    :contact_groups
      string    :default_currency
      datetime  :updated_date_utc, :api_name => 'UpdatedDateUTC'
      boolean   :is_supplier
      boolean   :is_customer
      
      has_many  :addresses
      has_many  :phones
      has_many  :contact_groups
      
      validates_presence_of :name
      validates_inclusion_of :contact_status, :in => CONTACT_STATUS.keys, :allow_blanks => true
      
    end
    
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
xeroizer-0.4.3 lib/xeroizer/models/contact.rb
xeroizer-0.4.2 lib/xeroizer/models/contact.rb
xeroizer-0.4.1 lib/xeroizer/models/contact.rb
xeroizer-0.4.0 lib/xeroizer/models/contact.rb
xeroizer-0.3.5 lib/xeroizer/models/contact.rb
xeroizer-0.3.4 lib/xeroizer/models/contact.rb
xeroizer-0.3.3 lib/xeroizer/models/contact.rb
xeroizer-0.3.2 lib/xeroizer/models/contact.rb
xeroizer-0.3.1 lib/xeroizer/models/contact.rb
xeroizer-0.3.0 lib/xeroizer/models/contact.rb
xeroizer-0.2.2 lib/xeroizer/models/contact.rb
xeroizer-0.2.1 lib/xeroizer/models/contact.rb