Files
co-lite/openspec/changes/add-admin-events/proposal.md
T

2.7 KiB

Proposal

Why

Lead capture (change 4) records every lead against an event, so staff need to create and maintain events before go-live. Tastefully's event screens live in the Thymeleaf backoffice, which Co-Lite never deploys, and mobile-api only reads the current event. This change adds an Events screen to the admin portal. See docs/superpowers/specs/2026-11-26-co-lite-foundation-and-leads-design.md (Admin portal, screen 4).

What Changes

  • Admin portal Events screens: a paged list (search by name, filter by enabled), a create page and an edit page. Desktop-first, like Users and Roles.
  • mobile-api gains /api/admin/events: list, get, create and update, guarded by a new BO_EVENTS module. They call the existing services-counter event endpoints (findByPropertyAndPageable, findByUuid, save); services-counter and its schema do not change.
  • Event fields kept from Tastefully: name, location, start date, end date, enabled. Tastefully's backoffice rules carry over: name and location required, both dates required, end date not before start date, dates are whole days, new events start enabled.
  • Not kept: the four Tastefully upload fields (floor plan, stage activities, lucky draw, taste rewards). Their columns stay in the table and are left untouched on update.
  • No delete, as in Tastefully. Leads will reference events, so an event is disabled instead.
  • Back-office module BO_EVENTS (/events) added to service-system.module; SQL in this change folder, mirrored in local/seed/.
  • Date picker: the portal forbids native date inputs (an existing test), so babyboo's DatePicker and Calendar components are ported, adding react-day-picker and date-fns. Change 4 reuses them for the follow-up date.

Not in this change: event booths, products, receipts, lucky draw and the other Tastefully event sub-screens; event company scoping (the design keeps user as the only existing table that gains company_id).

Capabilities

New Capabilities

  • admin-events: managing events in the admin portal (list, search, create, edit, enable and disable) and the rules an event must satisfy.

Modified Capabilities

None.

Impact

  • solvway-admin-portal: new app/events/** pages, app/api/events/** route handlers, an events service, the ported date picker and calendar, /events in the route-module map. New dependencies react-day-picker and date-fns.
  • solvway-mobile-api: new AdminEventController, AdminEventService, DTOs and counter endpoint constants.
  • Database service-system: one new module row. Additive only.
  • local/seed/03-colite.sql: mirrors the module row.
  • No change to services-counter, the gateway, or the event table.