from sqlalchemy import Column, BigInteger, String, TIMESTAMP, ForeignKey, Integer
from backend.app.db.base import Base


class NonIntrusiveSurvey(Base):
    __tablename__ = 'non_intrusive_survey'

    id = Column(BigInteger, primary_key=True, autoincrement=True)
    uprn = Column(Integer, nullable=False)
    survey_date = Column(TIMESTAMP, nullable=False)
    surveyor = Column(String, nullable=False)


class NonIntrusiveSurveyNotes(Base):
    __tablename__ = 'non_intrusive_survey_notes'

    id = Column(BigInteger, primary_key=True, autoincrement=True)
    survey_id = Column(BigInteger, ForeignKey('non_intrusive_survey.id'), nullable=False)
    title = Column(String, nullable=False)
    note = Column(String, nullable=False)
