Appearance
API: api.anhdac.com
Mọi request dùng cookie kmx_sid. Client gọi với credentials: "include".
Auth
| Method | Path | Mô tả |
|---|---|---|
| POST | /auth/google | Body { credential } (Google ID token). Tạo phiên, set cookie |
| GET | /auth/me | { user } hoặc { user: null } |
| POST | /auth/logout | Ghi thời điểm logout, xóa cookie |
Dữ liệu (cần đăng nhập)
| Method | Path | Trả về |
|---|---|---|
| GET | /api/capabilities | { domains: [{ ..., processes: [] }] } |
| GET | /api/journey | { stages: [] } |
| GET | /api/services | { services: [] } |
| GET | /api/scenarios | { scenarios: [] } |
| GET | /api/params | { params: [] } |
| PUT | /api/:entity/:id | { item }. Entity ∈ processes, journey, services, scenarios, params (id = key) |
Các trường sửa được:
| Entity | Trường |
|---|---|
| processes | name, description, owner, kpi, maturity (1–5), target_maturity (1–5), priority |
| journey | goal, customer_actions, pain_points, touchpoints[], kpis[], capability_codes[], emotion (1–5) |
| services | name, price, duration_min, cogs_pct, mix_pct, description, active |
| scenarios | name, description, technicians, sessions_per_tech_per_day, working_days_per_month, customers_per_month, visits_per_customer, ramp[12] |
| params | value |
Admin
| Method | Path | Mô tả |
|---|---|---|
| GET | /api/admin/logins | 500 lượt đăng nhập gần nhất |
| GET | /api/admin/changes | 500 thay đổi gần nhất |
Lỗi trả về { error: string } với HTTP 400/401/403/404/500.