2023-09-15 15:17:37 -07:00
|
|
|
from dataclasses import dataclass
|
|
|
|
from enum import Enum
|
2023-10-03 22:21:16 -07:00
|
|
|
from typing import Optional
|
2023-09-15 15:17:37 -07:00
|
|
|
|
|
|
|
|
2023-09-17 16:30:37 -07:00
|
|
|
class SiteName(Enum):
|
|
|
|
ZILLOW = "zillow"
|
|
|
|
REDFIN = "redfin"
|
|
|
|
REALTOR = "realtor.com"
|
|
|
|
|
2023-09-18 13:43:44 -07:00
|
|
|
@classmethod
|
|
|
|
def get_by_value(cls, value):
|
|
|
|
for item in cls:
|
|
|
|
if item.value == value:
|
|
|
|
return item
|
|
|
|
raise ValueError(f"{value} not found in {cls}")
|
|
|
|
|
2023-09-17 16:30:37 -07:00
|
|
|
|
2023-09-15 15:17:37 -07:00
|
|
|
class ListingType(Enum):
|
2023-09-18 11:38:17 -07:00
|
|
|
FOR_SALE = "FOR_SALE"
|
|
|
|
FOR_RENT = "FOR_RENT"
|
2023-10-05 11:43:00 -07:00
|
|
|
PENDING = "PENDING"
|
2023-09-18 11:38:17 -07:00
|
|
|
SOLD = "SOLD"
|
2023-09-15 15:17:37 -07:00
|
|
|
|
|
|
|
|
2024-03-13 19:17:17 -07:00
|
|
|
class PropertyType(Enum):
|
|
|
|
APARTMENT = "APARTMENT"
|
|
|
|
BUILDING = "BUILDING"
|
|
|
|
COMMERCIAL = "COMMERCIAL"
|
|
|
|
CONDO_TOWNHOME = "CONDO_TOWNHOME"
|
|
|
|
CONDO_TOWNHOME_ROWHOME_COOP = "CONDO_TOWNHOME_ROWHOME_COOP"
|
|
|
|
CONDO = "CONDO"
|
|
|
|
CONDOS = "CONDOS"
|
|
|
|
COOP = "COOP"
|
|
|
|
DUPLEX_TRIPLEX = "DUPLEX_TRIPLEX"
|
|
|
|
FARM = "FARM"
|
|
|
|
INVESTMENT = "INVESTMENT"
|
|
|
|
LAND = "LAND"
|
|
|
|
MOBILE = "MOBILE"
|
|
|
|
MULTI_FAMILY = "MULTI_FAMILY"
|
|
|
|
RENTAL = "RENTAL"
|
|
|
|
SINGLE_FAMILY = "SINGLE_FAMILY"
|
|
|
|
TOWNHOMES = "TOWNHOMES"
|
|
|
|
OTHER = "OTHER"
|
|
|
|
|
|
|
|
|
2023-09-15 15:17:37 -07:00
|
|
|
@dataclass
|
|
|
|
class Address:
|
2023-10-03 22:21:16 -07:00
|
|
|
street: str | None = None
|
|
|
|
unit: str | None = None
|
2023-09-19 19:13:20 -07:00
|
|
|
city: str | None = None
|
|
|
|
state: str | None = None
|
2023-10-03 22:21:16 -07:00
|
|
|
zip: str | None = None
|
2023-09-15 15:17:37 -07:00
|
|
|
|
|
|
|
|
2023-09-28 15:19:43 -07:00
|
|
|
@dataclass
|
2023-10-04 06:58:55 -07:00
|
|
|
class Description:
|
2023-11-24 11:41:46 -08:00
|
|
|
primary_photo: str | None = None
|
|
|
|
alt_photos: list[str] | None = None
|
2024-03-13 19:17:17 -07:00
|
|
|
style: PropertyType | None = None
|
2023-10-04 06:58:55 -07:00
|
|
|
beds: int | None = None
|
|
|
|
baths_full: int | None = None
|
|
|
|
baths_half: int | None = None
|
|
|
|
sqft: int | None = None
|
|
|
|
lot_sqft: int | None = None
|
|
|
|
sold_price: int | None = None
|
|
|
|
year_built: int | None = None
|
|
|
|
garage: float | None = None
|
|
|
|
stories: int | None = None
|
2023-09-28 15:19:43 -07:00
|
|
|
|
|
|
|
|
2024-04-16 12:55:44 -07:00
|
|
|
@dataclass
|
|
|
|
class Agent:
|
|
|
|
name: str | None = None
|
|
|
|
phone: str | None = None
|
|
|
|
|
|
|
|
|
2023-09-18 11:38:17 -07:00
|
|
|
@dataclass
|
|
|
|
class Property:
|
2023-10-04 06:58:55 -07:00
|
|
|
property_url: str
|
2023-10-03 22:21:16 -07:00
|
|
|
mls: str | None = None
|
2023-09-15 16:03:17 -07:00
|
|
|
mls_id: str | None = None
|
2023-10-03 22:21:16 -07:00
|
|
|
status: str | None = None
|
2023-10-04 06:58:55 -07:00
|
|
|
address: Address | None = None
|
2023-10-03 22:21:16 -07:00
|
|
|
|
|
|
|
list_price: int | None = None
|
|
|
|
list_date: str | None = None
|
2024-03-13 19:17:17 -07:00
|
|
|
pending_date: str | None = None
|
2023-10-03 22:21:16 -07:00
|
|
|
last_sold_date: str | None = None
|
2023-10-04 06:58:55 -07:00
|
|
|
prc_sqft: int | None = None
|
2023-10-03 22:21:16 -07:00
|
|
|
hoa_fee: int | None = None
|
2023-10-09 09:00:36 -07:00
|
|
|
days_on_mls: int | None = None
|
2023-10-04 06:58:55 -07:00
|
|
|
description: Description | None = None
|
2023-10-03 22:21:16 -07:00
|
|
|
|
2023-09-19 19:13:20 -07:00
|
|
|
latitude: float | None = None
|
|
|
|
longitude: float | None = None
|
2023-10-03 22:21:16 -07:00
|
|
|
neighborhoods: Optional[str] = None
|
2024-04-16 12:55:44 -07:00
|
|
|
|
|
|
|
agents: list[Agent] = None
|