Skip to content

Feat/commentary api - #6

Merged
itsXILO merged 6 commits into
mainfrom
feat/commentary-api
Aug 4, 2026
Merged

Feat/commentary api#6
itsXILO merged 6 commits into
mainfrom
feat/commentary-api

Conversation

@itsXILO

@itsXILO itsXILO commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added match commentary endpoints for viewing and creating commentary.
    • Commentary listings support result limits, chronological ordering, and structured responses.
    • Commentary submissions now validate required fields and optional metadata, tags, and sequence values.
    • Invalid requests return clear validation errors, with listing results capped at 100 entries.

@itsXILO
itsXILO merged commit d013890 into main Aug 4, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d87fc49-299d-4441-9692-8584e5eb83f0

📥 Commits

Reviewing files that changed from the base of the PR and between dc2f41f and a9059a4.

📒 Files selected for processing (3)
  • src/index.js
  • src/routes/commentary.js
  • src/validation/commentary.js

📝 Walkthrough

Walkthrough

The change adds Zod schemas and an Express router for listing and creating commentary. The server mounts the router at /matches/:id/commentary. Listing supports bounded limits and descending creation-time ordering.

Changes

Commentary API

Layer / File(s) Summary
Commentary validation contracts
src/validation/commentary.js
Defines a maximum listing limit of 100. Validates query limits and commentary creation fields, including metadata and tags.
Commentary route handlers
src/routes/commentary.js
Adds validated listing and creation handlers. The handlers query or insert commentary records, normalize sequence values, return JSON responses, and handle server errors.
Router mounting
src/index.js
Imports commentaryRouter and mounts it at /matches/:id/commentary.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant commentaryRouter
  participant CommentaryValidation
  participant Database
  Client->>commentaryRouter: Request commentary
  commentaryRouter->>CommentaryValidation: Validate match, query, or body
  CommentaryValidation-->>commentaryRouter: Validated input
  commentaryRouter->>Database: Query or insert commentary
  Database-->>commentaryRouter: Commentary records or created record
  commentaryRouter-->>Client: JSON response
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/commentary-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot mentioned this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant