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