Skip to content

fix: price levels admin page depends on PRO routes — needs Core-native API #476

@Blb3D

Description

@Blb3D

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions