Fix test issues

This commit is contained in:
Urtzi Alfaro
2025-07-19 12:51:28 +02:00
parent 72a7c0a0a6
commit 42097202d2
5 changed files with 259 additions and 72 deletions

View File

@@ -16,7 +16,7 @@ from app.core.database import get_db
from app.core.auth import get_current_user, AuthInfo
from app.services.sales_service import SalesService
from app.services.data_import_service import DataImportService
from app.services.messaging import data_publisher
from app.services.messaging import publish_sales_created
from app.schemas.sales import (
SalesDataCreate,
SalesDataResponse,
@@ -44,7 +44,7 @@ async def create_sales_record(
# Publish event (with error handling)
try:
await data_publisher.publish_sales_created({
await publish_sales_created({
"tenant_id": str(sales_data.tenant_id),
"product_name": sales_data.product_name,
"quantity_sold": sales_data.quantity_sold,
@@ -149,7 +149,7 @@ async def import_sales_json(
if result["success"]:
# Publish event (with error handling)
try:
await data_publisher.publish_data_imported({
await publish_data_imported({
"tenant_id": str(import_data.tenant_id),
"type": "json_import",
"records_created": result["records_created"],