feat(fehlteile): fehlende teile je sammlungseintrag pflegen
Jeder Sammlungseintrag hat jetzt eine Fehlteil-Liste: Teilenummer, Farbe, Anzahl und Notiz, abhakbar wenn das Teil nachgekauft ist. Ein Eintrag ohne Nummer geht auch - dann reicht die Notiz, denn beim Aufbauen kennt man die Nummer selten. Die Vollstaendigkeit pflegt sich dabei selbst: Der erste offene Eintrag setzt den Sammlungseintrag auf "Teile fehlen", der letzte erledigte zurueck auf "vollstaendig". Damit stimmt der Filter in der Sammlung, ohne dass man daran denken muss. Offene Fehlteile stehen als Badge an jedem Eintrag - in der Sammlung und auf der Set-Detailseite. Refs Phase 2 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -147,6 +147,22 @@ export const collectionItemSchema = z.object({
|
||||
notes: optionalText(2000),
|
||||
});
|
||||
|
||||
/**
|
||||
* A missing part needs at least something identifying: a part number or a
|
||||
* note. An entry with neither says nothing and would only clutter the list.
|
||||
*/
|
||||
export const missingPartSchema = z
|
||||
.object({
|
||||
partNumber: optionalText(40),
|
||||
colorName: optionalText(40),
|
||||
quantity: z.coerce.number().int().min(1).max(999).default(1),
|
||||
notes: optionalText(300),
|
||||
})
|
||||
.refine(
|
||||
(value) => value.partNumber !== null || value.notes !== null,
|
||||
'Bitte gib mindestens die Teilenummer oder eine Notiz an.',
|
||||
);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Wishlists
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user