Commit Graph
22 Commits
Author SHA1 Message Date
ngqileandClaude Opus 5.5 6598b58cb8 feat: locked sign-in message and Change password dialog in the portal
mobile-api now records the browser user agent the portal forwards as
X-Client-User-Agent instead of the portal server's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 14:16:11 +08:00
ngqileandClaude Opus 5.5 5ce684168a feat: admin API for login history, locked accounts, unlock and settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 14:01:04 +08:00
ngqileandClaude Opus 5.5 6c6734baa3 feat: admin change-password endpoint with lockout on wrong current password
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 13:51:57 +08:00
ngqileandClaude Opus 5.5 39708224ad feat: lock check and login history on admin sign-in and sign-out
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 13:43:42 +08:00
ngqileandClaude Opus 5.5 4b090083fb fix: address the email-listing branch review
List each email once when the recipient join returns it twice. The proposal,
design and handover now say Emails exposes every saved email, including member
verification codes and form submissions, not only password emails. The design
names the single catch-all proxy, the later-SQL table sits after the 04 check,
and the seed header says the release package is frozen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 12:14:30 +08:00
ngqileandClaude Opus 5.5 0961a10bb2 feat: read-only admin email listing for when no email provider is configured
GET /api/admin/emails lists saved emails newest first (no bodies), and
GET /api/admin/emails/{id} returns one with its body, under a new BO_EMAILS
module. A caller who is not a super admin cannot open an email addressed to a
super admin. Each view logs the email id and viewer, never the body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 12:05:21 +08:00
ngqileandClaude Opus 5.5 2c0a847b68 feat: admin-set passwords for staff, and a secure temporary-password generator
Creating a user takes the first password from the admin, and a new
POST /api/admin/users/{id}/password lets an admin set a temporary password
for another active user. Both store the bcrypt hash with login = N, so the
user must choose their own password at the next sign-in. No email is sent.
The password must match its confirmation and pass the admin password rules.
The emailed-password generator now draws from SecureRandom.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 11:19:10 +08:00
ngqileandClaude Opus 5.5 eab4053c06 feat(mobile-api): xlsx export of the lead and event lead listings
Same columns and filters as the screen, all pages, refused above 20,000
rows. Mobiles are text and dates are dates. Each export is logged with
user, listing and row count only. Adds poi-ooxml 4.1.0, as in services-system.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-27 16:32:56 +08:00
ngqileandClaude Opus 5.5 963735d524 feat(mobile-api): leads admin API and @AdminModule(also)
List, detail and update under /api/admin/leads. Update validates and
normalises like capture and needs both Edit leads and Leads, enforced by
the new also() attribute, which fails closed if any lookup throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-27 16:15:36 +08:00
ngqileandClaude Opus 5.5 fe9d9bd38d feat(mobile-api): event leads API with phone normalisation and team rule
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-27 11:37:27 +08:00
ngqileandClaude Opus 5.5 5d768b1566 feat(mobile-api): admin interests API
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-27 11:20:10 +08:00
ngqileandClaude Opus 5.5 33f1e7a505 fix(mobile-api): keep a deactivated member already on an event's team
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
2026-11-27 01:48:35 +08:00
ngqileandClaude Opus 5.5 2efdcba1ae fix(mobile-api): event errors use the portal's details/errors contract
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
2026-11-27 00:25:55 +08:00
ngqileandClaude Opus 5.5 1fa7c60fee feat(mobile-api): admin events API with salesperson teams
/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
2026-11-27 00:18:32 +08:00
ngqileandClaude Opus 5.5 69e2b4eb7b fix(mobile-api): read roles services-system sends as bare ids
services-system writes a role already seen in a response as its bare id. The
module check missed it, so a role granted two modules was refused the second;
the super-admin target guard now reads it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 22:37:49 +08:00
ngqileandClaude Opus 5.5 4c48ebea2e fix(mobile-api): stop admins widening their own access
- A non-super admin cannot change the roles on their own account (403 OWN_ROLES).
- ROLE_ADMIN and ROLE_MEMBER cannot be assigned (400 UNKNOWN_ROLE, as if absent).
- A non-super admin cannot change the grants of a role they hold (403 OWN_ROLE);
  this replaces the BO_ROLES lock-out check, which it makes unreachable.
- POST /api/admin/users/{id}/changePassword is removed; the emailed reset stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 22:30:11 +08:00
ngqileandClaude Opus 5.5 da813874ec feat(admin-portal): forgot password page; own account cannot be deactivated
/forgot-password always shows the same message; the route never forwards upstream
errors or a token. /api/admin/me now returns id and username so the user form can
lock the Active switch on your own account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 21:38:42 +08:00
ngqileandClaude Opus 5.5 a8cdf33a24 feat(mobile-api): admin roles API (list, create, rename, module grants)
Member and ROLE_ADMIN roles are hidden; super admin grants are not editable;
removing your own last BO_ROLES grant is refused. Renaming keeps child roles intact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 20:48:05 +08:00
ngqileandClaude Opus 5.5 f5d1b6d032 feat(mobile-api): admin users API (list, create, edit, deactivate, reset password)
New users get a temporary password by email and the creating admin's company.
Self-deactivation and super-admin changes by non-super admins are refused.
services-system: saving a user no longer cascades into role rows.
Local seed: dev admin on the GLOBAL branch (id 0 does not exist).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 20:26:33 +08:00
ngqileandClaude Opus 5.5 9f22837a00 feat(mobile-api): admin login, first-login, forgot password, logout, refresh and me
Wrong, blank or failed logins all answer the same 401. A deactivated admin is
refused and the token services-auth issued is revoked. resetAdminPassword now
refuses deactivated users and users without an email.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 19:55:58 +08:00
ngqileandClaude Opus 5.5 0a990cbcaf feat(mobile-api): admin guard on /api/admin/** (admin token, session state, module grants)
Ported from babyboo: @AdminModule, AdminModuleAccess, AdminSessionGuard and the
admin branch of AppAccessAspect. Adds the BO area, and services-auth findUserByToken
now returns no user for a logged-out token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 19:44:03 +08:00
ngqileandClaude Opus 5.5 5ee51d1913 chore: copy kept Tastefully modules and portals into Co-Lite
Backend modules from tastefully 8bd93d15: core-libs, core-session,
api-gateway, mobile-api, services-auth, services-system,
services-counter, services-member, services-log, services-email.
solvway-admin-portal from babyboo f64d096ea, solvway-customer-portal
from tastefully 8bd93d15. Copied as tracked files only.

Literal secrets replaced with environment placeholders:
- services-email: SMTP_PASSWORD, MAILGUN_API_KEY, SENDGRID_API_KEY,
  MAILJET_API_KEY, MAILJET_SECRET_KEY (optional, empty default)
- services-system: JUMIO_TOKEN, JUMIO_SECRET (optional)
- services-auth: USER_AUTH_API_SECRET (required); commented JWT secret removed
- core-libs: JWT_TOKEN default removed (required), XXL_JOB_TOKEN default
  removed, ipgeolocation key read from IPGEOLOCATION_API_KEY
- services-system EkycAppConfig: commented Jumio credentials removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 15:55:45 +08:00