Sha256: 659ce4dde880cab93a9669cd5308c771701c9c16dfb5f8e009dfc470a23e15f9

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 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
      
      validates_presence_of :name
      validates_inclusion_of :contact_status, :in => CONTACT_STATUS.keys, :allow_blanks => true
      
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xeroizer-0.2.0 lib/xeroizer/models/contact.rb
xeroizer-0.1.3 lib/xeroizer/models/contact.rb
xeroizer-0.1.2 lib/xeroizer/models/contact.rb
xeroizer-0.1.0 lib/xeroizer/models/contact.rb