reso 0.1.6.7 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +11 -17
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +60 -0
- data/LICENSE.txt +17 -18
- data/README.md +19 -125
- data/Rakefile +5 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/generators/reso/install/install_generator.rb +23 -0
- data/lib/generators/reso/install/templates/create_reso_enumeration_assignments.rb +14 -0
- data/lib/generators/reso/install/templates/create_reso_enumerations.rb +12 -0
- data/lib/reso/app/models/.DS_Store +0 -0
- data/lib/reso/app/models/application_record.rb +3 -0
- data/lib/reso/app/models/reso/contact.rb +3 -0
- data/lib/reso/app/models/reso/contact_listing.rb +3 -0
- data/lib/reso/app/models/reso/contact_listing_note.rb +3 -0
- data/lib/reso/app/models/reso/data_dictionary.rb +124 -0
- data/lib/reso/app/models/reso/enumeration.rb +3 -0
- data/lib/reso/app/models/reso/enumeration_assignment.rb +4 -0
- data/lib/reso/app/models/reso/history_transactional.rb +3 -0
- data/lib/reso/app/models/reso/internet_tracking/actor.rb +6 -0
- data/lib/reso/app/models/reso/internet_tracking/event.rb +6 -0
- data/lib/reso/app/models/reso/internet_tracking/object.rb +6 -0
- data/lib/reso/app/models/reso/internet_tracking.rb +7 -0
- data/lib/reso/app/models/reso/lookup/accessibility_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/actor_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/appliance.rb +4 -0
- data/lib/reso/app/models/reso/lookup/area_source.rb +6 -0
- data/lib/reso/app/models/reso/lookup/area_unit.rb +5 -0
- data/lib/reso/app/models/reso/lookup/association_amenity.rb +4 -0
- data/lib/reso/app/models/reso/lookup/association_fee_include.rb +5 -0
- data/lib/reso/app/models/reso/lookup/attended.rb +4 -0
- data/lib/reso/app/models/reso/lookup/basement.rb +5 -0
- data/lib/reso/app/models/reso/lookup/body_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/business_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/buyer_agent_designation.rb +5 -0
- data/lib/reso/app/models/reso/lookup/buyer_financing.rb +4 -0
- data/lib/reso/app/models/reso/lookup/change_type.rb +5 -0
- data/lib/reso/app/models/reso/lookup/class_name.rb +4 -0
- data/lib/reso/app/models/reso/lookup/co_buyer_agent_designation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/co_list_agent_designation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/common_interest.rb +4 -0
- data/lib/reso/app/models/reso/lookup/common_wall.rb +4 -0
- data/lib/reso/app/models/reso/lookup/community_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/compensation_type.rb +8 -0
- data/lib/reso/app/models/reso/lookup/concession.rb +4 -0
- data/lib/reso/app/models/reso/lookup/construction_material.rb +4 -0
- data/lib/reso/app/models/reso/lookup/contact_listing_preference.rb +4 -0
- data/lib/reso/app/models/reso/lookup/contact_status.rb +4 -0
- data/lib/reso/app/models/reso/lookup/contact_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/cooling.rb +4 -0
- data/lib/reso/app/models/reso/lookup/current_financing.rb +4 -0
- data/lib/reso/app/models/reso/lookup/current_use.rb +4 -0
- data/lib/reso/app/models/reso/lookup/daily_schedule.rb +4 -0
- data/lib/reso/app/models/reso/lookup/development_status.rb +4 -0
- data/lib/reso/app/models/reso/lookup/device_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/direction_face.rb +4 -0
- data/lib/reso/app/models/reso/lookup/door_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/electric.rb +4 -0
- data/lib/reso/app/models/reso/lookup/event_target.rb +4 -0
- data/lib/reso/app/models/reso/lookup/event_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/existing_lease_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/exterior_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/fencing.rb +4 -0
- data/lib/reso/app/models/reso/lookup/financial_data_source.rb +4 -0
- data/lib/reso/app/models/reso/lookup/fireplace_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/flooring.rb +4 -0
- data/lib/reso/app/models/reso/lookup/foundation_detail.rb +4 -0
- data/lib/reso/app/models/reso/lookup/frontage_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/furnished.rb +4 -0
- data/lib/reso/app/models/reso/lookup/green_building_verification_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/green_energy_efficient.rb +4 -0
- data/lib/reso/app/models/reso/lookup/green_energy_generation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/green_indoor_air_quality.rb +4 -0
- data/lib/reso/app/models/reso/lookup/green_sustainability.rb +4 -0
- data/lib/reso/app/models/reso/lookup/green_water_conservation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/heating.rb +4 -0
- data/lib/reso/app/models/reso/lookup/horse_amenity.rb +4 -0
- data/lib/reso/app/models/reso/lookup/hours_days_of_operation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/image_of.rb +4 -0
- data/lib/reso/app/models/reso/lookup/income_include.rb +4 -0
- data/lib/reso/app/models/reso/lookup/labor_information.rb +4 -0
- data/lib/reso/app/models/reso/lookup/laundry_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/lease_renewal_compensation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/lease_term.rb +4 -0
- data/lib/reso/app/models/reso/lookup/list_agent_designation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/listing_agreement.rb +4 -0
- data/lib/reso/app/models/reso/lookup/listing_service.rb +4 -0
- data/lib/reso/app/models/reso/lookup/listing_term.rb +4 -0
- data/lib/reso/app/models/reso/lookup/lock_box_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/lot_dimensions_source.rb +4 -0
- data/lib/reso/app/models/reso/lookup/lot_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/lot_size_source.rb +4 -0
- data/lib/reso/app/models/reso/lookup/lot_size_unit.rb +4 -0
- data/lib/reso/app/models/reso/lookup/media_category.rb +4 -0
- data/lib/reso/app/models/reso/lookup/media_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/member_designation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/member_other_phone_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/member_status.rb +4 -0
- data/lib/reso/app/models/reso/lookup/member_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/noted_by.rb +4 -0
- data/lib/reso/app/models/reso/lookup/object_id_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/object_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/occupant_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/open_house_status.rb +4 -0
- data/lib/reso/app/models/reso/lookup/open_house_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/operating_expense_include.rb +4 -0
- data/lib/reso/app/models/reso/lookup/other_equipment.rb +4 -0
- data/lib/reso/app/models/reso/lookup/other_structure.rb +4 -0
- data/lib/reso/app/models/reso/lookup/owner_pay.rb +4 -0
- data/lib/reso/app/models/reso/lookup/ownership_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/parking_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/patio_and_porch_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/permission.rb +4 -0
- data/lib/reso/app/models/reso/lookup/pets_allowed.rb +4 -0
- data/lib/reso/app/models/reso/lookup/pool_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/possession.rb +4 -0
- data/lib/reso/app/models/reso/lookup/possible_use.rb +4 -0
- data/lib/reso/app/models/reso/lookup/property_condition.rb +4 -0
- data/lib/reso/app/models/reso/lookup/property_sub_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/property_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/queue_transaction_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/reason_active_or_disabled.rb +4 -0
- data/lib/reso/app/models/reso/lookup/rent_include.rb +4 -0
- data/lib/reso/app/models/reso/lookup/road_frontage_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/road_responsibility.rb +4 -0
- data/lib/reso/app/models/reso/lookup/road_surface_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/roof.rb +4 -0
- data/lib/reso/app/models/reso/lookup/rule_format.rb +4 -0
- data/lib/reso/app/models/reso/lookup/schedule_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/search_query_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/security_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/sewer.rb +4 -0
- data/lib/reso/app/models/reso/lookup/showing_contact_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/showing_requirement.rb +4 -0
- data/lib/reso/app/models/reso/lookup/skirt.rb +4 -0
- data/lib/reso/app/models/reso/lookup/spa_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/special_license.rb +4 -0
- data/lib/reso/app/models/reso/lookup/special_listing_condition.rb +4 -0
- data/lib/reso/app/models/reso/lookup/standard_status.rb +4 -0
- data/lib/reso/app/models/reso/lookup/street_direction.rb +4 -0
- data/lib/reso/app/models/reso/lookup/structure_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/syndicate_to.rb +4 -0
- data/lib/reso/app/models/reso/lookup/tax_status_current.rb +4 -0
- data/lib/reso/app/models/reso/lookup/team_member_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/team_status.rb +4 -0
- data/lib/reso/app/models/reso/lookup/tenant_pay.rb +4 -0
- data/lib/reso/app/models/reso/lookup/unit_type_type.rb +4 -0
- data/lib/reso/app/models/reso/lookup/units_furnished.rb +4 -0
- data/lib/reso/app/models/reso/lookup/utility.rb +4 -0
- data/lib/reso/app/models/reso/lookup/vegetation.rb +4 -0
- data/lib/reso/app/models/reso/lookup/view.rb +4 -0
- data/lib/reso/app/models/reso/lookup/water_source.rb +4 -0
- data/lib/reso/app/models/reso/lookup/waterfront_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/window_feature.rb +4 -0
- data/lib/reso/app/models/reso/lookup/year_built_source.rb +4 -0
- data/lib/reso/app/models/reso/lookup.rb +2 -0
- data/lib/reso/app/models/reso/media.rb +3 -0
- data/lib/reso/app/models/reso/member.rb +3 -0
- data/lib/reso/app/models/reso/office.rb +3 -0
- data/lib/reso/app/models/reso/open_house.rb +3 -0
- data/lib/reso/app/models/reso/other_phone.rb +3 -0
- data/lib/reso/app/models/reso/ouid.rb +3 -0
- data/lib/reso/app/models/reso/property/business.rb +6 -0
- data/lib/reso/app/models/reso/property/characteristic.rb +9 -0
- data/lib/reso/app/models/reso/property/equipment.rb +5 -0
- data/lib/reso/app/models/reso/property/farming.rb +9 -0
- data/lib/reso/app/models/reso/property/financial.rb +9 -0
- data/lib/reso/app/models/reso/property/hoa.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/buyer_agent.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/buyer_office.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/co_buyer_agent.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/co_buyer_office.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/co_list_agent.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/co_list_office.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/list_agent.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/list_office.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office/team.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/agent_office.rb +15 -0
- data/lib/reso/app/models/reso/property/listing/closing.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/compensation.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/contract.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/date.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/marketing.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/media.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/price.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/remark.rb +6 -0
- data/lib/reso/app/models/reso/property/listing/showing.rb +6 -0
- data/lib/reso/app/models/reso/property/listing.rb +17 -0
- data/lib/reso/app/models/reso/property/location/address.rb +6 -0
- data/lib/reso/app/models/reso/property/location/area.rb +6 -0
- data/lib/reso/app/models/reso/property/location/gis.rb +6 -0
- data/lib/reso/app/models/reso/property/location/school.rb +6 -0
- data/lib/reso/app/models/reso/property/location.rb +10 -0
- data/lib/reso/app/models/reso/property/occupant_owner.rb +6 -0
- data/lib/reso/app/models/reso/property/structure/performance/green_marketing.rb +6 -0
- data/lib/reso/app/models/reso/property/structure/performance/green_verification.rb +6 -0
- data/lib/reso/app/models/reso/property/structure/performance.rb +7 -0
- data/lib/reso/app/models/reso/property/structure/room.rb +6 -0
- data/lib/reso/app/models/reso/property/structure.rb +11 -0
- data/lib/reso/app/models/reso/property/tax.rb +6 -0
- data/lib/reso/app/models/reso/property/unit_type.rb +9 -0
- data/lib/reso/app/models/reso/property/utility.rb +12 -0
- data/lib/reso/app/models/reso/property.rb +22 -0
- data/lib/reso/app/models/reso/property_agent_office.rb +2 -0
- data/lib/reso/app/models/reso/property_green_verification.rb +3 -0
- data/lib/reso/app/models/reso/property_location.rb +2 -0
- data/lib/reso/app/models/reso/property_performance.rb +2 -0
- data/lib/reso/app/models/reso/property_power_production.rb +3 -0
- data/lib/reso/app/models/reso/property_room.rb +3 -0
- data/lib/reso/app/models/reso/property_unit_type.rb +3 -0
- data/lib/reso/app/models/reso/prospecting.rb +3 -0
- data/lib/reso/app/models/reso/queue.rb +48 -0
- data/lib/reso/app/models/reso/rule.rb +85 -0
- data/lib/reso/app/models/reso/saved_search.rb +3 -0
- data/lib/reso/app/models/reso/showing/agent.rb +6 -0
- data/lib/reso/app/models/reso/showing/listing.rb +6 -0
- data/lib/reso/app/models/reso/showing.rb +7 -0
- data/lib/reso/app/models/reso/social_media.rb +3 -0
- data/lib/reso/app/models/reso/team.rb +7 -0
- data/lib/reso/app/models/reso/team_member.rb +3 -0
- data/lib/reso/config/inflections.rb +10 -0
- data/lib/reso/config/initializers/enumeration_assignments.rb +374 -0
- data/lib/reso/railtie.rb +5 -0
- data/lib/reso/version.rb +2 -2
- data/lib/reso.rb +215 -8
- data/reso-1.7.xml +109899 -0
- data/reso.gemspec +20 -20
- metadata +259 -159
- data/app/controllers/syndication_controller.rb +0 -5
- data/app/models/.keep +0 -0
- data/app/models/address.rb +0 -25
- data/app/models/address_type.rb +0 -3
- data/app/models/alternate_price.rb +0 -2
- data/app/models/appliance.rb +0 -3
- data/app/models/architecture_style.rb +0 -5
- data/app/models/area_unit.rb +0 -2
- data/app/models/brokerage.rb +0 -4
- data/app/models/builder.rb +0 -4
- data/app/models/business.rb +0 -8
- data/app/models/community.rb +0 -5
- data/app/models/cooling_system.rb +0 -3
- data/app/models/county.rb +0 -5
- data/app/models/currency_period.rb +0 -3
- data/app/models/enumeration.rb +0 -7
- data/app/models/expense.rb +0 -6
- data/app/models/expense_category.rb +0 -2
- data/app/models/exterior_type.rb +0 -3
- data/app/models/floor_covering.rb +0 -3
- data/app/models/foreclosure_status.rb +0 -5
- data/app/models/franchise.rb +0 -4
- data/app/models/gender.rb +0 -3
- data/app/models/heating_fuel.rb +0 -3
- data/app/models/heating_system.rb +0 -3
- data/app/models/home_feature.rb +0 -3
- data/app/models/import.rb +0 -153
- data/app/models/import_format.rb +0 -3
- data/app/models/import_result.rb +0 -12
- data/app/models/license_category.rb +0 -2
- data/app/models/listing.rb +0 -64
- data/app/models/listing_category.rb +0 -5
- data/app/models/listing_media.rb +0 -6
- data/app/models/listing_provider.rb +0 -9
- data/app/models/listing_status.rb +0 -5
- data/app/models/multiple_listing_service.rb +0 -5
- data/app/models/neighborhood.rb +0 -3
- data/app/models/office.rb +0 -6
- data/app/models/open_house.rb +0 -4
- data/app/models/parking.rb +0 -3
- data/app/models/participant.rb +0 -5
- data/app/models/participant_license.rb +0 -8
- data/app/models/participant_role.rb +0 -3
- data/app/models/person.rb +0 -18
- data/app/models/photo.rb +0 -3
- data/app/models/place.rb +0 -3
- data/app/models/price.rb +0 -4
- data/app/models/property_sub_type.rb +0 -5
- data/app/models/property_type.rb +0 -5
- data/app/models/queued_listing.rb +0 -31
- data/app/models/roof_type.rb +0 -3
- data/app/models/room.rb +0 -4
- data/app/models/room_category.rb +0 -2
- data/app/models/school.rb +0 -3
- data/app/models/school_category.rb +0 -2
- data/app/models/source_provider_category.rb +0 -2
- data/app/models/tax.rb +0 -3
- data/app/models/video.rb +0 -3
- data/app/models/view_type.rb +0 -3
- data/app/models/virtual_tour.rb +0 -3
- data/app/views/syndication/rets.xml.erb +0 -325
- data/lib/class_extensions.rb +0 -53
- data/lib/generators/reso/install_generator.rb +0 -45
- data/lib/generators/reso/setup.rb +0 -37
- data/lib/generators/reso/templates/create_addresses.rb +0 -33
- data/lib/generators/reso/templates/create_businesses.rb +0 -18
- data/lib/generators/reso/templates/create_enumerations.rb +0 -13
- data/lib/generators/reso/templates/create_expenses.rb +0 -13
- data/lib/generators/reso/templates/create_import_results.rb +0 -16
- data/lib/generators/reso/templates/create_imports.rb +0 -19
- data/lib/generators/reso/templates/create_join_tables.rb +0 -27
- data/lib/generators/reso/templates/create_listing_media.rb +0 -18
- data/lib/generators/reso/templates/create_listing_providers.rb +0 -13
- data/lib/generators/reso/templates/create_listings.rb +0 -111
- data/lib/generators/reso/templates/create_multiple_listing_services.rb +0 -11
- data/lib/generators/reso/templates/create_offices.rb +0 -29
- data/lib/generators/reso/templates/create_open_houses.rb +0 -18
- data/lib/generators/reso/templates/create_participant_licenses.rb +0 -13
- data/lib/generators/reso/templates/create_participants.rb +0 -26
- data/lib/generators/reso/templates/create_people.rb +0 -18
- data/lib/generators/reso/templates/create_places.rb +0 -20
- data/lib/generators/reso/templates/create_prices.rb +0 -19
- data/lib/generators/reso/templates/create_queued_listings.rb +0 -10
- data/lib/generators/reso/templates/create_rooms.rb +0 -10
- data/lib/generators/reso/templates/create_schools.rb +0 -13
- data/lib/generators/reso/templates/create_taxes.rb +0 -12
- data/lib/generators/reso/templates/enumerations.csv +0 -748
- data/lib/generators/reso/templates/reso.rake +0 -142
- data/lib/mapper/reso.rb +0 -617
- data/lib/mapper.rb +0 -274
- data/lib/reso/engine.rb +0 -13
- data/lib/reso/railties/reso.rake +0 -38
data/lib/mapper/reso.rb
DELETED
@@ -1,617 +0,0 @@
|
|
1
|
-
module Mapper
|
2
|
-
module Reso
|
3
|
-
|
4
|
-
def self.method_missing method_name, *args
|
5
|
-
args[1][method_name]
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.address queued_listing, listing
|
9
|
-
if (result = Mapper::get_value(queued_listing, %w(Address)))
|
10
|
-
listing.address ||= Address.new
|
11
|
-
listing.address.assign_attributes({
|
12
|
-
preference_order: result.drilldown('preference_order'),
|
13
|
-
address_preference_order: result.drilldown('address_preference_order'),
|
14
|
-
full_street_address: result.drilldown('FullStreetAddress'),
|
15
|
-
unit_number: result.drilldown('UnitNumber'),
|
16
|
-
city: result.drilldown('City'),
|
17
|
-
state_or_province: result.drilldown('StateOrProvince'),
|
18
|
-
postal_code: result.drilldown('PostalCode'),
|
19
|
-
country: result.drilldown('Country')
|
20
|
-
})
|
21
|
-
listing.address
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.alternate_prices queued_listing, listing
|
26
|
-
if (result = Mapper::get_repeaters(queued_listing, %w(AlternatePrices AlternatePrice)))
|
27
|
-
result.map{|item| listing.alternate_prices.find_or_initialize_by(
|
28
|
-
list_price: item.drilldown('AlternateListPrice'),
|
29
|
-
currency_code: item.drilldown('AlternateListPrice currencyCode'),
|
30
|
-
list_price_low: item.drilldown('AlternateListPriceLow'),
|
31
|
-
currency_code_low: item.drilldown('AlternateListPriceLow currencyCode')
|
32
|
-
)}
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def self.appliances queued_listing, listing
|
37
|
-
Mapper::get_enums(queued_listing, %w(DetailedCharacteristics Appliances Appliance))
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.architecture_style queued_listing, listing
|
41
|
-
(result = Mapper::get_value(queued_listing, %w(DetailedCharacteristics ArchitectureStyle))) ? Mapper::architecture_styles(result) : nil
|
42
|
-
end
|
43
|
-
|
44
|
-
def self.architecture_style_description queued_listing, listing
|
45
|
-
Mapper::get_value(queued_listing, %w(DetailedCharacteristics ArchitectureStyle otherDescription))
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.bathrooms queued_listing, listing
|
49
|
-
Mapper::get_value(queued_listing, %w(Bathrooms))
|
50
|
-
end
|
51
|
-
|
52
|
-
def self.bedrooms queued_listing, listing
|
53
|
-
Mapper::get_value(queued_listing, %w(Bedrooms))
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.brokerage queued_listing, listing
|
57
|
-
get_reso_business(queued_listing, 'Brokerage')
|
58
|
-
end
|
59
|
-
|
60
|
-
def self.builder queued_listing, listing
|
61
|
-
get_reso_business(queued_listing, 'Builder')
|
62
|
-
end
|
63
|
-
|
64
|
-
def self.building_unit_count queued_listing, listing
|
65
|
-
Mapper::get_value(queued_listing, %w(DetailedCharacteristics BuildingUnitCount))
|
66
|
-
end
|
67
|
-
|
68
|
-
def self.condo_floor_num queued_listing, listing
|
69
|
-
Mapper::get_value(queued_listing, %w(DetailedCharacteristics CondoFloorNum))
|
70
|
-
end
|
71
|
-
|
72
|
-
def self.cooling_systems queued_listing, listing
|
73
|
-
Mapper::get_enums(queued_listing, %w(DetailedCharacteristics CoolingSystems CoolingSystem))
|
74
|
-
end
|
75
|
-
|
76
|
-
def self.county queued_listing, listing
|
77
|
-
if (Mapper::get_value(queued_listing, %w(Location County)))
|
78
|
-
county = County.find_or_initialize_by(
|
79
|
-
name: Mapper::get_value(queued_listing, %w(Location County)),
|
80
|
-
state_or_province: Mapper::get_value(queued_listing, %w(Address StateOrProvince)),
|
81
|
-
country: Mapper::get_value(queued_listing, %w(Address Country))
|
82
|
-
)
|
83
|
-
else
|
84
|
-
return nil
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def self.currency_code queued_listing, listing
|
89
|
-
Mapper::get_value(queued_listing, %w(ListPrice currencyCode))
|
90
|
-
end
|
91
|
-
|
92
|
-
def self.directions queued_listing, listing
|
93
|
-
Mapper::get_value(queued_listing, %w(Location Directions))
|
94
|
-
end
|
95
|
-
|
96
|
-
def self.disclaimer queued_listing, listing
|
97
|
-
Mapper::get_value(queued_listing, %w(Disclaimer))
|
98
|
-
end
|
99
|
-
|
100
|
-
def self.disclose_address queued_listing, listing
|
101
|
-
Mapper::get_boolean_value(queued_listing, %w(DiscloseAddress))
|
102
|
-
end
|
103
|
-
|
104
|
-
def self.elevation queued_listing, listing
|
105
|
-
Mapper::get_value(queued_listing, %w(Location Elevation))
|
106
|
-
end
|
107
|
-
|
108
|
-
def self.expenses queued_listing, listing
|
109
|
-
if (result = Mapper::get_repeaters(queued_listing, %w(Expenses Expense)))
|
110
|
-
result.map{|item| listing.expenses.find_or_initialize_by(
|
111
|
-
expense_category: Mapper::expense_categories(item['ExpenseCategory']),
|
112
|
-
currency_period: Mapper::expense_categories(item['ExpenseValue']['currencyPeriod']),
|
113
|
-
expense_value: item['ExpenseValue'].unwrap_attribute
|
114
|
-
)}
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
def self.exterior_types queued_listing, listing
|
119
|
-
Mapper::get_enums(queued_listing, %w(DetailedCharacteristics ExteriorTypes ExteriorType))
|
120
|
-
end
|
121
|
-
|
122
|
-
def self.floor_coverings queued_listing, listing
|
123
|
-
Mapper::get_enums(queued_listing, %w(DetailedCharacteristics FloorCoverings FloorCovering))
|
124
|
-
end
|
125
|
-
|
126
|
-
def self.foreclosure_status queued_listing, listing
|
127
|
-
(result = Mapper::get_value(queued_listing, %w(ForeclosureStatus))) ? Mapper::foreclosure_statuses(result) : nil
|
128
|
-
end
|
129
|
-
|
130
|
-
def self.franchise queued_listing, listing
|
131
|
-
get_reso_business(queued_listing, 'Franchise')
|
132
|
-
end
|
133
|
-
|
134
|
-
def self.full_bathrooms queued_listing, listing
|
135
|
-
Mapper::get_value(queued_listing, %w(FullBathrooms))
|
136
|
-
end
|
137
|
-
|
138
|
-
def self.geocode_options queued_listing, listing
|
139
|
-
Mapper::get_value(queued_listing, %w(Location GeocodeOptions))
|
140
|
-
end
|
141
|
-
|
142
|
-
def self.half_bathrooms queued_listing, listing
|
143
|
-
Mapper::get_value(queued_listing, %w(HalfBathrooms))
|
144
|
-
end
|
145
|
-
|
146
|
-
def self.has_attic queued_listing, listing
|
147
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasAttic))
|
148
|
-
end
|
149
|
-
|
150
|
-
def self.has_barbecue_area queued_listing, listing
|
151
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasBarbecueArea))
|
152
|
-
end
|
153
|
-
|
154
|
-
def self.has_basement queued_listing, listing
|
155
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasBasement))
|
156
|
-
end
|
157
|
-
|
158
|
-
def self.has_ceiling_fan queued_listing, listing
|
159
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasCeilingFan))
|
160
|
-
end
|
161
|
-
|
162
|
-
def self.has_deck queued_listing, listing
|
163
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasDeck))
|
164
|
-
end
|
165
|
-
|
166
|
-
def self.has_disabled_access queued_listing, listing
|
167
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasDisabledAccess))
|
168
|
-
end
|
169
|
-
|
170
|
-
def self.has_dock queued_listing, listing
|
171
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasDock))
|
172
|
-
end
|
173
|
-
|
174
|
-
def self.has_doorman queued_listing, listing
|
175
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasDoorman))
|
176
|
-
end
|
177
|
-
|
178
|
-
def self.has_double_pane_windows queued_listing, listing
|
179
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasDoublePaneWindows))
|
180
|
-
end
|
181
|
-
|
182
|
-
def self.has_elevator queued_listing, listing
|
183
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasElevator))
|
184
|
-
end
|
185
|
-
|
186
|
-
def self.has_fireplace queued_listing, listing
|
187
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasFireplace))
|
188
|
-
end
|
189
|
-
|
190
|
-
def self.has_garden queued_listing, listing
|
191
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasGarden))
|
192
|
-
end
|
193
|
-
|
194
|
-
def self.has_gated_entry queued_listing, listing
|
195
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasGatedEntry))
|
196
|
-
end
|
197
|
-
|
198
|
-
def self.has_greenhouse queued_listing, listing
|
199
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasGreenhouse))
|
200
|
-
end
|
201
|
-
|
202
|
-
def self.has_hot_tub_spa queued_listing, listing
|
203
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasHotTubSpa))
|
204
|
-
end
|
205
|
-
|
206
|
-
def self.has_intercom queued_listing, listing
|
207
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics Intercom))
|
208
|
-
end
|
209
|
-
|
210
|
-
def self.has_jetted_bath_tub queued_listing, listing
|
211
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasJettedBathTub))
|
212
|
-
end
|
213
|
-
|
214
|
-
def self.has_lawn queued_listing, listing
|
215
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasLawn))
|
216
|
-
end
|
217
|
-
|
218
|
-
def self.has_mother_in_law queued_listing, listing
|
219
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasMotherInLaw))
|
220
|
-
end
|
221
|
-
|
222
|
-
def self.has_patio queued_listing, listing
|
223
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasPatio))
|
224
|
-
end
|
225
|
-
|
226
|
-
def self.has_pond queued_listing, listing
|
227
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasPond))
|
228
|
-
end
|
229
|
-
|
230
|
-
def self.has_pool queued_listing, listing
|
231
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasPool))
|
232
|
-
end
|
233
|
-
|
234
|
-
def self.has_porch queued_listing, listing
|
235
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasPorch))
|
236
|
-
end
|
237
|
-
|
238
|
-
def self.has_rv_parking queued_listing, listing
|
239
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasRVParking))
|
240
|
-
end
|
241
|
-
|
242
|
-
def self.has_sauna queued_listing, listing
|
243
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasSauna))
|
244
|
-
end
|
245
|
-
|
246
|
-
def self.has_security_system queued_listing, listing
|
247
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasSecuritySystem))
|
248
|
-
end
|
249
|
-
|
250
|
-
def self.has_skylight queued_listing, listing
|
251
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasSkylight))
|
252
|
-
end
|
253
|
-
|
254
|
-
def self.has_sports_court queued_listing, listing
|
255
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasSportsCourt))
|
256
|
-
end
|
257
|
-
|
258
|
-
def self.has_sprinkler_system queued_listing, listing
|
259
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasSprinklerSystem))
|
260
|
-
end
|
261
|
-
|
262
|
-
def self.has_vaulted_ceiling queued_listing, listing
|
263
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasVaultedCeiling))
|
264
|
-
end
|
265
|
-
|
266
|
-
def self.has_wet_bar queued_listing, listing
|
267
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics HasWetBar))
|
268
|
-
end
|
269
|
-
|
270
|
-
def self.heating_fuels queued_listing, listing
|
271
|
-
Mapper::get_enums(queued_listing, %w(DetailedCharacteristics HeatingFuels HeatingFuel)).uniq
|
272
|
-
end
|
273
|
-
|
274
|
-
def self.heating_systems queued_listing, listing
|
275
|
-
Mapper::get_enums(queued_listing, %w(DetailedCharacteristics HeatingSystems HeatingSystem)).uniq
|
276
|
-
end
|
277
|
-
|
278
|
-
def self.import queued_listing, listing
|
279
|
-
queued_listing.import
|
280
|
-
end
|
281
|
-
|
282
|
-
def self.is_cable_ready queued_listing, listing
|
283
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics IsCableReady))
|
284
|
-
end
|
285
|
-
|
286
|
-
def self.is_new_construction queued_listing, listing
|
287
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics IsNewConstruction))
|
288
|
-
end
|
289
|
-
|
290
|
-
def self.is_waterfront queued_listing, listing
|
291
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics IsWaterfront))
|
292
|
-
end
|
293
|
-
|
294
|
-
def self.is_wired queued_listing, listing
|
295
|
-
Mapper::get_boolean_value(queued_listing, %w(DetailedCharacteristics IsWired))
|
296
|
-
end
|
297
|
-
|
298
|
-
def self.latitude queued_listing, listing
|
299
|
-
Mapper::get_value(queued_listing, %w(Location Latitude))
|
300
|
-
end
|
301
|
-
|
302
|
-
def self.lead_routing_email queued_listing, listing
|
303
|
-
Mapper::get_value(queued_listing, %w(LeadRoutingEmail))
|
304
|
-
end
|
305
|
-
|
306
|
-
def self.legal_description queued_listing, listing
|
307
|
-
Mapper::get_value(queued_listing, %w(DetailedCharacteristics LegalDescription))
|
308
|
-
end
|
309
|
-
|
310
|
-
def self.list_price queued_listing, listing
|
311
|
-
Mapper::get_value(queued_listing, %w(ListPrice))
|
312
|
-
end
|
313
|
-
|
314
|
-
def self.list_price_low queued_listing, listing
|
315
|
-
Mapper::get_value(queued_listing, %w(ListPriceLow))
|
316
|
-
end
|
317
|
-
|
318
|
-
def self.listing_category queued_listing, listing
|
319
|
-
(result = Mapper::get_value(queued_listing, %w(ListingCategory))) ? Mapper::listing_categories(result) : nil
|
320
|
-
end
|
321
|
-
|
322
|
-
def self.listing_date queued_listing, listing
|
323
|
-
(result = Mapper::get_value(queued_listing, %w(ListingDate))) ? Chronic::parse(result).to_date : nil
|
324
|
-
end
|
325
|
-
|
326
|
-
def self.listing_description queued_listing, listing
|
327
|
-
Mapper::get_value(queued_listing, %w(ListingDescription))
|
328
|
-
end
|
329
|
-
|
330
|
-
def self.listing_media queued_listing, listing, elements
|
331
|
-
if (result = Mapper::get_repeaters(queued_listing, elements))
|
332
|
-
result.map do |item|
|
333
|
-
listing.send(elements.last.tableize).find_or_initialize_by(
|
334
|
-
media_url: item.drilldown('MediaURL'),
|
335
|
-
media_modification_timestamp: Chronic::parse(item.drilldown('MediaModificationTimestamp')),
|
336
|
-
media_order_number: item.drilldown('MediaOrderNumber'),
|
337
|
-
media_caption: item.drilldown('MediaCaption'),
|
338
|
-
media_description: item.drilldown('MediaDescription')
|
339
|
-
)
|
340
|
-
end
|
341
|
-
end
|
342
|
-
end
|
343
|
-
|
344
|
-
# TODO: Make ListingProvider and SourceProviderCategory Provider and ProviderCategory
|
345
|
-
def self.listing_provider queued_listing, listing
|
346
|
-
if Mapper::get_value(queued_listing, %w(ProviderName)).present?
|
347
|
-
result = ListingProvider.find_or_initialize_by(
|
348
|
-
name: Mapper::get_value(queued_listing, %w(ProviderName)),
|
349
|
-
url: Mapper::get_value(queued_listing, %w(ProviderURL)),
|
350
|
-
source_provider_category: Mapper::source_provider_categories(Mapper::get_value(queued_listing, %w(ProviderCategory)))
|
351
|
-
)
|
352
|
-
end
|
353
|
-
end
|
354
|
-
|
355
|
-
def self.listing_status queued_listing, listing
|
356
|
-
(result = Mapper::get_value(queued_listing, %w(ListingStatus))) ? Mapper::listing_statuses(result) : nil
|
357
|
-
end
|
358
|
-
|
359
|
-
def self.listing_title queued_listing, listing
|
360
|
-
Mapper::get_value(queued_listing, %w(ListingTitle))
|
361
|
-
end
|
362
|
-
|
363
|
-
def self.listing_url queued_listing, listing
|
364
|
-
Mapper::get_value(queued_listing, %w(ListingURL))
|
365
|
-
end
|
366
|
-
|
367
|
-
def self.living_area queued_listing, listing
|
368
|
-
Mapper::get_value(queued_listing, %w(LivingArea))
|
369
|
-
end
|
370
|
-
|
371
|
-
def self.living_area_unit queued_listing, listing
|
372
|
-
Mapper::get_value(queued_listing, %w(LivingArea areaUnits))
|
373
|
-
end
|
374
|
-
|
375
|
-
def self.longitude queued_listing, listing
|
376
|
-
Mapper::get_value(queued_listing, %w(Location Longitude))
|
377
|
-
end
|
378
|
-
|
379
|
-
def self.lot_size queued_listing, listing
|
380
|
-
value = Mapper::get_value(queued_listing, %w(LotSize))
|
381
|
-
value.to_s.to_f.zero? ? nil : value
|
382
|
-
end
|
383
|
-
|
384
|
-
def self.mls_number queued_listing, listing
|
385
|
-
Mapper::get_value(queued_listing, %w(MlsNumber))
|
386
|
-
end
|
387
|
-
|
388
|
-
def self.modification_timestamp queued_listing, listing
|
389
|
-
# TODO: Change from string to datetime
|
390
|
-
Mapper::get_value(queued_listing, %w(ModificationTimestamp))
|
391
|
-
end
|
392
|
-
|
393
|
-
def self.multiple_listing_service queued_listing, listing
|
394
|
-
if (Mapper::get_value(queued_listing, %w(MlsId)) || Mapper::get_value(queued_listing, %w(MlsName)))
|
395
|
-
MultipleListingService.find_or_initialize_by(
|
396
|
-
mls_id: Mapper::get_value(queued_listing, %w(MlsId)),
|
397
|
-
mls_name: Mapper::get_value(queued_listing, %w(MlsName))
|
398
|
-
)
|
399
|
-
end
|
400
|
-
end
|
401
|
-
|
402
|
-
def self.neighborhoods queued_listing, listing
|
403
|
-
if (result = Mapper::get_value(queued_listing, %w(Location Neighborhoods Neighborhood)))
|
404
|
-
places = result.map do |item|
|
405
|
-
place = Neighborhood.find_or_initialize_by(
|
406
|
-
city: Mapper::get_value(queued_listing, %w(Address City)),
|
407
|
-
name: item.drilldown('Name'),
|
408
|
-
state_or_province: Mapper::get_value(queued_listing, %w(Address StateOrProvince))
|
409
|
-
)
|
410
|
-
place.description = item.drilldown('Description')
|
411
|
-
place
|
412
|
-
end
|
413
|
-
end
|
414
|
-
places.present? ? places : []
|
415
|
-
end
|
416
|
-
|
417
|
-
def self.num_floors queued_listing, listing
|
418
|
-
Mapper::get_value(queued_listing, %w(DetailedCharacteristics NumFloors))
|
419
|
-
end
|
420
|
-
|
421
|
-
def self.num_parking_spaces queued_listing, listing
|
422
|
-
Mapper::get_value(queued_listing, %w(DetailedCharacteristics NumParkingSpaces))
|
423
|
-
end
|
424
|
-
|
425
|
-
def self.office queued_listing, listing
|
426
|
-
if (result = Mapper::get_value(queued_listing, %w(Offices Office)))
|
427
|
-
office = Office.find_or_initialize_by(
|
428
|
-
office_identifier: result.drilldown('OfficeId'),
|
429
|
-
name: result.drilldown('Name')
|
430
|
-
)
|
431
|
-
office.assign_attributes({
|
432
|
-
office_key: result.drilldown('OfficeKey'),
|
433
|
-
level: result.drilldown('Level'),
|
434
|
-
office_code_identifier: result.drilldown('OfficeCode OfficeCodeId'),
|
435
|
-
corporate_name: result.drilldown('CorporateName'),
|
436
|
-
broker_identifier: result.drilldown('BrokerId'),
|
437
|
-
phone_number: result.drilldown('PhoneNumber'),
|
438
|
-
website: result.drilldown('Website'),
|
439
|
-
})
|
440
|
-
office.address ||= Address.new
|
441
|
-
office.address.assign_attributes({
|
442
|
-
preference_order: result.drilldown('Address preference_order'),
|
443
|
-
address_preference_order: result.drilldown('Address address_preference_order'),
|
444
|
-
full_street_address: result.drilldown('Address FullStreetAddress'),
|
445
|
-
unit_number: result.drilldown('Address UnitNumber'),
|
446
|
-
city: result.drilldown('Address City'),
|
447
|
-
state_or_province: result.drilldown('Address StateOrProvince'),
|
448
|
-
postal_code: result.drilldown('Address PostalCode'),
|
449
|
-
country: result.drilldown('Address Country')
|
450
|
-
})
|
451
|
-
office
|
452
|
-
end
|
453
|
-
end
|
454
|
-
|
455
|
-
def self.one_quarter_bathrooms queued_listing, listing
|
456
|
-
Mapper::get_value(queued_listing, %w(OneQuarterBathrooms))
|
457
|
-
end
|
458
|
-
|
459
|
-
# TODO: Figure out how to provide time zone for StartTime and EndTime
|
460
|
-
def self.open_houses queued_listing, listing
|
461
|
-
if (result = Mapper::get_repeaters(queued_listing, %w(OpenHouses OpenHouse)))
|
462
|
-
result.map do |open_house|
|
463
|
-
oh = listing.open_houses.find_or_initialize_by(
|
464
|
-
showing_date: Chronic::parse(open_house['Date']).to_date,
|
465
|
-
start_time: open_house['StartTime'],
|
466
|
-
end_time: open_house['EndTime']
|
467
|
-
)
|
468
|
-
oh.description = open_house['Description']
|
469
|
-
oh
|
470
|
-
end
|
471
|
-
end
|
472
|
-
end
|
473
|
-
|
474
|
-
def self.parcel_id queued_listing, listing
|
475
|
-
Mapper::get_value(queued_listing, %w(Location ParcelId))
|
476
|
-
end
|
477
|
-
|
478
|
-
# TODO: Change participant_identifier to participant_id
|
479
|
-
def self.participants queued_listing, listing
|
480
|
-
if (result = Mapper::get_repeaters(queued_listing, %w(ListingParticipants Participant)))
|
481
|
-
result.map do |item|
|
482
|
-
participant = Participant.find_or_initialize_by(
|
483
|
-
first_name: item['FirstName'],
|
484
|
-
last_name: item['LastName'],
|
485
|
-
email: item['Email']
|
486
|
-
)
|
487
|
-
participant.assign_attributes({
|
488
|
-
participant_key: item['ParticipantKey'],
|
489
|
-
participant_identifier: item['ParticipantId'],
|
490
|
-
participant_role: Mapper::participant_roles(item['Role']),
|
491
|
-
primary_contact_phone: item['PrimaryContactPhone'],
|
492
|
-
office_phone: item['OfficePhone'],
|
493
|
-
fax: item['Fax'],
|
494
|
-
website_url: item['WebsiteURL']
|
495
|
-
})
|
496
|
-
participant
|
497
|
-
end
|
498
|
-
else
|
499
|
-
[]
|
500
|
-
end
|
501
|
-
end
|
502
|
-
|
503
|
-
def self.permit_address_on_internet queued_listing, listing
|
504
|
-
Mapper::get_boolean_value(queued_listing, %w(MarketingInformation PermitAddressOnInternet'))
|
505
|
-
end
|
506
|
-
|
507
|
-
def self.photos queued_listing, listing
|
508
|
-
listing_media(queued_listing, listing, %w(Photos Photo))
|
509
|
-
end
|
510
|
-
|
511
|
-
def self.property_sub_type queued_listing, listing
|
512
|
-
(result = Mapper::get_value(queued_listing, %w(PropertySubType))) ? Mapper::property_sub_types(result) : nil
|
513
|
-
end
|
514
|
-
|
515
|
-
def self.property_sub_type_description queued_listing, listing
|
516
|
-
Mapper::get_value(queued_listing, %w(PropertySubType otherDescription))
|
517
|
-
end
|
518
|
-
|
519
|
-
def self.property_type queued_listing, listing
|
520
|
-
(result = Mapper::get_value(queued_listing, %w(PropertyType))) ? Mapper::property_types(result) : nil
|
521
|
-
end
|
522
|
-
|
523
|
-
def self.property_type_description queued_listing, listing
|
524
|
-
Mapper::get_value(queued_listing, %w(PropertyType otherDescription))
|
525
|
-
end
|
526
|
-
|
527
|
-
def self.roof_types queued_listing, listing
|
528
|
-
Mapper::get_enums(queued_listing, %w(DetailedCharacteristics RoofTypes RoofType))
|
529
|
-
end
|
530
|
-
|
531
|
-
def self.room_count queued_listing, listing
|
532
|
-
Mapper::get_value(queued_listing, %w(DetailedCharacteristics RoomCount))
|
533
|
-
end
|
534
|
-
|
535
|
-
def self.rooms queued_listing, listing
|
536
|
-
if (result = Mapper::get_value(queued_listing, %w(DetailedCharacteristics Rooms Room)))
|
537
|
-
rooms = Array(result).map{|room_category| Room.new(listing: listing, room_category: Mapper::room_categories(room_category))}
|
538
|
-
end
|
539
|
-
rooms ? rooms : []
|
540
|
-
end
|
541
|
-
|
542
|
-
def self.taxes queued_listing, listing
|
543
|
-
if (result = Mapper::get_repeaters(queued_listing, %w(Taxes Tax)))
|
544
|
-
result.map{|item| Tax.find_or_initialize_by(
|
545
|
-
year: item['Year'],
|
546
|
-
amount: item['Amount'],
|
547
|
-
description: item['TaxDescription']
|
548
|
-
)}
|
549
|
-
end
|
550
|
-
end
|
551
|
-
|
552
|
-
def self.three_quarter_bathrooms queued_listing, listing
|
553
|
-
Mapper::get_value(queued_listing, %w(ThreeQuarterBathrooms))
|
554
|
-
end
|
555
|
-
|
556
|
-
def self.videos queued_listing, listing
|
557
|
-
listing_media(queued_listing, listing, %w(Videos Video))
|
558
|
-
end
|
559
|
-
|
560
|
-
def self.view_types queued_listing, listing
|
561
|
-
Mapper::get_enums(queued_listing, %w(DetailedCharacteristics ViewTypes ViewType))
|
562
|
-
end
|
563
|
-
|
564
|
-
def self.virtual_tours queued_listing, listing
|
565
|
-
listing_media(queued_listing, listing, %w(VirtualTours VirtualTour))
|
566
|
-
end
|
567
|
-
|
568
|
-
def self.vow_address_display queued_listing, listing
|
569
|
-
Mapper::get_boolean_value(queued_listing, %w(MarketingInformation VOWAutomatedValuationDisplay'))
|
570
|
-
end
|
571
|
-
|
572
|
-
def self.vow_automated_valuation_display queued_listing, listing
|
573
|
-
Mapper::get_boolean_value(queued_listing, %w(MarketingInformation VOWAddressDisplay'))
|
574
|
-
end
|
575
|
-
|
576
|
-
def self.vow_consumer_comment queued_listing, listing
|
577
|
-
Mapper::get_boolean_value(queued_listing, %w(MarketingInformation VOWConsumerComment'))
|
578
|
-
end
|
579
|
-
|
580
|
-
def self.year_built queued_listing, listing
|
581
|
-
Mapper::get_value(queued_listing, %w(YearBuilt))
|
582
|
-
end
|
583
|
-
|
584
|
-
def self.year_updated queued_listing, listing
|
585
|
-
Mapper::get_value(queued_listing, %w(DetailedCharacteristics YearUpdated))
|
586
|
-
end
|
587
|
-
|
588
|
-
# Utilities
|
589
|
-
|
590
|
-
def self.get_reso_business queued_listing, business_type
|
591
|
-
if (result = Mapper::get_value(queued_listing, [business_type]))
|
592
|
-
business = business_type.constantize.find_or_initialize_by(
|
593
|
-
name: result.drilldown('Name'),
|
594
|
-
phone: result.drilldown('Phone')
|
595
|
-
)
|
596
|
-
business.assign_attributes({
|
597
|
-
email: result.drilldown('Email'),
|
598
|
-
logo_url: result.drilldown('LogoURL'),
|
599
|
-
website_url: result.drilldown('WebsiteURL')
|
600
|
-
})
|
601
|
-
business.address ||= Address.new
|
602
|
-
business.address.assign_attributes({
|
603
|
-
preference_order: result.drilldown('Address preference_order'),
|
604
|
-
address_preference_order: result.drilldown('Address address_preference_order'),
|
605
|
-
full_street_address: result.drilldown('Address FullStreetAddress'),
|
606
|
-
unit_number: result.drilldown('Address UnitNumber'),
|
607
|
-
city: result.drilldown('Address City'),
|
608
|
-
state_or_province: result.drilldown('Address StateOrProvince'),
|
609
|
-
postal_code: result.drilldown('Address PostalCode'),
|
610
|
-
country: result.drilldown('Address Country')
|
611
|
-
})
|
612
|
-
business
|
613
|
-
end
|
614
|
-
end
|
615
|
-
|
616
|
-
end
|
617
|
-
end
|