Skip to content

Add UK API endpoints #63

@MaxGhenis

Description

@MaxGhenis

Summary

Add UK-specific API endpoints to the FastAPI backend.

Implementation

Update api/main.py and api/schemas.py with:

New Endpoints

  • POST /api/uk/calculate - Calculate UK tax impact of Gift Aid donations
  • POST /api/uk/target-donation - Calculate required donation for target net income
  • GET /api/uk/regions - Get list of UK regions (England, Scotland, Wales, NI)
  • GET /api/uk/tax-programs - Get UK Gift Aid program information

New Schemas

  • UKIncomeInput - UK income sources (employment_income, self_employment_income, etc.)
  • UKCalculateRequest - Request body for UK calculations
  • UKCalculateResponse - Response with Gift Aid metrics

Key Differences from US Endpoints

  • region instead of state_code
  • gift_aid instead of charitable_cash_donations
  • Include charity Gift Aid reclaim amount in response
  • Include donor tax relief amount in response

Acceptance Criteria

  • TDD: Tests written first
  • /api/uk/calculate returns correct tax savings
  • /api/uk/regions returns all 4 UK nations
  • Response includes both charity reclaim and donor relief
  • Proper error handling for invalid inputs

Part of #59

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions