# Path: flatisfy/database/base.py
# BASE = declarative_base()
# 
# Path: flatisfy/database/types.py
# class StringyJSON(types.TypeDecorator):
#     def process_bind_param(self, value, dialect):
#     def process_result_value(self, value, dialect):


import logging
import enum
import arrow
from sqlalchemy import (
    Boolean,
    Column,
    DateTime,
    Enum,
    Float,
    SmallInteger,
    String,
    Text,
    inspect,
)
from sqlalchemy.orm import validates
from flatisfy.database.base import BASE
from flatisfy.database.types import MagicJSON
    __searchable__ = ["title", "text", "station", "location", "details", "notes"]

    # Woob data
    id = Column(String, primary_key=True)
    area = Column(Float)
    bedrooms = Column(Float)
    cost = Column(Float)
    currency = Column(String)
    utilities = Column(Enum(FlatUtilities), default=FlatUtilities.unknown)
    date = Column(DateTime)
    details = Column(MagicJSON)
    location = Column(String)
    phone = Column(String)
    photos = Column(MagicJSON)
    rooms = Column(Float)
    station = Column(String)
    text = Column(Text)
    title = Column(String)
    urls = Column(MagicJSON)
    merged_ids = Column(MagicJSON)
    notes = Column(Text)
    notation = Column(SmallInteger, default=0)
    is_expired = Column(Boolean, default=False)

    # Flatisfy data
    # TODO: Should be in another table with relationships
    flatisfy_stations = Column(MagicJSON)
    flatisfy_postal_code = Column(String)
    flatisfy_time_to = Column(MagicJSON)
    flatisfy_constraint = Column(String)

# Path: flatisfy/database/base.py
# BASE = declarative_base()
# 
# Path: flatisfy/database/types.py
# class StringyJSON(types.TypeDecorator):
#     def process_bind_param(self, value, dialect):
#     def process_result_value(self, value, dialect):


# Path: flatisfy/models/flat.py
import logging
import enum
import arrow
from sqlalchemy import (
    Boolean,
    Column,
    DateTime,
    Enum,
    Float,
    SmallInteger,
    String,
    Text,
    inspect,
)
from sqlalchemy.orm import validates
from flatisfy.database.base import BASE
from flatisfy.database.types import MagicJSON

    __searchable__ = ["title", "text", "station", "location", "details", "notes"]

    # Woob data
    id = Column(String, primary_key=True)
    area = Column(Float)
    bedrooms = Column(Float)
    cost = Column(Float)
    currency = Column(String)
    utilities = Column(Enum(FlatUtilities), default=FlatUtilities.unknown)
    date = Column(DateTime)
    details = Column(MagicJSON)
    location = Column(String)
    phone = Column(String)
    photos = Column(MagicJSON)
    rooms = Column(Float)
    station = Column(String)
    text = Column(Text)
    title = Column(String)
    urls = Column(MagicJSON)
    merged_ids = Column(MagicJSON)
    notes = Column(Text)
    notation = Column(SmallInteger, default=0)
    is_expired = Column(Boolean, default=False)

    # Flatisfy data
    # TODO: Should be in another table with relationships
    flatisfy_stations = Column(MagicJSON)
    flatisfy_postal_code = Column(String)
    flatisfy_time_to = Column(MagicJSON)
    flatisfy_constraint = Column(String)

    flatisfy_position = Column(MagicJSON)