Sha256: 237b681a4292f5aceeda25204f9fe35a6dd846308003ad3f72be3ba3f6822c85

Contents?: true

Size: 1.75 KB

Versions: 3

Compression:

Stored size: 1.75 KB

Contents

require_relative 'base'

require 'amsi/request_section/moveins_filter'
require 'amsi/document_parser/get_moveins'

module Amsi
  module Request
    # Retrieve move ins for a property between a specified data range
    # and for a specified marketing source code.
    #
    # Required initializer parameters:
    #   @param property_id [String] Max of 50 characters according to their
    #     docs, this is AMSI's ID of the property we want to fetch move ins for.
    #   @param marketing_source_code [String] Max of 3 characters according to
    #     their docs, this is the code that corresponds to the marketing source
    #     for which we want to fetch move ins. The list of marketing sources
    #     that a given property supports can be found with a GetPropertyList
    #     request.
    #   @param from_date, through_date [Date] Together, these two params define
    #     the interval from which to fetch move ins.
    class GetMoveinsByFirstMarketingSource < Base
      def after_initialize(
        from_date:,
        marketing_source_code:,
        property_id:,
        through_date:
      )
        @from_date = from_date
        @marketing_source_code = marketing_source_code
        @property_id = property_id
        @through_date = through_date
      end

      private

      def parser
        DocumentParser::GetMoveins.new
      end

      def sections
        [
          RequestSection::MoveinsFilter.new(
            property_id: property_id,
            marketing_source_code: marketing_source_code,
            from_date: from_date,
            through_date: through_date
          )
        ]
      end

      attr_reader :from_date,
                  :marketing_source_code,
                  :property_id,
                  :through_date
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
amsi-1.1.0 lib/amsi/request/get_moveins_by_first_marketing_source.rb
amsi-1.0.1 lib/amsi/request/get_moveins_by_first_marketing_source.rb
amsi-1.0.0 lib/amsi/request/get_moveins_by_first_marketing_source.rb