Repository navigation
feat(categories): Farbe als Feld, Haupt- und Unterkategorien, Fahrradbörse nach Leitfaden (#300) - #307
Merged
Conversation
…ke template per guide (#300) - New category field "color" for bikes, clothing and sports gear; it can be made required and shows in the record (PDF/CSV) and at intake - Default categories for bike sales and children's bazaars: children's bikes, balance bikes, scooters, unicycles, ride-on toys, cargo bikes, e-bikes, bike trailers, child bike seats, bike accessories; migration 0032 adds them where the default categories are in use - Unicycles and child seats no longer get the bike fields (no frame number) - Children's vehicles are preselected for the children's bazaar and the bike sale; the bike sale template requires the frame number and has a €3 intake fee, as in the guide "Fahrradbörse organisieren" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚀 Review-Apphttps://review-307.bazarpro.de Modus: platform (wie bazarpro.de). Self-Hosting testen: Label Stand:
Laufendes Event mit allen Funktionen: Fahrradbörse Bürgerhalle (alle Funktionen). 📬 Alle Mails der Review-App: https://review-307-mail.bazarpro.de (Benutzer Die Review-App wird beim Schließen des Pull Requests entfernt. |
) - Default tree: "Fahrräder" with children's and cargo bikes, e-bikes, trailers, child seats and accessories; new main category "Kinderfahrzeuge" with balance bikes, scooters, unicycles, ride-on toys. Migration 0032 builds it on instances with the default categories and fixes their order (seeded categories shared one creation time) - Admins pick the main category when creating or editing; the backend keeps it one level deep (category.parentNotMain, category.hasSubcategories) - A label a field rule excludes on purpose has no fields, so "Fahrradanhänger" below "Fahrräder" does not inherit the frame number - Grouped lists: the bazaar form shows main categories that select their sub-categories and open to pick them one by one; item form and filters indent sub-categories; a filter on a main category includes them; bazaar pages name a fully chosen main category instead of all its children Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… extra fields (#300) - Default tree with 12 main and 60 sub-categories, e.g. baby, children's, women's and men's clothes, ski and ball sports, phones and consoles, novels and children's books, Lego and board games, prams; migration 0032 adds them where the default categories are in use - Admins choose the extra fields of a category from a fixed list (frame number, frame and wheel size, brand, color, one kind of size, model) or leave them to the name as before; stored in categories.fields (0033), checked by the backend (category.unknownField, category.oneSize) and used everywhere fields are resolved, sub-categories inherit them - Kinds of bazaars preselect a matching main category with its sub-categories, minus what they exclude (women's clothes at a children's bazaar, prams at a bike sale) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The demo seed deletes the categories of a fresh instance and created only its eleven flat main categories, so review apps showed no sub-categories. It now adds the whole default tree in the language of the demo, the same way the first start of the server does (categories::insert_default_tree). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the sub-categories in the demo data, "Sport" also matched "Sportschuhe" and "Ballsport", "Fahrräder" also "Kinderfahrräder". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owed categories enforced (#300) - Extra fields are data: admins add and edit them (name, example, hint, each in German and English, short values for labels) in a new "Extra fields" tab; categories pick from them, sub-categories take their main category's. Migration 0034 creates category_field_definitions with the fields so far and turns the old name rules into each category's own choice - Default tree: more kinds of bikes (city, trekking, MTB, road & gravel, BMX, folding, children's & youth), "Baby & Kind", "Freizeit & Hobby" and a "Weitere …" in every main category; items go into sub-categories, a main category with sub-categories only groups them (product.chooseSubcategory) - Bazaars only take items of the categories they allow, or of a sub-category of one (product.categoryNotAllowed): when announcing, for walk-in items and when the category of an announced item changes - Item form: the category picker opens a main category to its sub-categories and only offers what the chosen bazaars take; adding items to a bazaar locks those it does not take - Bazaar settings: one row per main category with a checkbox for all of it, opened to pick single sub-categories; a fully chosen main category is stored as itself, so sub-categories added later are allowed too - Admin page: main categories open to their sub-categories, a sub-category is added right below its main category - Demo items get fitting sub-categories, demo bazaars allow what they sell Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #300
Farbe als Feld
color(„Farbe“) für Fahrräder, Kleidung und Sport, in Rust und TS gespiegelt, Übersetzungen de/enrequiredFieldsals Pflicht wählbar; erscheint automatisch im Nachweis (PDF/CSV), bei der Annahme und auf dem Verkäuferausdruck (alle nutzendescribeAttributes)Haupt- und Unterkategorien
Damit die Listen kurz bleiben, gibt es eine Ebene Unterkategorien (
parent_idgab es schon, war aber nirgends setzbar). Standard-Baum: 12 Hauptkategorien mit 60 Unterkategorien:DEFAULT_CATEGORIESals Baum; Seed legt Hauptkategorien vor ihren Unterkategorien an und in fester Reihenfolge (alle Seeds teilen sich sonst einnow(), die Listen sortieren nachcreated_at)0032_more_categories.sql: nur auf Instanzen mit den Standard-Kategorien („Fahrräder“ existiert). Legt nur die neuen an (gelöschte Standard-Kategorien bleiben gelöscht), hängt Standard-Unterkategorien unter ihre Hauptkategorie (nur wenn sie oben stehen und selbst keine Unterkategorien haben) und ordnet die Standard-Kategorien. Mit PGlite geprüft: Instanz mit Standard-Kategorien, eigener Unterkategorie und gelöschter Kategorie, sowie leere Instanzcategory.parentNotMain,category.hasSubcategoriescategoryExclude: z. B. Damen-/Herrenkleidung und Romane beim Kinderbasar, Kinderwagen bei der Fahrradbörse)Zusatzfelder selbst wählen (Admin)
categories.fields text[](Migration0033). NULL = wie bisher nach dem Namen; sonst die gewählten Felder aus einem festen Katalog (SELECTABLE/SELECTABLE_FIELDS): Rahmennummer, Rahmengröße, Laufradgröße, Marke, Farbe, Größe (Kleidung / Schuhe EU / Sport), Modell. Höchstens eine Größe, weil alle denselben Schlüssel habencategory.unknownField,category.oneSize) und speichert sie in Katalog-Reihenfolge. Alle Stellen, die Felder auflösen (Anlegen, Nachweis, Quittung, Annahme …), nutzen sie; Unterkategorien ohne eigene Auswahl und ohne passenden Namen erbenVorlage Fahrradbörse nach Leitfaden
Wie besprochen bleibt es bei einer Vorlage; die Doku wird angepasst: BazarPro/docs#18
bikeExchangerequiredFields: ['frameNumber']intakeFee: 3Highlight der Vorlage: „Große Etiketten“ → „Rahmennummer Pflicht“.
Überarbeitung: Felder als Daten, Artikel in Unterkategorien, erlaubte Kategorien
category_field_definitions(Migration0034) mit den bisherigen Feldern. Admins legen Felder an und bearbeiten sie im Reiter „Zusatzfelder“: Name, Beispiel und Hinweis, jeweils auf Deutsch und Englisch, dazu „Kurzer Wert“ (höchstens 7 Zeichen, passt aufs Etikett). Kategorien wählen daraus; Unterkategorien übernehmen „Wie Hauptkategorie“ oder wählen selbst. Die alten Namensregeln überträgt0034einmalig auf die bestehenden Kategorien (auf einer Instanz mit den alten Kategorien geprüft); danach gibt es keine Namensregeln mehrproduct.chooseSubcategory). Im Artikelformular zeigt die Auswahl erst die Hauptkategorien; ein Klick klappt die Unterkategorien aufproduct.categoryNotAllowed). Das gilt beim Anmelden zum Basar, für Artikel von Spontan-Verkäufern und wenn ein angemeldeter Artikel seine Kategorie wechselt. Im Artikelformular bietet die Auswahl nur an, was die gewählten Basare nehmen. Beim „Artikel zum Basar hinzufügen“ sind die übrigen gesperrtTests
vitest: 776 grün (Tests der alten Namensregeln ersetzt), neue Tests für Kategorie-Auswahl, Basar-Auswahl, Admin-Seite und Zusatzfeldercargo test --lib,cargo clippy -D warnings,cargo fmt --check,tsc, eslint, prettier: grüncargo test(331 API-Tests, neu: Felder verwalten, Unterkategorie Pflicht, erlaubte Kategorien) und Playwright Chromium (42) grün🤖 Generated with Claude Code