Description
Align admin show delete behavior with admin trial delete behavior.
When deleting a ShowEntry in admin manage flow:
- Keep
ShowEntry as the primary delete target.
- After successful delete, count remaining
ShowEntry rows for that ShowEvent.
- If remaining count is
0, automatically delete the now-empty parent ShowEvent.
- Do not add a separate “delete ShowEvent” user action.
Scope:
packages/db/admin/shows/manage/delete-show-entry.ts: add empty-parent cleanup in same transaction.
packages/server/admin/shows/manage/delete-show-entry.ts: return deletedShowEvent: boolean.
apps/web/app/actions/admin/shows/manage/delete-admin-show-entry.ts: pass through new response field.
apps/web/queries/admin/shows/manage/use-delete-admin-show-entry-mutation.ts: keep invalidation; ensure UI handles deleted parent.
apps/web/components/admin/shows/manage/**: if deletedShowEvent === true, clear selected event / fallback safely.
- Update contracts and local
index.ts exports accordingly.
Acceptance criteria
- Admin can delete a single show result row.
- Parent
ShowEvent remains when other entries exist.
- Parent
ShowEvent is auto-deleted when last entry is removed.
- No boundary violations (
business logic in server, writes in db).
- Tests cover success, not_found, event remains, event removed, and UI handling of deleted parent.
Description
Align admin show delete behavior with admin trial delete behavior.
When deleting a
ShowEntryin admin manage flow:ShowEntryas the primary delete target.ShowEntryrows for thatShowEvent.0, automatically delete the now-empty parentShowEvent.Scope:
packages/db/admin/shows/manage/delete-show-entry.ts: add empty-parent cleanup in same transaction.packages/server/admin/shows/manage/delete-show-entry.ts: returndeletedShowEvent: boolean.apps/web/app/actions/admin/shows/manage/delete-admin-show-entry.ts: pass through new response field.apps/web/queries/admin/shows/manage/use-delete-admin-show-entry-mutation.ts: keep invalidation; ensure UI handles deleted parent.apps/web/components/admin/shows/manage/**: ifdeletedShowEvent === true, clear selected event / fallback safely.index.tsexports accordingly.Acceptance criteria
ShowEventremains when other entries exist.ShowEventis auto-deleted when last entry is removed.business logicin server,writesin db).