fix: safe status-recommendation flow, MO-016 order independence, brand constant, message codes
- Add a single shared, pure vehicle-status evaluator (app/services/vehicle_status.py)
used identically by the data-quality scanner, a new non-mutating status-recommendation
preview endpoint, and a transactional apply endpoint with optimistic-concurrency token
revalidation -- eliminates the old opaque "calculate and apply" action and the unsafe
"maintenance + active booking -> auto rented" shortcut. Frontend
DataQualityIssueDetail.tsx now shows a review/decide/confirm panel with localized
why/evidence/consequence text in nl-BE/en-GB/fr-BE, with an exact "Change status to
<status>" confirm action per the brief.
- Fix MO-016 issue-order dependency: resolving the booking-overlap issue before vs.
after the status-conflict issue now converges on the same final vehicle status,
proven by test_mo_016_status_conflict_recommendation_is_order_independent.
- Make "Fleet Ops" a non-localizable brand constant (frontend/src/product.ts,
backend PRODUCT_NAME) via {{productName}} interpolation everywhere the brand name
appeared in locale prose; add a permanent test guarding against a translation file
ever defining the brand name or an "appName" key again.
- Convert dynamic backend prose to stable message codes + params: return status
reasons, audit field/actor-type labels, automation last_error, and search
section/vehicle/booking/issue results all now carry codes the frontend localizes,
with raw technical text demoted to a "Technical details" disclosure.
- docs/fleet-ops-correction/: gap audit, i18n inventory, and the vehicle-status
decision table documenting the evaluator's rules and safe-status principles.
148 backend tests + Ruff + mypy green; Alembic migration verified upgrade/downgrade;
frontend tsc/build and the i18n-coverage Playwright suite green.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
18344bc8b7
commit
6deb95524d
@@ -71,3 +71,116 @@ test("no locale file contains an empty string value", () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// --- Brand-invariant: "Fleet Ops" is a fixed constant, never a translation value ---
|
||||
// (see frontend/src/product.ts and docs/fleet-ops-correction/current-gap-audit.md §1).
|
||||
// A regression here means someone re-introduced a per-locale brand key/value instead of
|
||||
// interpolating {{productName}} from the shared constant.
|
||||
|
||||
test("no locale file defines an 'appName' key or the literal brand string", () => {
|
||||
for (const language of LANGUAGES) {
|
||||
for (const namespace of namespaces) {
|
||||
const data = loadNamespace(language, namespace);
|
||||
const raw = JSON.stringify(data);
|
||||
expect(
|
||||
raw.includes("Fleet Ops"),
|
||||
`${language}/${namespace}.json contains the literal brand string "Fleet Ops" -- ` +
|
||||
`use {{productName}} interpolation instead so the brand can never drift per locale`,
|
||||
).toBe(false);
|
||||
const keys = collectKeyPaths(data);
|
||||
expect(
|
||||
keys.some((k) => k === "appName" || k.endsWith(".appName")),
|
||||
`${language}/${namespace}.json defines an "appName" key -- the brand name must come ` +
|
||||
`from the PRODUCT_NAME constant, never a translatable key`,
|
||||
).toBe(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// --- Translation-quality: prove values were actually translated, not copy-pasted ---
|
||||
// Sleutelpariteit alone doesn't prove translation happened (a locale file could contain
|
||||
// the literal English string under the right key and still pass). For every "real prose"
|
||||
// string (>=8 chars, not on the allowlist below), assert nl-BE and fr-BE differ from
|
||||
// en-GB, and that fr-BE differs from nl-BE -- catching both "still English" and
|
||||
// "Dutch text copy-pasted into French" in one pass.
|
||||
|
||||
// Exact (namespace, key-path) pairs that are legitimately identical across two or more
|
||||
// locales: real proper nouns/brand names, deliberately-untranslated role titles, and
|
||||
// genuine cross-language cognates (identical spelling in Dutch/French/English). This is
|
||||
// a precise allowlist by key path, not a broad word-level allowlist, so it can't quietly
|
||||
// hide an unrelated real mistranslation under the same key in a different namespace.
|
||||
const IDENTICAL_VALUE_ALLOWLIST = new Set([
|
||||
"audit.title", // "Audit trail" kept as an established cross-language compliance term
|
||||
"audit.diff.was", // "{{field}}: was {{value}}" -- "was" is spelled identically in Dutch
|
||||
"auth.roleOperationsManager", // deliberately-untranslated role title (see demo.json roles)
|
||||
"auth.roleRentalEmployee",
|
||||
"demo.scenarios.roles.operations_manager", // same convention, scenario-overview role labels
|
||||
"demo.scenarios.roles.rental_employee",
|
||||
"common.language.nl-BE", // language-picker options show each language's own endonym
|
||||
"common.language.fr-BE",
|
||||
"common.footer.productLine", // "{{productName}} Demo" -- brief-specified exact footer text
|
||||
"common.orgName", // "Northstar Mobility" -- fictional org proper noun, same in all 3
|
||||
"dashboard.attention.openRecord", // "Open {{title}}" -- "open" is also the Dutch imperative
|
||||
"demo.scenarios.durationValue", // "± {{minutes}} min" -- unit abbreviation, same in all 3
|
||||
"demo.scenarios.startScenario", // "start"/"scenario" are naturalised loanwords in Dutch
|
||||
"demo.about.limitationsTitle", // "Limitations" -- identical spelling in French
|
||||
"demo.integrationSummary.titles.mcp_hub", // "ITWorx MCP Hub" -- proper noun
|
||||
"fleet.list.columns.attention", // "Attention" -- identical spelling in French
|
||||
"fleet.detail.tabs.inspections", // "Inspections" -- identical spelling in French
|
||||
"integrations.cards.orchestrationKicker", // "Orchestration" -- identical in French
|
||||
"knowledge.questionLabel", // "Question" -- identical spelling in French
|
||||
"knowledge.retrievalFlow.question",
|
||||
"knowledge.questionLabelExchange",
|
||||
"navigation.items.audit", // "Audit trail" kept as an established cross-language term
|
||||
"returns.result.inspection", // "Inspection" -- identical spelling in French
|
||||
]);
|
||||
|
||||
function isTranslatableProse(value: unknown): value is string {
|
||||
if (typeof value !== "string") return false;
|
||||
if (value.trim().length < 8) return false;
|
||||
// Strip interpolation placeholders and non-letter characters; if nothing substantial
|
||||
// remains (pure numbers/punctuation/units), it's not "prose" that needs translating.
|
||||
const stripped = value
|
||||
.replace(/\{\{[^}]+\}\}/g, " ")
|
||||
.replace(/[^a-zA-Zà-öø-ÿÀ-ÖØ-ß]/g, "");
|
||||
return stripped.trim().length >= 3;
|
||||
}
|
||||
|
||||
test("nl-BE and fr-BE translations are not suspiciously identical to en-GB or each other", () => {
|
||||
for (const namespace of namespaces) {
|
||||
const en = loadNamespace("en-GB", namespace);
|
||||
const nl = loadNamespace("nl-BE", namespace);
|
||||
const fr = loadNamespace("fr-BE", namespace);
|
||||
const keys = collectKeyPaths(en);
|
||||
|
||||
for (const keyPath of keys) {
|
||||
if (IDENTICAL_VALUE_ALLOWLIST.has(`${namespace}.${keyPath}`)) continue;
|
||||
const at = (data: Record<string, unknown>) =>
|
||||
keyPath.split(".").reduce<unknown>((acc, part) => {
|
||||
if (acc && typeof acc === "object") return (acc as Record<string, unknown>)[part];
|
||||
return undefined;
|
||||
}, data);
|
||||
|
||||
const enValue = at(en);
|
||||
if (!isTranslatableProse(enValue)) continue;
|
||||
const nlValue = at(nl);
|
||||
const frValue = at(fr);
|
||||
|
||||
expect(
|
||||
nlValue,
|
||||
`${namespace}.json:${keyPath} — nl-BE is identical to en-GB ("${enValue}"); ` +
|
||||
`looks untranslated (add to IDENTICAL_VALUE_ALLOWLIST if this is intentional)`,
|
||||
).not.toBe(enValue);
|
||||
expect(
|
||||
frValue,
|
||||
`${namespace}.json:${keyPath} — fr-BE is identical to en-GB ("${enValue}"); ` +
|
||||
`looks untranslated (add to IDENTICAL_VALUE_ALLOWLIST if this is intentional)`,
|
||||
).not.toBe(enValue);
|
||||
expect(
|
||||
frValue,
|
||||
`${namespace}.json:${keyPath} — fr-BE is identical to nl-BE ("${nlValue}"); ` +
|
||||
`looks like Dutch text was copy-pasted into the French locale`,
|
||||
).not.toBe(nlValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -109,6 +109,7 @@ export interface AutomationRun {
|
||||
status: string;
|
||||
attempts: number;
|
||||
last_error: string | null;
|
||||
last_error_code: string | null;
|
||||
occurred_at: string;
|
||||
}
|
||||
|
||||
@@ -154,6 +155,8 @@ export interface ReturnPreviewResult {
|
||||
resulting_odometer_km: number;
|
||||
resulting_vehicle_status: string;
|
||||
status_reason: string;
|
||||
status_reason_code: string;
|
||||
status_reason_params: Record<string, string | number>;
|
||||
would_create_quality_issue: boolean;
|
||||
attention_reasons: string[];
|
||||
next_booking_risk: NextBookingRisk | null;
|
||||
@@ -173,7 +176,27 @@ export interface DataQualityIssueDetail extends DataQualityIssue {
|
||||
export interface ApplyRecommendedStatusResult {
|
||||
issue: DataQualityIssue;
|
||||
applied_status: string;
|
||||
reason: string;
|
||||
reason_code: string;
|
||||
}
|
||||
|
||||
export interface VehicleStatusFacts {
|
||||
active_booking_refs: string[];
|
||||
overlapping_booking_pairs: string[][];
|
||||
service_threshold_reached: boolean;
|
||||
odometer_km: number;
|
||||
next_service_km: number;
|
||||
open_booking_overlap_issue_ref: string | null;
|
||||
}
|
||||
|
||||
export interface StatusRecommendation {
|
||||
current_status: string;
|
||||
recommended_status: string | null;
|
||||
recommendation_code: string;
|
||||
safe_to_apply: boolean;
|
||||
manual_review_required: boolean;
|
||||
facts: VehicleStatusFacts;
|
||||
blocking_reasons: string[];
|
||||
recommendation_token: string;
|
||||
}
|
||||
|
||||
export interface ScanResult {
|
||||
@@ -183,7 +206,8 @@ export interface ScanResult {
|
||||
export interface SearchResultItem {
|
||||
type: "vehicle" | "booking" | "data_quality_issue" | "section";
|
||||
label: string;
|
||||
detail: string;
|
||||
detail_code: string;
|
||||
detail_params: Record<string, string>;
|
||||
link: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useDemoManifest } from "../context/DemoManifestContext";
|
||||
import { useViewportTier } from "../hooks/useViewportTier";
|
||||
import { DEMO_GUIDE_STEPS } from "../data/demoGuideSteps";
|
||||
import { Icon } from "./Icons";
|
||||
import { PRODUCT_NAME } from "../product";
|
||||
|
||||
export function DemoGuideTrigger() {
|
||||
const { t } = useTranslation("demo");
|
||||
@@ -206,7 +207,7 @@ export function DemoGuide() {
|
||||
<p><strong>{t("guide.whatYouWillSee")}</strong><br />{t(`guide.steps.${step.id}.whatYouWillSee`)}</p>
|
||||
<p><strong>{t("guide.whyItMatters")}</strong><br />{t(`guide.steps.${step.id}.whyItMatters`)}</p>
|
||||
<p><strong>{t("guide.startAction")}</strong><br />{t(`guide.steps.${step.id}.startAction`)}</p>
|
||||
<p><strong>{t("guide.expectedOutcome")}</strong><br />{t(`guide.steps.${step.id}.expectedOutcome`)}</p>
|
||||
<p><strong>{t("guide.expectedOutcome")}</strong><br />{t(`guide.steps.${step.id}.expectedOutcome`, { productName: PRODUCT_NAME })}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import { DemoGuide, DemoGuideTrigger } from "./DemoGuide";
|
||||
import { LanguageSwitcher } from "./LanguageSwitcher";
|
||||
import { useDemoGuide } from "../context/DemoGuideContext";
|
||||
import { useDemoManifest } from "../context/DemoManifestContext";
|
||||
import { PRODUCT_NAME } from "../product";
|
||||
|
||||
const SEARCH_ICON: Record<SearchResultItem["type"], IconName> = {
|
||||
vehicle: "fleet",
|
||||
@@ -18,6 +19,31 @@ const SEARCH_ICON: Record<SearchResultItem["type"], IconName> = {
|
||||
section: "chevron",
|
||||
};
|
||||
|
||||
// The backend only ever sends a stable code + raw data params (never English prose) --
|
||||
// see app/api/routers/search.py. Localizing here means the label/detail always follow
|
||||
// the operator's selected locale, in every namespace search results can point to.
|
||||
function searchResultLabel(t: (key: string, opts?: Record<string, unknown>) => string, item: SearchResultItem): string {
|
||||
if (item.type === "section") return t(`navigation:items.${item.label}`, { defaultValue: item.label });
|
||||
return item.label;
|
||||
}
|
||||
|
||||
function searchResultDetail(t: (key: string, opts?: Record<string, unknown>) => string, item: SearchResultItem): string {
|
||||
switch (item.type) {
|
||||
case "section":
|
||||
return t(`searchSections.${item.detail_code}`, { defaultValue: item.detail_code });
|
||||
case "vehicle":
|
||||
return t("searchVehicleSummary", { ...item.detail_params });
|
||||
case "booking":
|
||||
return t(`bookings:statuses.${item.detail_code}`, { defaultValue: item.detail_code });
|
||||
case "data_quality_issue":
|
||||
return t(`quality:ruleTypes.${item.detail_code}`, {
|
||||
defaultValue: item.detail_code.replace(/_/g, " "),
|
||||
});
|
||||
default:
|
||||
return item.detail_code;
|
||||
}
|
||||
}
|
||||
|
||||
interface NavItem {
|
||||
to: string;
|
||||
labelKey: string;
|
||||
@@ -177,7 +203,7 @@ export function Layout() {
|
||||
<aside className={`sidebar ${mobileOpen ? "is-open" : ""}`}>
|
||||
<div className="brand-lockup">
|
||||
<BrandMark className="brand-mark" />
|
||||
<div><strong>{t("common:appName")}</strong><span>{t("common:brandTagline")}</span></div>
|
||||
<div><strong>{PRODUCT_NAME}</strong><span>{t("common:brandTagline")}</span></div>
|
||||
</div>
|
||||
<div className="sidebar-language">
|
||||
<LanguageSwitcher />
|
||||
@@ -234,7 +260,7 @@ export function Layout() {
|
||||
</button>
|
||||
<div className="global-search" role="search" ref={searchBox}>
|
||||
<Icon name="search" />
|
||||
<label className="visually-hidden" htmlFor="global-search-input">{t("searchLabel")}</label>
|
||||
<label className="visually-hidden" htmlFor="global-search-input">{t("searchLabel", { productName: PRODUCT_NAME })}</label>
|
||||
<input
|
||||
id="global-search-input"
|
||||
ref={searchInput}
|
||||
@@ -276,8 +302,8 @@ export function Layout() {
|
||||
>
|
||||
<Icon name={SEARCH_ICON[item.type]} />
|
||||
<span className="search-result-copy">
|
||||
<strong>{item.label}</strong>
|
||||
<small>{item.detail}</small>
|
||||
<strong>{searchResultLabel(t, item)}</strong>
|
||||
<small>{searchResultDetail(t, item)}</small>
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
@@ -302,7 +328,7 @@ export function Layout() {
|
||||
</header>
|
||||
|
||||
<main id="main-content" tabIndex={-1}><Outlet /></main>
|
||||
<footer className="app-footer"><span>{t("common:footer.productLine")}</span><span>{t("common:footer.locale")}</span></footer>
|
||||
<footer className="app-footer"><span>{t("common:footer.productLine", { productName: PRODUCT_NAME })}</span><span>{t("common:footer.locale")}</span></footer>
|
||||
</div>
|
||||
|
||||
<nav className="mobile-nav" aria-label={t("mobileNavLabel")}>
|
||||
|
||||
@@ -220,7 +220,17 @@ export function ReturnForm({
|
||||
<Icon name={preview.attention_reasons.length > 0 ? "alert" : "check"} />
|
||||
<div>
|
||||
<strong>{t("review.expectedState")} <StatusBadge status={preview.resulting_vehicle_status} label={t(`fleet:statuses.${preview.resulting_vehicle_status}`, { defaultValue: preview.resulting_vehicle_status })} /></strong>
|
||||
<p>{preview.status_reason}</p>
|
||||
<p>{t(`review.reasonCodes.${preview.status_reason_code}`, {
|
||||
defaultValue: preview.status_reason,
|
||||
threshold_km:
|
||||
typeof preview.status_reason_params.threshold_km === "number"
|
||||
? formatNumber(preview.status_reason_params.threshold_km)
|
||||
: undefined,
|
||||
})}</p>
|
||||
<details className="evidence-disclosure">
|
||||
<summary>{t("common:actions.technicalDetails")}</summary>
|
||||
<pre className="evidence-block">{preview.status_reason}</pre>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
{preview.odometer_regression && (
|
||||
|
||||
@@ -40,6 +40,29 @@
|
||||
"was": "{{field}}: was {{value}}",
|
||||
"changed": "{{field}}: {{before}} → {{after}}"
|
||||
},
|
||||
"actorTypes": {
|
||||
"user": "User",
|
||||
"system": "System",
|
||||
"service": "Service"
|
||||
},
|
||||
"fields": {
|
||||
"status": "Status",
|
||||
"operational_status": "Operational status",
|
||||
"registration_number": "Registration number",
|
||||
"make": "Make",
|
||||
"model": "Model",
|
||||
"location": "Location",
|
||||
"first_name": "First name",
|
||||
"last_name": "Last name",
|
||||
"email": "Email",
|
||||
"phone": "Phone",
|
||||
"postal_code": "Postal code",
|
||||
"city": "City",
|
||||
"booking_end_odometer_km": "Booking end odometer",
|
||||
"vehicle_odometer_km": "Vehicle odometer",
|
||||
"survivor": "Retained profile",
|
||||
"loser": "Merged profile"
|
||||
},
|
||||
"actions": {
|
||||
"demo_login": "Logged in",
|
||||
"demo_logout": "Logged out",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"orgLine": "Demo organisation: {{orgName}} (fictional)",
|
||||
"headline1": "Every hand-off.",
|
||||
"headline2": "One clear view.",
|
||||
"defaultDescription": "Fleet Ops brings vehicle, booking and operational data together, supports rental processes, detects data-quality problems and automates controlled follow-up steps.",
|
||||
"defaultDescription": "{{productName}} brings vehicle, booking and operational data together, supports rental processes, detects data-quality problems and automates controlled follow-up steps.",
|
||||
"footnote": "Synthetic demo · no real customer or vehicle data · resettable at any time",
|
||||
"accessEyebrow": "Demo access",
|
||||
"accessHeading": "Choose how to start",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"appName": "Fleet Ops",
|
||||
"orgName": "Northstar Mobility",
|
||||
"brandTagline": "Control Centre",
|
||||
"actions": {
|
||||
@@ -35,7 +34,7 @@
|
||||
"fr-BE": "Français"
|
||||
},
|
||||
"footer": {
|
||||
"productLine": "Fleet Ops Demo",
|
||||
"productLine": "{{productName}} Demo",
|
||||
"locale": "Europe/Brussels · Synthetic demo data"
|
||||
},
|
||||
"demo": {
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
"whatYouWillSee": "An overview of what's functionally implemented in this demo, what's synthetic, and which integrations aren't live yet.",
|
||||
"whyItMatters": "A demo is only convincing if visitors can verify for themselves what really works and what's still ahead.",
|
||||
"startAction": "Read the 'About this demo' page.",
|
||||
"expectedOutcome": "You can explain yourself what Fleet Ops is and isn't, with no verbal explanation needed."
|
||||
"expectedOutcome": "You can explain yourself what {{productName}} is and isn't, with no verbal explanation needed."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -146,16 +146,16 @@
|
||||
},
|
||||
"about": {
|
||||
"eyebrow": "About this demo",
|
||||
"title": "What Fleet Ops is and isn't",
|
||||
"title": "What {{productName}} is and isn't",
|
||||
"description": "{{orgName}} is a fictional rental organisation that makes this demo tangible — not a real company.",
|
||||
"loading": "Loading demo information…",
|
||||
"ctaTitle": "Prefer to jump right in?",
|
||||
"ctaBody": "The guided demo walks through all eight steps above in practice.",
|
||||
"ctaButton": "Start guided demo",
|
||||
"problemTitle": "The fictional problem",
|
||||
"problemBody": "{{orgName}} rents around 50 campers and vans from one main location. Bookings, returns, customer records and maintenance used to live in separate spreadsheets and verbal hand-offs, so problems (duplicate customers, incorrect odometer readings, double-booked vehicles) only surfaced late. Fleet Ops shows how one connected system flags these problems early and lets them be resolved under control.",
|
||||
"problemBody": "{{orgName}} rents around 50 campers and vans from one main location. Bookings, returns, customer records and maintenance used to live in separate spreadsheets and verbal hand-offs, so problems (duplicate customers, incorrect odometer readings, double-booked vehicles) only surfaced late. {{productName}} shows how one connected system flags these problems early and lets them be resolved under control.",
|
||||
"scopeTitle": "Who it's for and its scope",
|
||||
"scopeBody": "This demo is for anyone who wants to see how Fleet Ops tackles operational problems at a small rental company: Operations Managers and Rental Employees, and anyone evaluating the approach. The scope is deliberately focused on one connected proof of concept — no accounting, no payments, no public reservations, no full CRM or ERP.",
|
||||
"scopeBody": "This demo is for anyone who wants to see how {{productName}} tackles operational problems at a small rental company: Operations Managers and Rental Employees, and anyone evaluating the approach. The scope is deliberately focused on one connected proof of concept — no accounting, no payments, no public reservations, no full CRM or ERP.",
|
||||
"realTitle": "What really works",
|
||||
"realBody": "Everything below is functional code, not just a mockup: role-based access and sessions, vehicle and booking management, return processing with server-side validation, five data-quality rules each with its own resolution step, a full audit trail, automated delivery to n8n with bounded retries, Docker-based deployment, and an automated test suite (backend and Playwright end-to-end).",
|
||||
"syntheticTitle": "What's synthetic",
|
||||
|
||||
@@ -63,6 +63,14 @@
|
||||
"noQualityIssues": "No quality issues recorded.",
|
||||
"fuel": "Fuel {{percent}}%",
|
||||
"damage": "Damage",
|
||||
"technicalWarning": "Technical warning"
|
||||
"technicalWarning": "Technical warning",
|
||||
"inspectionTypes": {
|
||||
"departure": "Departure inspection",
|
||||
"return": "Return inspection"
|
||||
},
|
||||
"maintenanceCategories": {
|
||||
"periodic_service": "Periodic service",
|
||||
"repair": "Repair"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,13 @@
|
||||
"noAction": "—",
|
||||
"eventTypes": {
|
||||
"vehicle.returned.v1": "Vehicle return processed"
|
||||
},
|
||||
"errorCodes": {
|
||||
"connectionError": "The workflow service was temporarily unreachable. The return was safely saved and can be retried.",
|
||||
"malformedPayload": "The job contained incomplete data and could not be delivered. The underlying data remains safely stored.",
|
||||
"remoteReportedFailure": "The workflow service declined the delivery. The job can be retried.",
|
||||
"staleLeaseRecovered": "This job was recovered after an earlier delivery attempt stalled without a result.",
|
||||
"unknownError": "An unexpected error occurred while delivering this job."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"Which checks are required before checkout?"
|
||||
],
|
||||
"emptyTitle": "Evidence before answers",
|
||||
"emptyDescription": "Ask about returns, damage, inspections or another indexed procedure. Fleet Ops will not invent an answer when evidence is missing.",
|
||||
"emptyDescription": "Ask about returns, damage, inspections or another indexed procedure. {{productName}} will not invent an answer when evidence is missing.",
|
||||
"retrievalFlow": {
|
||||
"question": "Question",
|
||||
"sources": "Sources",
|
||||
|
||||
@@ -27,12 +27,22 @@
|
||||
"resetConfirmYes": "Yes, reset",
|
||||
"resetCancel": "Cancel",
|
||||
"resetFailed": "Could not reset demo data.",
|
||||
"searchLabel": "Search Fleet Ops",
|
||||
"searchLabel": "Search {{productName}}",
|
||||
"searchPlaceholder": "Search fleet, booking or section…",
|
||||
"searchShortcutHint": "Ctrl K",
|
||||
"searchSearching": "Searching…",
|
||||
"searchUnavailable": "Search is unavailable right now.",
|
||||
"searchNoResults": "No matches for \"{{query}}\".",
|
||||
"searchVehicleSummary": "{{make}} {{model}} · {{location}}",
|
||||
"searchSections": {
|
||||
"overview": "Operations dashboard",
|
||||
"fleet": "Vehicle registry",
|
||||
"bookings": "Rental bookings",
|
||||
"quality": "Quality workbench",
|
||||
"knowledge": "Procedure assistant",
|
||||
"integrations": "Automation and integration status",
|
||||
"audit": "Audit history"
|
||||
},
|
||||
"switchRole": "Switch role",
|
||||
"switchRoleTitle": "Switch demo role",
|
||||
"languageSwitcherLabel": "Change language"
|
||||
|
||||
@@ -180,13 +180,48 @@
|
||||
"heading": "Resolve the status conflict",
|
||||
"description": "One authoritative rule recommends a corrected operational status for this vehicle.",
|
||||
"currentStatus": "Current status",
|
||||
"calculateAndApply": "Calculate and apply recommended status",
|
||||
"confirmTitle": "Confirm status change",
|
||||
"confirmBody": "Apply the authoritative recommended status for this vehicle?",
|
||||
"reviewRecommendation": "Review recommendation",
|
||||
"loadingRecommendation": "Loading recommendation…",
|
||||
"recommendationFailed": "Could not load a recommendation.",
|
||||
"recommendedStatus": "Recommended status",
|
||||
"whyHeading": "Why",
|
||||
"evidenceHeading": "Facts",
|
||||
"consequenceHeading": "Consequence",
|
||||
"consequence": {
|
||||
"statusWillChange": "The vehicle status will change to {{status}}.",
|
||||
"issueWillBeRechecked": "This quality issue will be re-checked.",
|
||||
"changeWillBeAudited": "The change will be recorded in the audit trail.",
|
||||
"bookingsNotDeleted": "The bookings themselves are not deleted."
|
||||
},
|
||||
"changeStatusTo": "Change status to {{status}}",
|
||||
"applying": "Applying…",
|
||||
"confirmYes": "Yes, apply",
|
||||
"applied": "Applied {{status}} — {{reason}}",
|
||||
"applyFailed": "Could not apply a recommended status."
|
||||
"applyFailed": "Could not apply a recommended status.",
|
||||
"staleRecommendation": "The situation has changed since this recommendation was shown. Review it again before applying.",
|
||||
"reviewAgain": "Review recommendation again",
|
||||
"manualReview": {
|
||||
"heading": "Manual review required",
|
||||
"body": "The facts for this vehicle contradict each other. An Operations Manager needs to review this in person rather than apply an automatic status change.",
|
||||
"hint": "Use 'Defer' or 'Reject' below, or investigate the vehicle and the related bookings manually."
|
||||
},
|
||||
"noConflict": {
|
||||
"heading": "No change needed",
|
||||
"body": "This vehicle's current status already matches the facts."
|
||||
},
|
||||
"evidence": {
|
||||
"activeBookings": "Active booking(s): {{refs}}",
|
||||
"overlappingBookings": "Overlapping bookings: {{pairs}}",
|
||||
"serviceThresholdReached": "Odometer reading ({{odometer}} km) has reached the service threshold ({{threshold}} km).",
|
||||
"openOverlapIssue": "Open booking-overlap issue: {{ref}}"
|
||||
},
|
||||
"reasonCodes": {
|
||||
"vehicle.active_rental": "This vehicle has an active rental but is not recorded as rented. The status is corrected to reflect the actual situation.",
|
||||
"vehicle.service_threshold_reached": "This vehicle has reached its service threshold. It is set to maintenance so it is not deployed before servicing takes place.",
|
||||
"vehicle.booking_conflict": "This vehicle has two overlapping bookings. Blocking it prevents it from being considered available again before the booking conflict is resolved.",
|
||||
"vehicle.rental_ended": "The rental for this vehicle has ended and there is no active booking left. It is set back to available.",
|
||||
"vehicle.manual_review_required": "The facts for this vehicle contradict each other (for example, an active booking while the vehicle is in maintenance, or a service threshold reached alongside an active rental). This requires a human review rather than an automatic status change.",
|
||||
"vehicle.no_conflict": "This vehicle's current status already matches the facts. No change is needed."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,13 @@
|
||||
"odometerRegressionWarning": "Submitted odometer ({{submitted}} km) is below the canonical reading ({{canonical}} km). The canonical odometer will not change, and a data-quality issue will be opened.",
|
||||
"nextBookingRisk": "Next booking {{ref}} starts {{when}} — may be affected by this return.",
|
||||
"nextBookingLowRisk": "Next booking {{ref}} starts {{when}} — low risk.",
|
||||
"reasonCodes": {
|
||||
"returnBlockedDamageAndTechnical": "Both damage and a technical warning were reported on this return.",
|
||||
"returnBlockedDamage": "Damage was reported on this return.",
|
||||
"returnBlockedTechnicalWarning": "A technical warning was reported on this return.",
|
||||
"returnServiceThresholdReached": "The odometer reading has reached the {{threshold_km}} km service threshold.",
|
||||
"returnRoutedToCleaning": "No damage, technical warning or service threshold reached; the vehicle goes to cleaning."
|
||||
},
|
||||
"commitList": {
|
||||
"inspection": "Create a return inspection",
|
||||
"updateAtomic": "Update the booking and vehicle atomically",
|
||||
@@ -66,8 +73,9 @@
|
||||
"continueDemo": "Continue the demo"
|
||||
},
|
||||
"scenario": {
|
||||
"ariaLabel": "Demo scenario",
|
||||
"title": "Demo scenario: odometer anomaly",
|
||||
"body": "This vehicle currently reads {{odometer}} km. The form below is pre-filled with a return reading below that — a sign of a data-entry mistake or a mixed-up vehicle. Confirm the return to see how Fleet Ops detects and handles this.",
|
||||
"body": "This vehicle currently reads {{odometer}} km. The form below is pre-filled with a return reading below that — a sign of a data-entry mistake or a mixed-up vehicle. Confirm the return to see how {{productName}} detects and handles this.",
|
||||
"preparing": "Preparing scenario…"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,29 @@
|
||||
"was": "{{field}} : était {{value}}",
|
||||
"changed": "{{field}} : {{before}} → {{after}}"
|
||||
},
|
||||
"actorTypes": {
|
||||
"user": "Utilisateur",
|
||||
"system": "Système",
|
||||
"service": "Service"
|
||||
},
|
||||
"fields": {
|
||||
"status": "Statut",
|
||||
"operational_status": "Statut opérationnel",
|
||||
"registration_number": "Plaque d'immatriculation",
|
||||
"make": "Marque",
|
||||
"model": "Modèle",
|
||||
"location": "Emplacement",
|
||||
"first_name": "Prénom",
|
||||
"last_name": "Nom",
|
||||
"email": "E-mail",
|
||||
"phone": "Téléphone",
|
||||
"postal_code": "Code postal",
|
||||
"city": "Ville",
|
||||
"booking_end_odometer_km": "Kilométrage final de la réservation",
|
||||
"vehicle_odometer_km": "Kilométrage du véhicule",
|
||||
"survivor": "Profil conservé",
|
||||
"loser": "Profil fusionné"
|
||||
},
|
||||
"actions": {
|
||||
"demo_login": "Connecté",
|
||||
"demo_logout": "Déconnecté",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"orgLine": "Organisation de démo : {{orgName}} (fictive)",
|
||||
"headline1": "Chaque transfert.",
|
||||
"headline2": "Une vue claire.",
|
||||
"defaultDescription": "Fleet Ops rassemble les données de véhicules, de réservations et d'exploitation, soutient les processus de location, détecte les problèmes de qualité des données et automatise les suites contrôlées.",
|
||||
"defaultDescription": "{{productName}} rassemble les données de véhicules, de réservations et d'exploitation, soutient les processus de location, détecte les problèmes de qualité des données et automatise les suites contrôlées.",
|
||||
"footnote": "Démo synthétique · aucune donnée client ou véhicule réelle · réinitialisable à tout moment",
|
||||
"accessEyebrow": "Accès démo",
|
||||
"accessHeading": "Choisissez comment démarrer",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"appName": "Fleet Ops",
|
||||
"orgName": "Northstar Mobility",
|
||||
"brandTagline": "Centre de contrôle",
|
||||
"actions": {
|
||||
@@ -35,7 +34,7 @@
|
||||
"fr-BE": "Français"
|
||||
},
|
||||
"footer": {
|
||||
"productLine": "Fleet Ops Demo",
|
||||
"productLine": "{{productName}} Demo",
|
||||
"locale": "Europe/Bruxelles · Données de démonstration synthétiques"
|
||||
},
|
||||
"demo": {
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
"whatYouWillSee": "Un aperçu de ce qui est fonctionnellement implémenté dans cette démo, ce qui est synthétique, et quelles intégrations ne sont pas encore en direct.",
|
||||
"whyItMatters": "Une démo n'est convaincante que si les visiteurs peuvent vérifier eux-mêmes ce qui fonctionne réellement et ce qui reste à venir.",
|
||||
"startAction": "Lisez la page « À propos de cette démo ».",
|
||||
"expectedOutcome": "Vous pouvez expliquer vous-même ce que Fleet Ops est et n'est pas, sans explication verbale nécessaire."
|
||||
"expectedOutcome": "Vous pouvez expliquer vous-même ce que {{productName}} est et n'est pas, sans explication verbale nécessaire."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -146,16 +146,16 @@
|
||||
},
|
||||
"about": {
|
||||
"eyebrow": "À propos de cette démo",
|
||||
"title": "Ce que Fleet Ops est et n'est pas",
|
||||
"title": "Ce que {{productName}} est et n'est pas",
|
||||
"description": "{{orgName}} est une organisation de location fictive qui rend cette démo concrète — pas une véritable entreprise.",
|
||||
"loading": "Chargement des informations de démo…",
|
||||
"ctaTitle": "Vous préférez vous lancer directement ?",
|
||||
"ctaBody": "La démo guidée parcourt les huit étapes ci-dessus en pratique.",
|
||||
"ctaButton": "Démarrer la démo guidée",
|
||||
"problemTitle": "Le problème fictif",
|
||||
"problemBody": "{{orgName}} loue environ 50 campings-cars et fourgonnettes depuis un site principal. Les réservations, retours, fiches clients et l'entretien vivaient jusqu'ici dans des feuilles de calcul séparées et des échanges verbaux, si bien que les problèmes (clients en double, kilométrages incorrects, véhicules réservés en double) n'apparaissaient que tardivement. Fleet Ops montre comment un système unique et connecté signale ces problèmes tôt et permet de les résoudre de façon contrôlée.",
|
||||
"problemBody": "{{orgName}} loue environ 50 campings-cars et fourgonnettes depuis un site principal. Les réservations, retours, fiches clients et l'entretien vivaient jusqu'ici dans des feuilles de calcul séparées et des échanges verbaux, si bien que les problèmes (clients en double, kilométrages incorrects, véhicules réservés en double) n'apparaissaient que tardivement. {{productName}} montre comment un système unique et connecté signale ces problèmes tôt et permet de les résoudre de façon contrôlée.",
|
||||
"scopeTitle": "Pour qui et avec quelle portée",
|
||||
"scopeBody": "Cette démo s'adresse à quiconque veut voir comment Fleet Ops traite les problèmes opérationnels d'un petit loueur : Operations Managers et Rental Employees, et toute personne évaluant l'approche. La portée est délibérément limitée à une preuve de concept unique et cohérente — pas de comptabilité, pas de paiements, pas de réservations publiques, pas de CRM ou ERP complet.",
|
||||
"scopeBody": "Cette démo s'adresse à quiconque veut voir comment {{productName}} traite les problèmes opérationnels d'un petit loueur : Operations Managers et Rental Employees, et toute personne évaluant l'approche. La portée est délibérément limitée à une preuve de concept unique et cohérente — pas de comptabilité, pas de paiements, pas de réservations publiques, pas de CRM ou ERP complet.",
|
||||
"realTitle": "Ce qui fonctionne réellement",
|
||||
"realBody": "Tout ce qui suit est du code fonctionnel, pas seulement une maquette : accès et sessions basés sur les rôles, gestion des véhicules et réservations, traitement des retours avec validation côté serveur, cinq règles de qualité des données avec chacune sa propre étape de résolution, une piste d'audit complète, une livraison automatisée vers n8n avec nouvelles tentatives limitées, un déploiement basé sur Docker, et une suite de tests automatisés (backend et Playwright de bout en bout).",
|
||||
"syntheticTitle": "Ce qui est synthétique",
|
||||
|
||||
@@ -63,6 +63,14 @@
|
||||
"noQualityIssues": "Aucun problème de qualité enregistré.",
|
||||
"fuel": "Carburant {{percent}}%",
|
||||
"damage": "Dommage",
|
||||
"technicalWarning": "Avertissement technique"
|
||||
"technicalWarning": "Avertissement technique",
|
||||
"inspectionTypes": {
|
||||
"departure": "Inspection de départ",
|
||||
"return": "Inspection de retour"
|
||||
},
|
||||
"maintenanceCategories": {
|
||||
"periodic_service": "Entretien périodique",
|
||||
"repair": "Réparation"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,13 @@
|
||||
"noAction": "—",
|
||||
"eventTypes": {
|
||||
"vehicle.returned.v1": "Retour de véhicule traité"
|
||||
},
|
||||
"errorCodes": {
|
||||
"connectionError": "Le service d'automatisation était temporairement injoignable. Le retour a été enregistré en toute sécurité et peut être soumis à nouveau.",
|
||||
"malformedPayload": "La tâche contenait des données incomplètes et n'a pas pu être livrée. Les données sous-jacentes restent enregistrées en toute sécurité.",
|
||||
"remoteReportedFailure": "Le service d'automatisation a refusé la livraison. La tâche peut être soumise à nouveau.",
|
||||
"staleLeaseRecovered": "Cette tâche a été récupérée après qu'une tentative de livraison précédente s'est arrêtée sans résultat.",
|
||||
"unknownError": "Une erreur inattendue s'est produite lors de la livraison de cette tâche."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"Quels contrôles sont requis avant le départ ?"
|
||||
],
|
||||
"emptyTitle": "Des preuves avant les réponses",
|
||||
"emptyDescription": "Posez des questions sur les retours, les dommages, les inspections ou une autre procédure indexée. Fleet Ops n'invente jamais de réponse en l'absence de preuves.",
|
||||
"emptyDescription": "Posez des questions sur les retours, les dommages, les inspections ou une autre procédure indexée. {{productName}} n'invente jamais de réponse en l'absence de preuves.",
|
||||
"retrievalFlow": {
|
||||
"question": "Question",
|
||||
"sources": "Sources",
|
||||
|
||||
@@ -27,12 +27,22 @@
|
||||
"resetConfirmYes": "Oui, réinitialiser",
|
||||
"resetCancel": "Annuler",
|
||||
"resetFailed": "Impossible de réinitialiser les données de démo.",
|
||||
"searchLabel": "Rechercher dans Fleet Ops",
|
||||
"searchLabel": "Rechercher dans {{productName}}",
|
||||
"searchPlaceholder": "Rechercher flotte, réservation ou section…",
|
||||
"searchShortcutHint": "Ctrl K",
|
||||
"searchSearching": "Recherche…",
|
||||
"searchUnavailable": "La recherche est momentanément indisponible.",
|
||||
"searchNoResults": "Aucun résultat pour « {{query}} ».",
|
||||
"searchVehicleSummary": "{{make}} {{model}} · {{location}}",
|
||||
"searchSections": {
|
||||
"overview": "Tableau de bord opérationnel",
|
||||
"fleet": "Registre de la flotte",
|
||||
"bookings": "Réservations de location",
|
||||
"quality": "Atelier qualité",
|
||||
"knowledge": "Assistant de procédures",
|
||||
"integrations": "Statut d'automatisation et d'intégration",
|
||||
"audit": "Historique d'audit"
|
||||
},
|
||||
"switchRole": "Changer de rôle",
|
||||
"switchRoleTitle": "Changer de rôle de démo",
|
||||
"languageSwitcherLabel": "Changer de langue"
|
||||
|
||||
@@ -180,13 +180,48 @@
|
||||
"heading": "Résoudre le conflit de statut",
|
||||
"description": "Une règle faisant autorité recommande un statut opérationnel corrigé pour ce véhicule.",
|
||||
"currentStatus": "Statut actuel",
|
||||
"calculateAndApply": "Calculer et appliquer le statut recommandé",
|
||||
"confirmTitle": "Confirmer le changement de statut",
|
||||
"confirmBody": "Appliquer le statut recommandé faisant autorité pour ce véhicule ?",
|
||||
"reviewRecommendation": "Voir la recommandation",
|
||||
"loadingRecommendation": "Chargement de la recommandation…",
|
||||
"recommendationFailed": "Impossible de charger une recommandation.",
|
||||
"recommendedStatus": "Statut recommandé",
|
||||
"whyHeading": "Pourquoi",
|
||||
"evidenceHeading": "Faits",
|
||||
"consequenceHeading": "Conséquence",
|
||||
"consequence": {
|
||||
"statusWillChange": "Le statut du véhicule sera changé en {{status}}.",
|
||||
"issueWillBeRechecked": "Ce problème de qualité sera à nouveau contrôlé.",
|
||||
"changeWillBeAudited": "Le changement sera enregistré dans la piste d'audit.",
|
||||
"bookingsNotDeleted": "Les réservations elles-mêmes ne sont pas supprimées."
|
||||
},
|
||||
"changeStatusTo": "Changer le statut vers {{status}}",
|
||||
"applying": "Application en cours…",
|
||||
"confirmYes": "Oui, appliquer",
|
||||
"applied": "Appliqué {{status}} — {{reason}}",
|
||||
"applyFailed": "Impossible d'appliquer un statut recommandé."
|
||||
"applyFailed": "Impossible d'appliquer un statut recommandé.",
|
||||
"staleRecommendation": "La situation a changé depuis l'affichage de cette recommandation. Consultez-la à nouveau avant de l'appliquer.",
|
||||
"reviewAgain": "Revoir la recommandation",
|
||||
"manualReview": {
|
||||
"heading": "Évaluation manuelle requise",
|
||||
"body": "Les faits concernant ce véhicule se contredisent. Un Operations Manager doit évaluer la situation en personne plutôt que d'appliquer un changement de statut automatique.",
|
||||
"hint": "Utilisez « Reporter » ou « Rejeter » ci-dessous, ou examinez manuellement le véhicule et les réservations concernées."
|
||||
},
|
||||
"noConflict": {
|
||||
"heading": "Aucun changement nécessaire",
|
||||
"body": "Le statut actuel de ce véhicule correspond déjà aux faits."
|
||||
},
|
||||
"evidence": {
|
||||
"activeBookings": "Réservation(s) active(s) : {{refs}}",
|
||||
"overlappingBookings": "Réservations qui se chevauchent : {{pairs}}",
|
||||
"serviceThresholdReached": "Le kilométrage ({{odometer}} km) a atteint le seuil d'entretien ({{threshold}} km).",
|
||||
"openOverlapIssue": "Problème de chevauchement de réservation ouvert : {{ref}}"
|
||||
},
|
||||
"reasonCodes": {
|
||||
"vehicle.active_rental": "Ce véhicule a une location active mais n'est pas enregistré comme loué. Le statut est corrigé pour refléter la situation réelle.",
|
||||
"vehicle.service_threshold_reached": "Ce véhicule a atteint son seuil d'entretien. Il est placé en entretien afin qu'il ne soit pas utilisé avant que la révision ait eu lieu.",
|
||||
"vehicle.booking_conflict": "Ce véhicule a deux réservations qui se chevauchent. Le bloquer évite qu'il soit à nouveau considéré comme disponible avant que le conflit de réservation ne soit résolu.",
|
||||
"vehicle.rental_ended": "La location de ce véhicule est terminée et il n'y a plus de réservation active. Il est remis en disponible.",
|
||||
"vehicle.manual_review_required": "Les faits concernant ce véhicule se contredisent (par exemple, une réservation active alors que le véhicule est en entretien, ou un seuil d'entretien atteint en même temps qu'une location active). Cela nécessite une évaluation humaine plutôt qu'un changement de statut automatique.",
|
||||
"vehicle.no_conflict": "Le statut actuel de ce véhicule correspond déjà aux faits. Aucun changement n'est nécessaire."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,13 @@
|
||||
"odometerRegressionWarning": "Le kilométrage saisi ({{submitted}} km) est inférieur au relevé de référence ({{canonical}} km). Le kilométrage de référence ne changera pas et un problème de qualité des données sera ouvert.",
|
||||
"nextBookingRisk": "La prochaine réservation {{ref}} débute {{when}} — peut être affectée par ce retour.",
|
||||
"nextBookingLowRisk": "La prochaine réservation {{ref}} débute {{when}} — risque faible.",
|
||||
"reasonCodes": {
|
||||
"returnBlockedDamageAndTechnical": "Des dégâts et une alerte technique ont tous deux été signalés lors de ce retour.",
|
||||
"returnBlockedDamage": "Des dégâts ont été signalés lors de ce retour.",
|
||||
"returnBlockedTechnicalWarning": "Une alerte technique a été signalée lors de ce retour.",
|
||||
"returnServiceThresholdReached": "Le kilométrage a atteint le seuil d'entretien de {{threshold_km}} km.",
|
||||
"returnRoutedToCleaning": "Aucun dégât, alerte technique ou seuil d'entretien atteint ; le véhicule part en nettoyage."
|
||||
},
|
||||
"commitList": {
|
||||
"inspection": "Créer une inspection de retour",
|
||||
"updateAtomic": "Mettre à jour la réservation et le véhicule de façon atomique",
|
||||
@@ -66,8 +73,9 @@
|
||||
"continueDemo": "Poursuivre la démo"
|
||||
},
|
||||
"scenario": {
|
||||
"ariaLabel": "Scénario de démo",
|
||||
"title": "Scénario de démo : anomalie de kilométrage",
|
||||
"body": "Ce véhicule affiche actuellement {{odometer}} km. Le formulaire ci-dessous est pré-rempli avec un relevé de retour inférieur — signe d'une erreur de saisie ou d'un véhicule confondu. Confirmez le retour pour voir comment Fleet Ops détecte et traite cela.",
|
||||
"body": "Ce véhicule affiche actuellement {{odometer}} km. Le formulaire ci-dessous est pré-rempli avec un relevé de retour inférieur — signe d'une erreur de saisie ou d'un véhicule confondu. Confirmez le retour pour voir comment {{productName}} détecte et traite cela.",
|
||||
"preparing": "Préparation du scénario…"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,29 @@
|
||||
"was": "{{field}}: was {{value}}",
|
||||
"changed": "{{field}}: {{before}} → {{after}}"
|
||||
},
|
||||
"actorTypes": {
|
||||
"user": "Gebruiker",
|
||||
"system": "Systeem",
|
||||
"service": "Dienst"
|
||||
},
|
||||
"fields": {
|
||||
"status": "Status",
|
||||
"operational_status": "Operationele status",
|
||||
"registration_number": "Kenteken",
|
||||
"make": "Merk",
|
||||
"model": "Model",
|
||||
"location": "Locatie",
|
||||
"first_name": "Voornaam",
|
||||
"last_name": "Achternaam",
|
||||
"email": "E-mail",
|
||||
"phone": "Telefoon",
|
||||
"postal_code": "Postcode",
|
||||
"city": "Stad",
|
||||
"booking_end_odometer_km": "Eindkilometerstand boeking",
|
||||
"vehicle_odometer_km": "Kilometerstand voertuig",
|
||||
"survivor": "Behouden profiel",
|
||||
"loser": "Samengevoegd profiel"
|
||||
},
|
||||
"actions": {
|
||||
"demo_login": "Ingelogd",
|
||||
"demo_logout": "Uitgelogd",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"orgLine": "Demo-organisatie: {{orgName}} (fictief)",
|
||||
"headline1": "Elke overdracht.",
|
||||
"headline2": "Eén helder overzicht.",
|
||||
"defaultDescription": "Fleet Ops brengt voertuig-, boekings- en operationele gegevens samen, ondersteunt verhuurprocessen, detecteert datakwaliteitsproblemen en automatiseert gecontroleerde vervolgstappen.",
|
||||
"defaultDescription": "{{productName}} brengt voertuig-, boekings- en operationele gegevens samen, ondersteunt verhuurprocessen, detecteert datakwaliteitsproblemen en automatiseert gecontroleerde vervolgstappen.",
|
||||
"footnote": "Synthetische demo · geen echte klant- of voertuiggegevens · op elk moment herstelbaar",
|
||||
"accessEyebrow": "Demo-toegang",
|
||||
"accessHeading": "Kies hoe je wil starten",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"appName": "Fleet Ops",
|
||||
"orgName": "Northstar Mobility",
|
||||
"brandTagline": "Bedieningscentrum",
|
||||
"actions": {
|
||||
@@ -35,7 +34,7 @@
|
||||
"fr-BE": "Français"
|
||||
},
|
||||
"footer": {
|
||||
"productLine": "Fleet Ops Demo",
|
||||
"productLine": "{{productName}} Demo",
|
||||
"locale": "Europa/Brussel · Synthetische demogegevens"
|
||||
},
|
||||
"demo": {
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
"whatYouWillSee": "Een overzicht van wat in deze demo functioneel geïmplementeerd is, wat synthetisch is, en welke koppelingen nog niet live zijn.",
|
||||
"whyItMatters": "Een demo is pas overtuigend als bezoekers zelf kunnen nagaan wat echt werkt en wat nog toekomstmuziek is.",
|
||||
"startAction": "Lees de pagina 'Over deze demo'.",
|
||||
"expectedOutcome": "Je kan zelf uitleggen wat Fleet Ops wel en niet is, zonder mondelinge toelichting."
|
||||
"expectedOutcome": "Je kan zelf uitleggen wat {{productName}} wel en niet is, zonder mondelinge toelichting."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -146,16 +146,16 @@
|
||||
},
|
||||
"about": {
|
||||
"eyebrow": "Over deze demo",
|
||||
"title": "Wat Fleet Ops wel en niet is",
|
||||
"title": "Wat {{productName}} wel en niet is",
|
||||
"description": "{{orgName}} is een fictieve verhuurorganisatie die dient om deze demo tastbaar te maken — geen bestaand bedrijf.",
|
||||
"loading": "Demo-informatie laden…",
|
||||
"ctaTitle": "Liever meteen aan de slag?",
|
||||
"ctaBody": "De gegidste demo doorloopt alle acht stappen hierboven in de praktijk.",
|
||||
"ctaButton": "Start begeleide demo",
|
||||
"problemTitle": "Het fictieve probleem",
|
||||
"problemBody": "{{orgName}} verhuurt zo'n 50 campers en bestelwagens vanuit één hoofdlocatie. Boekingen, retours, klantgegevens en onderhoud kwamen tot nu toe uit losse spreadsheets en mondelinge afspraken, waardoor fouten (dubbele klanten, foutieve kilometerstanden, dubbel geboekte voertuigen) laat aan het licht kwamen. Fleet Ops toont hoe één samenhangend systeem die problemen vroeg signaleert en gecontroleerd laat oplossen.",
|
||||
"problemBody": "{{orgName}} verhuurt zo'n 50 campers en bestelwagens vanuit één hoofdlocatie. Boekingen, retours, klantgegevens en onderhoud kwamen tot nu toe uit losse spreadsheets en mondelinge afspraken, waardoor fouten (dubbele klanten, foutieve kilometerstanden, dubbel geboekte voertuigen) laat aan het licht kwamen. {{productName}} toont hoe één samenhangend systeem die problemen vroeg signaleert en gecontroleerd laat oplossen.",
|
||||
"scopeTitle": "Voor wie en met welke scope",
|
||||
"scopeBody": "Deze demo is bedoeld voor wie wil zien hoe Fleet Ops operationele problemen bij een kleine verhuurder aanpakt: Operations Managers en Rental Employees, en iedereen die de aanpak evalueert. De scope is bewust afgebakend tot één samenhangende proof of concept — geen boekhouding, geen betalingen, geen publieke reservaties, geen volledig CRM of ERP.",
|
||||
"scopeBody": "Deze demo is bedoeld voor wie wil zien hoe {{productName}} operationele problemen bij een kleine verhuurder aanpakt: Operations Managers en Rental Employees, en iedereen die de aanpak evalueert. De scope is bewust afgebakend tot één samenhangende proof of concept — geen boekhouding, geen betalingen, geen publieke reservaties, geen volledig CRM of ERP.",
|
||||
"realTitle": "Wat écht werkt",
|
||||
"realBody": "Alles hieronder is functionele code, niet alleen een mockup: rol-gebaseerde toegang en sessies, voertuig- en boekingsbeheer, retourverwerking met serverzijdige validatie, vijf datakwaliteitsregels met elk een eigen oplossingsstap, een volledige audit trail, geautomatiseerde aflevering naar n8n met begrensde herpogingen, Docker-gebaseerde deployment en een geautomatiseerde testsuite (backend en Playwright end-to-end).",
|
||||
"syntheticTitle": "Wat synthetisch is",
|
||||
|
||||
@@ -63,6 +63,14 @@
|
||||
"noQualityIssues": "Geen kwaliteitsproblemen geregistreerd.",
|
||||
"fuel": "Brandstof {{percent}}%",
|
||||
"damage": "Schade",
|
||||
"technicalWarning": "Technische melding"
|
||||
"technicalWarning": "Technische melding",
|
||||
"inspectionTypes": {
|
||||
"departure": "Vertrekinspectie",
|
||||
"return": "Retourinspectie"
|
||||
},
|
||||
"maintenanceCategories": {
|
||||
"periodic_service": "Periodiek onderhoud",
|
||||
"repair": "Herstelling"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,13 @@
|
||||
"noAction": "—",
|
||||
"eventTypes": {
|
||||
"vehicle.returned.v1": "Voertuigretour verwerkt"
|
||||
},
|
||||
"errorCodes": {
|
||||
"connectionError": "De workflowdienst was tijdelijk niet bereikbaar. De retour is veilig opgeslagen en kan opnieuw worden aangeboden.",
|
||||
"malformedPayload": "De opdracht bevatte onvolledige gegevens en kon niet worden afgeleverd. De onderliggende gegevens blijven veilig bewaard.",
|
||||
"remoteReportedFailure": "De workflowdienst heeft de aflevering geweigerd. De opdracht kan opnieuw worden aangeboden.",
|
||||
"staleLeaseRecovered": "Deze opdracht werd hersteld nadat een eerdere afleverpoging vastliep zonder resultaat.",
|
||||
"unknownError": "Er is een onverwachte fout opgetreden bij het afleveren van deze opdracht."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"Welke controles zijn verplicht vóór vertrek?"
|
||||
],
|
||||
"emptyTitle": "Evidentie voor antwoorden",
|
||||
"emptyDescription": "Vraag naar retours, schade, inspecties of een andere geïndexeerde procedure. Fleet Ops verzint geen antwoord wanneer evidentie ontbreekt.",
|
||||
"emptyDescription": "Vraag naar retours, schade, inspecties of een andere geïndexeerde procedure. {{productName}} verzint geen antwoord wanneer evidentie ontbreekt.",
|
||||
"retrievalFlow": {
|
||||
"question": "Vraag",
|
||||
"sources": "Bronnen",
|
||||
|
||||
@@ -27,12 +27,22 @@
|
||||
"resetConfirmYes": "Ja, herstellen",
|
||||
"resetCancel": "Annuleren",
|
||||
"resetFailed": "Demogegevens konden niet hersteld worden.",
|
||||
"searchLabel": "Zoek in Fleet Ops",
|
||||
"searchLabel": "Zoek in {{productName}}",
|
||||
"searchPlaceholder": "Zoek wagenpark, boeking of onderdeel…",
|
||||
"searchShortcutHint": "Ctrl K",
|
||||
"searchSearching": "Zoeken…",
|
||||
"searchUnavailable": "Zoeken is momenteel niet beschikbaar.",
|
||||
"searchNoResults": "Geen resultaten voor \"{{query}}\".",
|
||||
"searchVehicleSummary": "{{make}} {{model}} · {{location}}",
|
||||
"searchSections": {
|
||||
"overview": "Operationeel dashboard",
|
||||
"fleet": "Wagenparkregister",
|
||||
"bookings": "Verhuurboekingen",
|
||||
"quality": "Kwaliteitswerkbank",
|
||||
"knowledge": "Procedureassistent",
|
||||
"integrations": "Automatiserings- en integratiestatus",
|
||||
"audit": "Auditgeschiedenis"
|
||||
},
|
||||
"switchRole": "Wissel van rol",
|
||||
"switchRoleTitle": "Wissel van demo-rol",
|
||||
"languageSwitcherLabel": "Taal wijzigen"
|
||||
|
||||
@@ -180,13 +180,48 @@
|
||||
"heading": "Statusconflict oplossen",
|
||||
"description": "Eén gezaghebbende regel beveelt een gecorrigeerde operationele status voor dit voertuig aan.",
|
||||
"currentStatus": "Huidige status",
|
||||
"calculateAndApply": "Aanbevolen status berekenen en toepassen",
|
||||
"confirmTitle": "Statuswijziging bevestigen",
|
||||
"confirmBody": "De gezaghebbende aanbevolen status voor dit voertuig toepassen?",
|
||||
"reviewRecommendation": "Aanbeveling bekijken",
|
||||
"loadingRecommendation": "Aanbeveling laden…",
|
||||
"recommendationFailed": "Kon geen aanbeveling ophalen.",
|
||||
"recommendedStatus": "Aanbevolen status",
|
||||
"whyHeading": "Waarom",
|
||||
"evidenceHeading": "Feiten",
|
||||
"consequenceHeading": "Gevolg",
|
||||
"consequence": {
|
||||
"statusWillChange": "De voertuigstatus wordt gewijzigd naar {{status}}.",
|
||||
"issueWillBeRechecked": "Dit kwaliteitsprobleem wordt opnieuw gecontroleerd.",
|
||||
"changeWillBeAudited": "De wijziging wordt vastgelegd in de audit trail.",
|
||||
"bookingsNotDeleted": "De boekingen zelf worden niet verwijderd."
|
||||
},
|
||||
"changeStatusTo": "Status wijzigen naar {{status}}",
|
||||
"applying": "Bezig met toepassen…",
|
||||
"confirmYes": "Ja, toepassen",
|
||||
"applied": "Toegepast {{status}} — {{reason}}",
|
||||
"applyFailed": "Kon geen aanbevolen status toepassen."
|
||||
"applyFailed": "Kon geen aanbevolen status toepassen.",
|
||||
"staleRecommendation": "De situatie is intussen gewijzigd. Bekijk de aanbeveling opnieuw voor u ze toepast.",
|
||||
"reviewAgain": "Aanbeveling opnieuw bekijken",
|
||||
"manualReview": {
|
||||
"heading": "Handmatige beoordeling vereist",
|
||||
"body": "De feiten voor dit voertuig spreken elkaar tegen. Een Operations Manager moet dit persoonlijk beoordelen in plaats van een automatische statuswijziging toe te passen.",
|
||||
"hint": "Gebruik 'Uitstellen' of 'Verwerpen' hieronder, of onderzoek het voertuig en de betrokken boekingen manueel."
|
||||
},
|
||||
"noConflict": {
|
||||
"heading": "Geen wijziging nodig",
|
||||
"body": "De huidige status van dit voertuig komt al overeen met de feiten."
|
||||
},
|
||||
"evidence": {
|
||||
"activeBookings": "Actieve boeking(en): {{refs}}",
|
||||
"overlappingBookings": "Overlappende reserveringen: {{pairs}}",
|
||||
"serviceThresholdReached": "Kilometerstand ({{odometer}} km) heeft de onderhoudsdrempel ({{threshold}} km) bereikt.",
|
||||
"openOverlapIssue": "Openstaand boekingsoverlapprobleem: {{ref}}"
|
||||
},
|
||||
"reasonCodes": {
|
||||
"vehicle.active_rental": "Dit voertuig heeft een actieve verhuring maar staat niet als verhuurd geregistreerd. De status wordt gecorrigeerd zodat ze de werkelijke situatie weerspiegelt.",
|
||||
"vehicle.service_threshold_reached": "Dit voertuig heeft de onderhoudsdrempel bereikt. Het wordt naar onderhoud gezet zodat het niet wordt ingezet voordat de service is uitgevoerd.",
|
||||
"vehicle.booking_conflict": "Dit voertuig heeft twee overlappende reserveringen. Het blokkeren voorkomt dat het opnieuw als inzetbaar wordt beschouwd voordat het boekingsconflict is opgelost.",
|
||||
"vehicle.rental_ended": "De verhuring voor dit voertuig is beëindigd en er is geen actieve boeking meer. Het wordt terug beschikbaar gezet.",
|
||||
"vehicle.manual_review_required": "De feiten voor dit voertuig spreken elkaar tegen (bijvoorbeeld een actieve boeking terwijl het voertuig in onderhoud staat, of een onderhoudsdrempel die samenvalt met een actieve verhuring). Dit vereist een menselijke beoordeling in plaats van een automatische statuswijziging.",
|
||||
"vehicle.no_conflict": "De huidige status van dit voertuig komt al overeen met de feiten. Er is geen wijziging nodig."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,13 @@
|
||||
"odometerRegressionWarning": "De ingevoerde kilometerstand ({{submitted}} km) ligt onder de laatst bevestigde stand ({{canonical}} km). De laatst bevestigde kilometerstand wijzigt niet en er wordt een datakwaliteitsprobleem geopend.",
|
||||
"nextBookingRisk": "Volgende boeking {{ref}} start {{when}} — mogelijk beïnvloed door deze retour.",
|
||||
"nextBookingLowRisk": "Volgende boeking {{ref}} start {{when}} — laag risico.",
|
||||
"reasonCodes": {
|
||||
"returnBlockedDamageAndTechnical": "Zowel schade als een technische melding werden gemeld bij deze retour.",
|
||||
"returnBlockedDamage": "Er werd schade gemeld bij deze retour.",
|
||||
"returnBlockedTechnicalWarning": "Er werd een technische melding gemeld bij deze retour.",
|
||||
"returnServiceThresholdReached": "De kilometerstand heeft de onderhoudsdrempel van {{threshold_km}} km bereikt.",
|
||||
"returnRoutedToCleaning": "Geen schade, technische melding of onderhoudsdrempel; het voertuig gaat naar reiniging."
|
||||
},
|
||||
"commitList": {
|
||||
"inspection": "Retourinspectie aanmaken",
|
||||
"updateAtomic": "Boeking en voertuig atomair bijwerken",
|
||||
@@ -66,8 +73,9 @@
|
||||
"continueDemo": "Ga verder met de demo"
|
||||
},
|
||||
"scenario": {
|
||||
"ariaLabel": "Demonstratiescenario",
|
||||
"title": "Demonstratiescenario: afwijkende kilometerstand",
|
||||
"body": "Dit voertuig staat momenteel op {{odometer}} km. Het onderstaande formulier is vooraf ingevuld met een retourstand die daaronder ligt — een teken van een foutieve invoer of een verwisseld voertuig. Bevestig de retour om te zien hoe Fleet Ops dit detecteert en afhandelt.",
|
||||
"body": "Dit voertuig staat momenteel op {{odometer}} km. Het onderstaande formulier is vooraf ingevuld met een retourstand die daaronder ligt — een teken van een foutieve invoer of een verwisseld voertuig. Bevestig de retour om te zien hoe {{productName}} dit detecteert en afhandelt.",
|
||||
"preparing": "Scenario voorbereiden…"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useDemoManifest } from "../context/DemoManifestContext";
|
||||
import { useLocaleFormat } from "../i18n/format";
|
||||
import { Icon } from "../components/Icons";
|
||||
import { IntegrationMark, LoadingState, PageHeader, SectionHeading } from "../components/PageChrome";
|
||||
import { PRODUCT_NAME } from "../product";
|
||||
|
||||
const INTEGRATION_ICON: Record<string, "n8n" | "rag" | "mcp"> = {
|
||||
n8n: "n8n",
|
||||
@@ -36,7 +37,7 @@ export function AboutDemo() {
|
||||
<div className="page">
|
||||
<PageHeader
|
||||
eyebrow={t("about.eyebrow")}
|
||||
title={t("about.title")}
|
||||
title={t("about.title", { productName: PRODUCT_NAME })}
|
||||
description={manifest ? t("about.description", { orgName: manifest.organization_name }) : undefined}
|
||||
/>
|
||||
|
||||
@@ -58,12 +59,12 @@ export function AboutDemo() {
|
||||
|
||||
<section className="record-surface about-card">
|
||||
<h2>{t("about.problemTitle")}</h2>
|
||||
<p>{t("about.problemBody", { orgName: manifest.organization_name })}</p>
|
||||
<p>{t("about.problemBody", { orgName: manifest.organization_name, productName: PRODUCT_NAME })}</p>
|
||||
</section>
|
||||
|
||||
<section className="record-surface about-card">
|
||||
<h2>{t("about.scopeTitle")}</h2>
|
||||
<p>{t("about.scopeBody")}</p>
|
||||
<p>{t("about.scopeBody", { productName: PRODUCT_NAME })}</p>
|
||||
</section>
|
||||
|
||||
<section className="record-surface about-card">
|
||||
|
||||
@@ -36,7 +36,7 @@ function ChangeDiff({
|
||||
const b = before?.[key];
|
||||
const a = after?.[key];
|
||||
if (JSON.stringify(b) === JSON.stringify(a)) continue;
|
||||
const field = humanizeField(key);
|
||||
const field = t(`fields.${key}`, { defaultValue: humanizeField(key) });
|
||||
if (b === undefined) lines.push({ field, text: t("diff.setTo", { field, value: JSON.stringify(a) }) });
|
||||
else if (a === undefined) lines.push({ field, text: t("diff.was", { field, value: JSON.stringify(b) }) });
|
||||
else lines.push({ field, text: t("diff.changed", { field, before: JSON.stringify(b), after: JSON.stringify(a) }) });
|
||||
@@ -163,7 +163,7 @@ export function Audit() {
|
||||
<span className="table-subtext">{formatDateTime(e.occurred_at)}</span>
|
||||
</div>
|
||||
<div className="audit-group-meta">
|
||||
<span><strong>{e.actor_label}</strong> <small className="table-subtext">{e.actor_type}</small></span>
|
||||
<span><strong>{e.actor_label}</strong> <small className="table-subtext">{t(`actorTypes.${e.actor_type}`, { defaultValue: e.actor_type })}</small></span>
|
||||
{e.entity_link ? (
|
||||
<Link to={e.entity_link}>{e.entity_ref ?? e.entity_type}</Link>
|
||||
) : (
|
||||
|
||||
@@ -118,7 +118,21 @@ export function Automation() {
|
||||
<StatusBadge status={r.status} label={t(`ledger.status${r.status.charAt(0).toUpperCase()}${r.status.slice(1)}`)} />
|
||||
</td>
|
||||
<td data-label={t("ledger.columns.attempts")}>{r.attempts}</td>
|
||||
<td data-label={t("ledger.columns.lastError")}>{r.last_error ?? "—"}</td>
|
||||
<td data-label={t("ledger.columns.lastError")}>
|
||||
{r.last_error_code ? (
|
||||
<>
|
||||
<span>{t(`ledger.errorCodes.${r.last_error_code}`, { defaultValue: r.last_error ?? r.last_error_code })}</span>
|
||||
{r.last_error && (
|
||||
<details className="evidence-disclosure">
|
||||
<summary>{t("common:actions.technicalDetails")}</summary>
|
||||
<pre className="evidence-block">{r.last_error}</pre>
|
||||
</details>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
"—"
|
||||
)}
|
||||
</td>
|
||||
<td data-label={t("ledger.columns.when")}>
|
||||
<time dateTime={r.occurred_at}>{formatDateTime(r.occurred_at)}</time>
|
||||
</td>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { StatusBadge } from "../components/Badge";
|
||||
import { ReturnForm, ReturnResultPanel } from "../components/ReturnForm";
|
||||
import { Icon } from "../components/Icons";
|
||||
import { ErrorState, LoadingState, PageHeader } from "../components/PageChrome";
|
||||
import { PRODUCT_NAME } from "../product";
|
||||
|
||||
export function BookingDetail() {
|
||||
const { t } = useTranslation(["bookings", "returns"]);
|
||||
@@ -73,11 +74,11 @@ export function BookingDetail() {
|
||||
</dl></section>
|
||||
|
||||
{isReturnAnomalyScenario && !returnResult && canonicalOdometerKm !== null && (
|
||||
<section className="record-surface scenario-callout" aria-label="Demo scenario">
|
||||
<section className="record-surface scenario-callout" aria-label={t("returns:scenario.ariaLabel")}>
|
||||
<Icon name="spark" />
|
||||
<div>
|
||||
<strong>{t("returns:scenario.title")}</strong>
|
||||
<p>{t("returns:scenario.body", { odometer: formatNumber(canonicalOdometerKm) })}</p>
|
||||
<p>{t("returns:scenario.body", { odometer: formatNumber(canonicalOdometerKm), productName: PRODUCT_NAME })}</p>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
@@ -6,6 +6,7 @@ import type {
|
||||
ApplyRecommendedStatusResult,
|
||||
DataQualityIssueDetail as IssueDetail,
|
||||
EntitySnapshot,
|
||||
StatusRecommendation,
|
||||
} from "../api/types";
|
||||
import { SeverityBadge, StatusBadge } from "../components/Badge";
|
||||
import { useAuth } from "../context/AuthContext";
|
||||
@@ -443,15 +444,62 @@ function BookingOverlapPanel({ issue, onResolved }: { issue: IssueDetail; onReso
|
||||
);
|
||||
}
|
||||
|
||||
function statusLabel(t: (key: string, opts?: Record<string, unknown>) => string, status: string): string {
|
||||
const raw = t(`fleet:statuses.${status}`, { defaultValue: status });
|
||||
return raw.charAt(0).toUpperCase() + raw.slice(1);
|
||||
}
|
||||
|
||||
function StatusRecommendationEvidence({ recommendation }: { recommendation: StatusRecommendation }) {
|
||||
const { t } = useTranslation("quality");
|
||||
const { formatNumber } = useLocaleFormat();
|
||||
const facts = recommendation.facts;
|
||||
const lines: string[] = [];
|
||||
if (facts.active_booking_refs.length > 0) {
|
||||
lines.push(
|
||||
t("detail.vehicleStatusConflict.evidence.activeBookings", { refs: facts.active_booking_refs.join(", ") }),
|
||||
);
|
||||
}
|
||||
if (facts.overlapping_booking_pairs.length > 0) {
|
||||
lines.push(
|
||||
t("detail.vehicleStatusConflict.evidence.overlappingBookings", {
|
||||
pairs: facts.overlapping_booking_pairs.map((pair) => pair.join(" ↔ ")).join(", "),
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (facts.service_threshold_reached) {
|
||||
lines.push(
|
||||
t("detail.vehicleStatusConflict.evidence.serviceThresholdReached", {
|
||||
odometer: formatNumber(facts.odometer_km),
|
||||
threshold: formatNumber(facts.next_service_km),
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (facts.open_booking_overlap_issue_ref) {
|
||||
lines.push(
|
||||
t("detail.vehicleStatusConflict.evidence.openOverlapIssue", { ref: facts.open_booking_overlap_issue_ref }),
|
||||
);
|
||||
}
|
||||
if (lines.length === 0) return null;
|
||||
return (
|
||||
<ul className="evidence-list">
|
||||
{lines.map((line) => (
|
||||
<li key={line}>{line}</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
function VehicleStatusConflictPanel({ issue, onResolved }: { issue: IssueDetail; onResolved: () => void }) {
|
||||
const { t } = useTranslation("quality");
|
||||
const navigate = useNavigate();
|
||||
const { manifest } = useDemoManifest();
|
||||
const { open: guideOpen, currentIndex, completeAndAdvance } = useDemoGuide();
|
||||
const [recommendation, setRecommendation] = useState<StatusRecommendation | null>(null);
|
||||
const [loadingRecommendation, setLoadingRecommendation] = useState(false);
|
||||
const [stale, setStale] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [result, setResult] = useState<ApplyRecommendedStatusResult | null>(null);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [confirming, setConfirming] = useState(false);
|
||||
|
||||
function continueDemo() {
|
||||
completeAndAdvance();
|
||||
@@ -465,23 +513,52 @@ function VehicleStatusConflictPanel({ issue, onResolved }: { issue: IssueDetail;
|
||||
// visibility via `result` rather than disappearing the instant the reload lands.
|
||||
if (issue.status !== "open" && !result) return null;
|
||||
|
||||
async function loadRecommendation() {
|
||||
setError(null);
|
||||
setStale(false);
|
||||
setLoadingRecommendation(true);
|
||||
try {
|
||||
const preview = await api.post<StatusRecommendation>(
|
||||
`/api/v1/data-quality/issues/${issue.public_ref}/status-recommendation`,
|
||||
);
|
||||
setRecommendation(preview);
|
||||
} catch (err) {
|
||||
setError(err instanceof ApiError ? err.message : t("detail.vehicleStatusConflict.recommendationFailed"));
|
||||
} finally {
|
||||
setLoadingRecommendation(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleApply() {
|
||||
if (!recommendation) return;
|
||||
setError(null);
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const applied = await api.post<ApplyRecommendedStatusResult>(
|
||||
`/api/v1/data-quality/issues/${issue.public_ref}/apply-recommended-status`,
|
||||
{ recommendation_token: recommendation.recommendation_token },
|
||||
);
|
||||
setResult(applied);
|
||||
onResolved();
|
||||
} catch (err) {
|
||||
setError(err instanceof ApiError ? err.message : t("detail.vehicleStatusConflict.applyFailed"));
|
||||
setConfirming(false);
|
||||
if (err instanceof ApiError && err.code === "RECOMMENDATION_STALE") {
|
||||
setError(t("detail.vehicleStatusConflict.staleRecommendation"));
|
||||
setRecommendation(null);
|
||||
setStale(true);
|
||||
} else {
|
||||
setError(err instanceof ApiError ? err.message : t("detail.vehicleStatusConflict.applyFailed"));
|
||||
}
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
}
|
||||
|
||||
const needsManualReview =
|
||||
recommendation !== null && (recommendation.manual_review_required || !recommendation.safe_to_apply);
|
||||
const noChangeNeeded = recommendation !== null && !needsManualReview && recommendation.recommended_status === null;
|
||||
const hasSafeRecommendation =
|
||||
recommendation !== null && !needsManualReview && recommendation.recommended_status !== null;
|
||||
|
||||
return (
|
||||
<section className="panel" aria-labelledby="status-conflict-heading">
|
||||
<SectionHeading
|
||||
@@ -496,7 +573,12 @@ function VehicleStatusConflictPanel({ issue, onResolved }: { issue: IssueDetail;
|
||||
{result ? (
|
||||
<>
|
||||
<p className="quiet-empty">
|
||||
<Icon name="check" /> {t("detail.vehicleStatusConflict.applied", { status: result.applied_status, reason: result.reason })}
|
||||
<Icon name="check" /> {t("detail.vehicleStatusConflict.applied", {
|
||||
status: statusLabel(t, result.applied_status),
|
||||
reason: t(`detail.vehicleStatusConflict.reasonCodes.${result.reason_code}`, {
|
||||
defaultValue: result.reason_code,
|
||||
}),
|
||||
})}
|
||||
</p>
|
||||
<div className="result-links">
|
||||
<Link className="button button-secondary" to="/audit">{t("detail.resolved.viewAudit")}<Icon name="chevron" /></Link>
|
||||
@@ -508,21 +590,63 @@ function VehicleStatusConflictPanel({ issue, onResolved }: { issue: IssueDetail;
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
) : !confirming ? (
|
||||
<button type="button" className="button button-primary" onClick={() => setConfirming(true)}>
|
||||
{t("detail.vehicleStatusConflict.calculateAndApply")}
|
||||
) : !recommendation ? (
|
||||
<button type="button" className="button button-primary" onClick={loadRecommendation} disabled={loadingRecommendation}>
|
||||
{loadingRecommendation
|
||||
? t("detail.vehicleStatusConflict.loadingRecommendation")
|
||||
: t(stale ? "detail.vehicleStatusConflict.reviewAgain" : "detail.vehicleStatusConflict.reviewRecommendation")}
|
||||
</button>
|
||||
) : (
|
||||
<div className="confirm-bar" role="alertdialog" aria-label={t("detail.vehicleStatusConflict.confirmTitle")}>
|
||||
<p>{t("detail.vehicleStatusConflict.confirmBody")}</p>
|
||||
) : needsManualReview ? (
|
||||
<div className="status-decision" role="status">
|
||||
<h3>{t("detail.vehicleStatusConflict.manualReview.heading")}</h3>
|
||||
<p>{t("detail.vehicleStatusConflict.manualReview.body")}</p>
|
||||
<StatusRecommendationEvidence recommendation={recommendation} />
|
||||
<p className="table-subtext">{t("detail.vehicleStatusConflict.manualReview.hint")}</p>
|
||||
</div>
|
||||
) : noChangeNeeded ? (
|
||||
<div className="status-decision" role="status">
|
||||
<h3>{t("detail.vehicleStatusConflict.noConflict.heading")}</h3>
|
||||
<p>{t("detail.vehicleStatusConflict.noConflict.body")}</p>
|
||||
</div>
|
||||
) : hasSafeRecommendation && recommendation.recommended_status ? (
|
||||
<div className="status-decision" role="group" aria-label={t("detail.vehicleStatusConflict.recommendedStatus")}>
|
||||
<dl className="detail-grid">
|
||||
<div>
|
||||
<dt>{t("detail.vehicleStatusConflict.recommendedStatus")}</dt>
|
||||
<dd>
|
||||
<StatusBadge
|
||||
status={recommendation.recommended_status}
|
||||
label={t(`fleet:statuses.${recommendation.recommended_status}`, {
|
||||
defaultValue: recommendation.recommended_status,
|
||||
})}
|
||||
/>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<h3>{t("detail.vehicleStatusConflict.whyHeading")}</h3>
|
||||
<p>{t(`detail.vehicleStatusConflict.reasonCodes.${recommendation.recommendation_code}`, {
|
||||
defaultValue: recommendation.recommendation_code,
|
||||
})}</p>
|
||||
<h3>{t("detail.vehicleStatusConflict.evidenceHeading")}</h3>
|
||||
<StatusRecommendationEvidence recommendation={recommendation} />
|
||||
<h3>{t("detail.vehicleStatusConflict.consequenceHeading")}</h3>
|
||||
<ul className="evidence-list">
|
||||
<li>{t("detail.vehicleStatusConflict.consequence.statusWillChange", {
|
||||
status: statusLabel(t, recommendation.recommended_status),
|
||||
})}</li>
|
||||
<li>{t("detail.vehicleStatusConflict.consequence.issueWillBeRechecked")}</li>
|
||||
<li>{t("detail.vehicleStatusConflict.consequence.changeWillBeAudited")}</li>
|
||||
<li>{t("detail.vehicleStatusConflict.consequence.bookingsNotDeleted")}</li>
|
||||
</ul>
|
||||
<button type="button" className="button button-primary" onClick={handleApply} disabled={submitting}>
|
||||
{submitting ? t("detail.vehicleStatusConflict.applying") : t("detail.vehicleStatusConflict.confirmYes")}
|
||||
</button>
|
||||
<button type="button" className="button button-secondary" onClick={() => setConfirming(false)} disabled={submitting}>
|
||||
{t("list.cancel")}
|
||||
{submitting
|
||||
? t("detail.vehicleStatusConflict.applying")
|
||||
: t("detail.vehicleStatusConflict.changeStatusTo", {
|
||||
status: statusLabel(t, recommendation.recommended_status),
|
||||
})}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
) : null}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { api, ApiError } from "../api/client";
|
||||
import type { GroundedAnswer, KnowledgeHealth } from "../api/types";
|
||||
import { Icon } from "../components/Icons";
|
||||
import { PageHeader } from "../components/PageChrome";
|
||||
import { PRODUCT_NAME } from "../product";
|
||||
|
||||
interface Exchange {
|
||||
question: string;
|
||||
@@ -121,7 +122,7 @@ export function Knowledge() {
|
||||
<div className="knowledge-empty">
|
||||
<span><Icon name="knowledge" /></span>
|
||||
<h2>{t("emptyTitle")}</h2>
|
||||
<p>{t("emptyDescription")}</p>
|
||||
<p>{t("emptyDescription", { productName: PRODUCT_NAME })}</p>
|
||||
<div className="retrieval-flow" aria-hidden="true">
|
||||
<span>{t("retrievalFlow.question")}</span><i />
|
||||
<span>{providerLabel}</span><i />
|
||||
|
||||
@@ -6,6 +6,7 @@ import { useDemoManifest } from "../context/DemoManifestContext";
|
||||
import { LanguageSwitcher } from "../components/LanguageSwitcher";
|
||||
import type { Role } from "../api/types";
|
||||
import { BrandMark, Icon } from "../components/Icons";
|
||||
import { PRODUCT_NAME } from "../product";
|
||||
|
||||
export function Login() {
|
||||
const { t } = useTranslation(["auth", "common"]);
|
||||
@@ -25,14 +26,14 @@ export function Login() {
|
||||
}
|
||||
|
||||
const orgName = manifest?.organization_name ?? t("common:orgName");
|
||||
const description = t("defaultDescription");
|
||||
const description = t("defaultDescription", { productName: PRODUCT_NAME });
|
||||
|
||||
return (
|
||||
<main className="login-shell">
|
||||
<section className="login-story" aria-labelledby="product-name">
|
||||
<div className="brand-lockup login-brand">
|
||||
<BrandMark className="brand-mark" />
|
||||
<div><strong>{t("common:appName")}</strong><span>{t("brandTagline")}</span></div>
|
||||
<div><strong>{PRODUCT_NAME}</strong><span>{t("brandTagline")}</span></div>
|
||||
</div>
|
||||
<div className="login-message">
|
||||
<p className="eyebrow">{t("orgLine", { orgName })}</p>
|
||||
|
||||
@@ -83,7 +83,7 @@ export function VehicleDetail() {
|
||||
{vehicle.inspections.length === 0 && <li>{t("detail.noInspections")}</li>}
|
||||
{vehicle.inspections.map((i) => (
|
||||
<li key={i.public_ref}>
|
||||
<span>{i.type}</span>
|
||||
<span>{t(`fleet:detail.inspectionTypes.${i.type}`, { defaultValue: i.type })}</span>
|
||||
<span>{formatNumber(i.odometer_km)} km</span>
|
||||
<span>{t("detail.fuel", { percent: i.fuel_level_percent })}</span>
|
||||
{i.damage_reported && <span className="badge severity-high">{t("detail.damage")}</span>}
|
||||
@@ -99,7 +99,7 @@ export function VehicleDetail() {
|
||||
{vehicle.maintenance.length === 0 && <li>{t("detail.noMaintenance")}</li>}
|
||||
{vehicle.maintenance.map((m) => (
|
||||
<li key={m.public_ref}>
|
||||
<span>{m.category}</span>
|
||||
<span>{t(`fleet:detail.maintenanceCategories.${m.category}`, { defaultValue: m.category })}</span>
|
||||
<span>{m.summary}</span>
|
||||
<time dateTime={m.occurred_at}>{formatShortDate(m.occurred_at)}</time>
|
||||
</li>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// The visible product name is a fixed brand constant, never a translatable string: it
|
||||
// must read identically ("Fleet Ops") in every supported locale. Keeping it out of the
|
||||
// i18n resource files makes that a structural guarantee rather than a convention a
|
||||
// translator could accidentally break by editing one locale's JSON.
|
||||
export const PRODUCT_NAME = "Fleet Ops";
|
||||
@@ -273,6 +273,14 @@ details summary { cursor: pointer; color: var(--teal-dark); }.data-table details
|
||||
.scenario-callout strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: .82rem; }
|
||||
.scenario-callout p { margin: 0; color: var(--ink-soft); font-size: .78rem; line-height: 1.55; }
|
||||
|
||||
.status-decision { margin-top: 16px; padding: 16px 18px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
|
||||
.status-decision h3 { margin: 16px 0 6px; color: var(--ink); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
|
||||
.status-decision h3:first-child { margin-top: 0; }
|
||||
.status-decision > .detail-grid { margin-bottom: 4px; }
|
||||
.evidence-list { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: .78rem; line-height: 1.6; }
|
||||
.evidence-list li { margin-bottom: 2px; }
|
||||
.status-decision .button { margin-top: 16px; }
|
||||
|
||||
.duplicate-compare { margin-top: 18px; }.duplicate-compare fieldset { margin: 15px 0; padding: 13px; border: 1px solid var(--line); }.duplicate-compare legend { padding: 0 5px; color: var(--ink-soft); font-size: .69rem; font-weight: 700; }.duplicate-compare fieldset label { display: inline-flex !important; margin-right: 18px; }
|
||||
.compare-table th, .compare-table td { vertical-align: top; }.compare-table label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }.difference-mark, .match-mark { display: block; width: max-content; margin-top: 4px; padding: 2px 5px; font-size: .52rem; border-radius: 2px; }.difference-mark { color: var(--warning); background: var(--warning-pale); }.match-mark { color: var(--success); background: var(--success-pale); }
|
||||
.merge-preview { padding: 13px; color: var(--ink-soft); background: var(--surface-subtle); border-left: 3px solid var(--teal); font-size: .75rem; }.duplicate-compare > button { color: white; background: var(--teal-dark); border-color: var(--teal-dark); }
|
||||
|
||||
Reference in New Issue
Block a user