Skip to main content

Overview

The user models handle user profiles, authentication credentials, registration, and driver-specific information for the Rodando platform.

Response Models

UserProfile

Basic public user profile information. Source: src/app/core/models/user/user.response.ts:7
interface UserProfile {
  id: string | null;
  name: string | null;
  email: string | null;
  phoneNumber?: string | null;
  profilePictureUrl?: string | null;
  createdAt?: string;
}
id
string
Unique identifier for the user (UUID). May be null for anonymous profiles.
name
string
User’s full name.
email
string
User’s email address.
phoneNumber
string
User’s phone number in international format.
profilePictureUrl
string
URL to the user’s profile picture.
createdAt
string
ISO 8601 timestamp of when the user account was created.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "John Driver",
  "email": "[email protected]",
  "phoneNumber": "+1234567890",
  "profilePictureUrl": "https://example.com/profiles/john.jpg",
  "createdAt": "2024-01-15T10:30:00Z"
}

UserListItem

Lightweight user representation for list views. Source: src/app/core/models/user/user.response.ts:21
interface UserListItem {
  id: string;
  name: string;
  email: string;
  profilePictureUrl?: string;
  userType: UserType;
  status: UserStatus;
  phoneNumber?: string;
  createdAt: string;
}
id
string
required
Unique identifier for the user (UUID).
name
string
required
User’s full name.
email
string
required
User’s email address.
profilePictureUrl
string
URL to the user’s profile picture.
userType
UserType
required
Type of user account.Enum values: passenger | driver | admin
status
UserStatus
required
Current status of the user account.Enum values: active | inactive | banned
phoneNumber
string
User’s phone number.
createdAt
string
required
ISO 8601 timestamp of account creation.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "John Driver",
  "email": "[email protected]",
  "profilePictureUrl": "https://example.com/profiles/john.jpg",
  "userType": "driver",
  "status": "active",
  "phoneNumber": "+1234567890",
  "createdAt": "2024-01-15T10:30:00Z"
}

User

Complete user object with all details. Source: src/app/core/models/user/user.response.ts:37
interface User {
  id: string;
  name: string;
  email: string;
  emailVerified: boolean;
  phoneNumber?: string;
  phoneNumberVerified: boolean;
  userType: UserType;
  profilePictureUrl?: string;
  currentLocation?: Geolocation;
  vehicles: string[];
  status: UserStatus;
  preferredLanguage?: string;
  termsAcceptedAt?: string;
  privacyPolicyAcceptedAt?: string;
  createdAt: string;
  deletedAt?: string;
}
id
string
required
Unique identifier for the user (UUID).
name
string
required
User’s full name.
email
string
required
User’s email address.
emailVerified
boolean
required
Whether the email address has been verified.
phoneNumber
string
User’s phone number in international format.
phoneNumberVerified
boolean
required
Whether the phone number has been verified.
userType
UserType
required
Type of user account.Enum values: passenger | driver | admin
profilePictureUrl
string
URL to the user’s profile picture.
currentLocation
Geolocation
User’s current geographic location.
vehicles
string[]
required
Array of vehicle IDs associated with this user (for drivers).
status
UserStatus
required
Current account status.Enum values: active | inactive | banned
preferredLanguage
string
ISO 639-1 language code (e.g., “en”, “es”, “fr”).
termsAcceptedAt
string
ISO 8601 timestamp of when the user accepted the terms of service.
privacyPolicyAcceptedAt
string
ISO 8601 timestamp of when the user accepted the privacy policy.
createdAt
string
required
ISO 8601 timestamp of account creation.
deletedAt
string
ISO 8601 timestamp of account deletion (soft delete). Null for active accounts.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "John Driver",
  "email": "[email protected]",
  "emailVerified": true,
  "phoneNumber": "+1234567890",
  "phoneNumberVerified": true,
  "userType": "driver",
  "profilePictureUrl": "https://example.com/profiles/john.jpg",
  "currentLocation": {
    "latitude": 40.7128,
    "longitude": -74.0060
  },
  "vehicles": [
    "vehicle-uuid-1",
    "vehicle-uuid-2"
  ],
  "status": "active",
  "preferredLanguage": "en",
  "termsAcceptedAt": "2024-01-15T10:30:00Z",
  "privacyPolicyAcceptedAt": "2024-01-15T10:30:00Z",
  "createdAt": "2024-01-15T10:30:00Z",
  "deletedAt": null
}

Payload Models

CreateUserPayload

