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.
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import ForeignKey, String, UniqueConstraint, Uuid
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.db.base import Base, PkMixin, TimestampMixin, UTCDateTime
|
|
|
|
|
|
class FinancialSpace(Base, PkMixin, TimestampMixin):
|
|
__tablename__ = "financial_spaces"
|
|
|
|
name: Mapped[str] = mapped_column(String(200), nullable=False)
|
|
status: Mapped[str] = mapped_column(String(16), nullable=False, default="active")
|
|
deletion_scheduled_at: Mapped[datetime | None] = mapped_column(UTCDateTime(), nullable=True)
|
|
|
|
|
|
class Membership(Base, PkMixin, TimestampMixin):
|
|
__tablename__ = "memberships"
|
|
__table_args__ = (UniqueConstraint("space_id", "user_id", name="uq_memberships_space_user"),)
|
|
|
|
space_id: Mapped[uuid.UUID] = mapped_column(
|
|
Uuid, ForeignKey("financial_spaces.id", ondelete="CASCADE"), nullable=False, index=True
|
|
)
|
|
user_id: Mapped[uuid.UUID] = mapped_column(
|
|
Uuid, ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True
|
|
)
|
|
role: Mapped[str] = mapped_column(String(16), nullable=False, default="member")
|