Start integrating the onboarding flow with backend 3

This commit is contained in:
Urtzi Alfaro
2025-09-04 23:19:53 +02:00
parent 9eedc2e5f2
commit 0faaa25e58
26 changed files with 314 additions and 767 deletions

View File

@@ -9,7 +9,7 @@ from uuid import UUID
import structlog
from app.core.database import get_db
from shared.auth.decorators import get_current_user_dep, get_current_tenant_id_dep
from shared.auth.decorators import get_current_user_dep
router = APIRouter(tags=["pos-config"])
logger = structlog.get_logger()
@@ -20,14 +20,10 @@ async def get_pos_configurations(
tenant_id: UUID = Path(..., description="Tenant ID"),
pos_system: Optional[str] = Query(None, description="Filter by POS system"),
is_active: Optional[bool] = Query(None, description="Filter by active status"),
current_tenant: str = Depends(get_current_tenant_id_dep),
db=Depends(get_db)
):
"""Get POS configurations for a tenant"""
try:
# Verify tenant access
if str(tenant_id) != current_tenant:
raise HTTPException(status_code=403, detail="Access denied to this tenant")
# TODO: Implement configuration retrieval
# This is a placeholder for the basic structure
@@ -46,15 +42,11 @@ async def get_pos_configurations(
async def create_pos_configuration(
configuration_data: Dict[str, Any],
tenant_id: UUID = Path(..., description="Tenant ID"),
current_tenant: str = Depends(get_current_tenant_id_dep),
current_user: Dict[str, Any] = Depends(get_current_user_dep),
db=Depends(get_db)
):
"""Create a new POS configuration"""
try:
# Verify tenant access
if str(tenant_id) != current_tenant:
raise HTTPException(status_code=403, detail="Access denied to this tenant")
# TODO: Implement configuration creation
logger.info("Creating POS configuration",
@@ -73,14 +65,10 @@ async def create_pos_configuration(
async def get_pos_configuration(
tenant_id: UUID = Path(..., description="Tenant ID"),
config_id: UUID = Path(..., description="Configuration ID"),
current_tenant: str = Depends(get_current_tenant_id_dep),
db=Depends(get_db)
):
"""Get a specific POS configuration"""
try:
# Verify tenant access
if str(tenant_id) != current_tenant:
raise HTTPException(status_code=403, detail="Access denied to this tenant")
# TODO: Implement configuration retrieval
return {"message": "Configuration details", "id": str(config_id)}
@@ -96,14 +84,10 @@ async def update_pos_configuration(
configuration_data: Dict[str, Any],
tenant_id: UUID = Path(..., description="Tenant ID"),
config_id: UUID = Path(..., description="Configuration ID"),
current_tenant: str = Depends(get_current_tenant_id_dep),
db=Depends(get_db)
):
"""Update a POS configuration"""
try:
# Verify tenant access
if str(tenant_id) != current_tenant:
raise HTTPException(status_code=403, detail="Access denied to this tenant")
# TODO: Implement configuration update
return {"message": "Configuration updated successfully"}
@@ -118,14 +102,10 @@ async def update_pos_configuration(
async def delete_pos_configuration(
tenant_id: UUID = Path(..., description="Tenant ID"),
config_id: UUID = Path(..., description="Configuration ID"),
current_tenant: str = Depends(get_current_tenant_id_dep),
db=Depends(get_db)
):
"""Delete a POS configuration"""
try:
# Verify tenant access
if str(tenant_id) != current_tenant:
raise HTTPException(status_code=403, detail="Access denied to this tenant")
# TODO: Implement configuration deletion
return {"message": "Configuration deleted successfully"}
@@ -140,14 +120,10 @@ async def delete_pos_configuration(
async def test_pos_connection(
tenant_id: UUID = Path(..., description="Tenant ID"),
config_id: UUID = Path(..., description="Configuration ID"),
current_tenant: str = Depends(get_current_tenant_id_dep),
db=Depends(get_db)
):
"""Test connection to POS system"""
try:
# Verify tenant access
if str(tenant_id) != current_tenant:
raise HTTPException(status_code=403, detail="Access denied to this tenant")
# TODO: Implement connection testing
return {