feat(project): move whole meeting sections up/down from the 구분 column

- 구분 cell: right-click or ⋯ menu → 구역 위로 / 구역 아래로 / 구역 끝에 줄 추가
- POST /api/goals/meeting-items/{id}/move-section swaps the contiguous section block
  with its neighbour under the meeting lock (row order and merges follow; 409 after completion)
- Next meetings inherit the new order; help + docs; tests (DB-less, real PostgreSQL, jsdom)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 13:29:53 +09:00
parent ae6b6ec603
commit ee09e8bfd1
17 changed files with 185 additions and 18 deletions
+30
View File
@@ -1166,6 +1166,36 @@ def test_review_meeting_result_lock_rules():
_drop_meetings([w1, w2])
def test_review_meeting_section_move():
"""구역(첫 열) 통째로 위/아래 — 묶음 안 줄 순서 그대로, 다음 주 회의록이 바뀐 순서를 이어받는다."""
from app.modules.project import store
w1 = store.month_weeks(2031, 11)[1][0] # 11월 2주차 시작일(주차 시작일이어야 회의록을 만든다)
w2 = store.week_period(w1)[1] + timedelta(days=1)
_drop_meetings([w1, w2])
try:
_create_meeting(w1)
secs = lambda w: [s for i, s in enumerate(r["section"] for r in ST.get_meeting(week_start=w)["items"])
if i == 0 or s != ST.get_meeting(week_start=w)["items"][i - 1]["section"]]
before = secs(w1)
assert len(before) >= 2, before
items = ST.get_meeting(week_start=w1)["items"]
second = next(r for r in items if r["section"] == before[1])
labels_second = [r["label"] for r in items if r["section"] == before[1]]
r = req("POST", f"/project/api/goals/meeting-items/{second['id']}/move-section", BOB, json={"direction": -1})
assert r.status_code == 200, r.text
after = secs(w1)
assert after[:2] == [before[1], before[0]] and after[2:] == before[2:], (before, after)
assert [r["label"] for r in ST.get_meeting(week_start=w1)["items"] if r["section"] == before[1]] == labels_second
_create_meeting(w2)
assert secs(w2) == after # 다음 회의록은 바뀐 구역 순서를 이어받는다
ST.set_meeting_completed(week_start=w1, done=True, by=ADMIN)
assert req("POST", f"/project/api/goals/meeting-items/{second['id']}/move-section", BOB,
json={"direction": 1}).status_code == 409 # 회의 완료 뒤 잠금
finally:
_drop_meetings([w1, w2])
if __name__ == "__main__":
if not ENABLED:
print("SKIP: PROJECT_TEST_DB_URL(localhost) not set")