Skip to content

Mobile fleet, download reminders and historical activities

Implemented in the development source tree, extending mobile intake for Pro (SQLite, in-process worker) and Enterprise (PostgreSQL, FleetMiraWorker). Basic has no mobile listener; Enterprise Client performs no central evaluation. Installed release acceptance remains a separate gate.

Access and known consumers

Regular migration adds component mobile_fleet version 1 and durable table mobile_fleet_request. The existing configured mobile HTTPS listener hosts these routes. Each call requires an active user, valid revocable Bearer token, current role rights and product entitlement. Scope fleet.read requires permissions fleet.read and archive.read; history additionally requires scope history.read and permission compliance.dashboard.read. Existing upload tokens acquire no new scopes automatically.

python mobile_admin.py --data-root C:\ProgramData\FleetMira --administrator ADMIN create-token --label Android-Fleet --fleet --read-only --days 365

Without --read-only, --fleet adds to existing upload scopes. This local CLI requires interactive administrator authentication. Secrets are displayed once and must not enter documentation or logs.

Confirmed consumer: Android DTCO Download 0.5.0-dev onward, FleetHttpsApi/FleetReadWorker. Internal consumers: Pro worker tick and Enterprise dispatcher job mobile_fleet_read. Evidence: test_mobile_fleet.py and Android FleetLiveInstrumentedTest. Other external consumers are unknown; missing references do not prove absence of use.

Endpoints below /api/mobile/v1/fleet

Method / path Purpose / response Changes and permissions
GET /capabilities Product/API/contract version 1, server/user identity, token expiry, features, historyZone, page size 100, maximum 31 days No business change; fleet/archive rights and fleet.read
POST /requests JSON {"kind":"FLEET"} or {"kind":"HISTORY","personId":"…","from":"YYYY-MM-DD","to":"YYYY-MM-DD"}; Idempotency-Key; 202 with ID Durable token-owned request; four outstanding requests per token; HISTORY requires additional rights
GET /requests/{id} QUEUED, RUNNING, COMPLETE, FAILED, error code, metadata, collection counts, expiry Owner token and still-valid rights; no business change
GET /requests/{id}/pages?collection=drivers&offset=0&limit=100 Immutable page: id, collection, offset, items, total, nextOffset Owner token, still-valid rights, completed result

FLEET collections: vehicles, drivers, deadlines. HISTORY: days, weeks, activities, findings, sources. Inclusive dates allow at most 31 days through today in the analysis time zone. Driver assignments must be confirmed and unambiguous. Responses omit addresses, birth dates, secrets and internal archive paths. History includes required card/source identifiers, technical rule codes and existing engine notices.

HTTP: 426 without HTTPS; 403 for missing/revoked access or entitlement; 404 for unknown/other-token IDs; 409 for invalid contracts, idempotency conflict or incomplete results; 410 expired results; 413 above 4096 request bytes; 429 full queue. Responses use Cache-Control: no-store; results expire after one day. Codes include ACCESS_REVOKED, FEATURE_UNAVAILABLE, SUBJECT_AMBIGUOUS, SUBJECT_NOT_FOUND, RESULT_TOO_LARGE, EVALUATION_FAILED. Expired leases resume after restart; late former workers cannot overwrite newer results.

Business meaning

Snapshots include the authorized company's entire active vehicle and driver/personnel inventory, including unlinked personnel. Existing managed download deadlines and confirmed archives are reused. Reads neither create nor modify business deadlines. Missing, outdated and conflicting assignments remain unresolved. Untracked vehicles receive no invented deadline; leadDays=0 remains zero days. Deadlines use UTC like the existing deadline service. Historical analysis uses the configured Fleet Mira time zone.

History reuses ComplianceEvaluationService, trusted archives, modules, rules and evaluation audits. Day/ISO-week totals use the same normalizer. DST days have 23/25 hours; unknown time and gaps are not rest. Cards and generations remain distinct. Activities are clipped to the selected period; rule findings may retain explanatory context from the existing evaluation. This is a historical technical precheck, not a live remaining-driving-time counter.

Android: primary server, cache and reminders

Settings select one active Fleet Mira target as primary server; other upload targets remain. Fleet provides local vehicles plus remote vehicles, drivers and deadlines. Drivers open day/week/activity/assessment/source views. Manual refresh complements approximately six-hour background synchronization; Android can delay execution. Wi-Fi is default, mobile data is configurable per target. A local WLAN without Internet is explicitly bound. USB sessions take priority.

Each binding has a random cache generation. Complete pages are staged and atomically published together; interruption cannot replace a complete snapshot. Server/account/token changes, known access withdrawal, expiry and disabling block/remove remote data, preserving local original DDD files and vehicle histories. Retention is at most 30 days, ten historical periods and a 64 MiB remote-payload budget; database files can be larger because of indexes/WAL. Views show their saved timestamp; revocation cannot be learned while disconnected.

Reminders require opt-in and Android notification permission. From 09:00 UTC daily summaries cover due/upcoming downloads and unresolved tracked download states, using only server dates and lead times. The phone contains no statutory intervals. Snapshots older than 24 hours or known access loss do not trigger new reminders. The server generation timestamp also counts; resuming a download later does not make old results fresh again. Notifications contain counts only and open deadlines; Android power saving may delay them.

Impact and evidence

Four additive routes and scopes; existing device/parser/upload/diagnostic endpoint protection is unchanged. Old servers require an update. New clients need the updated server and explicit token grants. Fallback: unselect the primary server and disable the listener through the existing operational procedure. Original archives remain; do not start older software against the upgraded schema.

Reviewed baseline: working sources dated 4 November 2026: mobile_fleet.py, mobile_integration.py, mobile_api.py, worker_runtime.py, database_runtime.py, tachograph_compliance.py, ddd_drivercard_compliance_561.py, time_basis.py. Dated artifacts/test-reports record actual tests and remaining release gates. Existing security gaps remain assigned to separate project-specific impact analyses.