feat(plans): reactivate + delete-when-unused; card layout fixes overlap
Addresses three issues with the plan catalog screen: 1. Retired plans had NO actions (the action cell was gated on "current version", which a retired plan lacks) — so there was no way to make one in-force again. Add POST /:planId/reactivate (inverse of retire) + a Reactivate button on retired plans. 2. No delete. Add DELETE /:planId, allowed ONLY when zero subscriptions reference the planId (any version) — a referenced plan version must survive for reproducible repricing/audit, so an in-use delete returns 409 and the UI says "retire it instead". The Delete button only shows when the plan has 0 subscribers. 3. The 6-column table overflowed max-w-3xl: action buttons overlapped and the status badges wrapped to a second line. Replace it with a CARD list (one card per planId, grouped across versions): name + status on top, price · hours · effective on a wrap row, "used by N" expandable to holder names, and actions on their own bordered row — nothing overlaps, badges stay inline. Build+lint 12/12 (i18n parity). Verified on a DB copy: unused plans report deletable; retire→reactivate flips active back. Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
This commit is contained in:
@@ -464,8 +464,16 @@ export const en: Catalog = {
|
||||
subscribers: "Subscribers",
|
||||
inForce: "in force",
|
||||
retired: "retired",
|
||||
versionCount: "{{count}} versions",
|
||||
newVersion: "New version",
|
||||
retire: "Retire",
|
||||
reactivate: "Reactivate",
|
||||
delete: "Delete",
|
||||
deleteTitle: "Delete this plan permanently (only when no subscription uses it)",
|
||||
reactivated: "“{{name}}” is sellable again.",
|
||||
confirmDelete: "Delete the plan “{{name}}” permanently? This can't be undone.",
|
||||
deleted: "Plan “{{name}}” deleted.",
|
||||
deleteInUse: "Can't delete — subscriptions still use this plan. Retire it instead.",
|
||||
newTitle: "New plan",
|
||||
newVersionTitle: "Publish new version",
|
||||
newVersionHint: "This publishes a NEW version of the plan — existing sales keep their original price.",
|
||||
|
||||
Reference in New Issue
Block a user