Summary
Add a Roman numeral converter at app/api/routes-f/roman/route.ts. Convert numbers to Roman numerals and vice versa (1–3999).
⚠️ Scope Constraint — READ BEFORE STARTING
All files for this task must live inside app/api/routes-f/. This includes:
- The route handler (e.g.
app/api/routes-f/<feature>/route.ts)
- Any helpers/utilities (e.g.
app/api/routes-f/<feature>/_lib/helpers.ts)
- Any types (e.g.
app/api/routes-f/<feature>/_lib/types.ts)
- Any tests (e.g.
app/api/routes-f/<feature>/__tests__/route.test.ts)
Do not modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional — it keeps these tasks independent and mergeable in any order.
Requirements
GET /api/routes-f/roman?to_roman=1994 returns { roman: "MCMXCIV" }
GET /api/routes-f/roman?to_number=MCMXCIV returns { number: 1994 }
- Valid range: 1–3999
- Must use subtractive notation (IV not IIII, IX not VIIII)
- Reject invalid Roman input (e.g.,
IIII, VV, IC) with 400
- Reject out-of-range numbers with 400
- Include unit tests covering boundary values and invalid inputs
Acceptance Criteria
Summary
Add a Roman numeral converter at
app/api/routes-f/roman/route.ts. Convert numbers to Roman numerals and vice versa (1–3999).All files for this task must live inside
app/api/routes-f/. This includes:app/api/routes-f/<feature>/route.ts)app/api/routes-f/<feature>/_lib/helpers.ts)app/api/routes-f/<feature>/_lib/types.ts)app/api/routes-f/<feature>/__tests__/route.test.ts)Do not modify, import from, or add files to
lib/,utils/,types/,components/, or anywhere else outsideapp/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional — it keeps these tasks independent and mergeable in any order.Requirements
GET /api/routes-f/roman?to_roman=1994returns{ roman: "MCMXCIV" }GET /api/routes-f/roman?to_number=MCMXCIVreturns{ number: 1994 }IIII,VV,IC) with 400Acceptance Criteria
app/api/routes-f/roman/