Sha256: df69fed4d02a25316f0665676060eda8b6ef9f34273544f16c3db65689c18bd8

Contents?: true

Size: 1.58 KB

Versions: 2

Compression:

Stored size: 1.58 KB

Contents

require_relative 'base'

module Amsi
  module Model
    class Lease < Base
      module Status
        CURRENT = 'C'.freeze
        APPLICANT = 'A'.freeze
        INTENT_TO_TRANSFER = 'I'.freeze
        LEASED = 'L'.freeze
        NOTICE = 'N'.freeze
        PREVIOUS = 'P'.freeze
        TRANSFER = 'T'.freeze
        APPROVED = 'V'.freeze
        CANCELLED = 'X'.freeze
      end

      date_attrs *%i[
        application_date
        lease_begin_date
        lease_end_date
        lease_sign_date
        move_in_date
       ]

      string_attrs *%i[
        bldg_id
        external_reference_id
        occu_status_code
        occu_status_code_description
        property_id
        resi_id
        unit_id
        lease_marketing_source
        guest_card_no
      ]

      decimal_attrs :rent_amount

      date_time_attrs :guest_first_contact_date

      alias_method :begin_date, :lease_begin_date
      alias_method :end_date, :lease_end_date
      alias_method :sign_date, :lease_sign_date
      alias_method :lead_id, :guest_card_no
      alias_method :lead_date, :guest_first_contact_date
      alias_method :lead_source_code, :lease_marketing_source
      alias_method :building_id, :bldg_id
      alias_method :resident_id, :resi_id
      alias_method :occupant_status_code, :occu_status_code
      alias_method :occupant_status_code_description,
                   :occu_status_code_description

      attr_accessor :occupants
      attr_accessor :guest_card
      attr_writer :matched_guest_cards

      def matched_guest_cards
        @matched_guest_cards ||= []
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
amsi-1.0.1 lib/amsi/model/lease.rb
amsi-1.0.0 lib/amsi/model/lease.rb