You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
699 B
20 lines
699 B
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from db.models.conveer import DBConveer
|
|
from db.repository.analytics import AnalyticsRepository
|
|
|
|
|
|
class AnalyticsManager:
|
|
|
|
@classmethod
|
|
async def get_by_filters(cls,
|
|
session: AsyncSession,
|
|
start_date: Optional[datetime],
|
|
end_date: Optional[datetime]) -> list[DBConveer]:
|
|
datas: list[DBConveer] = await AnalyticsRepository(session).get_analytic(start_date=start_date,
|
|
end_date=end_date)
|
|
return datas
|