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:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user