appraisermetrics-report-service

Report Service app for AM app.

gem dependencies

usage

# will need a deploy key
gem 'appraisermetrics_report_service', git: 'https://github.com/StackPointCloud/appraisermetrics-report-service.git' 
require 'appraisermetrics_report_service'

ClosedSale

c = ClosedSale.new do
    write_content(ruby_hash_object, images, ) # => returns ClosedSaleObject which inherits from Prawn::Document
end

# ruby_hash_object is identical to Comp document, with references to the Mongo Shell removed (ISODate, ObjectID) 
# images takes an array of image paths. [0] should be the profile image for the property
# office_logo takes a file path

EvalReport

# generate an eval report
r = EvalReport.new do
    write_content(subject, comparables, , docs={}) 
    # docs is an optional hash. All keys are should be filepaths, with the exception of 
    # :subjectphotos which is an Array of filepaths, 

    # subject is a hash, comparables is an array, logo is a filepath
end

Output

# render it to file
r.render_file("some_name.pdf") => local directory pdf called "some_name" with extension .pdf
# stringIO
StringIO.new(r.render) => <StringIO>


Testing/Dev

  • Rspec suite covers table methods invidually, as well as helper methods.
  • The pdf-reader gem is used in specs to read content into tests
  • The Sampler class is used to generate sample ruby objects to be used in specs.

To generate test pdf reports:

irb

load './spec/test_data/sampler'

# closed sale
Sampler.test_closed_sale

# eval report
Sampler.test_eval_report