refactor: route/schema consistency (parseId, broad invalidation, Czech messages, Zod 4 strictObject)

- OfferDetail: invalidate broad ["offers"] not ["offers","list"] (CLAUDE.md convention)
- trips.ts/sessions.ts: use parseId helper (validated 400) instead of raw parseInt for route ids
- audit-log.ts: z.object().strict() -> z.strictObject() (Zod 4 idiom)
- attendance.ts, orders/offers schemas: English user-facing strings -> Czech
- project-files.ts: unify 'not found' phrasing to the codebase-dominant 'nenalezen' form

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-06 02:29:04 +02:00
parent 522afefc80
commit 9ae49c0d6a
8 changed files with 43 additions and 45 deletions

View File

@@ -12,12 +12,10 @@ import { parseBody } from "../../schemas/common";
// forensic history.
const DELETE_ALL_CONFIRM = "DELETE_ALL_AUDIT" as const;
const AuditCleanupSchema = z
.object({
days: z.number().int().nonnegative().optional(),
confirm: z.string().optional(),
})
.strict();
const AuditCleanupSchema = z.strictObject({
days: z.number().int().nonnegative().optional(),
confirm: z.string().optional(),
});
export default async function auditLogRoutes(
fastify: FastifyInstance,