feat(meeting-room): Meeting Room + Booking DocTypes (TETRA-2191) #167

Merged
khanhn merged 1 commit from feat/TETRA-2191-meeting-room-doctypes into main 2026-06-19 10:39:13 +07:00
Collaborator

Mục tiêu

Thêm 3 DocType cho tính năng Phòng họp (TETRA-2191) — nguồn data + logic ghi cốt lõi. TETRA trở thành thin BFF (proxy CRUD + mask/notify ở phía TETRA).

DocTypes

  • Meeting Room — master data (room_name, location, capacity, facilities, timezone, requires_approval, buffers, is_active). Autoname MR-.#####.
  • Meeting Room Booking — transactional. Autoname MRB-.#####.
  • Meeting Room Booking Participant — child table, định danh theo email (chuẩn TETRA).

Logic (validate() của Booking)

  • Chặn đặt quá khứ (chỉ khi giờ bắt đầu thay đổi).
  • Phòng phải active; range giờ hợp lệ.
  • State-machine (Draft → Pending Approval → Confirmed → Cancelled/Completed) qua ALLOWED_TRANSITIONS.
  • Chống trùng giờ race-safe: lock row Meeting Room for_update → query overlap (nửa-mở [start,end)) → throw. Thay cho GiST EXCLUDE constraint của Postgres (MariaDB không có exclusion constraint).

Test

  • test_meeting_room_booking.py (7 ca). bench run-tests bị chặn bởi bootstrap ERPNext ở local; đã smoke test qua bench console: tất cả 9 check PASS (overlap/past/end<start/inactive/back-to-back/online/transition).
  • ruff lint + format: pass.

Refs: TETRA-2191

## Mục tiêu Thêm 3 DocType cho tính năng Phòng họp (TETRA-2191) — nguồn data + logic ghi cốt lõi. TETRA trở thành thin BFF (proxy CRUD + mask/notify ở phía TETRA). ## DocTypes - **Meeting Room** — master data (room_name, location, capacity, facilities, timezone, requires_approval, buffers, is_active). Autoname `MR-.#####`. - **Meeting Room Booking** — transactional. Autoname `MRB-.#####`. - **Meeting Room Booking Participant** — child table, định danh theo **email** (chuẩn TETRA). ## Logic (validate() của Booking) - Chặn đặt **quá khứ** (chỉ khi giờ bắt đầu thay đổi). - Phòng phải **active**; range giờ hợp lệ. - **State-machine** (Draft → Pending Approval → Confirmed → Cancelled/Completed) qua ALLOWED_TRANSITIONS. - **Chống trùng giờ race-safe**: lock row Meeting Room `for_update` → query overlap (nửa-mở `[start,end)`) → throw. Thay cho GiST EXCLUDE constraint của Postgres (MariaDB không có exclusion constraint). ## Test - `test_meeting_room_booking.py` (7 ca). `bench run-tests` bị chặn bởi bootstrap ERPNext ở local; đã **smoke test qua bench console**: tất cả 9 check PASS (overlap/past/end<start/inactive/back-to-back/online/transition). - ruff lint + format: pass. Refs: TETRA-2191
khanhn force-pushed feat/TETRA-2191-meeting-room-doctypes from a7e07bd76f
All checks were successful
Test (offline) / test (push) Successful in 30s
Test (offline) / test (pull_request) Successful in 27s
to df28583995
All checks were successful
Test (offline) / test (push) Successful in 44s
Test (offline) / test (pull_request) Successful in 35s
2026-06-19 09:10:31 +07:00
Compare
khanhn merged commit 4ea74218ad into main 2026-06-19 10:39:13 +07:00
khanhn deleted branch feat/TETRA-2191-meeting-room-doctypes 2026-06-19 10:39:13 +07:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tant/vhrms!167
No description provided.