···11+import datetime
12from typing import TYPE_CHECKING, Optional
2334from sqlalchemy import Column, String
45from sqlmodel import Field, Relationship, SQLModel
5667if TYPE_CHECKING:
88+ from kefi.models.core.models import User
79 from kefi.models.kudos.models import Action
1010+1111+1212+class MeetingSession(SQLModel, table=True):
1313+ """A meeting session that represents a moment scheduled to create a group call with
1414+ the different groups of attendees."""
1515+1616+ date = datetime.datetime # When the meetings are going to be created
1717+1818+1919+class Attendance(SQLModel, table=True):
2020+ """An attendance is a user who has spent kefis to be part of a meetings session."""
2121+2222+ # Meeting session that the attendance makes reference
2323+ meeting_session_id: int = Field(default=None, foreign_key="meeting_session.id")
2424+ meeting_session: MeetingSession = Relationship(
2525+ back_populates="attendances",
2626+ sa_relationship_kwargs=dict(foreign_keys="[Attendance.meeting_session_id]"),
2727+ )
2828+ # User who is going to attend to the meeting session
2929+ user_id: int = Field(foreign_key="user.id")
3030+ user: User = Relationship(
3131+ back_populates="attendances",
3232+ sa_relationship_kwargs=dict(foreign_keys="[Attendance.user_id]"),
3333+ )