12 lines
331 B
Python
12 lines
331 B
Python
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
from sqlmodel import Session, select
|
|
|
|
from app.database.models.shop_model import Shop
|
|
|
|
def get_shop_id_from_uuid(session: Session, shop_id: int) -> Optional[UUID]:
|
|
stmt = select(Shop).where(Shop.id == shop_id)
|
|
db_shop = session.exec(stmt).one_or_none()
|
|
return db_shop
|