diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd07af1..1a11418 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,37 @@ # Hướng Dẫn Đóng Góp +## Kỷ Luật Commit & Push (Bắt Buộc) + +> Để tránh conflict khi nhiều agent/engineer làm việc song song, toàn bộ team PHẢI tuân thủ các quy định sau. Nguồn: [GOO-91](/GOO/issues/GOO-91) (chỉ thị từ CEO qua [GOO-88](/GOO/issues/GOO-88)). + +1. **Commit ngay khi hoàn thành task** — mỗi task = một commit (hoặc một chuỗi commit nhỏ liên quan). Không gom nhiều task không liên quan vào một commit lớn. +2. **Pull/rebase trước khi push** — luôn chạy `git pull --rebase origin ` trước `git push` để giảm merge conflict. +3. **Push ngay sau commit** — không giữ commit local quá 1 ngày làm việc. Commit không push = rủi ro mất việc + conflict tăng. +4. **Conventional Commits** — bắt buộc (`feat:`, `fix:`, `chore:`, `refactor:`, `docs:`, `test:`, `style:`, `perf:`). Xem [Quy Ước Commit](#quy-ước-commit) bên dưới. +5. **KHÔNG push trực tiếp lên `main` / `master`** — luôn dùng feature branch + Pull Request. Branch chính được bảo vệ bằng GitHub branch protection rules. +6. **PR phải pass CI** (`lint` → `typecheck` → `test` → `build`) trước khi merge. PR đỏ CI không được merge dù đã approve. +7. **Squash-merge khi merge PR** — giữ history trên `main` sạch, mỗi PR = một commit logic. +8. **Xóa feature branch sau khi merge** — tránh branch sprawl. GitHub có auto-delete branch sau merge; bật nó trong repo settings. + +### Flow nhanh cho mỗi task + +```bash +# 1. Tạo/chuyển sang feature branch (KHÔNG commit trực tiếp vào main) +git checkout -b feature/goo-xx-short-description + +# 2. Làm việc, khi hoàn thành task: +git add +git commit -m "feat(scope): mô tả ngắn" + +# 3. Đồng bộ & push +git pull --rebase origin main # hoặc develop +git push -u origin feature/goo-xx-short-description + +# 4. Mở PR, chờ CI xanh + review, squash-merge, xóa branch +``` + +--- + ## Quy Trình Git & Branching ### Nhánh Chính diff --git a/apps/web/components/inquiries/inquiry-detail-dialog.tsx b/apps/web/components/inquiries/inquiry-detail-dialog.tsx index 835c66b..b93a8f2 100644 --- a/apps/web/components/inquiries/inquiry-detail-dialog.tsx +++ b/apps/web/components/inquiries/inquiry-detail-dialog.tsx @@ -13,6 +13,7 @@ import { } from '@/components/ui/dialog'; import { useMarkInquiryRead } from '@/lib/hooks/use-inquiries'; import type { InquiryReadDto } from '@/lib/inquiries-api'; +import { formatPhone, zaloHref } from '@/lib/phone'; interface InquiryDetailDialogProps { inquiry: InquiryReadDto | null; @@ -42,6 +43,8 @@ export function InquiryDetailDialog({ inquiry, open, onOpenChange }: InquiryDeta minute: '2-digit', }); + const phone = inquiry.phone ?? inquiry.userPhone; + return ( @@ -60,7 +63,7 @@ export function InquiryDetailDialog({ inquiry, open, onOpenChange }: InquiryDeta
-

SĐT: {inquiry.phone ?? inquiry.userPhone}

+

SĐT: {formatPhone(phone)}

Ngày gửi: {formattedDate}

@@ -78,13 +81,13 @@ export function InquiryDetailDialog({ inquiry, open, onOpenChange }: InquiryDeta

Liên hệ nhanh