fixed uid mapping to id

This commit is contained in:
ValueOn AG 2026-01-21 10:59:44 +01:00
parent f3b01c823e
commit b0d89b9080
2 changed files with 7 additions and 7 deletions

View file

@ -43,7 +43,7 @@ class UserMandateCreate(BaseModel):
class UserMandateResponse(BaseModel):
"""Response model for user mandate membership"""
userMandateId: str
id: str # UserMandate ID as primary key
userId: str
mandateId: str
roleIds: List[str]
@ -52,11 +52,11 @@ class UserMandateResponse(BaseModel):
class MandateUserInfo(BaseModel):
"""User info within a mandate context"""
id: str # UserMandate ID as primary key
userId: str
username: str
email: Optional[str]
fullName: Optional[str]
userMandateId: str
roleIds: List[str]
roleLabels: List[str] # Resolved role labels for display
enabled: bool
@ -379,11 +379,11 @@ async def listMandateUsers(
roleLabels.append(roleId) # Fallback to ID if not found
result.append(MandateUserInfo(
id=um.get("id"), # UserMandate ID as primary key
userId=str(user.id),
username=user.username,
email=user.email,
fullName=user.fullName,
userMandateId=um.get("id"),
roleIds=roleIds,
roleLabels=roleLabels,
enabled=um.get("enabled", True)
@ -500,7 +500,7 @@ async def addUserToMandate(
)
return UserMandateResponse(
userMandateId=str(userMandate.id),
id=str(userMandate.id), # UserMandate ID as primary key
userId=data.targetUserId,
mandateId=targetMandateId,
roleIds=data.roleIds,
@ -690,7 +690,7 @@ async def updateUserRolesInMandate(
)
return UserMandateResponse(
userMandateId=str(membership.id),
id=str(membership.id), # UserMandate ID as primary key
userId=targetUserId,
mandateId=targetMandateId,
roleIds=roleIds,

View file

@ -722,11 +722,11 @@ class FeatureInstanceUserCreate(BaseModel):
class FeatureInstanceUserResponse(BaseModel):
"""Response model for a user in a feature instance"""
id: str # Use the FeatureAccess ID as primary key
userId: str
username: str
email: Optional[str]
fullName: Optional[str]
featureAccessId: str
roleIds: List[str]
roleLabels: List[str]
enabled: bool
@ -803,11 +803,11 @@ async def listFeatureInstanceUsers(
roleLabels.append(roles[0].get("roleLabel", ""))
result.append(FeatureInstanceUserResponse(
id=featureAccessId, # FeatureAccess ID as primary key
userId=userId,
username=user.get("username", ""),
email=user.get("email"),
fullName=user.get("fullName"),
featureAccessId=featureAccessId,
roleIds=roleIds,
roleLabels=roleLabels,
enabled=fa.get("enabled", True)