# Sports Implemented State

## Surface
- `/admin/sports` now renders a Ballbox-local admin UI for coaches, open matches, and classes.
- `/api/sports` now returns DB-backed sports data instead of only documenting a planned shell.
- `/classes` now renders the first public student-facing sports surface.
- `/classes-by-date` now renders a coach-availability-driven reservation surface that starts by asking for a zone and then filters visible clubs / slots to that area.
- `/classes/[offerId]` now shows offer detail, visible ATC public-read slots when a local offer is linked, and a local request form that lets the student choose one slot or fall back to any schedule / place.
- `/classes/me` now provides a small read-only student request history view filtered by email for demo follow-up.
- `/classes` and `/classes/[offerId]` now render Ballbox-local offer data first, then hydrate ATC public-read context asynchronously from cached host-app APIs so first paint is not gated by ATC response time.
- `/coaches` now starts with `Sign in`, and only moves to `Sign up` when the user does not have an account yet.
- `/coaches` sign-up first asks whether the account is `Coach` or `Club`, then asks only for name, email, and password.
- `/coaches/settings` now opens on a coach dashboard split into `Calendar` and `Analytics`: calendar shows the current week's availability plus taken student reservations, while analytics shows weekly earnings, student consistency rows, and review placeholders before the separate `Mi Perfil` and `Alumnos` sections.
- `/coaches/settings` now also lets the coach assign existing Ballbox players to concrete occupied slots, track upcoming taken hours, and keep a student roster with WhatsApp / Telegram contact fields.
- `/clubs` now opens as a club-only service home right after club sign-in/sign-up, showing service cards where `Entrenadores` is the active path into the existing club coaches workspace and the rest stay marked `Proximamente`.
- `/clubs/coaches` now opens on a club workspace with top-level `Calendar`, `Analytics`, `Sedes`, and `Profesores` sections: calendar shows the current week's coach availability/reservations with sede/coach/court filters plus quick manual class loading, analytics shows professor/reservation money splits, `Sedes` handles venue creation and quick venue reservation settings, and `Profesores` handles invite links plus the club coach table.
- `/clubs/venues/[venueId]` now gives each venue its own configuration screen, with venue opening/closing time, weekly coach hours, external-coach availability, reservation settings, club-coach discount setup, court setup, and venue-specific coach assignment.
- Existing club/venue setting edits now auto-save in place and clickable panels/links use stronger accent styling to separate actions from read-only information.
- Authenticated coach/club screens now share the same top navbar with section tabs plus a profile-initial menu for sign out; the old corner text links and dedicated explainer hero panels are gone.

## Model
- Ballbox persists `Coach`, `OpenMatch`, and `Class` in Prisma/Postgres.
- `Coach` may belong to a `Club`.
- `Coach` now also stores an email, a password hash, a club-selection mode, and joins to clubs via `CoachClub`.
- Ballbox now derives coach account affiliation from whether that coach belongs to a primary `Club`.
- `Coach` can now also belong to one `Venue` inside that club.
- `Coach` now also stores a Mercado Pago placeholder handle and reusable `CoachSalesPackage` rows for price, duration, class type, and max-student setup.
- Ballbox now also persists `CoachStudentBooking` rows so a coach or club can block a real date/time with an existing `Player`, optionally assign a court, and keep lightweight follow-up tied to that student.
- `Player` now also stores optional `whatsappPhone` and `telegramHandle` fields so coaches can message tracked students from their roster.
- Ballbox persists `CoachAvailability` weekly ranges (day-of-week + time range + timezone).
- Coach availability writes are now validated against the assigned venue's coach hours or the union of the selected external clubs' enabled venue hours.
- `OpenMatch` and `Class` belong to a `Venue`.
- `Venue` now also stores one opening time, one closing time, weekly half-hour coach-availability ranges, whether that venue accepts external coaches, a reservation price for coach classes, a club-coach-only discount over that reservation fee, and a late-cancellation window in hours.
- `VenueCourt` persists the per-court setup for covered/open courts plus whether coaches can teach on that court.
- Ballbox now also persists `ClassOffer` and `ClassRequest` locally.
- `ClassOffer` belongs to a Ballbox-local `Coach` and `Venue`; `ClassRequest` belongs to a `ClassOffer`.
- `ClassRequest` now stores either a concrete selected slot snapshot or a flexible-selection fallback mode.
- Clubs now only store ATC sportclub ids; club metadata is hydrated from ATC at runtime for availability and display.
- ATC public-read does not expose a stable slot id today, so Ballbox persists a slot snapshot (`start`, duration, price, club id, court id) and revalidates that snapshot against ATC again when the request is submitted.
- ATC public-read lookups are now cached briefly on the server because the visible availability query is shared across visitors; without that cache, Ballbox would repeat the same ATC fetch for each page load.

## APIs
- Sports route handlers and `/admin/sports` page now call dedicated sports backend modules directly (`lib/sports-backend-events.ts`, `lib/sports-backend-coaches.ts`) instead of importing sports access through `lib/ballbox-store.ts`.
- `/api/sports`
- `/api/classes/offers`
- `/api/classes/offers/[offerId]`
- `/api/classes/requests`
- `/api/account/session`
- `/api/coaches/accounts`
- `/api/coaches/invites/[token]`
- `/api/coaches/session`
- `/api/coaches/logout`
- `/api/coaches/me`
- `/api/coaches/availability`
- `/api/coaches/clubs`
- `/api/coaches/students`
- `/api/clubs/accounts`
- `/api/clubs/invites`
- `/api/clubs/session`
- `/api/clubs/logout`
- `/api/clubs/me`
- `/api/clubs/coaches`
- `/api/clubs/coaches/[coachId]`
- `/api/clubs/manual-classes`
- `/api/clubs/venues`
- `/api/clubs/venues/[venueId]`
- `/api/admin/sports/operations`
- `/api/admin/sports/coaches`
- `/api/admin/sports/coaches/[coachId]`
- `/api/admin/sports/open-matches`
- `/api/admin/sports/open-matches/[matchId]`
- `/api/admin/sports/classes`
- `/api/admin/sports/classes/[classId]`

