Skip to content

guard22/test-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speed Task — Tasks & Rewards

This repo is intentionally small. Two tests are failing on purpose.

Quick Start

pnpm install
pnpm test

Optional (run UI + API):

pnpm dev

API: http://localhost:3000 Web: http://localhost:5173

Tasks

1) Fix: validation + status codes

Route: POST /api/users/register

Expected behavior:

  • Missing telegramId -> 400
  • New user -> 201
  • Existing user (same telegramId) -> 200 and same user id

2) Feature: idempotent notes

Route: POST /api/notes

Expected behavior:

  • title required, max 120 -> 400 when invalid
  • externalId required
  • First create -> 201
  • Duplicate externalId -> 200 and same note id
  • Concurrent requests must not create duplicates

3) Frontend

Implement a minimal UI:

  • Form: externalId, title
  • Show list of notes
  • Show error state on failure

Rules

  • Do not refactor unrelated code.
  • Keep changes focused and minimal.
  • Ensure idempotency behavior is covered by tests.

Submission

  • Share the repo link or PR.
  • If something is incomplete, say what and why.

There are TODO markers in the code to guide you.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •