AGENT SKILL

working-on-ops

Hướng dẫn nghiệp vụ dashboard CRM, export, và import dữ liệu trong module ops của backend Cluvix. Dùng skill này KHI đụng report/dashboard CRM, thêm cột export (`?columns=`), hoặc import khách hàng (migration onboard SAAS client) — đọc trước khi đổi bất kỳ hành vi nào trong các luồng này.

License 许可
AGPL-3.0
所属仓库
cluvix/cluvix-crm
最近更新
2026-11-02
Stars
★ 21
Forks
20

01 前言 Front Matter

name
working-on-ops
description
Hướng dẫn nghiệp vụ dashboard CRM, export, và import dữ liệu trong module ops của backend Cluvix. Dùng skill này KHI đụng report/dashboard CRM, thêm cột export (`?columns=`), hoặc import khách hàng (migration onboard SAAS client) — đọc trước khi đổi bất kỳ hành vi nào trong các luồng này.

02 资源文件 2

03 SKILL.md 正文

Ops — Dashboard, Export, Import

reference/export.md = cơ chế export list (?_export=1, colDef core/optional); (cron/scheduler đã bỏ 2026-10-17); reference/import.md = import migration onboard SAAS client một lần.

Accountant — đã bỏ

CRM standalone đã xoá module webapp/accountant/ (công nợ đơn hàng/điều trị/khách hàng/buổi điều trị, sổ cái, khoá kỳ — D2, xem bmad/crm-standalone/architecture.md §scope) và company (D15). Không còn báo cáo công nợ nào để sửa.

CRM Dashboard (20 API)

Route prefix: /dashboard/crm/

Tài chính

  • payment-in-month — doanhSo + doanhThu + thucThu + hoanDV + hoanCoc + so sánh tháng trước
  • payment-branch-overview — 7 metrics per branch (1 query, 7 LEFT JOIN subqueries)
  • marketing-view — budget + thucThu online + doanhSo online + ROI

Thống kê nhanh

  • quick-starts — customer (month/today) + appointment (today/coming) + orderNew + serviceNew
  • additional-stats — reminder + customerLead + customerCare + broker + coupon

Lịch hẹn

  • compare-appointment — Lịch hẹn theo ngày tháng này vs tháng trước
  • appointment-accepted-stats — Trạng thái đồng ý hôm nay
  • overview-appointment — lichHen/daDen/dongY/huy/conLai (unique customer, cached)
  • report-statistics — Pie chart is_accepted tháng, top 5 + Khác

Marketing & Funnel

  • overview-online — Tỷ lệ chuyển đổi online (lead→lịch→đến→đồng ý)
  • estimate-price-marketing — Chi phí per-action marketing (budget / count)
  • customer-status-marketing — Funnel marketing online
  • status-customer-overview — Funnel customer status (ticket→lead→hẹn→đến→đồng ý→hoàn thành)

Charts

  • report-customer-by-region — Top 8 tỉnh + Khu vực khác (cached 300s)
  • overview-service-type-accepted — Top 3 nhóm DV đồng ý + Khác
  • overview-chart-source — Top 5 nguồn KH + Nguồn khác
  • overview-chart-event — Top 10 sự kiện + Sự kiện khác
  • overview-service-type-interest — Top 10 nhóm DV quan tâm + Khác
  • service-used-statistics — Top 10 DV (quantity + revenue) + Dịch vụ khác

Lưu ý FE

  • Tất cả route GET, response trả raw numbers → FE tự format VND
  • ROI trả float (85.5) → FE thêm %
  • calcTrend: 0=không đổi, 1=giảm, 2=tăng
  • Chart data: [{name, value}] hoặc [{name, value, itemStyle}]

04 同仓库更多 Skills

cluvix
cluvix/cluvix-crm

writing-mysql-migrations

Viết migration MySQL cho Cluvix (golang-migrate, Go + GORM): quy ước timestamp, idempotent ADD/DROP COLUMN, FK constraint thật, decimal tiền, MySQL 9.7 LTS syntax mới/cũ, và luật CẤM tuyệt đối test/migrate chạm DB dev/prod thật. Dùng skill này TRƯỚC KHI tạo file migration mới, sửa schema, thêm cột/FK, backfill dữ liệu, hoặc trước khi chạy `cmd/migrate`/integration test đụng tới database — kể cả migration chỉ 1-2 dòng.

★ 21
cluvix
cluvix/cluvix-crm

writing-backend-resources

Hướng dẫn quy trình 6 bước TẠO MỚI resource backend Go (entity, dao, repository, service, handler, router, DTO, module layout) cho ERP Cluvix. Dùng skill này TRƯỚC KHI tạo resource CRUD mới hoặc module mới trong internal/modules/, khi cần biết Handler DI/Router/Repository Reader/DTO pattern chuẩn, hoặc trước khi đụng module service (status filter 2 tầng, cascade, optimistic lock). KHÔNG dùng skill này để debug/sửa query đang sai — xem debugging-backend-queries cho việc đó.

★ 21
cluvix
cluvix/cluvix-crm

working-on-hr

Quy tắc và pattern nghiệp vụ HR Cluvix trong CRM standalone: user nội bộ, role/RBAC, đổi/đặt lại mật khẩu, import user. Dùng skill này KHI làm feature/sửa bug đụng module hr (chỉ còn `hr/user`) — trước khi đọc code.

★ 21
cluvix
cluvix/cluvix-crm

working-on-crm

Quy tắc và pattern nghiệp vụ CRM Cluvix: khách hàng, lịch hẹn, liệu trình, đơn hàng, thanh toán. Dùng skill này KHI làm feature/sửa bug đụng module crm (customer, appointment, order, treatment, payment) — trước khi đọc code, để tránh phá vỡ business rule đã có (tái khai thác, customer status IN(...)).

★ 21
cluvix
cluvix/cluvix-crm

working-on-config

Quy tắc và pattern nghiệp vụ Config Cluvix còn sống trong CRM standalone: mẫu in (print_template), control field trong bảng (control_field_in_table), IndexedDB sync của config. Dùng skill này KHI làm feature/sửa bug đụng các module đó — trước khi đọc code. Tổng đài/chữ ký số/AI config đã bỏ (chỉ còn mô tả lịch sử trong skill, KHÔNG áp dụng).

★ 21
cluvix
cluvix/cluvix-crm

testing-backend

Hạ tầng test Go: unit test, integration test với TEST_MYSQL_DSN (MySQL disposable thật, KHÔNG dockertest), FreshTenant helper, HTTP handler test qua httptest, và mutation test (`go test -overlay`) để chứng minh test thật sự neo hành vi. Dùng skill này TRƯỚC KHI viết test mới cho backend Go, khi cần biết cách dựng DB test sạch mỗi lần chạy, trước khi báo một AC dạng phủ định/mặc định là Done, hoặc trước khi verify build/test theo Development Protocol bước 4 (Validate).

★ 21