{
    "type": "object",
    "properties": {
        "user": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Unique identifier for the user"
                },
                "name": {
                    "type": "string",
                    "description": "User's full name"
                },
                "firstName": {
                    "type": "string",
                    "description": "User's first name"
                },
                "lastName": {
                    "type": "string",
                    "description": "User's last name"
                },
                "email": {
                    "type": "string",
                    "description": "User's email address"
                },
                "phone": {
                    "type": "string",
                    "description": "User's phone number"
                },
                "username": {
                    "type": "string",
                    "description": "User's username"
                },
                "companyId": {
                    "type": "string",
                    "description": "Company ID the user belongs to"
                },
                "locationIds": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "Array of location IDs the user has access to"
                },
                "roles": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "role": {
                                "type": "string",
                                "enum": ["admin", "user", "readonly", "manager", "agent", "owner"],
                                "description": "User role"
                            },
                            "locationId": {
                                "type": "string",
                                "description": "Location ID for this role"
                            },
                            "type": {
                                "type": "string",
                                "enum": ["account", "location", "company"],
                                "description": "Role scope type"
                            }
                        }
                    },
                    "description": "User roles and permissions"
                },
                "permissions": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "Specific permissions granted to the user"
                },
                "profile": {
                    "type": "object",
                    "properties": {
                        "avatar": {
                            "type": "string",
                            "description": "URL to user's avatar image"
                        },
                        "bio": {
                            "type": "string",
                            "description": "User's biography"
                        },
                        "timezone": {
                            "type": "string",
                            "description": "User's timezone"
                        },
                        "language": {
                            "type": "string",
                            "description": "User's preferred language"
                        },
                        "title": {
                            "type": "string",
                            "description": "User's job title"
                        },
                        "department": {
                            "type": "string",
                            "description": "User's department"
                        },
                        "address": {
                            "type": "object",
                            "properties": {
                                "street": {
                                    "type": "string",
                                    "description": "Street address"
                                },
                                "city": {
                                    "type": "string",
                                    "description": "City"
                                },
                                "state": {
                                    "type": "string",
                                    "description": "State/Province"
                                },
                                "postalCode": {
                                    "type": "string",
                                    "description": "Postal/ZIP code"
                                },
                                "country": {
                                    "type": "string",
                                    "description": "Country"
                                }
                            },
                            "description": "User's address"
                        }
                    },
                    "description": "User profile information"
                },
                "preferences": {
                    "type": "object",
                    "properties": {
                        "notifications": {
                            "type": "object",
                            "properties": {
                                "email": {
                                    "type": "boolean",
                                    "description": "Email notifications enabled"
                                },
                                "sms": {
                                    "type": "boolean",
                                    "description": "SMS notifications enabled"
                                },
                                "desktop": {
                                    "type": "boolean",
                                    "description": "Desktop notifications enabled"
                                },
                                "mobile": {
                                    "type": "boolean",
                                    "description": "Mobile push notifications enabled"
                                }
                            },
                            "description": "Notification preferences"
                        },
                        "theme": {
                            "type": "string",
                            "enum": ["light", "dark", "auto"],
                            "description": "UI theme preference"
                        },
                        "dateFormat": {
                            "type": "string",
                            "description": "Preferred date format"
                        },
                        "timeFormat": {
                            "type": "string",
                            "enum": ["12h", "24h"],
                            "description": "Preferred time format"
                        }
                    },
                    "description": "User preferences"
                },
                "status": {
                    "type": "string",
                    "enum": ["active", "inactive", "pending", "suspended", "invited"],
                    "description": "User account status"
                },
                "isEmailVerified": {
                    "type": "boolean",
                    "description": "Whether the user's email is verified"
                },
                "isPhoneVerified": {
                    "type": "boolean",
                    "description": "Whether the user's phone is verified"
                },
                "isTwoFactorEnabled": {
                    "type": "boolean",
                    "description": "Whether two-factor authentication is enabled"
                },
                "lastLoginAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Last login timestamp"
                },
                "lastActiveAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Last activity timestamp"
                },
                "createdBy": {
                    "type": "string",
                    "description": "User ID who created this user"
                },
                "createdAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "User creation timestamp"
                },
                "updatedAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Last update timestamp"
                },
                "invitedAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the user was invited (if applicable)"
                },
                "activatedAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the user account was activated"
                }
            },
            "description": "User details"
        },
        "success": {
            "type": "boolean",
            "description": "Whether the request was successful"
        }
    },
    "version": 1
}
