SmartGare
Referential

Vehicles, identity, and permits

Fleet records, identifier resolution, permit history, expiry watch, imports, search, and master-data eligibility.

Vehicle record

A vehicle carries durable fleet facts: plate, fleet number, carrier attachment, category, capacity, seating mode, brand, model, and administrative lifecycle.

ACTIVE means administratively enabled. It never means “may enter now.”

Maintenance supports correction, category change, carrier transfer, suspension, reactivation, carrier history, and seat-layout replacement. Category and carrier changes are separate commands with their own events and history.

Identifier resolution

The plate is an identifier technology. Registration enrolls it as PLATE; LPR and RFID readings use one resolution model.

  • Raw values are preserved exactly.
  • Normalized values remove accepted punctuation, spacing, and case differences.
  • One active identifier exists per vehicle and technology.
  • Active normalized values are unique within a technology.
  • Revoked identifiers remain history and stop resolving.
  • Unresolved evidence commits even when resolution returns not-found.

Replacement requires explicit revocation first; enrollment never auto-revokes.

Vehicle permits

A permit is an effective-dated agrément.

  • Permit numbers are unique station-wide.
  • Two non-revoked permits for one vehicle cannot overlap.
  • PostgreSQL exclusion constraints close concurrent issue races.
  • Revocation requires a reason and preserves actor/time evidence.
  • Issue, lapse, or revocation never changes vehicle status.

Expiry watch

The scheduled watch publishes one warning per permit and configured horizon, then one expiry fact when vehicle coverage lapses. A durable announcement table deduplicates restarts, repeated runs, and missed days.

The cross-fleet worklist exposes approaching and expired permits with announcement history. Remaining days use station time, never browser time.

Master-data eligibility

POST /referential/v1/checkpoints/{id}/eligibility returns ALLOWED or REFUSED plus every check:

CheckQuestion
IDENTIFIER_MATCHEDDid an active identifier resolve?
CARRIER_ACTIVEIs the attached carrier operating?
VEHICLE_ACTIVEIs the vehicle administratively active?
VEHICLE_CATEGORY_KNOWNDoes the catalog know the category?
PERMIT_COVERS_TODAYDoes a non-revoked permit cover the station date?

The call writes no decision and publishes no event. Point-specific policy and operational state belong to Rules and Cycle.

Search and CSV import

Fleet search matches partial plate, fleet number, or active identifier and combines carrier, category, status, and permit-coverage filters.

Permit CSV import resolves rows by plate and reports imported, rejected, conflicted, and unresolved outcomes. Data errors are per row; infrastructure or concurrent batch-write failures roll back the transaction.

On this page