catalogue operations, db migr and so on.

pre release version.
This commit is contained in:
2026-03-11 20:26:38 +07:00
parent 1af0cf1826
commit 7f4f8a883d
17 changed files with 284 additions and 63 deletions

View File

@@ -1,5 +1,5 @@
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select, update
from sqlalchemy import select
from sqlalchemy.sql.expression import func
from typing import Optional
@@ -32,13 +32,9 @@ class ProductRepository:
async def add_product_file_id(
self, session: AsyncSession, product_id: int, *, file_id: str
) -> None:
stmt = (
update(Product)
.where(Product.id == product_id)
.where(Product.file_id is None)
.values(file_id=file_id)
)
await session.execute(stmt)
product = await self.get_product_by_id(session, product_id)
product.file_id = file_id
await session.commit()
async def search(