feat: billing guest access
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from typing import Union
|
||||
|
||||
from fastapi import HTTPException
|
||||
from sqlalchemy import select, func, Integer, update
|
||||
from sqlalchemy.orm import selectinload
|
||||
@@ -5,25 +7,17 @@ from sqlalchemy.orm import selectinload
|
||||
import utils.barcodes
|
||||
from backend import config
|
||||
from external.s3_uploader.uploader import S3Uploader
|
||||
from models.product import Product, ProductBarcode, ProductImage
|
||||
from models import User
|
||||
from models.product import Product, ProductImage
|
||||
from schemas.base import PaginationSchema
|
||||
from services.base import BaseService
|
||||
from schemas.product import *
|
||||
from services.base import BaseService
|
||||
from utils.dependecies import is_valid_pagination
|
||||
|
||||
|
||||
class ProductService(BaseService):
|
||||
|
||||
async def create(self, request: ProductCreateRequest) -> ProductCreateResponse:
|
||||
# Unique article validation
|
||||
# existing_product_query = await self.session.execute(
|
||||
# select(Product)
|
||||
# .where(Product.client_id == request.client_id,
|
||||
# Product.article == request.article)
|
||||
# )
|
||||
# existing_product = existing_product_query.first()
|
||||
# if existing_product:
|
||||
# return ProductCreateResponse(ok=False, message='Товар с таким артикулом уже существует у клиента')
|
||||
|
||||
# Creating product
|
||||
product_dict = request.dict()
|
||||
|
||||
Reference in New Issue
Block a user