Skip to content

Transit Times Frontend Guide

This document covers all frontend forms, pages, and UI components related to Transit Times management in the iDrv5-MyFR8 platform.

This document covers all frontend forms, pages, and UI components related to Transit Times management in the iDrv5-MyFR8 platform.

  1. Overview
  2. Transit Time Profiles Page
  3. Rate Card Details - Transit Times Tab
  4. Service Levels Page
  5. API Endpoints Reference
  6. Data Flow

The Transit Times system allows users to configure how long freight takes to travel between zones. The system supports four modes:

ModeDescription
InheritUses the system default transit time profile
ProfileUses a specific named transit time profile
CustomRate card maintains its own transit time entries
NoneTransit times not applicable for this rate card
  • Transit Time Profile: A reusable collection of transit time configurations
  • Transit Time Entry: A single origin-destination pair with base transit hours
  • Service Level Multiplier: Adjusts base transit time based on service level (Express, Standard, Economy, etc.)
  • Base Transit Hours: The standard transit time for a route (typically for “Standard” service level)
Final Transit Time = (Base Transit Hours × Service Level Multiplier) + Adjustment Hours

Example:

  • Base Transit: 24 hours (Sydney to Melbourne)
  • Express Multiplier: 0.5x
  • Adjustment: 0 hours
  • Result: 24 × 0.5 + 0 = 12 hours

URL: /operations/rate/transit-time-profiles

Template: templates/portals/operations/transit_time_profiles.html

Purpose: Manage reusable transit time profiles that can be shared across multiple rate cards.

┌─────────────────────────────────────────────────────────────────┐
│ Transit Time Profiles [+ Create Profile] │
├─────────────────────────────────────────────────────────────────┤
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Total │ │ Total │ │ Linked │ │
│ │ Profiles: 3 │ │ Entries: 45 │ │ Rate Cards: 8│ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ Standard Australian │ │ Express Network │ │
│ │ Network [DEFAULT]│ │ │ │
│ │ 25 entries │ │ 12 entries │ │
│ │ 5 rate cards │ │ 2 rate cards │ │
│ │ [View] [Edit] [Del] │ │ [View] [Edit] [Del] │ │
│ └─────────────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
CardDescription
Total ProfilesNumber of transit time profiles in the system
Total EntriesSum of all zone-to-zone transit time entries
Linked Rate CardsNumber of rate cards using profile mode
ButtonAction
ViewOpens profile details modal with tabs
EditOpens edit modal to modify profile settings
DeleteDeletes profile (disabled for default profile)

Modal ID: profileModal

Purpose: Create new profiles or edit existing ones.

FieldTypeRequiredDescription
Profile NameTextYesUnique name for the profile
DescriptionTextareaNoDescription of when to use this profile
Set as DefaultCheckboxNoMakes this the system default profile

Users can switch between three input modes for entering service level multipliers:

┌─────────────────────────────────────────────────────────────────┐
│ Input Mode: [Multiplier] [Hours] [Days] │
│ │
│ Base Hours Reference: [24] hours (shown for Hours/Days modes) │
│ ℹ️ Standard service base time │
└─────────────────────────────────────────────────────────────────┘
ModeInput TypeExampleDescription
MultiplierDecimal (0.1 - 5.0)0.5xDirect multiplier value
HoursInteger (1 - 720)12 hrsActual transit hours, auto-calculates multiplier
DaysDecimal (0.1 - 30)0.5 daysActual transit days, auto-calculates multiplier

How It Works:

  • When using Hours or Days mode, a “Base Hours Reference” field appears
  • The base hours represent the Standard service level time (default: 24 hours)
  • The system automatically calculates the multiplier: multiplier = entered_time / base_hours
  • Switching modes preserves the underlying multiplier value and converts the display

Example - Setting Express to 12 hours when base is 24 hours:

  • In Hours mode: Enter 12 → System calculates 12 / 24 = 0.5x multiplier
  • In Days mode: Enter 0.5 → System calculates (0.5 × 24) / 24 = 0.5x multiplier
  • In Multiplier mode: Enter 0.5 directly
ColumnDescription
Service LevelName and description from service_levels table
ValueMultiplier, Hours, or Days (based on selected input mode)
Adjustment (Hours)Fixed hours added/subtracted (-48 to +48)
EffectVisual badge + calculated hours display

Effect Column Display:

┌──────────────┐
│ 50% Faster │ ← Speed effect badge
│ 12h (0.5d) │ ← Calculated hours based on base reference
└──────────────┘

Effect Badges:

  • 🟢 X% Faster - Multiplier < 1.0 (green badge)
  • 🔵 Normal - Multiplier = 1.0 (blue badge)
  • 🟡 X% Slower - Multiplier > 1.0 (yellow badge)

