Skip to content

Feature: Events page #45

@FadyGergesRezk

Description

@FadyGergesRezk

Implement the Events management page under /events.

Priority: P1

API endpoints used

Method Endpoint Description
GET /events List all events (EventSummary[])
POST /events Create a new event (EventCreate)
GET /events/{event_id} Get full event details (Event)
PATCH /events/{event_id} Update event fields (EventPartialUpdate)
DELETE /events/{event_id} Delete an event

Tasks

  • Add src/features/events/api/queries.ts with useListEvents and useGetEvent hooks using TanStack Query; expose eventListQueryOptions and eventDetailQueryOptions for use in the route loader
  • Add src/features/events/api/mutations.ts with useCreateEvent, useUpdateEvent, and useDeleteEvent hooks; on success invalidate eventListQueryOptions
  • Add src/features/events/api/query-keys.ts for structured query keys
  • Wire a React Router v7 loader on the /events route that calls queryClient.ensureQueryData(eventListQueryOptions())
  • Add Zod schema for EventCreate and EventPartialUpdate derived from the generated types in src/api.ts
  • Add Zustand slice for UI state only: selected event ID, detail sheet open/closed
  • Build an events list view (shadcn/ui Table with columns: name, start_time, end_time)
  • Add an event detail Sheet showing all Event fields including attendees, sports_linked, and teams_linked
  • Add a "New Event" Dialog with a React Hook Form + Zod validated form for EventCreate (required: name, start_time, end_time)
  • Support edit (PATCH) and delete with confirmation from the detail Sheet

Acceptance criteria

  • Events list loads from GET /events before the page renders (via loader prefetch)
  • Creating, editing, and deleting an event reflects in the list without a full page reload
  • Form validates required fields (name, start_time, end_time) before submitting and shows inline errors
  • Dates are sent to the API as ISO-8601 and rendered consistently in the UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientIssue regarding the client frontendenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions