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
4.6 KiB
4.6 KiB
Tasks
Babyboo source: ~/Projects/babyboo (read only). Tastefully backoffice rules: ~/Projects/tastefully/solvway-backoffice/.../controller/EventController.java (add and edit). All tasks run serially.
1. Database
- 1.1 Write
sql/01-event-salesperson.sql(service-counter.event_salesperson:idbigint auto-increment PK,company_idbigint NOT NULL,event_uuidbigint NOT NULL,user_idbigint NOT NULL,create_byvarchar(255),create_date_timedatetime default now; unique(event_uuid, user_id), indexevent_uuid),sql/02-bo-events-module.sql(40100000 BO_EVENTS'Events', area BO, type M, parent 40000000, url/events, iconCalendarDays) andsql/99-rollback.sql. Mirror intolocal/seed/03-colite.sql. Verify:docker compose -f local/docker-compose.yml down -v && local/up.shexits 0, then a read-only SELECT shows the table and the module row.- Scope:
openspec/changes/add-admin-events/sql/**,local/seed/**
- Scope:
2. services-counter event team
- 2.1 Add
EventSalespersonentity and repository, andEventSalespersonControllerwithGET /counter/eventSalesperson/findByEventUuid/{eventUuid}andPOST /counter/eventSalesperson/replace({eventUuid, companyId, userIds, doneBy}; delete the event's rows and insert the set in one transaction; duplicate ids collapse to one row). Tests first: replace then find returns the new set; replacing with an empty list clears it; a failure midway leaves the old set. Verify:mvn -T 1C -B -q -pl solvway-services-counter -am verify.- Scope:
solvway-services-counter/src/**
- Scope:
3. mobile-api events
- 3.1 Add
AdminEventControllerandAdminEventServiceunder/api/admin/events, all@AdminModule("BO_EVENTS"):GET /events(paged;qsearches name;enabledY/N filter; sort by name, startDate, endDate),GET /events/{uuid}(withteam),POST /events,PUT /events/{uuid},GET /events/salesperson-options(active admin users{id, name, username}). Per design: uuid as a JSON string, dates asYYYY-MM-DDmapped to 00:00:00 and 23:59:59, update patches the stored event so upload fields andcreateBysurvive, validation codesREQUIRED_FIELD/TOO_LONG/END_BEFORE_START/INVALID_DATEwith the field name, team ids must be enabled type-A users (else 400UNKNOWN_USER),company_idfrom the caller, partial create answers 502TEAM_NOT_SAVEDwith the uuid, unknown uuid 404. Tests first for eachadmin-eventsscenario that the API decides, including an exact-JSON test thatuuidis a string. Verify:mvn -T 1C -B -q -pl solvway-mobile-api -am verify.- Scope:
solvway-mobile-api/src/**/controller/admin/**,solvway-mobile-api/src/**/service/AdminEvent*,solvway-mobile-api/src/**/dto/admin/**,solvway-mobile-api/src/**/constant/api/**, matching tests
- Scope:
4. Admin portal
- 4.1 Port babyboo's
calendar.tsxanddate-picker.tsx(and their tests) intoapp/components/ui/, addingreact-day-picker10.0.1 anddate-fns^4.4.0 topackage.json(npm install, commit the lockfile). Verify:npm run lint && npx tsc --noEmit && npx vitest runexit 0.- Scope:
solvway-admin-portal/app/components/ui/**,solvway-admin-portal/package.json,solvway-admin-portal/package-lock.json
- Scope:
- 4.2 Add the Events screens on the Users pattern:
app/events/page.tsx(list: search, enabled filter, sortable name/start/end, columns name, location, start, end, enabled; row Edit),app/events/new/page.tsx,app/events/[uuid]/page.tsx, anEventForm(name, location, start and endDatePicker, enabled on edit only, team multi-select from salesperson-options with inactive members shown marked), route handlersapp/api/events/**,app/lib/services/adminEvents.ts, types, i18n defaults, and/events→BO_EVENTSinrouteModules. Form checks required fields and end not before start before submitting; API errors show on the field.TEAM_NOT_SAVEDlands on the edit page with its message. Tests first (vitest) for each portal-visible scenario. Verify:npm run lint && npx tsc --noEmit && npx vitest run && npm run buildexit 0.- Scope:
solvway-admin-portal/app/**
- Scope:
5. End-to-end check
- 5.1 Rebuild the stack and drive the portal with Playwright: grant
BO_EVENTSto a role, create an event with a two-person team, the missing-field and end-before-start errors, edit dates and team, disable it, search and filter the list, and a user withoutBO_EVENTSgets not-authorised. Screenshots inverification/. Only local dev data. Verify: each scenario observed as specified,local/smoke.shprintssmoke: OK.- Scope:
openspec/changes/add-admin-events/verification/**
- Scope:
Workflow follow-up
- Code review, PR to
main, merge, then archive this change.