Initial commit - Migrated to Dev environment

This commit is contained in:
2026-02-03 19:55:45 +00:00
commit a34e5b7976
3518 changed files with 481663 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
from datetime import datetime, timedelta
from sqlalchemy import select
from app.models.user import User
from app.models.vehicle import Vehicle
from app.core.email import send_expiry_notification
async def check_expiring_documents(db: AsyncSession, background_tasks: BackgroundTasks):
# Példa: Műszaki vizsga lejárata 30 napon belül
threshold = datetime.now().date() + timedelta(days=30)
result = await db.execute(
select(Vehicle, User).join(User).where(Vehicle.mot_expiry_date <= threshold)
)
for vehicle, user in result.all():
send_expiry_notification(background_tasks, user.email, f"Műszaki vizsga ({vehicle.license_plate})")