feat: get deal barcodes pdf
This commit is contained in:
@ -79,10 +79,27 @@ async def delete_product(
|
||||
response_model=GetProductBarcodePdfResponse,
|
||||
)
|
||||
async def get_product_barcode_pdf(
|
||||
request: GetProductBarcodePdfRequest, session: SessionDependency
|
||||
session: SessionDependency,
|
||||
request: GetProductBarcodePdfRequest,
|
||||
):
|
||||
service = BarcodePrinterService(session)
|
||||
filename, base64_string = await service.generate_base64(request)
|
||||
filename, base64_string = await service.generate_product_base64(request)
|
||||
return GetProductBarcodePdfResponse(
|
||||
base64_string=base64_string, filename=filename, mime_type="application/pdf"
|
||||
)
|
||||
|
||||
|
||||
@router.post(
|
||||
"/barcode/for-deal/get-pdf",
|
||||
operation_id="get_deal_barcodes_pdf",
|
||||
response_model=GetDealBarcodesPdfResponse,
|
||||
)
|
||||
async def get_deal_barcodes_pdf(
|
||||
session: SessionDependency,
|
||||
request: GetDealBarcodesPdfRequest,
|
||||
):
|
||||
service = BarcodePrinterService(session)
|
||||
filename, base64_string = await service.generate_deal_base64(request)
|
||||
return GetProductBarcodePdfResponse(
|
||||
base64_string=base64_string, filename=filename, mime_type="application/pdf"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user