Returns all company articles with id, sku, name, and eans as a flat
array. Walks the category tree to find reachable articles. Single
query using recursive CTE + FOR JSON for eans.
Replaces 6 round-trips (1 sequential resolve + 5 parallel detail)
with one query. Auth resolution, article detail, categories, photos,
eans, and prices are all fetched in a single round-trip.
Replace inline UNIQUE constraint with filtered unique index on token
column to allow multiple NULL values while maintaining uniqueness
for non-NULL tokens.
- Added required name NVARCHAR(255) NOT NULL column to posterminal schema
- Updated SQL queries (LIST_BY_COMPANY, GET_BY_ID, CREATE, UPDATE) to include name
- Updated upsert store method to validate and persist name
- Updated README with name in method signatures and return types
Add posterminal and posterminalcategory tables to control which categories
are visible on each POS terminal. The existence of a row in
posterminalcategory means the category is visible on that terminal.
Store methods:
- posterminal.list/upsert/delete - CRUD for terminals
- posterminal.setOn/setOff - toggle single category on a terminal
- posterminal.setOnAll/setOffAll - toggle all categories on a terminal
- posterminal.getCategoryPosterminalIds - internal, used by category tree
The category tree (getTreeForCompany) now includes a posterminalIds array
on each node listing which terminals have that category enabled.
Validates both source and target via resolveCategoryAccess so the new
parent must be a category of the same authorized company, and guards
against moving into a descendant (cycle). Assigns next sibling sort.
brand now carries a NOT NULL company_id (unique per (company_id, name))
with brand.list/upsert/delete backed by resolveCompanyAccess. Adds
companysetting key-value store (list/get/set/delete, frontend flag).