1. Find a RealtyTrac home
- RT homes will have a home datum with source,
realtytrac
- The RT home datum must have an
rt_property_id
value AND a "success" in the datasources column (e.g.,{"realtytrac": {"date": "2019-06-28T17:44:05.262Z", "status": "success"}}
) - Things to note:
- Does the home also have a SiteX home datum? If so, simply delete the SiteX home datum (as well as any SiteX AVMs and Loans)
- Does the home have a CMA? If so, make note of the
system_generated
,updated
,amount
, anddiff
values, as these will determine what happens to the CMA post-migration (see step 3).
2. Migrate the RealtyTrac home to SiteX
- Open rails console
- Plug the home ID into the following command and run:
MigrateRealtyTracHomes.new.migrate_home(home_id)
3. Check the home post-migration
- Assuming SiteX was able to find a match, the home should now have at least a SiteX home datum. If SiteX could find any, the home should also have a SiteX AVM and SiteX loans.
- The home should also have a HomeAnswer with
question: 'realtyTracMigration'
andresponse: 'UNANSWERED'
- If the home had a CMA before-hand:
- If the CMA was from more than 1 year ago, it should've been deleted.
- If the CMA was system-generated (an auto-CMA), it should've been deleted.
- Otherwise, the CMA diff should be updated to be the CMA amount minus the SiteX AVM amount.
How to make a home into a RT home:
- Either in Rails console or in Postico, duplicate a SiteX home datum and change the following values:
source
- change from
sitex
torealtytrac
- change from
datasources
- change from
{"sitex": {"date": "2019-06-28T17:44:05.262Z", "status": "success"}}
to{"realtytrac": {"date": "2019-06-28T17:44:05.262Z", "status": "success"}}
(the date doesn't matter)
- change from
rt_property_id
- using the RealtyTrac API (creds in 1Password), find the
@PropertyParcelID_ext
value by searching by address. Copy that value into thert_property_id
column.
- using the RealtyTrac API (creds in 1Password), find the
- Save that home datum
- Open Loopback console
- Plug the home ID into the following command and run:
Home.updateExternalData(home_id);
A couple helpful lines for
rails c