feat: admin events with salesperson teams (add-admin-events) #5

Merged
ngqile merged 11 commits from add-admin-events into main 2026-11-26 18:37:53 +00:00
Owner

Change 3 of Co-Lite, OpenSpec add-admin-events.

What

  • Admin Events list, create and edit screens, behind the new BO_EVENTS module. Fields are name, location, start and end date (whole days; the end may not be before the start) and enabled (edit only). Events cannot be deleted.
  • Each event has a team of active admin users (salespeople), picked on create and on edit. A deactivated member stays listed, marked inactive, and the event still saves with them on it.
  • services-counter: new event_salesperson table and a replace endpoint that runs as one transaction.
  • mobile-api: /api/admin/events (list, get, create, update, salesperson options). Every endpoint requires @AppAuth and @AdminModule("BO_EVENTS").
  • Portal: babyboo's date picker and calendar ported over, the Events screens, and a CalendarDays icon for the Events menu.

Verification

  • mvn -T 1C -B -q verify exits 0.
  • Portal: vitest 951 tests pass, tsc is clean, lint has 0 errors, npm run build succeeds.
  • local/smoke.sh prints smoke: OK; openspec validate add-admin-events --strict passes.
  • Playwright on the local stack: screenshots are in openspec/changes/add-admin-events/verification/.

Known follow-ups (minor, from the final review)

  • The event list sorts on one column only, so events that tie on that column can repeat or go missing between pages.
  • An edit resets an older event's times to 00:00:00 and 23:59:59.
  • An update with an invalid body for an unknown event id answers 400 instead of 404.
  • Two admins saving the same event's team at the same moment can get TEAM_NOT_SAVED; saving again fixes it.
  • After TEAM_NOT_SAVED, the admin has to pick the team again.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM

Change 3 of Co-Lite, OpenSpec `add-admin-events`. ## What - Admin Events list, create and edit screens, behind the new `BO_EVENTS` module. Fields are name, location, start and end date (whole days; the end may not be before the start) and enabled (edit only). Events cannot be deleted. - Each event has a team of active admin users (salespeople), picked on create and on edit. A deactivated member stays listed, marked inactive, and the event still saves with them on it. - services-counter: new `event_salesperson` table and a replace endpoint that runs as one transaction. - mobile-api: `/api/admin/events` (list, get, create, update, salesperson options). Every endpoint requires `@AppAuth` and `@AdminModule("BO_EVENTS")`. - Portal: babyboo's date picker and calendar ported over, the Events screens, and a CalendarDays icon for the Events menu. ## Verification - `mvn -T 1C -B -q verify` exits 0. - Portal: vitest 951 tests pass, tsc is clean, lint has 0 errors, `npm run build` succeeds. - `local/smoke.sh` prints `smoke: OK`; `openspec validate add-admin-events --strict` passes. - Playwright on the local stack: screenshots are in `openspec/changes/add-admin-events/verification/`. ## Known follow-ups (minor, from the final review) - The event list sorts on one column only, so events that tie on that column can repeat or go missing between pages. - An edit resets an older event's times to 00:00:00 and 23:59:59. - An update with an invalid body for an unknown event id answers 400 instead of 404. - Two admins saving the same event's team at the same moment can get `TEAM_NOT_SAVED`; saving again fixes it. - After `TEAM_NOT_SAVED`, the admin has to pick the team again. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
ngqile added 11 commits 2026-11-26 18:37:50 +00:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
GET /counter/eventSalesperson/findByEventUuid/{eventUuid} and
POST /counter/eventSalesperson/replace (bulk delete then insert, one transaction).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
/api/admin/events list, get, create, update and salesperson-options, all behind
BO_EVENTS. Whole-day dates, uuid as a string, team ids checked before saving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Adds react-day-picker 10.0.1 (it brings date-fns). The portal bans native date
inputs, and the events and leads forms need a date field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
The portal forwards only code, errors and flat details from a ProblemDetail, so
the failing field and the TEAM_NOT_SAVED event uuid move into details and the
missing-field list into errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Only users being added must be active admins; someone already on the team stays
until an admin removes them, so an unrelated event edit no longer fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
ngqile merged commit 5588ade48d into main 2026-11-26 18:37:53 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ngqile/co-lite#5