fix(repairs): stop rejecting log when broken serial already exists
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:
@@ -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>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user