When creating a new profile, multipliers are auto-assigned based on service level name:

Name PatternDefault Multiplier
Express, Hot Shot, Urgent, Priority0.5x
Standard (or unmatched)1.0x
Economy, Saver, Budget1.5x

Given a Base Hours Reference of 24 hours (1 day for Standard service):

Service LevelMultiplier ModeHours ModeDays ModeEffect
Express0.50x12 hrs0.5 days50% Faster
Hot Shot0.50x12 hrs0.5 days50% Faster
Standard1.00x24 hrs1.0 daysNormal
Economy1.50x36 hrs1.5 days50% Slower
Budget2.00x48 hrs2.0 days100% Slower

Note: Regardless of input mode, the system always saves the actual multiplier value to the database. The Hours and Days modes are purely for user convenience during data entry.


Modal ID: profileDetailsModal

Purpose: View detailed information about a profile.

Displays zone-to-zone base transit times.

ColumnDescription
Origin ZoneStarting zone name
Destination ZoneEnding zone name
Base TimeHours and day equivalent (e.g., “24h (1 day)“)
DistanceOptional distance in kilometers
ActionsDelete button

Actions:

  • Export CSV - Download entries as CSV file
  • Add Entry - Opens add entry modal

Visual card display of all service level multipliers.

┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Express │ │ Hot Shot │ │ Standard │ │ Economy │
│ 0.5x │ │ 0.5x │ │ 1.0x │ │ 1.7x │
│ 50% Faster │ │ 50% Faster │ │ Normal │ │ 70% Slower │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘

Warning Indicator: Service levels without configured multipliers show a yellow warning badge.

Shows count and list of rate cards using this profile.

ButtonAction
Copy ProfileCreates a duplicate with new name
Edit ProfileOpens edit modal
CloseCloses the modal

Modal ID: addEntryModal

Purpose: Add a new zone-to-zone transit time entry.

FieldTypeRequiredDescription
Origin ZoneDropdownYesSelect from available zones
Destination ZoneDropdownYesSelect from available zones
Base Transit TimeNumber + “hours”YesBase time in hours
DistanceNumber + “km”NoOptional distance
NotesTextNoOptional notes

URL: /operations/rate-cards/<id>

Template: templates/portals/operations/rate_card_details.html

Purpose: Configure transit time settings for a specific rate card.

Located in the rate card info panel and expanded in the Transit Times tab.

┌─────────────────────────────────────────────────────────────────┐
│ TRANSIT TIME CONFIGURATION │
├─────────────────────────────────────────────────────────────────┤
│ Transit Time Mode: [Dropdown: Inherit ▼] │
│ │
│ ○ Inherit - Use system default profile │
│ ○ Profile - Use specific profile: [Profile Dropdown ▼] │
│ ○ Custom - Manage transit times for this rate card only │
│ ○ None - Transit times not applicable │
│ [Save Mode] │
└─────────────────────────────────────────────────────────────────┘
  • Uses the system default transit time profile
  • Transit times table shows entries from default profile (read-only)
  • No profile selector shown
  • Shows profile selector dropdown
  • Transit times table shows entries from selected profile (read-only)
  • Changing profile updates displayed times
  • Shows full transit times management interface
  • Add Manual Entry button enabled
  • Can create rate-card-specific transit time entries
  • Entries stored in rate_card_transit_overrides table
  • Transit times section hidden or shows “Not applicable”
  • Used for rate cards where transit time doesn’t apply
ColumnDescription
OriginOrigin zone name with search
DestinationDestination zone name with search
ExpressTransit time for Express service
StandardTransit time for Standard service
EconomyTransit time for Economy service
ActionsEdit/Delete (custom mode only)

Available in Custom mode only.

FieldTypeDescription
Origin ZoneSearchable dropdownOrigin zone selection
Destination ZoneSearchable dropdownDestination zone selection
Service TypeDropdownExpress/Standard/Economy
Transit TimeNumberTime value
UnitToggleHours or Days

Note: Days are converted to hours (×24) before saving to API.


URL: /operations/rate/service-levels

Template: templates/portals/operations/service_levels/service_levels_list.html

Purpose: Manage service levels that affect transit time calculations.

FieldDescription
NameService level name (Express, Standard, etc.)
DescriptionDescription of the service
PriorityDisplay order (lower = higher priority)
Is ActiveWhether the service level is available
Base Cost MultiplierAffects pricing calculations
Transit Time MultiplierDefault multiplier for transit calculations
  • Service levels are loaded dynamically in Transit Time Profile forms
  • Each profile can configure multipliers for each active service level
  • New service levels automatically appear in profile edit forms
  • Service levels without configured multipliers default to 1.0x

