Skip to content

Dev - #78

Merged
YOGESH-08 merged 171 commits into
prodfrom
dev
Sep 17, 2026
Merged

Dev#78
YOGESH-08 merged 171 commits into
prodfrom
dev

Conversation

@YOGESH-08

Copy link
Copy Markdown
Contributor

No description provided.

lakshraja and others added 30 commits August 25, 2026 15:13
namitg105 and others added 29 commits September 13, 2026 14:11
Polling Redis instead of Postgress on getresult
SubmitCode never checked attempt/purchase status before enqueueing a
submission to Judge0, unlike submitVisualSolution (Round 1) which
already gates on GetAttemptForUpdate + status "available" -> 403.
This meant a user could call POST /submit directly, skip
POST /attempts/:id entirely, and still collect the full reward on a
correct submission: EnsureAttempt silently backfills an unpaid
"bought" attempt row at result-finalize time in
finalizeSubmission, and the reward payout only checks
attempt.Status != "answered", not whether the buy-in was ever paid.

Adds a plain (non-locking) GetAttempt query mirroring
GetAttemptForUpdate's shape, and checks it in SubmitCode before any
Judge0 work happens: no attempt row, or a row still in "available",
now returns 403 "Question not purchased -- buy this question before
submitting", matching the exact wording and status code
submit_round1.go already uses for the same concept.

The decision itself is extracted into attemptAllowsSubmission(status
string) bool so it's unit-testable without a database connection.

Verified: go build, go vet, golangci-lint (0 issues), go test ./...
all pass. database/queries/attempts.sql + internal/db/sqlc/* were
regenerated via `sqlc generate` (v1.31.1, matching go.mod) -- not
hand-edited.
…-attempt

fix(submission): reject code submissions for unpurchased questions
Google login previously matched users strictly by google_id, so
accounts seeded ahead of the event (email/reg_no/role only, no
google_id) always failed with 'Account is not registered' on first
sign-in.

findUser now falls back to a lookup by verified email when no
google_id match exists, and claims the account by setting google_id
(guarded by 'WHERE google_id IS NULL' to prevent re-linking/takeover
of an already-claimed account). Adds GetUserByEmail and LinkGoogleID
sqlc queries.
- multi-target Dockerfile (api/worker/migrate), non-root
- docker-compose: add migrate + worker services, health gating
- docker-compose.dev.yml: hot-reload overlay
- fix Dockerfile.dev (missing air install, pin air for go1.25, git safe.directory)
- rewrite Makefile with .PHONY, worker/migrate/dev/clean targets
- drop MAKEFILE_COMMANDS.md, fold into README
…ogin

fix: link google_id on first login for pre-seeded accounts
chore: make Docker/Makefile setup prod-ready
Issue 57, 58 fixed GetResult timeout issue
feat: Implemented the partial scoring system
…und-control

feat(admin): implement admin dashboard and round control engine
@YOGESH-08
YOGESH-08 merged commit 0e94f79 into prod Sep 17, 2026
2 checks passed
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.

8 participants