Problem
The Price Levels admin page (AdminPriceLevels.jsx) calls /api/v1/pro/catalogs/price-levels which is a PRO-only route. If the PRO plugin is not installed, the page errors with a 404.
The price_levels table lives in Core's database — Core owns this data. But there is no Core API endpoint for it. The UI was built against the PRO endpoint, creating an invisible dependency.
Current State
price_levels table → Core DB ✅
/api/v1/price-levels → Does not exist ❌
/api/v1/pro/catalogs/... → PRO route (requires plugin)
AdminPriceLevels.jsx → Calls PRO route ❌
Expected State
price_levels table → Core DB ✅
/api/v1/price-levels → Core CRUD endpoint ✅ (new)
/api/v1/pro/catalogs/... → PRO extends with customer assignment
AdminPriceLevels.jsx → Calls Core API ✅
Scope
Backend (new Core endpoints)
GET /api/v1/price-levels — list all price levels
POST /api/v1/price-levels — create
PATCH /api/v1/price-levels/{id} — update
DELETE /api/v1/price-levels/{id} — deactivate
Frontend
- Update
AdminPriceLevels.jsx to call Core endpoints for CRUD
- Customer assignment (the modal with assign/unassign) can stay on PRO routes — it uses
pro_customer_price_levels which is genuinely a PRO table
- If PRO is not installed, the page should work for managing price levels, just without the customer assignment feature
Model
- Core already has
price_levels table and model — no schema changes needed
- Add schema + service + endpoint files
Why This Matters
A Core-only user (open source, no PRO) cannot manage price levels at all right now. The page is inaccessible without the PRO plugin installed. This violates the principle that Core runs independently.
🤖 Generated with Claude Code
Problem
The Price Levels admin page (
AdminPriceLevels.jsx) calls/api/v1/pro/catalogs/price-levelswhich is a PRO-only route. If the PRO plugin is not installed, the page errors with a 404.The
price_levelstable lives in Core's database — Core owns this data. But there is no Core API endpoint for it. The UI was built against the PRO endpoint, creating an invisible dependency.Current State
Expected State
Scope
Backend (new Core endpoints)
GET /api/v1/price-levels— list all price levelsPOST /api/v1/price-levels— createPATCH /api/v1/price-levels/{id}— updateDELETE /api/v1/price-levels/{id}— deactivateFrontend
AdminPriceLevels.jsxto call Core endpoints for CRUDpro_customer_price_levelswhich is genuinely a PRO tableModel
price_levelstable and model — no schema changes neededWhy This Matters
A Core-only user (open source, no PRO) cannot manage price levels at all right now. The page is inaccessible without the PRO plugin installed. This violates the principle that Core runs independently.
🤖 Generated with Claude Code