Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attendance tracking #106

Open
jontyms opened this issue May 28, 2024 · 1 comment
Open

Add attendance tracking #106

jontyms opened this issue May 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jontyms
Copy link
Member

jontyms commented May 28, 2024

No description provided.

@jontyms jontyms added this to the July 31 Luanch milestone Jul 12, 2024
@jontyms jontyms added the enhancement New feature or request label Jul 12, 2024
@jontyms
Copy link
Member Author

jontyms commented Jul 12, 2024

/attendance Endpoint

  • Method: GET
    • URL Arguments: event_id (optional)
    • Description: If event_id is provided, show a confirmation for the event. If event_id is not provided, show a form to enter the event code.
  • Method: POST
    • Request Body: event_code (required if event_id is not provided)
    • Description: Validate the event code or event_id. If valid, create a row in the attendance table for the user and event.

/admin/events Endpoint

  • Method: GET
    • Description: Show a UI listing all current events with a button to create a new event.
  • Method: POST
    • Request Body: Details for the new event (e.g., name, date, etc.)
    • Description: Create a new event.

/admin/event/{id} Endpoint

  • Method: GET
    • Description: Show event details and settings. Allow setting event code, opening/closing attendance, setting counts toward total, setting event type, viewing members in the event, and removing members from the event.
  • Method: PATCH
    • URL Parameters: id (event ID)
    • Request Body: Partial update data (e.g., event_code, attendance_status, counts_toward_total, event_type)
    • Description: Update event settings.
  • Method: DELETE
    • URL Parameters: id (event ID)
    • Request Body: member_id
    • Description: Remove a member from the event.
  • Method: POST
    • URL Parameters: id (event ID)
    • Request Body: member_id
    • Description: add a member to the event.

Database

class Event(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str
    date: datetime
    event_code: Optional[str] = None
    attendance_open: bool = False
    counts_toward_total: bool = False
    event_type: Optional[str] = None
    comment: Optional[str] = None
    
    
  class Attendance(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    user_id: uuid = Field(foreign_key="user.id")
    event_id: int = Field(foreign_key="event.id")
    user: Optional["User"] = Relationship(back_populates="attendances")
    event: Optional["Event"] = Relationship(back_populates="attendances")
  # update user  
  class User(SQLModel, table=True):
    id: Optional[uuid] = Field(default=None, primary_key=True)
    attendances: list["Attendance"] = Relationship(back_populates="user")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant