Commit Graph

29 Commits

Author SHA1 Message Date
Frudrax Cheng 35cd939b92 Add OSS site image uploads for aftersales 2026-06-02 11:04:25 +08:00
Frudrax Cheng 1ebec18869 Add responsible signature to aftersales confirmation 2026-06-02 10:38:29 +08:00
Frudrax Cheng d1d189528c Decouple aftersales customers from company management 2026-05-28 10:29:17 +08:00
Frudrax Cheng 2aab9203a0 Add employee serial QR query support 2026-05-28 10:24:32 +08:00
Frudrax Cheng d3ee215f61 Refactor employee management 2026-05-28 10:05:59 +08:00
Frudrax Cheng f394d3a8bd feat: add employee role and block backend login 2026-05-28 09:30:31 +08:00
Frudrax Cheng 0beb912e0c fix: return user fields in lower-case json for aftersales relations 2026-05-28 09:21:20 +08:00
Frudrax Cheng 539eae3bdc docs: update aftersales README for new serial and labels 2026-05-28 09:15:35 +08:00
Frudrax Cheng da02be0a4f feat: update aftersales service types and serial format 2026-05-28 09:13:02 +08:00
Frudrax Cheng 6a48b0624f Replace phone last-4 verification with customer signature
Customer now signs on the confirm page instead of inputting the last
4 digits of their phone. Signature is stored as a base64 PNG dataURL
on the work order and shown back to the customer plus archived for
admin review. Reject still bypasses signature but now requires a
reason.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 18:02:04 +08:00
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
Frudrax Cheng 1029d5966b Fix leftover department references after rename to position
FindAll search query and tests still referenced the old column name,
causing vet errors and runtime SQL failures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:41:01 +08:00
Frudrax Cheng 0d82260fd9 Add aftersales work order feature
- AftersalesOrder model with state machine (created/pending_confirmation/closed/rejected)
- Public scan-to-confirm flow with phone last-4 verification and rate limiting
- Technician role and middleware for ownership-scoped operations
- QR code generation pointing to /aftersales/{serialNumber}
- Admin overrides: reassign, force-close, delete

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:39:49 +08:00
cynosura e820b858bf Change department to position 2026-03-02 14:01:52 +08:00
cynosura 4f18028a7b Re-migrate code 2026-03-02 12:57:07 +08:00
cynosura 6070df659a Re-migrate code 2026-03-02 10:41:43 +08:00
cynosura 1cc3097d9b Re-migrate code 2026-03-02 10:31:45 +08:00
cynosura f80f2b43ce Re-migrate code 2026-03-02 10:24:11 +08:00
cynosura 51025195a5 Re-migrate code 2026-03-02 10:05:12 +08:00
cynosura d1e6f15745 Update .env.example 2026-03-02 09:53:41 +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
cynosura a87980a44c update .gitignore 2026-02-12 19:24:21 +08:00
cynosura 8afed25543 docs: update README and cleanup miscellaneous files 2026-02-12 19:20:31 +08:00
cynosura d51e2dc500 feat: integrate swagger documentation and gin cors middleware 2026-02-12 19:13:58 +08:00
cynosura aed996f409 feat(config): implement layered configuration using config.yaml and .env 2026-02-12 14:41:49 +08:00
cynosura e01cdc9889 Initial commit 2026-02-12 14:31:30 +08:00