Products Rendering, removal of deprecated files

This commit is contained in:
2026-02-06 20:08:05 +07:00
parent 0e95c2986a
commit d8cad25f33
17 changed files with 277 additions and 62 deletions

View File

@@ -1,18 +0,0 @@
from typing import Optional
from sqlalchemy.ext.asyncio import AsyncSession
from dto.categories import CategoryDTO
from repositories import CategoriesRepository
class CategoryService:
def __init__(self, category_repo: CategoriesRepository):
self.category_repo = category_repo
async def get_children(
self, session: AsyncSession, parent_id: Optional[int] = None
) -> list[CategoryDTO]:
result = await self.category_repo.get_category_by_parent_id(session, parent_id)
return [
CategoryDTO(x.id, x.name) for x in result
] # FIXME: Optimization may be required here - O(n)