Skip to content

feat(routes-f): roman numeral converter (1 to 3999) #587

@davedumto

Description

@davedumto

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

  • Round-trip (number -> roman -> number) is lossless for 1–3999
  • Subtractive notation strictly enforced
  • Invalid inputs rejected
  • Tests cover boundaries (1, 3999) and known tricky cases (4, 9, 40, 90, 400, 900)
  • All files inside app/api/routes-f/roman/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions