20 lines
690 B
Python
20 lines
690 B
Python
from fastapi import APIRouter, HTTPException
|
|
|
|
from app.schemas.parcel import ParcelDetail, ParcelSearchRequest, ParcelSearchResponse
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.post("/search", response_model=ParcelSearchResponse)
|
|
async def search_parcels(payload: ParcelSearchRequest) -> ParcelSearchResponse:
|
|
"""Search parcels by filters + scoring.
|
|
|
|
TODO Stage 2b: PostGIS query + scorer service.
|
|
"""
|
|
return ParcelSearchResponse(items=[], total=0)
|
|
|
|
|
|
@router.get("/{parcel_id}", response_model=ParcelDetail)
|
|
async def get_parcel(parcel_id: str) -> ParcelDetail:
|
|
"""TODO Stage 2b: fetch parcel by id from DB."""
|
|
raise HTTPException(status_code=501, detail="Not implemented yet")
|