Skip to main content

Overview

The trip models handle trip lifecycle, driver assignments, fare calculations, and location tracking for rides in the Rodando platform.

Core Trip Models

TripDto

Complete trip object with all details including status, location, and fare information. Source: src/app/features/trip/interfaces/trip.interface.ts:16
interface TripDto {
  id: string;
  currentStatus: 'pending' | 'assigning' | 'accepted' | 'arriving' | 'in_progress' | 'completed' | 'cancelled' | 'no_drivers_found';
  pickupAddress?: string | null;
  pickupPoint?: { lat: number; lng: number } | null;
  stops?: TripStopDto[];
  fareSnapshot?: FareSnapshotDto | null;
  requestedVehicleCategory?: { id: string; name?: string } | null;
  requestedServiceClass?: { id: string; name?: string } | null;
  fareEstimatedTotal?: number | null;
  fareFinalCurrency?: string | null;
  fareDistanceKm?: number | null;
  fareDurationMin?: number | null;
}
id
string
required
Unique identifier for the trip (UUID).
currentStatus
string
required
Current status of the trip in its lifecycle.Possible values:
  • pending - Trip created, awaiting assignment
  • assigning - System is finding a driver
  • accepted - Driver accepted the assignment
  • arriving - Driver is en route to pickup location
  • in_progress - Trip is in progress
  • completed - Trip finished successfully
  • cancelled - Trip was cancelled
  • no_drivers_found - No available drivers found
pickupAddress
string
Human-readable pickup address (e.g., “123 Main St, New York, NY”).
pickupPoint
object
Geographic coordinates of the pickup location.
stops
TripStopDto[]
Array of intermediate stops and final destination.
fareSnapshot
FareSnapshotDto
Snapshot of fare calculation at trip creation time.
requestedVehicleCategory
object
The type of vehicle requested for this trip.
requestedServiceClass
object
The service level requested for this trip.
fareEstimatedTotal
number
Estimated total fare for the trip.
fareFinalCurrency
string
Currency for the final fare (e.g., “USD”).
fareDistanceKm
number
Distance used for fare calculation in kilometers.
fareDurationMin
number
Duration used for fare calculation in minutes.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "currentStatus": "accepted",
  "pickupAddress": "123 Main Street, New York, NY 10001",
  "pickupPoint": {
    "lat": 40.7128,
    "lng": -74.0060
  },
  "stops": [
    {
      "seq": 0,
      "point": {
        "lat": 40.7589,
        "lng": -73.9851
      },
      "address": "Times Square, New York, NY"
    }
  ],
  "fareSnapshot": {
    "currency": "USD",
    "surgeMultiplier": 1.2,
    "distanceKmEst": 5.3,
    "durationMinEst": 18,
    "estimatedTotal": 24.50
  },
  "requestedVehicleCategory": {
    "id": "cat-sedan",
    "name": "Sedan"
  },
  "requestedServiceClass": {
    "id": "class-economy",
    "name": "Economy"
  },
  "fareEstimatedTotal": 24.50,
  "fareFinalCurrency": "USD",
  "fareDistanceKm": 5.3,
  "fareDurationMin": 18
}

TripStopDto

Represents a stop (intermediate or final destination) in a trip. Source: src/app/features/trip/interfaces/trip.interface.ts:1
interface TripStopDto {
  seq: number;
  point: { lat: number; lng: number } | null;
  address?: string | null;
}
seq
number
required
Sequence number for the stop (0-based). Determines the order in which stops are visited.
point
object
Geographic coordinates of the stop location.
address
string
Human-readable address for the stop.

FareSnapshotDto

Snapshot of fare calculation parameters at the time of trip creation. Source: src/app/features/trip/interfaces/trip.interface.ts:7
interface FareSnapshotDto {
  currency: string;
  surgeMultiplier?: number | null;
  breakdown?: any;
  distanceKmEst?: number | null;
  durationMinEst?: number | null;
  estimatedTotal?: number | null;
}
currency
string
required
ISO 4217 currency code (e.g., “USD”, “EUR”, “GBP”).
surgeMultiplier
number
Surge pricing multiplier applied to base fare. A value of 1.5 means 1.5x the base price.
breakdown
any
Detailed breakdown of fare components. Structure varies based on implementation.
distanceKmEst
number
Estimated trip distance in kilometers.
durationMinEst
number
Estimated trip duration in minutes.
estimatedTotal
number
Total estimated fare amount in the specified currency.
{
  "currency": "USD",
  "surgeMultiplier": 1.3,
  "breakdown": {
    "baseFare": 5.00,
    "distanceFare": 12.50,
    "timeFare": 3.00,
    "surgeFee": 6.15,
    "serviceFee": 2.50
  },
  "distanceKmEst": 8.2,
  "durationMinEst": 22,
  "estimatedTotal": 29.15
}

Driver Action Models

DriverActionPayload

Payload for driver-initiated trip actions (arriving, starting trip). Source: src/app/features/trip/interfaces/trip.interface.ts:31
interface DriverActionPayload {
  driverId: string;
}
driverId
string
required
Unique identifier of the driver performing the action (UUID).
{
  "driverId": "550e8400-e29b-41d4-a716-446655440000"
}

CompleteTripPayload

Payload for completing a trip with final details and charges. Source: src/app/features/trip/interfaces/trip.interface.ts:35
interface CompleteTripPayload {
  driverId: string;
  actualDistanceKm?: number | null;
  actualDurationMin?: number | null;
  extraFees?: number | null;
  waitingTimeMinutes?: number | null;
  waitingReason?: string | null;
}
driverId
string
required
Unique identifier of the driver completing the trip (UUID).
actualDistanceKm
number
Actual distance traveled in kilometers (from odometer or GPS tracking).
actualDurationMin
number
Actual trip duration in minutes.
extraFees
number
Additional fees charged (e.g., tolls, parking, special handling).
waitingTimeMinutes
number
Time driver waited for passenger in minutes.
waitingReason
string
Reason for waiting time (e.g., “Passenger delayed”, “Loading luggage”).
{
  "driverId": "550e8400-e29b-41d4-a716-446655440000",
  "actualDistanceKm": 8.7,
  "actualDurationMin": 25,
  "extraFees": 3.50,
  "waitingTimeMinutes": 5,
  "waitingReason": "Passenger loading luggage"
}

Assignment Models

TripAssignedVm

View model for trip assignment notifications displayed to drivers. Source: src/app/features/trip/interfaces/trip-assigned-modal.interface.ts:1
type TripAssignedVm = {
  tripId: string;
  pickupLabel?: string | null;
  destinationLabel?: string | null;
  distanceKm?: number | null;
  durationMin?: number | null;
  totalEstimated?: number | null;
  currency?: string | null;
};
tripId
string
required
Unique identifier of the assigned trip (UUID).
pickupLabel
string
Short label or address for the pickup location.
destinationLabel
string
Short label or address for the destination.
distanceKm
number
Estimated distance to complete the trip in kilometers.
durationMin
number
Estimated duration to complete the trip in minutes.
totalEstimated
number
Estimated total fare for the trip.
currency
string
Currency code for the fare (e.g., “USD”).
{
  "tripId": "550e8400-e29b-41d4-a716-446655440000",
  "pickupLabel": "123 Main St",
  "destinationLabel": "Times Square",
  "distanceKm": 5.3,
  "durationMin": 18,
  "totalEstimated": 24.50,
  "currency": "USD"
}

See also:
  • User Models - User profiles and driver information (includes driver availability)
  • Auth Models - Authentication and session data

Build docs developers (and LLMs) love