# Quy định Git workflow và quy ước code

nhasioc

# TỔNG QUAN

**<span style="font-size: 18.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">I. Mục đích</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Tài liệu này nhằm:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Thống nhất cách quản lý source code trong dự án</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Giảm xung đột khi làm việc nhóm</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Đảm bảo code dễ đọc, dễ review, dễ bảo trì</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Làm căn cứ xử lý khi vi phạm quy trình kỹ thuật</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Quy định này áp dụng cho toàn bộ thành viên tham gia phát triển và chỉnh sửa source code của dự án.</span>

<div align="center" class="MsoNormal" id="bkmrk-" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 18.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">II. Nguyên tắc chung</span>**

**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">1. Không làm việc trực tiếp trên nhánh chính</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không commit trực tiếp vào </span><span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">main</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không commit trực tiếp vào </span><span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">develop</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Mọi thay đổi phải thông qua nhánh riêng và Pull Request</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Vi phạm quy định này được xem là vi phạm quy trình kỹ thuật.</span>

<div align="center" class="MsoNormal" id="bkmrk--1" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">2. Mọi thay đổi đều phải trace được</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Mỗi commit phải gắn với task hoặc issue cụ thể</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không commit không rõ mục đích</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không chỉnh sửa code mà không có liên quan đến task</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Code không trace được nguồn gốc được xem là không hợp lệ.</span>

<div align="center" class="MsoNormal" id="bkmrk--2" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">3. Code phải ưu tiên tính rõ ràng</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Viết code để người khác đọc được</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không tối ưu hóa sớm khi chưa cần thiết</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không viết logic phức tạp nếu có thể tách nhỏ</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Code khó đọc, khó hiểu sẽ bị yêu cầu chỉnh sửa trong quá trình review.</span>

<div align="center" class="MsoNormal" id="bkmrk--3" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>

# QUY ĐỊNH GIT WORKFLOW

**<span style="font-size: 18.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">III. Cấu trúc nhánh</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Dự án sử dụng cấu trúc nhánh:</span>

- <span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">main</span><span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">: nhánh production</span>
- <span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">develop</span><span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">: nhánh tích hợp chung</span>
- <span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">feature/\*</span><span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">: phát triển tính năng</span>
- <span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">bugfix/\*</span><span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">: sửa lỗi</span>
- <span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">hotfix/\*</span><span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">: sửa lỗi khẩn cấp production</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không tạo nhánh tự do ngoài quy ước trên nếu chưa được thống nhất.</span>

<div align="center" class="MsoNormal" id="bkmrk--4" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 18.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">IV. Quy trình thực hiện task</span>**

**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">4. Tạo nhánh</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Nhánh phải được tạo từ </span><span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">develop</span><span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Luôn pull </span><span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">develop</span><span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';"> mới nhất trước khi tạo nhánh</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không tạo nhánh từ nhánh cá nhân khác</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Quy ước đặt tên nhánh:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">feature/TASKID-mo-ta-ngan</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">bugfix/TASKID-mo-ta-ngan</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">hotfix/TASKID-mo-ta-ngan</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Yêu cầu:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không dùng tiếng Việt có dấu</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không viết hoa tùy ý</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không đặt tên chung chung như: fix, test, abc</span>

<div align="center" class="MsoNormal" id="bkmrk--5" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">5. Commit</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Mỗi commit phải:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Có nội dung rõ ràng</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Gắn với mã task</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Phản ánh đúng thay đổi thực tế</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Cấu trúc commit message:</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">\[TASK-ID\] Loại thay đổi: Mô tả ngắn</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Loại thay đổi bao gồm:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Add</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Fix</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Update</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Refactor</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Remove</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Optimize</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Docs</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không chấp nhận commit message không có ý nghĩa.</span>

<div align="center" class="MsoNormal" id="bkmrk--6" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">6. Pull Request</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Khi hoàn thành task:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Push nhánh lên remote</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Tạo Pull Request vào </span><span style="font-size: 10.0pt; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';">develop</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Mô tả rõ:</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Mục đích thay đổi</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Phạm vi ảnh hưởng</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Điểm cần lưu ý</span>


<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không tự ý merge khi chưa được review.</span>

<div align="center" class="MsoNormal" id="bkmrk--7" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">7. Review</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Mỗi Pull Request phải:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Có ít nhất 1 người review</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Được approve trước khi merge</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Reviewer có trách nhiệm:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Đọc và hiểu logic</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Kiểm tra ảnh hưởng hệ thống</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Yêu cầu chỉnh sửa nếu cần</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Approve hình thức hoặc không đọc kỹ được xem là không hoàn thành trách nhiệm review.</span>

<div align="center" class="MsoNormal" id="bkmrk--8" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">8. Merge và xử lý conflict</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Người tạo PR chịu trách nhiệm xử lý conflict</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Phải test lại sau khi resolve conflict</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không force push vào nhánh chung</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Sau khi merge, người thực hiện task chịu trách nhiệm theo dõi lỗi phát sinh liên quan.</span>

