Fix: add future annotations to all files, fix date field name shadowing type in RewardRedeemRequest

This commit is contained in:
claude 2026-03-15 00:42:13 +00:00
parent 16d00fbd1b
commit 7846e3445d
32 changed files with 70 additions and 5 deletions

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Annotated
from datetime import date
from fastapi import APIRouter, Depends, Query

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Annotated
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy import select

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Annotated
from datetime import date
from decimal import Decimal

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Annotated
from datetime import datetime, timezone
import uuid as uuid_mod

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Annotated
from decimal import Decimal
from fastapi import APIRouter, Depends

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Annotated
from datetime import date
import uuid as uuid_mod
@ -141,7 +143,7 @@ async def redeem(
user: Annotated[User, Depends(get_current_user)],
db: Annotated[AsyncSession, Depends(get_db)],
):
result = await redeem_reward(db, user.id, uuid_mod.UUID(reward_id), req.date)
result = await redeem_reward(db, user.id, uuid_mod.UUID(reward_id), req.redemption_date)
if not result["success"]:
raise HTTPException(status_code=400, detail=result["reason"])
return result

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Annotated
from datetime import date, timedelta
import uuid as uuid_mod