Payload for creating a new user profile. Source: src/app/core/models/user/user.payload.ts:27
interface CreateUserPayload {
  name: string;
  email: string;
  userType: UserType;
  phoneNumber?: string;
  status?: UserStatus;
  profilePictureUrl?: string;
  currentLocation?: Location;
  vehicleId?: string;
  preferredLanguage?: string;
  termsAcceptedAt?: string;
  privacyPolicyAcceptedAt?: string;
}
name
string
required
User’s full name.
email
string
required
User’s email address.
userType
UserType
required
Type of user account to create.Enum values: passenger | driver | admin
phoneNumber
string
User’s phone number in international format.
status
UserStatus
Initial account status (defaults to active).Enum values: active | inactive | banned
profilePictureUrl
string
URL to the user’s profile picture.
currentLocation
Location
User’s initial location.
vehicleId
string
ID of the vehicle to associate with the driver.
preferredLanguage
string
ISO 639-1 language code (e.g., “en”, “es”).
termsAcceptedAt
string
ISO 8601 timestamp of terms acceptance.
privacyPolicyAcceptedAt
string
ISO 8601 timestamp of privacy policy acceptance.
{
  "name": "John Driver",
  "email": "[email protected]",
  "userType": "driver",
  "phoneNumber": "+1234567890",
  "status": "active",
  "profilePictureUrl": "https://example.com/profiles/john.jpg",
  "currentLocation": {
    "latitude": 40.7128,
    "longitude": -74.0060
  },
  "vehicleId": "vehicle-uuid-1",
  "preferredLanguage": "en",
  "termsAcceptedAt": "2024-01-15T10:30:00Z",
  "privacyPolicyAcceptedAt": "2024-01-15T10:30:00Z"
}

UpdateUserPayload

Payload for updating an existing user profile. All fields are optional. Source: src/app/core/models/user/user.payload.ts:46
type UpdateUserPayload = Partial<CreateUserPayload>;
...fields
Partial<CreateUserPayload>
All fields from CreateUserPayload are optional. Only include fields you want to update.
{
  "name": "John Updated Driver",
  "profilePictureUrl": "https://example.com/profiles/john-new.jpg",
  "preferredLanguage": "es"
}

RegisterUserPayload

Complete payload for registering a new user with credentials. Source: src/app/core/models/user/user.payload.ts:53
interface RegisterUserPayload {
  user: CreateUserPayload;
  credentials: CreateAuthCredentialsPayload;
}
user
CreateUserPayload
required
User profile information.
credentials
CreateAuthCredentialsPayload
required
Authentication credentials for the new user.
{
  "user": {
    "name": "John Driver",
    "email": "[email protected]",
    "userType": "driver",
    "phoneNumber": "+1234567890",
    "preferredLanguage": "en",
    "termsAcceptedAt": "2024-01-15T10:30:00Z",
    "privacyPolicyAcceptedAt": "2024-01-15T10:30:00Z"
  },
  "credentials": {
    "authenticationMethod": "local",
    "password": "SecurePassword123!",
    "mfaEnabled": false
  }
}

ChangePasswordPayload

Payload for changing a user’s password. Source: src/app/core/models/user/user.payload.ts:66
interface ChangePasswordPayload {
  newPassword: string;
  confirmPassword: string;
}
newPassword
string
required
The new password. Should meet security requirements (minimum length, complexity, etc.).Example: MiNuevaContrasenaSegura123!
confirmPassword
string
required
Confirmation of the new password. Must match newPassword exactly.Example: MiNuevaContrasenaSegura123!
{
  "newPassword": "MyNewSecurePassword123!",
  "confirmPassword": "MyNewSecurePassword123!"
}

Auxiliary Types

UserType

Enumeration of user account types. Source: src/app/core/models/user/user.auxiliary.ts:4
enum UserType {
  Passenger = 'passenger',
  Driver = 'driver',
  Admin = 'admin',
}
Passenger
string
Regular passenger user. Value: 'passenger'
Driver
string
Driver user with vehicle access. Value: 'driver'
Admin
string
Administrative user with elevated privileges. Value: 'admin'

UserStatus

Enumeration of user account statuses. Source: src/app/core/models/user/user.auxiliary.ts:12
enum UserStatus {
  Active = 'active',
  Inactive = 'inactive',
  Banned = 'banned',
}
Active
string
Account is active and in good standing. Value: 'active'
Inactive
string
Account is temporarily inactive. Value: 'inactive'
Banned
string
Account has been banned due to policy violations. Value: 'banned'

AuthMethod

Enumeration of authentication methods. Source: src/app/core/models/user/user.auxiliary.ts:19
enum AuthMethod {
  LOCAL = 'local',
  GOOGLE = 'google',
  FACEBOOK = 'facebook',
  APPLE = 'apple',
}
LOCAL
string
Local authentication with email/phone and password. Value: 'local'
GOOGLE
string
Google OAuth authentication. Value: 'google'
FACEBOOK
string
Facebook OAuth authentication. Value: 'facebook'
APPLE
string
Apple Sign In authentication. Value: 'apple'

Location

Geographic coordinates. Source: src/app/core/models/user/user.auxiliary.ts:33
interface Location {
  latitude: number;
  longitude: number;
}
latitude
number
required
Latitude coordinate (range: -90 to 90).
longitude
number
required
Longitude coordinate (range: -180 to 180).

OAuthProviders

OAuth provider identifiers. Source: src/app/core/models/user/user.auxiliary.ts:42
interface OAuthProviders {
  googleId?: string;
  facebookId?: string;
  appleId?: string;
}
googleId
string
Google OAuth user identifier.
facebookId
string
Facebook OAuth user identifier.
appleId
string
Apple OAuth user identifier.

Driver-Specific Models

DriverAvailabilitySnapshot

Current availability and location snapshot for a driver. Source: src/app/core/models/driver-availability.models.ts:10
interface DriverAvailabilitySnapshot {
  id: UUID;
  driverId: UUID;
  isOnline: boolean;
  isAvailableForTrips: boolean;
  lastLocation: { lat: number; lng: number } | null;
  lastLocationTimestamp: string | null;
  currentTripId: UUID | null;
  currentVehicleId: UUID | null;
  lastOnlineTimestamp: string | null;
  availabilityReason: AvailabilityReason | null;
  updatedAt: string;
  deletedAt: string | null;
}
id
string
required
Unique identifier for this availability snapshot (UUID).
driverId
string
required
Driver’s user ID (UUID).
isOnline
boolean
required
Whether the driver is currently online in the app.
isAvailableForTrips
boolean
required
Whether the driver is available to accept new trip assignments.
lastLocation
object
Driver’s last known geographic location.
lastLocationTimestamp
string
ISO 8601 timestamp of the last location update.
currentTripId
string
ID of the trip currently in progress (UUID). Null if not on a trip.
currentVehicleId
string
ID of the vehicle currently being used (UUID).
lastOnlineTimestamp
string
ISO 8601 timestamp of when the driver last went online.
availabilityReason
AvailabilityReason
Reason for current availability status.Enum values: OFFLINE | ON_TRIP | UNAVAILABLE
updatedAt
string
required
ISO 8601 timestamp of last update to this snapshot.
deletedAt
string
ISO 8601 timestamp of soft deletion. Null for active records.
{
  "id": "snapshot-uuid-123",
  "driverId": "550e8400-e29b-41d4-a716-446655440000",
  "isOnline": true,
  "isAvailableForTrips": true,
  "lastLocation": {
    "lat": 40.7128,
    "lng": -74.0060
  },
  "lastLocationTimestamp": "2024-03-09T14:30:00Z",
  "currentTripId": null,
  "currentVehicleId": "vehicle-uuid-1",
  "lastOnlineTimestamp": "2024-03-09T12:00:00Z",
  "availabilityReason": null,
  "updatedAt": "2024-03-09T14:30:00Z",
  "deletedAt": null
}

DriverAvailabilityPing

Compact location ping payload sent by drivers to update their location. Source: src/app/core/models/driver-availability.models.ts:31
interface DriverAvailabilityPing {
  lat?: number;
  lng?: number;
  accuracyMeters?: number;
  reportedAt?: string;
  forceSave?: boolean;
}
lat
number
Latitude coordinate of current location.
lng
number
Longitude coordinate of current location.
accuracyMeters
number
GPS accuracy in meters.
reportedAt
string
ISO 8601 timestamp when the location was captured on the device.
forceSave
boolean
Force the backend to save this ping even if it’s similar to the previous one.
{
  "lat": 40.7128,
  "lng": -74.0060,
  "accuracyMeters": 15.5,
  "reportedAt": "2024-03-09T14:30:00Z",
  "forceSave": false
}

UpdateDriverAvailabilityStatus

Payload for toggling driver availability from the UI. Source: src/app/core/models/driver-availability.models.ts:40
interface UpdateDriverAvailabilityStatus {
  isAvailableForTrips?: boolean;
}
isAvailableForTrips
boolean
Set to true to mark driver as available for trips, false to mark as unavailable.
{
  "isAvailableForTrips": true
}

AvailabilityReason

Enumeration of reasons for a driver’s current availability status. Source: src/app/core/models/driver-availability.models.ts:3
enum AvailabilityReason {
  OFFLINE = 'OFFLINE',
  ON_TRIP = 'ON_TRIP',
  UNAVAILABLE = 'UNAVAILABLE',
}
OFFLINE
string
Driver is offline. Value: 'OFFLINE'
ON_TRIP
string
Driver is currently on a trip. Value: 'ON_TRIP'
UNAVAILABLE
string
Driver is online but explicitly unavailable. Value: 'UNAVAILABLE'

See also:

Build docs developers (and LLMs) love