fix: locale-independent code upper-casing; refresh note

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-01 16:40:50 +08:00
1 parent 39139ed7b1
commit cbe48c2db9
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -116,7 +116,7 @@ Run both before the new images go live: the new services-counter reads the new `
|---|---|
| `openspec/changes/archive/2026-12-01-uppercase-company-codes/sql/01-uppercase-codes.sql` | Turns every company code and every staff login name to capitals (`ins` becomes `INS`, `sales9@cv` becomes `sales9@CV`). Safe to run twice. |
Run it when the new services-system and mobile-api go live. Staff who are signed in must sign in again. Sign-in still ignores case, so staff may keep typing `ins` or `cv`. `99-rollback.sql` in the same folder turns codes and login names back to lowercase.
Run it when the new services-system and mobile-api go live. Staff who are signed in keep working until their session needs a refresh, then sign in again. Sign-in still ignores case, so staff may keep typing `ins` or `cv`. `99-rollback.sql` in the same folder turns codes and login names back to lowercase.
**Review the privacy notice before go-live.** The seeded text is a starting template written for the PDPA, not legal advice. INS and CV should each have theirs checked; a super admin changes it under **Companies → Privacy notice**. A company with no notice has no working QR codes.
@@ -207,7 +207,7 @@ public class AdminAuthController {
if (!StringUtils.hasText(username) || username.contains("@")) {
return null;
}
String code = company == null ? "" : company.trim().toUpperCase();
String code = company == null ? "" : company.trim().toUpperCase(java.util.Locale.ROOT);
return code.isEmpty() ? username.trim() : username.trim() + "@" + code;
}
}
@@ -97,7 +97,7 @@ public class CompanyService {
}
private static String validCode(String code) {
String v = code == null ? "" : code.trim().toUpperCase();
String v = code == null ? "" : code.trim().toUpperCase(java.util.Locale.ROOT);
if (!CODE.matcher(v).matches()) throw new IllegalArgumentException("Code must be 2 to 20 characters: A-Z, 0-9 or -");
return v;
}