## Browser Coverage
- Playwright covers `/admin/sports` create, edit, and delete flows for coaches, open matches, and classes.

## Current Gaps
- Coach experience thesis is still being validated through an online form; Ballbox does not yet have enough field evidence to lock the first sports workflow.
- ATC scope is still public-read only; no admin/write ATC, booking writes, or ATC teacher dependency.
- The selected slot is still a local lead preference, not a confirmed reservation; ATC availability can move between render and submit, and Ballbox rejects stale selections when revalidation no longer finds the slot.
- ATC is still an external dependency with variable latency, so Ballbox now uses a short timeout and async hydration instead of delaying the initial HTML while waiting for ATC.
- No player registration/attendance links yet.
- No operator request inbox yet.
- Coach login remains demo-grade (shared password + email) and should not be treated as production auth.


# Docs Index

## How To Navigate
- `PLAN.md`: current repo execution state and next implementation steps
- `docs/next-steps-queue.md`: prioritized backlog with dependency states
- `docs/repo-map.md`: fast file-level entrypoint for each domain
- `docs/implemented-*.md`: shipped behavior only
- `docs/*-rfc.md`: proposed implementation slices
- `docs/*-plan.md`: route/product planning
- `docs/*-discovery*.md`: validation and research framing
- `docs/*-gap-analysis.md`: what Ballbox still needs to build
- `docs/maintainability-priorities-2026-03.md`: prioritized frontend/backend maintainability work for the next refactor cycle
- `docs/demo-iteration-mode.md`: rapid demo delivery model with anti-debt guardrails

## Operator Priority Path
1. `PLAN.md`
2. `docs/next-steps-queue.md`
3. `docs/repo-map.md`
4. `docs/demo-iteration-mode.md`
5. relevant `docs/implemented-*.md` for the touched domain

## Current Refactor Input
- `docs/maintainability-priorities-2026-03.md`

## Execution And Coordination
- `docs/next-steps-queue.md`
- `docs/repo-map.md`
- `docs/demo-iteration-mode.md`

## Implemented State
- `docs/implemented-host-app.md`
- `docs/implemented-network.md`
- `docs/implemented-payments.md`
- `docs/implemented-players.md`
- `docs/implemented-sports.md`
- `docs/implemented-tvs.md`

## Discovery And Strategy
- `docs/coaches-discovery-stage.md`
- `docs/coaches-form-current.md`
- `docs/atc-integration-discovery.md`
- `docs/coaches-opportunity-brief.md`
- `docs/coaches-research-repository.md`
- `docs/coaches-validation-checklist-2-weeks.md`
- `docs/coaches-solution-thesis.md`

## Current Build Docs
- `docs/classes-subroute-plan.md`
- `docs/classes-mvp-rfc.md`
- `docs/coaches-coordination-gap-analysis.md`
- `docs/atc-mock-integration-plan.md`


edit

import { ClubCoachesPageClient } from "@/components/club-coaches-page-client";

export const dynamic = "force-dynamic";

export default function ClubCoachesPage() {
  return (
    <main className="min-h-screen bg-[radial-gradient(circle_at_top,_rgba(196,214,0,0.12),_transparent_30%),linear-gradient(180deg,#080b07_0%,#0d120d_46%,#0a0f09_100%)] text-white">
      <div className="mx-auto max-w-6xl px-6 py-8 sm:py-10">
        <ClubCoachesPageClient />
      </div>
    </main>
  );
}

import { redirect } from "next/navigation";
import { resolveClubFromSession } from "@/app/api/clubs/club-route-helpers";
import { ClubCoachesPageClient } from "@/components/club-coaches-page-client";

export const dynamic = "force-dynamic";

export default async function ClubCoachesPage() {
  const result = await resolveClubFromSession();
  if (!result.ok) {
    redirect("/coaches");
  }

  return (
    <main className="min-h-screen bg-[radial-gradient(circle_at_top,_rgba(196,214,0,0.12),_transparent_30%),linear-gradient(180deg,#080b07_0%,#0d120d_46%,#0a0f09_100%)] text-white">
      <div className="mx-auto max-w-6xl px-6 py-8 sm:py-10">
        <ClubCoachesPageClient />
      </div>
    </main>
  );
}


Successfully replaced 1 block(s) in app/clubs/coaches/page.tsx.

+ 1 import { redirect } from "next/navigation";
+ 2 import { resolveClubFromSession } from "@/app/api/clubs/club-route-helpers";
  1 import { ClubCoachesPageClient } from "@/components/club-coaches-page-client";
  2
  3 export const dynamic = "force-dynamic";
  4
