email wiring

This commit is contained in:
debu-2 2026-10-04 20:50:47 +05:30
parent ee23b71f0f
commit 42cd937f0a
12 changed files with 494 additions and 45 deletions

View file

@ -50,7 +50,13 @@ class Account(Base):
)
invitation_email: Mapped[str | None] = mapped_column(String(320), nullable=True)
must_change_password: Mapped[bool] = mapped_column(Boolean, default=False)
section_id: Mapped[uuid.UUID | None] = mapped_column(
UUID(as_uuid=True),
ForeignKey("org_sections.id"),
nullable=True,
)
password_hash: Mapped[str] = mapped_column(String(255))
section: Mapped["OrgSection | None"] = relationship()
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
server_default=func.now(),
@ -138,6 +144,22 @@ class SmtpCredential(Base):
domain: Mapped[MailDomain] = relationship(back_populates="smtp_credentials")
class OrgSection(Base):
__tablename__ = "org_sections"
id: Mapped[uuid.UUID] = mapped_column(
UUID(as_uuid=True),
primary_key=True,
default=uuid.uuid4,
)
company_domain: Mapped[str] = mapped_column(String(253), index=True)
name: Mapped[str] = mapped_column(String(120))
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
server_default=func.now(),
)
class OrgSecuritySettings(Base):
__tablename__ = "org_security_settings"