Initial commit: CI Agent competitive-intelligence monitoring app
FastAPI + Celery + Next.js + Postgres/Redis app with company monitoring, source collection, LLM-based change analysis, enrichment, and account security (Turnstile, escalating lockout, email verification).
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.models.notification_delivery import NotificationDelivery
|
||||
|
||||
|
||||
class NotificationDeliveryRepository:
|
||||
def __init__(self, db: AsyncSession) -> None:
|
||||
self.db = db
|
||||
|
||||
async def create(self, delivery: NotificationDelivery) -> NotificationDelivery:
|
||||
self.db.add(delivery)
|
||||
await self.db.flush()
|
||||
return delivery
|
||||
|
||||
async def list_for_alert(self, alert_id: uuid.UUID) -> list[NotificationDelivery]:
|
||||
result = await self.db.execute(
|
||||
select(NotificationDelivery).where(NotificationDelivery.alert_id == alert_id)
|
||||
)
|
||||
return list(result.scalars().all())
|
||||
Reference in New Issue
Block a user