- 5 export default function ClubCoachesPage() {
+ 7 export default async function ClubCoachesPage() {
+ 8   const result = await resolveClubFromSession();
+ 9   if (!result.ok) {
+10     redirect("/coaches");
+11   }
+12
  6   return (
  7     <main className="min-h-screen bg-[radial-gradient(circle_at_top,_rgba(196,214,0,0.12),_transparent_30%),linear-gradient(180deg,#080b07_0%,#0d120d_46%,#0a0f09_100%)] text-white">
  8       <div className="mx-auto max-w-6xl px-6 py-8 sm:py-10">
  9         <ClubCoachesPageClient />
    ...


- `/clubs/coaches` now lands on a club workspace with top-level `Calendar`, `Analytics`, `Sedes`, and `Profesores` sections: calendar shows the current week's coach availability and reservations with sede/coach/court filters plus in-place manual class loading, analytics shows professor/reservation money splits and review placeholders, `Sedes` groups venue creation plus venue quick settings, and `Profesores` groups invite links plus the club coach table.
- `/clubs/coaches` now also enforces the club session at the page boundary before rendering the workspace, preventing the `Entrenadores` service-card hop from dropping users back into the shared `/coaches` access hub after a valid club login.

- `/clubs/coaches` now opens on a club workspace with top-level `Calendar`, `Analytics`, `Sedes`, and `Profesores` sections: calendar shows the current week's coach availability/reservations with sede/coach/court filters plus quick manual class loading, analytics shows professor/reservation money splits, `Sedes` handles venue creation and quick venue reservation settings, and `Profesores` handles invite links plus the club coach table.
- `/clubs/coaches` now checks the club session during page render too, so the `Entrenadores` card cannot land on a client-only shell that later bounces authenticated club users back to `/coaches`.


Successfully replaced 1 block(s) in PLAN.md.

     ...
  77 - `/coaches` now defaults to `Sign in`, and `Sign up` is the fallback path for new accounts.
  78 - `/coaches/settings` now lands on a coach dashboard first with `Calendar` and `Analytics` sub-sections: calendar shows the current week's coach availability plus taken student reservations, while analytics shows weekly earnings and student consistency/review rows; setup stays in `Mi Perfil` and student follow-up stays in `Alumnos`.
  79 - `/clubs` now exists as the club-only service home that opens right after club sign-in/sign-up and groups the operational surfaces into service cards, with `Entrenadores` as the active entry point into the existing coaches workspace and the remaining services marked as `Proximamente`.
  80 - `/clubs/coaches` now lands on a club workspace with top-level `Calendar`, `Analytics`, `Sedes`, and `Profesores` sections: calendar shows the current week's coach availability and reservations with sede/coach/court filters plus in-place manual class loading, analytics shows professor/reservation money splits and review placeholders, `Sedes` groups venue creation plus venue quick settings, and `Profesores` groups invite links plus the club coach table.
+ 81 - `/clubs/coaches` now also enforces the club session at the page boundary before rendering the workspace, preventing the `Entrenadores` service-card hop from dropping users back into the shared `/coaches` access hub after a valid club login.
  81 - Club workspace clickable actions are now visually distinguished with stronger accent borders, CTA chips, and hover/focus states, while existing-setting edits in club quick settings and venue detail auto-save in place instead of requiring explicit `Guardar` buttons or reloading the user back to the top.
  82 - `/api/coaches/students` now lets a coach load existing Ballbox players into concrete occupied time slots, validating availability, venue fit, and overlap rules, and the coach workspace now surfaces those students in a dedicated `Alumnos` section with WhatsApp / Telegram contact fields.
  83 - `/clubs/venues/[venueId]` now exists as the dedicated venue detail view for configuring venue opening/closing time, coach hours, external-coach availability, reservation settings, courts, and the coaches assigned to that venue.
  84 - `CoachAvailability` weekly ranges and `CoachClub` selections now model coach intent separately from ATC court availability, while coach-side editing is clamped to the hours enabled by the assigned venue or the selected external clubs.
     ...


Successfully replaced 1 block(s) in docs/implemented-sports.md.

    ...
 13 - `/coaches/settings` now opens on a coach dashboard split into `Calendar` and `Analytics`: calendar shows the current week's availability plus taken student reservations, while analytics shows weekly earnings, student consistency rows, and review placeholders before the separate `Mi Perfil` and `Alumnos` sections.
 14 - `/coaches/settings` now also lets the coach assign existing Ballbox players to concrete occupied slots, track upcoming taken hours, and keep a student roster with WhatsApp / Telegram contact fields.
 15 - `/clubs` now opens as a club-only service home right after club sign-in/sign-up, showing service cards where `Entrenadores` is the active path into the existing club coaches workspace and the rest stay marked `Proximamente`.
 16 - `/clubs/coaches` now opens on a club workspace with top-level `Calendar`, `Analytics`, `Sedes`, and `Profesores` sections: calendar shows the current week's coach availability/reservations with sede/coach/court filters plus quick manual class loading, analytics shows professor/reservation money splits, `Sedes` handles venue creation and quick venue reservation settings, and `Profesores` handles invite links plus the club coach table.
+17 - `/clubs/coaches` now checks the club session during page render too, so the `Entrenadores` card cannot land on a client-only shell that later bounces authenticated club users back to `/coaches`.
 17 - `/clubs/venues/[venueId]` now gives each venue its own configuration screen, with venue opening/closing time, weekly coach hours, external-coach availability, reservation settings, club-coach discount setup, court setup, and venue-specific coach assignment.
 18 - Existing club/venue setting edits now auto-save in place and clickable panels/links use stronger accent styling to separate actions from read-only information.
 19 - Authenticated coach/club screens now share the same top navbar with section tabs plus a profile-initial menu for sign out; the old corner text links and dedicated explainer hero panels are gone.
 20
    ...


bash

git diff -- app/clubs/coaches/page.tsx PLAN.md docs/implemented-sports.md


! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-10.33.0.tgz
app/api/clubs/coaches/route.ts(26,34): error TS7006: Parameter 'invite' implicitly has an 'any' type.
lib/club-accounts-backend.ts(272,3): error TS2353: Object literal may only specify known properties, and 'contactEmail' does not exist in type 'ClubSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(310,7): error TS2353: Object literal may only specify known properties, and 'coaches' does not exist in type 'VenueCountOutputTypeSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(451,32): error TS2339: Property 'filter' does not exist on type 'never'.
lib/club-accounts-backend.ts(451,40): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(452,39): error TS2339: Property 'filter' does not exist on type 'never'.
lib/club-accounts-backend.ts(452,47): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(466,34): error TS2339: Property 'map' does not exist on type 'never'.
lib/club-accounts-backend.ts(471,27): error TS2339: Property 'length' does not exist on type 'never'.
lib/club-accounts-backend.ts(473,31): error TS2339: Property 'length' does not exist on type 'never'.
lib/club-accounts-backend.ts(476,26): error TS2339: Property 'map' does not exist on type 'never'.
lib/club-accounts-backend.ts(476,31): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(727,23): error TS2339: Property 'filter' does not exist on type 'never'.
lib/club-accounts-backend.ts(727,31): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(741,18): error TS2339: Property 'map' does not exist on type 'never'.
lib/club-accounts-backend.ts(741,23): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(763,33): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(817,28): error TS2339: Property 'map' does not exist on type 'never'.
lib/club-accounts-backend.ts(817,33): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1047,7): error TS2353: Object literal may only specify known properties, and 'venue' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(1075,22): error TS2345: Argument of type '(coach: { id: string; name: string; email: string | null; clubId: string | null; venue: BallboxClubVenueSummary | null; availabilities?: { id: string; dayOfWeek: number; startTime: string; endTime: string; }[] | undefined; _count: { ...; }; classOffers: { ...; }[]; }) => BallboxClubRosterCoach' is not assignable to parameter of type '(value: { name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }, index: number, array: { ...; }[]) => BallboxClubRosterCoach'.
  Types of parameters 'coach' and 'value' are incompatible.
    Type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is missing the following properties from type '{ id: string; name: string; email: string | null; clubId: string | null; venue: BallboxClubVenueSummary | null; availabilities?: { id: string; dayOfWeek: number; startTime: string; endTime: string; }[] | undefined; _count: { ...; }; classOffers: { ...; }[]; }': venue, _count, classOffers
lib/club-accounts-backend.ts(1080,14): error TS2353: Object literal may only specify known properties, and 'contactEmail' does not exist in type 'ClubWhereUniqueInput'.
lib/club-accounts-backend.ts(1085,25): error TS2345: Argument of type '{ name: string | null; status: ClubStatus | null; id: string; slug: string | null; atcSportclubId: string | null; createdAt: Date; updatedAt: Date; }' is not assignable to parameter of type '{ id: string; name: string | null; slug: string | null; contactEmail: string | null; passwordHash?: string | null | undefined; }'.
  Property 'contactEmail' is missing in type '{ name: string | null; status: ClubStatus | null; id: string; slug: string | null; atcSportclubId: string | null; createdAt: Date; updatedAt: Date; }' but required in type '{ id: string; name: string | null; slug: string | null; contactEmail: string | null; passwordHash?: string | null | undefined; }'.
lib/club-accounts-backend.ts(1090,14): error TS2353: Object literal may only specify known properties, and 'contactEmail' does not exist in type 'ClubWhereUniqueInput'.
lib/club-accounts-backend.ts(1095,31): error TS2345: Argument of type '{ name: string | null; status: ClubStatus | null; id: string; slug: string | null; atcSportclubId: string | null; createdAt: Date; updatedAt: Date; }' is not assignable to parameter of type '{ id: string; name: string | null; slug: string | null; contactEmail: string | null; passwordHash: string | null; }'.
  Type '{ name: string | null; status: ClubStatus | null; id: string; slug: string | null; atcSportclubId: string | null; createdAt: Date; updatedAt: Date; }' is missing the following properties from type '{ id: string; name: string | null; slug: string | null; contactEmail: string | null; passwordHash: string | null; }': contactEmail, passwordHash
lib/club-accounts-backend.ts(1111,16): error TS2353: Object literal may only specify known properties, and 'contactEmail' does not exist in type 'ClubWhereUniqueInput'.
lib/club-accounts-backend.ts(1112,27): error TS2353: Object literal may only specify known properties, and 'passwordHash' does not exist in type 'ClubSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(1128,28): error TS2339: Property 'passwordHash' does not exist on type '{ name: string | null; status: ClubStatus | null; id: string; slug: string | null; atcSportclubId: string | null; createdAt: Date; updatedAt: Date; }'.
lib/club-accounts-backend.ts(1140,11): error TS2353: Object literal may only specify known properties, and 'passwordHash' does not exist in type '(Without<ClubUpdateInput, ClubUncheckedUpdateInput> & ClubUncheckedUpdateInput) | (Without<...> & ClubUpdateInput)'.
lib/club-accounts-backend.ts(1148,11): error TS2353: Object literal may only specify known properties, and 'contactEmail' does not exist in type '(Without<ClubCreateInput, ClubUncheckedCreateInput> & ClubUncheckedCreateInput) | (Without<...> & ClubCreateInput)'.
lib/club-accounts-backend.ts(1155,52): error TS2345: Argument of type '{ name: string | null; status: ClubStatus | null; id: string; slug: string | null; atcSportclubId: string | null; createdAt: Date; updatedAt: Date; }' is not assignable to parameter of type '{ id: string; name: string | null; slug: string | null; contactEmail: string | null; passwordHash?: string | null | undefined; }'.
  Property 'contactEmail' is missing in type '{ name: string | null; status: ClubStatus | null; id: string; slug: string | null; atcSportclubId: string | null; createdAt: Date; updatedAt: Date; }' but required in type '{ id: string; name: string | null; slug: string | null; contactEmail: string | null; passwordHash?: string | null | undefined; }'.
lib/club-accounts-backend.ts(1176,12): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/club-accounts-backend.ts(1263,51): error TS7006: Parameter 'map' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1263,56): error TS7006: Parameter 'booking' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1269,29): error TS7006: Parameter 'request' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1292,16): error TS7006: Parameter 'coach' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1293,13): error TS7006: Parameter 'coach' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1311,36): error TS7006: Parameter 'venue' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1314,33): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1321,27): error TS7006: Parameter 'coach' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1328,27): error TS7006: Parameter 'player' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1396,9): error TS2353: Object literal may only specify known properties, and 'venueId' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(1426,9): error TS2353: Object literal may only specify known properties, and 'whatsappPhone' does not exist in type 'PlayerSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(1443,14): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/club-accounts-backend.ts(1443,29): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/club-accounts-backend.ts(1443,62): error TS2339: Property 'venueId' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/club-accounts-backend.ts(1448,20): error TS2339: Property 'venueCourt' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/club-accounts-backend.ts(1477,11): error TS2339: Property 'availabilities' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/club-accounts-backend.ts(1483,11): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/club-accounts-backend.ts(1493,43): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/club-accounts-backend.ts(1521,13): error TS2353: Object literal may only specify known properties, and 'whatsappPhone' does not exist in type '(Without<PlayerUpdateInput, PlayerUncheckedUpdateInput> & PlayerUncheckedUpdateInput) | (Without<...> & PlayerUpdateInput)'.
lib/club-accounts-backend.ts(1526,13): error TS2353: Object literal may only specify known properties, and 'whatsappPhone' does not exist in type 'PlayerSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(1531,32): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/club-accounts-backend.ts(1565,42): error TS2339: Property 'whatsappPhone' does not exist on type '{ name: string; id: string; createdAt: Date; updatedAt: Date; }'.
lib/club-accounts-backend.ts(1626,7): error TS2353: Object literal may only specify known properties, and 'openingTime' does not exist in type 'Without<VenueCreateInput, VenueUncheckedCreateInput> & VenueUncheckedCreateInput'.
lib/club-accounts-backend.ts(1711,9): error TS2353: Object literal may only specify known properties, and 'openingTime' does not exist in type '(Without<VenueUpdateInput, VenueUncheckedUpdateInput> & VenueUncheckedUpdateInput) | (Without<...> & VenueUpdateInput)'.
lib/club-accounts-backend.ts(1720,14): error TS2339: Property 'venueCoachHour' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/club-accounts-backend.ts(1722,14): error TS2339: Property 'venueCoachHour' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/club-accounts-backend.ts(1733,18): error TS2339: Property 'venueCourt' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/club-accounts-backend.ts(1737,14): error TS7006: Parameter 'court' implicitly has an 'any' type.
lib/club-accounts-backend.ts(1742,14): error TS2339: Property 'venueCourt' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/club-accounts-backend.ts(1758,18): error TS2339: Property 'venueCourt' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/club-accounts-backend.ts(1763,18): error TS2339: Property 'venueCourt' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/club-accounts-backend.ts(1800,13): error TS2353: Object literal may only specify known properties, and 'venueId' does not exist in type '(Without<CoachUpdateInput, CoachUncheckedUpdateInput> & CoachUncheckedUpdateInput) | (Without<...> & CoachUpdateInput)'.
lib/club-accounts-backend.ts(1806,7): error TS2353: Object literal may only specify known properties, and 'venue' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(1832,52): error TS2345: Argument of type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is not assignable to parameter of type '{ id: string; name: string; email: string | null; clubId: string | null; venue: BallboxClubVenueSummary | null; availabilities?: { id: string; dayOfWeek: number; startTime: string; endTime: string; }[] | undefined; _count: { ...; }; classOffers: { ...; }[]; }'.
  Type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is missing the following properties from type '{ id: string; name: string; email: string | null; clubId: string | null; venue: BallboxClubVenueSummary | null; availabilities?: { id: string; dayOfWeek: number; startTime: string; endTime: string; }[] | undefined; _count: { ...; }; classOffers: { ...; }[]; }': venue, _count, classOffers
