d582f15681
- Implemented tests for import polling functionality, ensuring correct behavior for active and terminal import statuses. - Created tests for the login page, validating user interactions and error handling. - Added unit tests for money utility functions, covering parsing, formatting, and summation of monetary values. - Developed tests for query keys, ensuring proper scoping and invalidation roots. chore: setup testing environment and configuration - Added setup file for testing with Vitest and Testing Library. - Configured TypeScript and Vite for the frontend project. - Created Docker and Nginx configurations for local development and production environments. - Established a PostgreSQL initialization script for setting up application roles. docs: add README and environment configuration for infra - Included README for the infra directory, detailing local development setup and service descriptions. - Created an example environment configuration file for local development with placeholders for sensitive information.
37 lines
1.7 KiB
Python
37 lines
1.7 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import ForeignKey, LargeBinary, String, Uuid
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.db.base import Base, PkMixin, TimestampMixin, UTCDateTime
|
|
|
|
|
|
class DataExport(Base, PkMixin, TimestampMixin):
|
|
__tablename__ = "data_exports"
|
|
|
|
space_id: Mapped[uuid.UUID] = mapped_column(
|
|
Uuid, ForeignKey("financial_spaces.id", ondelete="CASCADE"), nullable=False, index=True
|
|
)
|
|
requested_by_user_id: Mapped[uuid.UUID | None] = mapped_column(
|
|
Uuid, ForeignKey("users.id", ondelete="SET NULL"), nullable=True
|
|
)
|
|
status: Mapped[str] = mapped_column(String(16), nullable=False, default="queued")
|
|
object_key: Mapped[str | None] = mapped_column(String(64), nullable=True, unique=True)
|
|
dek_wrapped: Mapped[bytes | None] = mapped_column(LargeBinary, nullable=True)
|
|
dek_wrap_nonce: Mapped[bytes | None] = mapped_column(LargeBinary, nullable=True)
|
|
content_nonce: Mapped[bytes | None] = mapped_column(LargeBinary, nullable=True)
|
|
expires_at: Mapped[datetime | None] = mapped_column(UTCDateTime(), nullable=True)
|
|
consumed_at: Mapped[datetime | None] = mapped_column(UTCDateTime(), nullable=True)
|
|
error_code: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
|
|
|
|
|
class DeletionLedger(Base, PkMixin, TimestampMixin):
|
|
"""Durable deletion marker reapplied after disaster restore."""
|
|
|
|
__tablename__ = "deletion_ledger"
|
|
|
|
space_id: Mapped[uuid.UUID] = mapped_column(Uuid, nullable=False, unique=True, index=True)
|
|
scheduled_at: Mapped[datetime] = mapped_column(UTCDateTime(), nullable=False)
|
|
completed_at: Mapped[datetime | None] = mapped_column(UTCDateTime(), nullable=True)
|