reso 0.1.0.0
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 +7 -0
- data/.gitignore +17 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +149 -0
- data/Rakefile +1 -0
- data/app/controllers/syndication_controller.rb +5 -0
- data/app/models/.keep +0 -0
- data/app/models/address.rb +25 -0
- data/app/models/address_type.rb +3 -0
- data/app/models/alternate_price.rb +2 -0
- data/app/models/appliance.rb +3 -0
- data/app/models/architecture_style.rb +5 -0
- data/app/models/area_unit.rb +2 -0
- data/app/models/brokerage.rb +4 -0
- data/app/models/builder.rb +4 -0
- data/app/models/business.rb +8 -0
- data/app/models/community.rb +5 -0
- data/app/models/cooling_system.rb +3 -0
- data/app/models/county.rb +5 -0
- data/app/models/currency_period.rb +3 -0
- data/app/models/enumeration.rb +7 -0
- data/app/models/expense.rb +6 -0
- data/app/models/expense_category.rb +2 -0
- data/app/models/exterior_type.rb +3 -0
- data/app/models/floor_covering.rb +3 -0
- data/app/models/foreclosure_status.rb +5 -0
- data/app/models/franchise.rb +4 -0
- data/app/models/gender.rb +3 -0
- data/app/models/heating_fuel.rb +3 -0
- data/app/models/heating_system.rb +3 -0
- data/app/models/home_feature.rb +3 -0
- data/app/models/import.rb +16 -0
- data/app/models/import_format.rb +3 -0
- data/app/models/license_category.rb +2 -0
- data/app/models/listing.rb +64 -0
- data/app/models/listing_category.rb +5 -0
- data/app/models/listing_media.rb +6 -0
- data/app/models/listing_provider.rb +9 -0
- data/app/models/listing_status.rb +5 -0
- data/app/models/multiple_listing_service.rb +5 -0
- data/app/models/neighborhood.rb +3 -0
- data/app/models/office.rb +6 -0
- data/app/models/open_house.rb +4 -0
- data/app/models/parking.rb +3 -0
- data/app/models/participant.rb +5 -0
- data/app/models/participant_license.rb +8 -0
- data/app/models/participant_role.rb +3 -0
- data/app/models/person.rb +18 -0
- data/app/models/photo.rb +3 -0
- data/app/models/place.rb +3 -0
- data/app/models/price.rb +4 -0
- data/app/models/property_sub_type.rb +5 -0
- data/app/models/property_type.rb +5 -0
- data/app/models/queued_listing.rb +26 -0
- data/app/models/roof_type.rb +3 -0
- data/app/models/room.rb +4 -0
- data/app/models/room_category.rb +2 -0
- data/app/models/school.rb +3 -0
- data/app/models/school_category.rb +2 -0
- data/app/models/source_provider_category.rb +2 -0
- data/app/models/tax.rb +3 -0
- data/app/models/video.rb +3 -0
- data/app/models/view_type.rb +3 -0
- data/app/models/virtual_tour.rb +3 -0
- data/app/views/syndication/rets.xml.erb +325 -0
- data/lib/class_extensions.rb +53 -0
- data/lib/generators/reso/install_generator.rb +43 -0
- data/lib/generators/reso/setup.rb +36 -0
- data/lib/generators/reso/templates/create_addresses.rb +33 -0
- data/lib/generators/reso/templates/create_businesses.rb +19 -0
- data/lib/generators/reso/templates/create_enumerations.rb +11 -0
- data/lib/generators/reso/templates/create_expenses.rb +13 -0
- data/lib/generators/reso/templates/create_imports.rb +17 -0
- data/lib/generators/reso/templates/create_join_tables.rb +27 -0
- data/lib/generators/reso/templates/create_listing_media.rb +19 -0
- data/lib/generators/reso/templates/create_listing_providers.rb +12 -0
- data/lib/generators/reso/templates/create_listings.rb +154 -0
- data/lib/generators/reso/templates/create_multiple_listing_services.rb +11 -0
- data/lib/generators/reso/templates/create_offices.rb +29 -0
- data/lib/generators/reso/templates/create_open_houses.rb +18 -0
- data/lib/generators/reso/templates/create_participant_licenses.rb +13 -0
- data/lib/generators/reso/templates/create_participants.rb +26 -0
- data/lib/generators/reso/templates/create_people.rb +18 -0
- data/lib/generators/reso/templates/create_places.rb +20 -0
- data/lib/generators/reso/templates/create_prices.rb +19 -0
- data/lib/generators/reso/templates/create_queued_listings.rb +10 -0
- data/lib/generators/reso/templates/create_rooms.rb +10 -0
- data/lib/generators/reso/templates/create_schools.rb +13 -0
- data/lib/generators/reso/templates/create_taxes.rb +12 -0
- data/lib/generators/reso/templates/enumerations.csv +748 -0
- data/lib/mapper/reso.rb +658 -0
- data/lib/mapper.rb +114 -0
- data/lib/reso/engine.rb +13 -0
- data/lib/reso/railties/reso.rake +128 -0
- data/lib/reso/version.rb +3 -0
- data/lib/reso.rb +10 -0
- data/reso.gemspec +31 -0
- metadata +261 -0
@@ -0,0 +1,154 @@
|
|
1
|
+
class CreateListings < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :listings, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.references :architecture_style, index: true
|
5
|
+
t.string :architecture_style_description
|
6
|
+
t.integer :bathrooms
|
7
|
+
t.integer :bedrooms
|
8
|
+
t.references :brokerage, index: true
|
9
|
+
t.references :builder, index: true
|
10
|
+
t.integer :building_unit_count
|
11
|
+
t.references :community, index: true
|
12
|
+
t.integer :condo_floor_num
|
13
|
+
t.references :county, index: true
|
14
|
+
t.string :currency_code
|
15
|
+
t.text :directions
|
16
|
+
t.string :disclaimer
|
17
|
+
t.boolean :disclose_address
|
18
|
+
t.string :elevation
|
19
|
+
t.references :foreclosure_status, index: true
|
20
|
+
t.references :franchise, index: true
|
21
|
+
t.integer :full_bathrooms
|
22
|
+
t.string :geocode_options
|
23
|
+
t.integer :half_bathrooms
|
24
|
+
t.boolean :has_attic
|
25
|
+
t.boolean :has_barbecue_area
|
26
|
+
t.boolean :has_basement
|
27
|
+
t.boolean :has_ceiling_fan
|
28
|
+
t.boolean :has_deck
|
29
|
+
t.boolean :has_disabled_access
|
30
|
+
t.boolean :has_dock
|
31
|
+
t.boolean :has_doorman
|
32
|
+
t.boolean :has_double_pane_windows
|
33
|
+
t.boolean :has_elevator
|
34
|
+
t.boolean :has_fireplace
|
35
|
+
t.boolean :has_garden
|
36
|
+
t.boolean :has_gated_entry
|
37
|
+
t.boolean :has_greenhouse
|
38
|
+
t.boolean :has_hot_tub_spa
|
39
|
+
t.boolean :has_intercom
|
40
|
+
t.boolean :has_jetted_bath_tub
|
41
|
+
t.boolean :has_lawn
|
42
|
+
t.boolean :has_mother_in_law
|
43
|
+
t.boolean :has_patio
|
44
|
+
t.boolean :has_pond
|
45
|
+
t.boolean :has_pool
|
46
|
+
t.boolean :has_porch
|
47
|
+
t.boolean :has_rv_parking
|
48
|
+
t.boolean :has_sauna
|
49
|
+
t.boolean :has_security_system
|
50
|
+
t.boolean :has_skylight
|
51
|
+
t.boolean :has_sports_court
|
52
|
+
t.boolean :has_sprinkler_system
|
53
|
+
t.boolean :has_vaulted_ceiling
|
54
|
+
t.boolean :has_wet_bar
|
55
|
+
t.references :import, index: true, foreign_key: true
|
56
|
+
t.boolean :is_cable_ready
|
57
|
+
t.boolean :is_new_construction
|
58
|
+
t.boolean :is_waterfront
|
59
|
+
t.boolean :is_wired
|
60
|
+
t.decimal :latitude, precision: 10, scale: 6
|
61
|
+
t.string :lead_routing_email
|
62
|
+
t.text :legal_description
|
63
|
+
t.integer :list_price, limit: 8
|
64
|
+
t.integer :list_price_low, limit: 8
|
65
|
+
t.references :listing_category, index: true
|
66
|
+
t.date :listing_date
|
67
|
+
t.text :listing_description
|
68
|
+
t.string :listing_key, null: false, limit: 255
|
69
|
+
t.references :listing_provider, index: true
|
70
|
+
t.references :listing_status, index: true
|
71
|
+
t.text :listing_title
|
72
|
+
t.string :listing_url
|
73
|
+
t.integer :living_area
|
74
|
+
t.string :living_area_unit, default: "squareFoot"
|
75
|
+
t.decimal :longitude, precision: 10, scale: 6
|
76
|
+
t.float :lot_size
|
77
|
+
t.string :lot_size_unit
|
78
|
+
t.references :multiple_listing_service, index: true
|
79
|
+
t.string :mls_number, limit: 255
|
80
|
+
t.string :modification_timestamp
|
81
|
+
t.integer :num_floors
|
82
|
+
t.integer :num_parking_spaces
|
83
|
+
t.references :office, index: true
|
84
|
+
t.integer :one_quarter_bathrooms
|
85
|
+
t.string :originating_system_key, limit: 255
|
86
|
+
t.string :parcel_info
|
87
|
+
t.integer :partial_bathrooms
|
88
|
+
t.boolean :permit_address_on_internet
|
89
|
+
t.references :property_sub_type, index: true
|
90
|
+
t.string :property_sub_type_description
|
91
|
+
t.references :property_type, index: true
|
92
|
+
t.string :property_type_description
|
93
|
+
t.integer :room_count
|
94
|
+
t.boolean :short_sale
|
95
|
+
t.integer :three_quarter_bathrooms
|
96
|
+
t.string :tracking_item
|
97
|
+
t.boolean :vow_address_display
|
98
|
+
t.boolean :vow_automated_valuation_display
|
99
|
+
t.boolean :vow_consumer_comment
|
100
|
+
t.integer :year_built
|
101
|
+
t.integer :year_updated
|
102
|
+
t.references :zoning_type, index: true
|
103
|
+
|
104
|
+
t.timestamps
|
105
|
+
end
|
106
|
+
add_index :listings, :list_price
|
107
|
+
add_index :listings, :listing_key
|
108
|
+
add_index :listings, :mls_number
|
109
|
+
add_index :listings, :bedrooms
|
110
|
+
add_index :listings, :bathrooms
|
111
|
+
add_index :listings, :has_attic
|
112
|
+
add_index :listings, :has_barbecue_area
|
113
|
+
add_index :listings, :has_basement
|
114
|
+
add_index :listings, :has_ceiling_fan
|
115
|
+
add_index :listings, :has_deck
|
116
|
+
add_index :listings, :has_disabled_access
|
117
|
+
add_index :listings, :has_dock
|
118
|
+
add_index :listings, :has_doorman
|
119
|
+
add_index :listings, :has_double_pane_windows
|
120
|
+
add_index :listings, :has_elevator
|
121
|
+
add_index :listings, :has_fireplace
|
122
|
+
add_index :listings, :has_garden
|
123
|
+
add_index :listings, :has_gated_entry
|
124
|
+
add_index :listings, :has_greenhouse
|
125
|
+
add_index :listings, :has_hot_tub_spa
|
126
|
+
add_index :listings, :has_intercom
|
127
|
+
add_index :listings, :has_jetted_bath_tub
|
128
|
+
add_index :listings, :has_lawn
|
129
|
+
add_index :listings, :has_mother_in_law
|
130
|
+
add_index :listings, :has_patio
|
131
|
+
add_index :listings, :has_pond
|
132
|
+
add_index :listings, :has_pool
|
133
|
+
add_index :listings, :has_porch
|
134
|
+
add_index :listings, :has_rv_parking
|
135
|
+
add_index :listings, :has_sauna
|
136
|
+
add_index :listings, :has_security_system
|
137
|
+
add_index :listings, :has_skylight
|
138
|
+
add_index :listings, :has_sports_court
|
139
|
+
add_index :listings, :has_sprinkler_system
|
140
|
+
add_index :listings, :has_vaulted_ceiling
|
141
|
+
add_index :listings, :has_wet_bar
|
142
|
+
add_index :listings, :is_cable_ready
|
143
|
+
add_index :listings, :is_new_construction
|
144
|
+
add_index :listings, :is_waterfront
|
145
|
+
add_index :listings, :is_wired
|
146
|
+
add_index :listings, :living_area
|
147
|
+
add_index :listings, :lot_size
|
148
|
+
add_index :listings, :listing_date
|
149
|
+
add_index :listings, :latitude
|
150
|
+
add_index :listings, :longitude
|
151
|
+
add_index :listings, :originating_system_key
|
152
|
+
add_index :listings, :year_built
|
153
|
+
end
|
154
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateMultipleListingServices < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :multiple_listing_services, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.string :mls_id
|
5
|
+
t.string :mls_name
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :multiple_listing_services, [:mls_id, :mls_name]
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class CreateOffices < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :offices, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.string :office_key, null: false
|
5
|
+
t.string :office_identifier, null: false
|
6
|
+
t.string :level
|
7
|
+
t.string :office_code_identifier
|
8
|
+
t.string :name, null: false
|
9
|
+
t.string :franchise_affiliation
|
10
|
+
t.string :corporate_name
|
11
|
+
t.string :broker_identifier
|
12
|
+
t.string :main_office_identifier
|
13
|
+
t.string :phone_number
|
14
|
+
t.string :office_fax
|
15
|
+
t.string :office_email
|
16
|
+
t.string :website
|
17
|
+
t.boolean :idx_office_participation_yn
|
18
|
+
t.string :main_office_key
|
19
|
+
t.string :main_office_mlsid
|
20
|
+
t.string :office_broker_key
|
21
|
+
t.string :office_broker_mlsid
|
22
|
+
|
23
|
+
t.timestamps
|
24
|
+
end
|
25
|
+
add_index :offices, :name
|
26
|
+
add_index :offices, [:office_identifier, :name]
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateOpenHouses < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :open_houses, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.date :showing_date
|
5
|
+
|
6
|
+
# TODO: Does RESO provide a way to specify time zone?
|
7
|
+
t.string :start_time
|
8
|
+
t.string :end_time
|
9
|
+
t.text :description
|
10
|
+
t.references :listing, index: true, null: false, foreign_key: true
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
add_index :open_houses, :showing_date
|
15
|
+
add_index :open_houses, :start_time
|
16
|
+
add_index :open_houses, :end_time
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateParticipantLicenses < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :participant_licenses, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.references :license_category, index: true, null: false
|
5
|
+
t.string :license_number
|
6
|
+
t.string :jurisdiction
|
7
|
+
t.string :state_or_province
|
8
|
+
t.references :participant, index: true, null: false, foreign_key: true
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class CreateParticipants < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :participants, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.string :participant_key
|
5
|
+
t.string :participant_identifier
|
6
|
+
t.string :participant_code
|
7
|
+
t.string :first_name
|
8
|
+
t.string :last_name
|
9
|
+
t.references :person, null: true, foreign_key: true
|
10
|
+
t.references :participant_role, index: true
|
11
|
+
t.string :primary_contact_phone
|
12
|
+
t.string :office_phone
|
13
|
+
t.string :mobile_phone
|
14
|
+
t.string :email
|
15
|
+
t.string :fax
|
16
|
+
t.string :website_url
|
17
|
+
t.string :photo_url
|
18
|
+
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
add_index :participants, :participant_key
|
22
|
+
add_index :participants, :participant_identifier
|
23
|
+
add_index :participants, :person_id
|
24
|
+
add_index :participants, [:first_name, :last_name, :email]
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreatePeople < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :people, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.string :person_key # 123-1234-ABCD
|
5
|
+
t.string :personal_title # Mr, Ms, Miss, Mrs, Dr.
|
6
|
+
t.string :first_name # Edwin
|
7
|
+
t.string :middle_name # E.
|
8
|
+
t.string :nick_name # Buzz
|
9
|
+
t.string :last_name # Aldrin
|
10
|
+
t.string :suffix # Jr., Sr., MD, DDS
|
11
|
+
t.date :birthdate # 1972-08-20
|
12
|
+
t.references :gender
|
13
|
+
t.string :preferred_locale, default: "en-US" # en-US
|
14
|
+
t.string :modification_timestamp
|
15
|
+
t.timestamps
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreatePlaces < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :places, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.string :city
|
6
|
+
t.string :state_or_province
|
7
|
+
t.string :country, null: false, default: "US"
|
8
|
+
t.string :type, null: false
|
9
|
+
t.text :description
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
add_index :places, :name
|
14
|
+
add_index :places, :city
|
15
|
+
add_index :places, :state_or_province
|
16
|
+
add_index :places, :country
|
17
|
+
add_index :places, :type
|
18
|
+
add_index :places, [:name, :state_or_province, :country]
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreatePrices < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :prices, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.references :listing, index: true, null: false, foreign_key: true
|
5
|
+
t.references :currency_period, index: true
|
6
|
+
|
7
|
+
t.string :type, null: false
|
8
|
+
t.integer :list_price, limit: 8
|
9
|
+
t.string :currency_code, default: "USD"
|
10
|
+
t.integer :list_price_low, limit: 8
|
11
|
+
t.string :currency_code_low, default: "USD"
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
add_index :prices, [:list_price, :currency_code]
|
16
|
+
add_index :prices, :list_price
|
17
|
+
add_index :prices, :type
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateSchools < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :schools, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.string :name
|
5
|
+
t.references :school_category, index: true, null: false
|
6
|
+
t.string :district
|
7
|
+
t.text :description
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :schools, [:name, :school_category_id, :district], name: "name_category_district"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateTaxes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :taxes, options: 'DEFAULT CHARSET=utf8' do |t|
|
4
|
+
t.integer :year
|
5
|
+
t.decimal :amount, null: false
|
6
|
+
t.string :description
|
7
|
+
t.references :listing, index: true, null: false, foreign_key: true
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|