Skip to content

LVT-40: Warn user if manually entered match info doesn't match schedule#53

Open
jackattack-4 wants to merge 5 commits into
mainfrom
jackshim415/lvt-40-warn-user-if-manually-entered-match-info-doesnt-match
Open

LVT-40: Warn user if manually entered match info doesn't match schedule#53
jackattack-4 wants to merge 5 commits into
mainfrom
jackshim415/lvt-40-warn-user-if-manually-entered-match-info-doesnt-match

Conversation

@jackattack-4

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a manager endpoint intended to validate whether a manually-entered match reference (tournament/team/match number/type) corresponds to an existing scheduled match, supporting UI warnings when user input doesn’t match the schedule.

Changes:

  • Added a new Manager API route (GET /v1/manager/checkmatch) and OpenAPI documentation for it.
  • Implemented checkMatchExists handler that ensures tournament matches are loaded and queries teamMatchData for the requested match row.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
src/routes/manager/manager.routes.ts Registers OpenAPI spec for /checkmatch and wires the Express route into the manager router.
src/handler/manager/checkMatchExists.ts New handler to validate query params, load tournament matches, and look up teamMatchData for the requested match.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/routes/manager/manager.routes.ts
Comment thread src/routes/manager/manager.routes.ts
Comment thread src/routes/manager/manager.routes.ts
Comment thread src/handler/manager/checkMatchExists.ts Outdated
Comment thread src/handler/manager/checkMatchExists.ts Outdated
Comment thread src/handler/manager/checkMatchExists.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@railway-app

railway-app Bot commented Jul 3, 2026

Copy link
Copy Markdown

🚅 Deployed to the lovat-server-pr-53 environment in lovat

Service Status Web Updated (UTC)
lovat-server ✅ Success (View Logs) Web Jul 3, 2026 at 6:44 pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

router.get("/teams", requireAuth, getTeams);
router.get("/tournaments", requireAuth, getTournaments);

router.get("/checkmatch", checkMatchExists);
Comment on lines +140 to +159
request: {
query: z.object({
tournamentKey: z.string(),
teamNumber: z.coerce.number().int(),
matchNumber: z.coerce.number().int(),
isElim: z.coerce.boolean(),
}),
},
responses: {
200: {
description: "Match Data Row (or null if not found)",
content: {
"application/json": { schema: TeamMatchDataSchema.nullable() },
},
},
400: { description: "Invalid parameters" },
401: { description: "Unauthorized" },
},
security: [],
});
Comment on lines +14 to +18
tournamentKey: z.string(),
teamNumber: z.coerce.number().int(),
matchNumber: z.coerce.number().int(),
isElim: z.coerce.boolean(),
})
Comment on lines +35 to +37
matchType: params.isElim
? MatchType.QUALIFICATION
: MatchType.ELIMINATION,
Comment on lines +42 to +45
res
.status(200)
.send({ match, alliance: Number(match.key[-1]) < 3 ? "RED" : "BLUE" });
return;
TournamentSchema,
} from "../../lib/prisma-zod.js";
import { requireVerifiedTeam } from "../../lib/middleware/requireVerifiedTeam.js";
import { MatchType } from "@prisma/client";
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.

2 participants