Commit Graph

7 Commits

Author SHA1 Message Date
Frudrax Cheng 128bb7cda6 Add aftersales stats to dashboard and service-layer tests
- CompanyStatsOverviewDTO and GetStats() now include aftersales counts
  (total, pending confirmation, closed, rejected) and a recentAftersales list
- aftersales_service_test.go covers YYMMNN sequence, owner-only submit,
  state machine, phone last-4 check, reject increment, force-close
- users_service_test.go covers duplicate username, self-demotion guard,
  last-admin guard, password reset, assignable filter

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 11:04:23 +08:00
Frudrax Cheng 3ddd4db126 Add user management for admin (CRUD + role + reset password)
Adds /api/users endpoints (admin only) plus /api/users/assignable
(admin + technician) used by the aftersales reassign picker. Guards
prevent self-demotion, self-deletion, and removing the last admin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:57:53 +08:00
Frudrax Cheng b1e3adaf6a Change aftersales serial to YYMMNN monthly sequence
User-requested format: zjbf-sh-260501 (26=year, 05=month, 01=monthly seq).
Sequence resets each month and skips soft-deleted entries to avoid reuse.
Also documents aftersales API and new technician role in AGENTS.md / README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:51:16 +08:00
cynosura 4f18028a7b Re-migrate code 2026-03-02 12:57:07 +08:00
cynosura f80f2b43ce Re-migrate code 2026-03-02 10:24:11 +08:00
cynosura c29cbdf847 Add employee code assignment function 2026-03-02 09:38:03 +08:00
cynosura 58b1ac1126 add AGENTS.md 2026-02-12 19:27:11 +08:00