MukeshKapoor25 commited on
Commit
60b9eb5
·
1 Parent(s): 4fe4dba

fix: Correct type hint for user_info in StaffMobileOTPLoginResponse and adjust router definition placement

Browse files
app/system_users/controllers/router.py CHANGED
@@ -1,3 +1,4 @@
 
1
  from pydantic import BaseModel, Field
2
 
3
  # --- Staff Mobile OTP Login ---
@@ -9,7 +10,7 @@ class StaffMobileOTPLoginResponse(BaseModel):
9
  access_token: str
10
  token_type: str = "bearer"
11
  expires_in: int
12
- user_info: UserInfoResponse
13
 
14
  @router.post("/staff/login/mobile-otp", response_model=StaffMobileOTPLoginResponse, summary="Staff login with mobile and OTP")
15
  async def staff_login_mobile_otp(
@@ -57,6 +58,7 @@ from typing import List, Optional
57
  from fastapi import APIRouter, Depends, HTTPException, status, Request
58
  from fastapi.security import HTTPAuthorizationCredentials
59
 
 
60
  from app.system_users.services.service import SystemUserService
61
  from app.core.config import settings
62
  from app.system_users.schemas.schema import (
@@ -84,6 +86,7 @@ from app.core.logging import get_logger
84
 
85
  logger = get_logger(__name__)
86
 
 
87
  router = APIRouter(
88
  prefix="/auth",
89
  tags=["Authentication & User Management"]
 
1
+
2
  from pydantic import BaseModel, Field
3
 
4
  # --- Staff Mobile OTP Login ---
 
10
  access_token: str
11
  token_type: str = "bearer"
12
  expires_in: int
13
+ user_info: 'UserInfoResponse'
14
 
15
  @router.post("/staff/login/mobile-otp", response_model=StaffMobileOTPLoginResponse, summary="Staff login with mobile and OTP")
16
  async def staff_login_mobile_otp(
 
58
  from fastapi import APIRouter, Depends, HTTPException, status, Request
59
  from fastapi.security import HTTPAuthorizationCredentials
60
 
61
+
62
  from app.system_users.services.service import SystemUserService
63
  from app.core.config import settings
64
  from app.system_users.schemas.schema import (
 
86
 
87
  logger = get_logger(__name__)
88
 
89
+ # Move router definition above its first usage
90
  router = APIRouter(
91
  prefix="/auth",
92
  tags=["Authentication & User Management"]