Skip to content

feat(contests): add contest_submissions table + SubmitToContest action#833

Open
dylanjeffers wants to merge 1 commit into
mainfrom
claude/gifted-tereshkova-989bfa
Open

feat(contests): add contest_submissions table + SubmitToContest action#833
dylanjeffers wants to merge 1 commit into
mainfrom
claude/gifted-tereshkova-989bfa

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • Adds the `contest_submissions` table (api repo, migration 0203) keyed on `(contest_id, track_id)`, with secondary indexes on `track_id` and `user_id`. Backs the new "open contest" flow where entries don't have a remix-parent track.
  • Defines a new `SubmitToContest` ManageEntity action constant in `indexer/`. Discovery is the writer; see the companion discovery PR.
  • Adds `POST /v1/events/:eventId/submit` that signs and relays a `SubmitToContest` / Event ManageEntity tx with metadata `{"track_id": }`.

This change is API-only — it doesn't process the action; that lives in the discovery indexer.

Test plan

  • `bash ddl/local-test.sh` runs migration 0203 cleanly (idempotent on re-run).
  • `go build ./... && go vet ./...` (already verified locally).
  • Hit `POST /v1/events/:eventId/submit` with a valid auth + `{"track_id": "..."}` against a dev stack and confirm the relayed tx lands a row in `contest_submissions` once discovery indexes it.
  • Negative paths: missing / non-numeric `track_id`, unknown `eventId`, unauthenticated → 4xx responses.

🤖 Generated with Claude Code

Backs the new "open contest" event flow where contest entries don't
require a remix-parent track. Defines the contest_submissions table that
discovery indexes into and registers a new ManageEntity action +
endpoint for submitting a track to a contest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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