Base URL: /api/transit-profiles

MethodEndpointDescription
GET/List all profiles
POST/Create new profile
GET/<id>Get profile with entries and multipliers
PUT/<id>Update profile
DELETE/<id>Delete profile
GET/defaultGet default profile
POST/<id>/copyCopy profile
MethodEndpointDescription
GET/<id>/entriesList profile entries
POST/<id>/entriesAdd entry
PUT/<id>/entries/<entry_id>Update entry
DELETE/<id>/entries/<entry_id>Delete entry
MethodEndpointDescription
GET/<id>/multipliersList multipliers
POST/<id>/multipliersCreate/update multiplier (upsert)
DELETE/<id>/multipliers/<sl_id>Delete multiplier
MethodEndpointDescription
GET/rate-card/<id>/transit-timesGet all transit times for rate card
GET/rate-card/<id>/transit-timeGet single transit time (with query params)
GET/rate-card/<id>/overridesList custom overrides
POST/rate-card/<id>/overridesAdd override
DELETE/rate-card/<id>/overrides/<id>Delete override

Base URL: /api/service-levels

MethodEndpointDescription
GET/List all service levels
POST/Create service level
GET/<id>Get service level
PUT/<id>Update service level
DELETE/<id>Delete service level
MethodEndpointDescription
GET/api/rate-cards/<id>Includes transit_time_mode and transit_time_profile_id
PUT/api/rate-cards/<id>Can update transit time mode and profile

User Action API Call Database
───────────────────────────────────────────────────────────────────────
1. Click "Create Profile" - -
2. Fill form, click Save POST /api/transit-profiles/ INSERT transit_time_profiles
3. Multipliers saved POST /<id>/multipliers INSERT service_level_transit_multipliers
4. Reload profiles GET /api/transit-profiles/ SELECT all profiles
User Action API Call Database
───────────────────────────────────────────────────────────────────────
1. Open Rate Card Details GET /api/rate-cards/<id> SELECT rate_card
2. Change mode to "Profile" - -
3. Select profile - -
4. Click Save Mode PUT /api/rate-cards/<id> UPDATE rate_cards SET
transit_time_mode='profile',
transit_time_profile_id=<id>
5. Load transit times GET /transit-profiles/<id> SELECT entries, multipliers
Input Processing Output
───────────────────────────────────────────────────────────────────────
Rate Card ID: 5 1. Get rate card mode
Origin Zone: Sydney 2. If profile mode:
Destination Zone: Melbourne - Get profile entries
Service Level: Express - Get multiplier (0.5x)
3. Find base time (24h)
4. Calculate: Final: 12 hours
24 × 0.5 + 0 = 12

-- Transit Time Profiles
transit_time_profiles (
id, name, description, is_default, is_active, created_at, updated_at
)
-- Transit Time Entries (zone-to-zone base times)
transit_time_entries (
id, profile_id, origin_zone_id, destination_zone_id,
base_transit_hours, distance_km, notes
)
-- Service Level Multipliers
service_level_transit_multipliers (
id, profile_id, service_level_id,
transit_multiplier, adjustment_hours, display_priority
)
-- Rate Card Overrides (for custom mode)
rate_card_transit_overrides (
id, rate_card_id, origin_zone_id, destination_zone_id,
service_level_id, transit_hours
)
-- Rate Cards (transit-related columns)
rate_cards (
...,
transit_time_mode VARCHAR(20) DEFAULT 'inherit',
transit_time_profile_id INTEGER REFERENCES transit_time_profiles(id)
)

FilePurpose
templates/portals/operations/transit_time_profiles.htmlTransit Time Profiles management page
templates/portals/operations/rate_card_details.htmlRate Card details with transit times tab
templates/portals/operations/service_levels/service_levels_list.htmlService levels management
api/transit_time_profiles_api.pyBackend API for transit profiles
api/rate_cards_api.pyRate cards API (transit mode endpoints)
api/service_levels_api.pyService levels API
models/transit_time_profiles.pySQLAlchemy models
migrations/create_transit_time_profiles.sqlDatabase migration

  • Check /api/service-levels returns data
  • Ensure service levels have is_active = true
  • Check browser console for JavaScript errors
  • Verify profile has entries for the zone pair
  • Check multipliers are configured for service level
  • Confirm rate card is using correct mode and profile
  • Clear browser cache
  • Verify API response shows updated data
  • Check rate card’s transit_time_profile_id is set

Last Updated: December 2024


  • Added Input Mode Selector for service level multipliers (Multiplier/Hours/Days)
  • Added Base Hours Reference field for Hours and Days input modes
  • Enhanced Effect column to show calculated hours alongside speed badges
  • Improved UX for users who prefer entering actual transit times instead of multipliers