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, images, , docs={}) 
    # images is a hash, subject is a hash, comparables is an array, logo is a filepath
    # docs is an options hash that will accept file paths for related pdf and image files
end

# image hash construction: {subject_photos: [], regional_maps: [], topo_maps: [], ag_sales_map: String}

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