# QUY ƯỚC CODE

**<span style="font-size: 18.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">V. Quy ước đặt tên</span>**

**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">9. Biến</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Sử dụng camelCase</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Tên phải có ý nghĩa</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không viết tắt khó hiểu</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không sử dụng tên như: a, data1, temp, test nếu không có ý nghĩa rõ ràng.</span>

<div align="center" class="MsoNormal" id="bkmrk--10" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">10. Class và Interface</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Sử dụng PascalCase</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Tên phản ánh đúng chức năng</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Ví dụ:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">UserSyncService</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">AuthController</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">DataMappingRepository</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không đặt tên chung chung như: Service1, TestClass.</span>

<div align="center" class="MsoNormal" id="bkmrk--11" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">11. Tên file</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Tên file trùng với class chính</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không đặt tên file không rõ nghĩa</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không sử dụng các tên như: utils2, newfile, test.</span>

<div align="center" class="MsoNormal" id="bkmrk--12" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 18.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">VI. Cấu trúc và tổ chức code</span>**

**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">12. Phân tầng rõ ràng</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Controller không chứa business logic phức tạp</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Service không truy cập database trực tiếp nếu đã có repository layer</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không viết toàn bộ logic trong một file duy nhất</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Phải tuân thủ đúng kiến trúc đã thống nhất của dự án.</span>

<div align="center" class="MsoNormal" id="bkmrk--13" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">13. Hàm và logic</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Một function chỉ nên thực hiện một nhiệm vụ</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không viết function quá dài và khó theo dõi</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Logic phức tạp phải được tách nhỏ</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Nếu một function vượt quá mức hợp lý và khó đọc, reviewer có quyền yêu cầu refactor.</span>

<div align="center" class="MsoNormal" id="bkmrk--14" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">14. Logging</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Log phải có mục đích rõ ràng</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không log dữ liệu nhạy cảm</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không để log debug dư thừa trước khi merge</span>

<div align="center" class="MsoNormal" id="bkmrk--15" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">15. Xử lý lỗi</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không catch lỗi mà bỏ qua</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không throw lỗi chung chung</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Message lỗi phải rõ ràng, có ngữ cảnh</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không để các khối catch rỗng hoặc bỏ qua exception.</span>

<div align="center" class="MsoNormal" id="bkmrk--16" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">16. Format và kiểm tra tự động</span>**

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Bắt buộc sử dụng ESLint / Prettier theo cấu hình dự án</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không merge nếu format sai</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không thay đổi format toàn bộ file nếu không liên quan đến task</span>

<div align="center" class="MsoNormal" id="bkmrk--17" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 24.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt;">VII. Trách nhiệm kỹ thuật</span>**

1. <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Code trước khi tạo PR phải:</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Chạy được</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không lỗi compile</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không làm hỏng chức năng cũ</span>

3. <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Người thực hiện task chịu trách nhiệm:</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Test lại trước khi merge</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Theo dõi lỗi phát sinh sau khi merge</span>

5. <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không đổ lỗi cho quá trình merge nếu chưa kiểm tra kỹ trước đó.</span>

<div align="center" class="MsoNormal" id="bkmrk--18" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 24.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt;">VIII. Xử lý vi phạm</span>**

**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">17. Vi phạm mức độ 1 – Yêu cầu chỉnh sửa</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Áp dụng khi:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Sai format</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Sai naming</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Commit message không đúng quy ước</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">PR thiếu mô tả</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Hình thức xử lý:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Yêu cầu chỉnh sửa trước khi approve</span>

<div align="center" class="MsoNormal" id="bkmrk--19" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">18. Vi phạm mức độ 2 – Từ chối merge</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Áp dụng khi:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không tuân thủ workflow</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Tự ý commit vào nhánh chính</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không xử lý conflict</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không test trước khi tạo PR</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Hình thức xử lý:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Từ chối merge</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Yêu cầu làm lại theo đúng quy trình</span>

<div align="center" class="MsoNormal" id="bkmrk--20" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 13.5pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">19. Vi phạm mức độ 3 – Đánh giá năng lực kỹ thuật</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Áp dụng khi:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Lặp lại vi phạm nhiều lần</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Không tuân thủ quy ước dù đã được nhắc</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Gây ảnh hưởng nghiêm trọng đến hệ thống</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Hình thức xử lý:</span>

- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Trao đổi trực tiếp</span>
- <span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Đánh giá lại mức độ phù hợp trong dự án</span>

<div align="center" class="MsoNormal" id="bkmrk--21" style="margin-bottom: .0001pt; text-align: center; line-height: normal;">---

</div>**<span style="font-size: 18.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">IX. Hiệu lực</span>**

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Quy định này có hiệu lực kể từ ngày ban hành và áp dụng cho toàn bộ thành viên tham gia phát triển dự án.</span>

<span style="font-size: 12.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman';">Mọi thay đổi về workflow hoặc quy ước kỹ thuật phải được thống nhất trước khi áp dụng.</span>