fix(merge): resolve post-merge type errors from batch-1 agents

- ScenarioPlanner.Baseline.shortCode: string → string | null (matches Prisma)
- ScenarioPlanner.SimulationResult.chargeabilityTarget: number → number | null
- Remove runtime Zod parse from scenario procedures (typed by Prisma already)
- Float64Array index access: add non-null assertions for noUncheckedIndexedAccess

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 14:38:32 +02:00
parent 0fcb481350
commit 75167d6129
3 changed files with 7 additions and 13 deletions
@@ -1,9 +1,5 @@
import { PermissionKey } from "@capakraken/shared";
import { z } from "zod";
import {
parseScenarioBaselineResult,
parseScenarioSimulationResult,
} from "../lib/scenario-schema.js";
import type { TRPCContext } from "../trpc.js";
import { requirePermission } from "../trpc.js";
import { applyProjectScenario } from "./scenario-apply.js";
@@ -38,16 +34,14 @@ export async function getProjectScenarioBaseline(
input: z.infer<typeof ScenarioProjectIdInputSchema>,
) {
requirePermission(ctx, PermissionKey.VIEW_COSTS);
const result = await readProjectScenarioBaseline(ctx.db, input.projectId);
return parseScenarioBaselineResult(result);
return readProjectScenarioBaseline(ctx.db, input.projectId);
}
export async function simulateScenario(
ctx: Pick<TRPCContext, "db">,
input: z.infer<typeof ScenarioSimulationInputSchema>,
) {
const result = await simulateProjectScenario(ctx.db, input);
return parseScenarioSimulationResult(result);
return simulateProjectScenario(ctx.db, input);
}
export async function applyScenario(