feat: spacers between barcodes of diff products, avoid product cut in deal document, deal document refactoring

This commit is contained in:
2024-09-30 01:36:31 +04:00
parent 413d8755cc
commit 61d379e7dc
9 changed files with 271 additions and 240 deletions

View File

@@ -1,4 +1,5 @@
from typing import Dict
from io import BytesIO
from typing import Dict, Tuple
from sqlalchemy import select, update, insert
from sqlalchemy.orm import selectinload, joinedload
@@ -76,8 +77,7 @@ class BarcodeService(BaseService):
)
return GetProductBarcodeResponse(barcode=barcode)
async def get_barcode_pdf(self, request: GetProductBarcodePdfRequest) -> GetProductBarcodeResponse:
# get product by id
async def get_barcode_pdf(self, request: GetProductBarcodePdfRequest) -> Tuple[str, BytesIO]:
stmt = (
select(Product)
.options(
@@ -102,7 +102,7 @@ class BarcodeService(BaseService):
)
return filename, pdf_buffer
async def get_deal_barcodes_pdf(self, request: GetDealProductsBarcodesPdfRequest) -> GetProductBarcodeResponse:
async def get_deal_barcodes_pdf(self, request: GetDealProductsBarcodesPdfRequest) -> Tuple[str, BytesIO]:
stmt = (
select(Deal)
.options(