feat(admin): product catalog editor #231
Reference in New Issue
Block a user
Delete Branch "feature/e7-catalog-editor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second slice of the admin / reports / catalog work (PR1 #230 = the finance panel).
Catalog editor (
/_gm/catalog)The console gains a product editor — the source of truth for the catalog:
and per-rail prices (RUB via direct, VOTE via vk, XTR via telegram, CHIP for a value);
product.active; archived products are hidden fromplayers but still credit an in-flight payment and can be granted (PR3);
(the FK
orders/ledger → productRESTRICT is the DB backstop, surfaced as a clean message).Shape validation on activation (a pure, unit-tested
validateProduct): a pack (thechipsatom ⇒ a money price per rail, chips-only) or a value (no chips ⇒ a single CHIP price); a
tournament-bearing product is composable (a draft/template) but never sellable until thetournament stage. An archived draft may be incomplete.
Backend
payments.AdminCatalog / CreateProduct / UpdateProduct / SetProductActive / DeleteProduct+the store CRUD (one tx for create/update). No wire/edge changes — server-rendered console only.
Tests
TestValidateProduct— pack / value / tournament / duplicate / bad-shape (15 cases).TestConsoleCatalogEditor— CSRF-guarded create; create + edit a value; refuse an invalid activepack; archive hides it; delete a clean product; refuse deleting a transacted one.