lib/club-accounts-backend.ts(1846,27): error TS2353: Object literal may only specify known properties, and 'venueId' does not exist in type 'Without<CoachUpdateInput, CoachUncheckedUpdateInput> & CoachUncheckedUpdateInput'.
lib/club-accounts-backend.ts(1852,7): error TS2353: Object literal may only specify known properties, and 'venue' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/club-accounts-backend.ts(1878,52): error TS2345: Argument of type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is not assignable to parameter of type '{ id: string; name: string; email: string | null; clubId: string | null; venue: BallboxClubVenueSummary | null; availabilities?: { id: string; dayOfWeek: number; startTime: string; endTime: string; }[] | undefined; _count: { ...; }; classOffers: { ...; }[]; }'.
  Type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is missing the following properties from type '{ id: string; name: string; email: string | null; clubId: string | null; venue: BallboxClubVenueSummary | null; availabilities?: { id: string; dayOfWeek: number; startTime: string; endTime: string; }[] | undefined; _count: { ...; }; classOffers: { ...; }[]; }': venue, _count, classOffers
lib/coach-invites-backend.ts(49,31): error TS2339: Property 'coachInvite' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-invites-backend.ts(66,32): error TS2339: Property 'coachInvite' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-invites-backend.ts(89,31): error TS2339: Property 'coachInvite' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-invites-backend.ts(109,31): error TS2339: Property 'coachInvite' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-invites-backend.ts(153,14): error TS2339: Property 'coachInvite' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/coach-students-backend.ts(273,7): error TS2353: Object literal may only specify known properties, and 'venue' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/coach-students-backend.ts(307,26): error TS2339: Property 'availabilities' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(309,11): error TS2339: Property 'availabilities' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(309,31): error TS7006: Parameter 'availability' implicitly has an 'any' type.
lib/coach-students-backend.ts(316,13): error TS2339: Property 'club' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(317,26): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(320,23): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(321,25): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(322,27): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(323,48): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(324,47): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coach-students-backend.ts(375,12): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-students-backend.ts(420,40): error TS7006: Parameter 'booking' implicitly has an 'any' type.
lib/coach-students-backend.ts(421,49): error TS7006: Parameter 'booking' implicitly has an 'any' type.
lib/coach-students-backend.ts(486,52): error TS7006: Parameter 'booking' implicitly has an 'any' type.
lib/coach-students-backend.ts(488,18): error TS7006: Parameter 'booking' implicitly has an 'any' type.
lib/coach-students-backend.ts(489,18): error TS7006: Parameter 'total' implicitly has an 'any' type.
lib/coach-students-backend.ts(489,25): error TS7006: Parameter 'booking' implicitly has an 'any' type.
lib/coach-students-backend.ts(493,33): error TS7006: Parameter 'venue' implicitly has an 'any' type.
lib/coach-students-backend.ts(505,17): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-students-backend.ts(613,43): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-students-backend.ts(633,32): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-students-backend.ts(682,7): error TS2353: Object literal may only specify known properties, and 'whatsappPhone' does not exist in type '(Without<PlayerUpdateInput, PlayerUncheckedUpdateInput> & PlayerUncheckedUpdateInput) | (Without<...> & PlayerUpdateInput)'.
lib/coach-students-backend.ts(704,36): error TS2345: Argument of type '{ name: string; id: string; createdAt: Date; updatedAt: Date; }' is not assignable to parameter of type '{ id: string; name: string; whatsappPhone: string | null; telegramHandle: string | null; memberships: { club: { id: string; name: string | null; }; }[]; }'.
  Type '{ name: string; id: string; createdAt: Date; updatedAt: Date; }' is missing the following properties from type '{ id: string; name: string; whatsappPhone: string | null; telegramHandle: string | null; memberships: { club: { id: string; name: string | null; }; }[]; }': whatsappPhone, telegramHandle, memberships
