feat: admin Verktyg (live fordon + sanktioner lookup) + service-type pricing in configurator

/admin/verktyg uses live /api/vehicles (RDW) + /api/screen (OpenSanctions); added to admin nav. Configurator now has a Tjänst selector that applies each service's price multiplier (lib/services) to the live estimate + summary; service_type carried into the order so orders-store prices by service. tsc 0, build green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
2026-06-25 02:17:18 +02:00
co-authored by Claude Opus 4.8
parent 56e117a6d6
commit 76b20e341d
5 changed files with 117 additions and 4 deletions
+3
View File
@@ -1,5 +1,6 @@
import { getSql } from "@/lib/db";
import { computeEstimate, type EntityType, type Frequency } from "@/lib/data";
import { serviceById } from "@/lib/services";
export interface OrderConfig {
markets?: string[];
@@ -10,6 +11,7 @@ export interface OrderConfig {
frequency?: Frequency;
confidence?: number;
formats?: string[];
service_type?: string;
}
export interface Order {
@@ -37,6 +39,7 @@ function estimateFor(config: OrderConfig) {
volume: config.volume ?? 1000,
frequency: config.frequency ?? "Engångs",
confidence: config.confidence ?? 92,
serviceMult: serviceById(config.service_type ?? "")?.mult ?? 1,
});
}