docs: JSDoc and comments for schema, core services and middleware#187
docs: JSDoc and comments for schema, core services and middleware#187saggacce wants to merge 1 commit into
Conversation
Schema (schema.prisma): - All 23 models documented with purpose, field semantics and gotchas - Enum values explained - Event stream hypertable warning noted - JSON field shapes described Services: - match-service.ts: file overview, all interfaces documented, function JSDoc with @param/@returns/@throws Middleware: - require-auth.ts: auth flow, SessionUser shape, cookie name - error-handler.ts: three-tier error strategy, AppError usage example - require-role.ts: teamId resolution order, PLATFORM_ADMIN bypass - require-platform-admin.ts: usage pattern, role check - auth-rate-limit.ts: WSL fallback strategy, rate limit config Worker: - client.ts: rate limit rationale, User-Agent updated to RiftLine/1.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91d61b698c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// here — it is hardcoded to full access in the permissions service. | ||
| /// Shape: { PLATFORM_ADMIN: { "teams.own.view": true, ... }, MANAGER: {...}, ... } | ||
| /// See permissions-service.ts for the full PermissionKey union type. | ||
| model PermissionsConfig { |
There was a problem hiding this comment.
Add a migration for the permissions table
This adds a new Prisma model, but the commit does not include a corresponding workers/data-sync/prisma/migrations/.../migration.sql entry. In environments that deploy with Prisma migrations, migrate deploy will apply only the checked-in SQL migrations and will not create the PermissionsConfig table, so any generated client or follow-up code that uses db.permissionsConfig will fail against the deployed database. Please either add the migration for this model or remove the schema change from this docs-only commit.
Useful? React with 👍 / 👎.
Qué se hizo
Primera pasada de documentación — ficheros de mayor impacto para un desarrollador nuevo.
Ficheros documentados
Schema (
workers/data-sync/prisma/schema.prisma)Servicios
match-service.ts— @fileoverview, todas las interfaces documentadas, JSDoc con @param/@returns/@throwsMiddleware (5 ficheros)
require-auth.ts— flujo de auth, SessionUser shape, nombre de cookieerror-handler.ts— estrategia de 3 niveles, ejemplo de AppErrorrequire-role.ts— orden de resolución de teamId, bypass de PLATFORM_ADMINrequire-platform-admin.ts— patrón de uso, lógica de rolauth-rate-limit.ts— estrategia WSL fallback, config de rate limitWorker
workers/data-sync/src/client.ts— rationale del rate limit, User-Agent actualizadoPendiente — Issue #186 para Codex
Resto de ficheros: services (sync, team, analyst, player...), routes (16 ficheros), frontend hooks, components y pages.