lib/coach-students-backend.ts(709,32): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coach-students-backend.ts(723,16): error TS2339: Property 'coachStudentBooking' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
lib/coaches-backend.ts(687,15): error TS2353: Object literal may only specify known properties, and 'coachReservationPrice' does not exist in type 'VenueSelect<DefaultArgs>'.
lib/coaches-backend.ts(717,7): error TS2353: Object literal may only specify known properties, and 'venue' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/coaches-backend.ts(722,26): error TS2345: Argument of type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is not assignable to parameter of type '{ id: string; name: string; email: string | null; clubSelectionMode: "ALL" | "CUSTOM"; club: { id: string; name: string | null; } | null; venue: { id: string; name: string; } | null; }'.
  Type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is missing the following properties from type '{ id: string; name: string; email: string | null; clubSelectionMode: "ALL" | "CUSTOM"; club: { id: string; name: string | null; } | null; venue: { id: string; name: string; } | null; }': club, venue
lib/coaches-backend.ts(732,7): error TS2353: Object literal may only specify known properties, and 'passwordHash' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/coaches-backend.ts(740,32): error TS2345: Argument of type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is not assignable to parameter of type '{ id: string; name: string; email: string | null; passwordHash: string | null; clubSelectionMode: "ALL" | "CUSTOM"; club: { id: string; name: string | null; } | null; venue: { id: string; name: string; } | null; }'.
  Type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is missing the following properties from type '{ id: string; name: string; email: string | null; passwordHash: string | null; clubSelectionMode: "ALL" | "CUSTOM"; club: { id: string; name: string | null; } | null; venue: { id: string; name: string; } | null; }': passwordHash, club, venue
lib/coaches-backend.ts(752,7): error TS2353: Object literal may only specify known properties, and 'venue' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/coaches-backend.ts(757,26): error TS2345: Argument of type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is not assignable to parameter of type '{ id: string; name: string; email: string | null; clubSelectionMode: "ALL" | "CUSTOM"; club: { id: string; name: string | null; } | null; venue: { id: string; name: string; } | null; }'.
  Type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is missing the following properties from type '{ id: string; name: string; email: string | null; clubSelectionMode: "ALL" | "CUSTOM"; club: { id: string; name: string | null; } | null; venue: { id: string; name: string; } | null; }': club, venue
lib/coaches-backend.ts(780,27): error TS2353: Object literal may only specify known properties, and 'passwordHash' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/coaches-backend.ts(783,16): error TS2353: Object literal may only specify known properties, and 'contactEmail' does not exist in type 'ClubWhereUniqueInput'.
lib/coaches-backend.ts(793,22): error TS2339: Property 'passwordHash' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(802,9): error TS2353: Object literal may only specify known properties, and 'passwordHash' does not exist in type '(Without<CoachUpdateInput, CoachUncheckedUpdateInput> & CoachUncheckedUpdateInput) | (Without<...> & CoachUpdateInput)'.
lib/coaches-backend.ts(812,9): error TS2353: Object literal may only specify known properties, and 'passwordHash' does not exist in type '(Without<CoachCreateInput, CoachUncheckedCreateInput> & CoachUncheckedCreateInput) | (Without<...> & CoachCreateInput)'.
lib/coaches-backend.ts(855,9): error TS2353: Object literal may only specify known properties, and 'venueId' does not exist in type 'Without<CoachUpdateInput, CoachUncheckedUpdateInput> & CoachUncheckedUpdateInput'.
lib/coaches-backend.ts(924,18): error TS2353: Object literal may only specify known properties, and 'externalCoachesAllowed' does not exist in type 'VenueWhereInput'.
lib/coaches-backend.ts(929,11): error TS2353: Object literal may only specify known properties, and 'coachReservationPrice' does not exist in type 'VenueSelect<DefaultArgs>'.
lib/coaches-backend.ts(944,27): error TS2339: Property 'venues' does not exist on type '{ name: string | null; status: ClubStatus | null; id: string; slug: string | null; atcSportclubId: string | null; createdAt: Date; updatedAt: Date; }'.
lib/coaches-backend.ts(944,39): error TS7006: Parameter 'venue' implicitly has an 'any' type.
lib/coaches-backend.ts(951,45): error TS7006: Parameter 'venue' implicitly has an 'any' type.
lib/coaches-backend.ts(1018,7): error TS2353: Object literal may only specify known properties, and 'venue' does not exist in type 'CoachSelect<DefaultArgs>'.
lib/coaches-backend.ts(1058,23): error TS2339: Property 'club' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1064,17): error TS2551: Property 'clubSelections' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'. Did you mean 'clubSelectionMode'?
lib/coaches-backend.ts(1064,37): error TS7006: Parameter 'selection' implicitly has an 'any' type.
lib/coaches-backend.ts(1064,77): error TS7006: Parameter 'clubId' implicitly has an 'any' type.
lib/coaches-backend.ts(1069,34): error TS2339: Property 'club' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1070,20): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1072,23): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1073,25): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1074,40): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1075,42): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1076,49): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1077,49): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1078,43): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1079,31): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1080,27): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1117,35): error TS2345: Argument of type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is not assignable to parameter of type '{ id: string; name: string; email: string | null; clubSelectionMode: "ALL" | "CUSTOM"; club: { id: string; name: string | null; } | null; venue: { id: string; name: string; } | null; }'.
  Type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }' is missing the following properties from type '{ id: string; name: string; email: string | null; clubSelectionMode: "ALL" | "CUSTOM"; club: { id: string; name: string | null; } | null; venue: { id: string; name: string; } | null; }': club, venue
