fix(repairs): stop rejecting log when broken serial already exists
CI / Lint · Typecheck · Test · Build (push) Successful in 1m13s
CI / Playwright (smoke) (push) Has been skipped
CI / Build & push images (push) Successful in 1m35s

The LogRepairRequest superRefine demanded brokenPartModelId or
brokenMpn+brokenManufacturerId on every request, but the service only
consumes those fields when ingesting a brand-new broken part. For
serials already in Vector, the client correctly omits them — schema
then false-rejected the payload. Drop the refine; the service still
throws with the same message when ingest truly needs it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-17 16:01:14 -04:00
parent e60d049e69
commit ae65d9f2a8
+2 -10
View File
@@ -25,16 +25,8 @@ export const LogRepairRequest = z
path: ['hostId'],
});
}
const hasModel =
v.brokenPartModelId !== undefined ||
(v.brokenMpn !== undefined && v.brokenManufacturerId !== undefined);
if (!hasModel) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Provide brokenPartModelId or both brokenMpn and brokenManufacturerId',
path: ['brokenPartModelId'],
});
}
// Model fields are only required when the broken serial isn't already in Vector. The
// server resolves the serial before demanding them — see services/repairs.ts.
});
export type LogRepairRequest = z.infer<typeof LogRepairRequest>;