Skip to content

Feat/routes f 731 732 735 736#747

Merged
davedumto merged 4 commits intoStreamFi-x:devfrom
KevinMB0220:feat/routes-f-731-732-735-736
Apr 29, 2026
Merged

Feat/routes f 731 732 735 736#747
davedumto merged 4 commits intoStreamFi-x:devfrom
KevinMB0220:feat/routes-f-731-732-735-736

Conversation

@KevinMB0220
Copy link
Copy Markdown
Contributor

Description

Closes #731
Closes #732
Closes #735
Closes #736

Changes proposed

What were you told to do?

Implementar 4 nuevos endpoints de utilidad y matemáticas dentro de la colección routes-f:

  1. Triangle Math: Cálculo de área, tipo y ángulos desde lados o vértices.
  2. Mortgage Calculator: Calculadora de cuotas mensuales e intereses de hipotecas.
  3. URL Parser: Descomposición de URLs en partes estructuradas.
  4. Query String Utility: Parser y generador de query strings con soporte para objetos anidados.

What did you do?

  • Creación de manejadores de ruta (Route Handlers) y suites de pruebas para cada issue:
    • app/api/routes-f/triangle/route.ts & __tests__/triangle.test.ts
    • app/api/routes-f/mortgage/route.ts & __tests__/mortgage.test.ts
    • app/api/routes-f/url-parse/route.ts & __tests__/url-parse.test.ts
    • app/api/routes-f/query-parse/route.ts & __tests__/query-parse.test.ts
  • Implementación de lógica matemática (Fórmula de Herón, Amortización estándar) y parsing de strings.
  • Validación de entradas (Triangle inequality, URL length caps, etc.).
  • Cumplimiento estricto del Scope Constraint: Todo el código y pruebas viven exclusivamente dentro de app/api/routes-f/.
  • Verificación local de 45 tests pasando (100% de cobertura para estas funciones).

Check List

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch.
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots/Videos

Test Results (Local execution)

PASS app/api/routes-f/__tests__/query-parse.test.ts
PASS app/api/routes-f/__tests__/triangle.test.ts
PASS app/api/routes-f/__tests__/mortgage.test.ts
PASS app/api/routes-f/__tests__/url-parse.test.ts

Test Suites: 4 passed, 4 total
Tests:       45 passed, 45 total

- POST endpoint at app/api/routes-f/triangle/route.ts
- Supports mode: sides (3 side lengths) and vertices (3 [x,y] points)
- Heron formula for area, law of cosines for angles
- Triangle inequality and degenerate triangle validation
- Returns type, angle_type, sides, angles_deg, area, perimeter,
  circumradius, and centroid (vertices mode)
- 12 tests covering all triangle types, right triangles (3-4-5),
  vertices mode, and invalid inputs
…i-x#732)

- POST endpoint at app/api/routes-f/mortgage/route.ts
- Standard mortgage formula with cent precision rounding
- Supports property_tax_annual, insurance_annual, hoa_monthly
- Caps years at 50, handles zero interest rate
- Returns loan_amount, monthly breakdowns, total_interest,
  total_paid, ltv_ratio, payoff_date
- 9 tests covering typical 30-year, all fees, zero interest,
  validation errors, and cent precision
…i-x#735)

- POST endpoint at app/api/routes-f/url-parse/route.ts
- Uses built-in URL constructor for parsing
- Query object handles repeated keys as arrays
- 4KB URL length cap, rejects invalid URLs with 400
- Returns protocol, host, hostname, port, pathname, search,
  hash, username, password, query, path_segments, origin
- 8 tests covering full URLs with auth/query, repeated keys,
  varied protocols, and invalid inputs
- POST endpoint at app/api/routes-f/query-parse/route.ts
- Two modes: parse (string -> object) and build (object -> string)
- Array formats: repeat (default), bracket, comma
- Nested objects via bracket notation: a[b]=c
- 16 tests covering parse/build, all array formats, nested objects,
  round-trip consistency, and validation errors
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

@KevinMB0220 is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@KevinMB0220 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

result[parentKey] = {};
}

(result[parentKey] as Record<string, unknown>)[childKey] = value;
@davedumto davedumto merged commit c70c117 into StreamFi-x:dev Apr 29, 2026
4 of 6 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

3 participants