lib/coaches-backend.ts(1126,17): error TS2551: Property 'clubSelections' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'. Did you mean 'clubSelectionMode'?
lib/coaches-backend.ts(1126,37): error TS7006: Parameter 'item' implicitly has an 'any' type.
lib/coaches-backend.ts(1126,67): error TS7006: Parameter 'clubId' implicitly has an 'any' type.
lib/coaches-backend.ts(1131,34): error TS2339: Property 'club' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1132,20): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1134,23): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1135,25): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1136,40): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1137,42): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1138,49): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1139,49): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1140,43): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1141,31): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1142,27): error TS2339: Property 'venue' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1149,26): error TS2339: Property 'salesPackages' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1152,24): error TS2339: Property 'classOffers' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1154,30): error TS2339: Property 'availabilities' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1163,32): error TS2339: Property 'mercadoPagoHandle' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1167,20): error TS2339: Property 'availabilities' does not exist on type '{ name: string; email: string | null; id: string; createdAt: Date; updatedAt: Date; clubId: string | null; clubSelectionMode: CoachClubSelectionMode; }'.
lib/coaches-backend.ts(1202,9): error TS2353: Object literal may only specify known properties, and 'mercadoPagoHandle' does not exist in type '(Without<CoachUpdateInput, CoachUncheckedUpdateInput> & CoachUncheckedUpdateInput) | (Without<...> & CoachUpdateInput)'.
lib/coaches-backend.ts(1206,14): error TS2339: Property 'coachSalesPackage' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/coaches-backend.ts(1211,16): error TS2339: Property 'coachSalesPackage' does not exist on type 'Omit<PrismaClient<PrismaClientOptions, never, DefaultArgs>, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends">'.
lib/players-backend.ts(89,27): error TS2339: Property 'whatsappPhone' does not exist on type '{ memberships: ({ club: { id: string; atcSportclubId: string | null; }; } & { id: string; createdAt: Date; updatedAt: Date; clubId: string; playerId: string; })[]; } & { name: string; id: string; createdAt: Date; updatedAt: Date; }'.
lib/players-backend.ts(90,28): error TS2339: Property 'telegramHandle' does not exist on type '{ memberships: ({ club: { id: string; atcSportclubId: string | null; }; } & { id: string; createdAt: Date; updatedAt: Date; clubId: string; playerId: string; })[]; } & { name: string; id: string; createdAt: Date; updatedAt: Date; }'.
lib/players-backend.ts(108,44): error TS2345: Argument of type '{ memberships: ({ club: { id: string; atcSportclubId: string | null; }; } & { id: string; createdAt: Date; updatedAt: Date; clubId: string; playerId: string; })[]; } & { name: string; id: string; createdAt: Date; updatedAt: Date; }' is not assignable to parameter of type '{ id: string; name: string; whatsappPhone: string | null; telegramHandle: string | null; memberships: { id: string; club: { id: string; atcSportclubId: string | null; }; }[]; }'.
  Type '{ memberships: ({ club: { id: string; atcSportclubId: string | null; }; } & { id: string; createdAt: Date; updatedAt: Date; clubId: string; playerId: string; })[]; } & { name: string; id: string; createdAt: Date; updatedAt: Date; }' is missing the following properties from type '{ id: string; name: string; whatsappPhone: string | null; telegramHandle: string | null; memberships: { id: string; club: { id: string; atcSportclubId: string | null; }; }[]; }': whatsappPhone, telegramHandle
lib/players-backend.ts(123,20): error TS2345: Argument of type '{ memberships: ({ club: { id: string; atcSportclubId: string | null; }; } & { id: string; createdAt: Date; updatedAt: Date; clubId: string; playerId: string; })[]; } & { name: string; id: string; createdAt: Date; updatedAt: Date; }' is not assignable to parameter of type '{ id: string; name: string; whatsappPhone: string | null; telegramHandle: string | null; memberships: { id: string; club: { id: string; atcSportclubId: string | null; }; }[]; }'.
  Type '{ memberships: ({ club: { id: string; atcSportclubId: string | null; }; } & { id: string; createdAt: Date; updatedAt: Date; clubId: string; playerId: string; })[]; } & { name: string; id: string; createdAt: Date; updatedAt: Date; }' is missing the following properties from type '{ id: string; name: string; whatsappPhone: string | null; telegramHandle: string | null; memberships: { id: string; club: { id: string; atcSportclubId: string | null; }; }[]; }': whatsappPhone, telegramHandle
lib/players-backend.ts(130,7): error TS2353: Object literal may only specify known properties, and 'whatsappPhone' does not exist in type '(Without<PlayerCreateInput, PlayerUncheckedCreateInput> & PlayerUncheckedCreateInput) | (Without<...> & PlayerCreateInput)'.
lib/players-backend.ts(155,7): error TS2353: Object literal may only specify known properties, and 'whatsappPhone' does not exist in type '(Without<PlayerUpdateInput, PlayerUncheckedUpdateInput> & PlayerUncheckedUpdateInput) | (Without<...> & PlayerUpdateInput)'.
prisma/seed.ts(57,9): error TS2353: Object literal may only specify known properties, and 'contactEmail' does not exist in type '(Without<ClubUpdateInput, ClubUncheckedUpdateInput> & ClubUncheckedUpdateInput) | (Without<...> & ClubUpdateInput)'.
prisma/seed.ts(66,9): error TS2353: Object literal may only specify known properties, and 'contactEmail' does not exist in type '(Without<ClubCreateInput, ClubUncheckedCreateInput> & ClubUncheckedCreateInput) | (Without<...> & ClubCreateInput)'.
prisma/seed.ts(157,9): error TS2353: Object literal may only specify known properties, and 'passwordHash' does not exist in type 'Without<CoachUpdateInput, CoachUncheckedUpdateInput> & CoachUncheckedUpdateInput'.
prisma/seed.ts(165,9): error TS2353: Object literal may only specify known properties, and 'passwordHash' does not exist in type 'Without<CoachCreateInput, CoachUncheckedCreateInput> & CoachUncheckedCreateInput'.

Command exited with code 2


diff --git a/PLAN.md b/PLAN.md
index d9fa415..63a30ac 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -78,6 +78,7 @@
 - `/coaches/settings` now lands on a coach dashboard first with `Calendar` and `Analytics` sub-sections: calendar shows the current week's coach availability plus taken student reservations, while analytics shows weekly earnings and student consistency/review rows; setup stays in `Mi Perfil` and student follow-up stays in `Alumnos`.
 - `/clubs` now exists as the club-only service home that opens right after club sign-in/sign-up and groups the operational surfaces into service cards, with `Entrenadores` as the active entry point into the existing coaches workspace and the remaining services marked as `Proximamente`.
 - `/clubs/coaches` now lands on a club workspace with top-level `Calendar`, `Analytics`, `Sedes`, and `Profesores` sections: calendar shows the current week's coach availability and reservations with sede/coach/court filters plus in-place manual class loading, analytics shows professor/reservation money splits and review placeholders, `Sedes` groups venue creation plus venue quick settings, and `Profesores` groups invite links plus the club coach table.
+- `/clubs/coaches` now also enforces the club session at the page boundary before rendering the workspace, preventing the `Entrenadores` service-card hop from dropping users back into the shared `/coaches` access hub after a valid club login.
 - Club workspace clickable actions are now visually distinguished with stronger accent borders, CTA chips, and hover/focus states, while existing-setting edits in club quick settings and venue detail auto-save in place instead of requiring explicit `Guardar` buttons or reloading the user back to the top.
 - `/api/coaches/students` now lets a coach load existing Ballbox players into concrete occupied time slots, validating availability, venue fit, and overlap rules, and the coach workspace now surfaces those students in a dedicated `Alumnos` section with WhatsApp / Telegram contact fields.
 - `/clubs/venues/[venueId]` now exists as the dedicated venue detail view for configuring venue opening/closing time, coach hours, external-coach availability, reservation settings, courts, and the coaches assigned to that venue.
diff --git a/app/clubs/coaches/page.tsx b/app/clubs/coaches/page.tsx
index acf27dc..f34fcac 100644
--- a/app/clubs/coaches/page.tsx
+++ b/app/clubs/coaches/page.tsx
@@ -1,8 +1,15 @@
+import { redirect } from "next/navigation";
+import { resolveClubFromSession } from "@/app/api/clubs/club-route-helpers";
 import { ClubCoachesPageClient } from "@/components/club-coaches-page-client";

 export const dynamic = "force-dynamic";

-export default function ClubCoachesPage() {
+export default async function ClubCoachesPage() {
+  const result = await resolveClubFromSession();
+  if (!result.ok) {
+    redirect("/coaches");
+  }
+
   return (
     <main className="min-h-screen bg-[radial-gradient(circle_at_top,_rgba(196,214,0,0.12),_transparent_30%),linear-gradient(180deg,#080b07_0%,#0d120d_46%,#0a0f09_100%)] text-white">
       <div className="mx-auto max-w-6xl px-6 py-8 sm:py-10">
diff --git a/docs/implemented-sports.md b/docs/implemented-sports.md
index 026d86e..ab50892 100644
--- a/docs/implemented-sports.md
+++ b/docs/implemented-sports.md
@@ -14,6 +14,7 @@
 - `/coaches/settings` now also lets the coach assign existing Ballbox players to concrete occupied slots, track upcoming taken hours, and keep a student roster with WhatsApp / Telegram contact fields.
 - `/clubs` now opens as a club-only service home right after club sign-in/sign-up, showing service cards where `Entrenadores` is the active path into the existing club coaches workspace and the rest stay marked `Proximamente`.
 - `/clubs/coaches` now opens on a club workspace with top-level `Calendar`, `Analytics`, `Sedes`, and `Profesores` sections: calendar shows the current week's coach availability/reservations with sede/coach/court filters plus quick manual class loading, analytics shows professor/reservation money splits, `Sedes` handles venue creation and quick venue reservation settings, and `Profesores` handles invite links plus the club coach table.
+- `/clubs/coaches` now checks the club session during page render too, so the `Entrenadores` card cannot land on a client-only shell that later bounces authenticated club users back to `/coaches`.
 - `/clubs/venues/[venueId]` now gives each venue its own configuration screen, with venue opening/closing time, weekly coach hours, external-coach availability, reservation settings, club-coach discount setup, court setup, and venue-specific coach assignment.
 - Existing club/venue setting edits now auto-save in place and clickable panels/links use stronger accent styling to separate actions from read-only information.
 - Authenticated coach/club screens now share the same top navbar with section tabs plus a profile-initial menu for sign out; the old corner text links and dedicated explainer hero panels are gone.


Did fix.

What changed:
- `app/clubs/coaches/page.tsx`
  - now checks club session on server before render
  - if no valid club session, redirects to `/coaches`
  - this stops client shell from loading first and then bouncing after `Entrenadores` click

Also updated:
- `PLAN.md`
- `docs/implemented-sports.md`

Important:
- `pnpm typecheck` fails, but not from this fix.
- Repo already has big existing Prisma/type drift errors all over sports/account files.
- My change itself is small and clean in diff.

Why this likely fixes your bug:
- before, `/clubs/coaches` rendered without page-level auth guard
- then client fetched `/api/clubs/coaches`
- if that fetch hit unauthorized/state mismatch, user got thrown back to `/coaches`
- now route guards at entry, same as `/clubs`

Branch:
- `fix/login-entrenadores`

If want, me do next:
1. run app and test flow locally
2. commit fix
3. open PR


commit yo main direct
fix issues if clear, or ask questions if not


Need confirm because direct push main explicit asked yes. Need commit on branch then push main direct maybe checkout main fast-forward/cherry-pick. Need inspect git status.

git status --short --branch && git log --oneline --decorate -n 5


## fix/login-entrenadores...origin/main
 M PLAN.md
 M app/clubs/coaches/page.tsx
 M docs/implemented-sports.md
1ba63f7 (HEAD -> fix/login-entrenadores, origin/main, origin/HEAD, main) force redeploy
39bdcce Merge pull request #25 from sebasfavaron/FelipeVersion
129e317 fix CI errors
edd7b44 Merge branch 'main' into FelipeVersion
e7ff23e Dashboard principal mostrando todos los servicios para clubes, calendario como view principal para coahces y profesores


Need commit and push main direct.

git add app/clubs/coaches/page.tsx PLAN.md docs/implemented-sports.md && git commit -m "fix club coaches auth redirect"

git checkout main && git pull --ff-only origin main && git cherry-pick fix/login-entrenadores && git push origin main


[fix/login-entrenadores 7cbe64a] fix club coaches auth redirect
 3 files changed, 10 insertions(+), 1 deletion(-)


fatal: Unable to create '/mnt/rpi/repos/ballbox/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

Command exited with code 128


Need clear lock if stale.

test -f .git/index.lock && ls -l .git/index.lock && rm -f .git/index.lock; git checkout main && git pull --ff-only origin main && git cherry-pick 7cbe64a && git push origin main