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
+23
View File
@@ -3320,6 +3320,29 @@ class ProjectStore:
for n, x in enumerate(ids):
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
def move_meeting_section(self, *, item_id: int, direction: int) -> None:
"""구역(표 첫 열 "구분") 통째로 한 칸 위/아래 — item_id 가 든 구역 묶음(이어진 같은 구역 줄)과 옆 구역 묶음의
자리를 바꾼다. 묶음 안 줄 순서·세로 병합(content_row_span)은 그대로 따라간다. 맨 위/맨 아래면 그대로."""
with self._pool.connection() as conn:
with conn.transaction():
self._require_meetings(conn)
rows = self._locked_meeting_items(conn, item_id)
ids = [int(r["id"]) for r in rows]
blocks: list[list[int]] = [] # 이어진 같은 구역 줄 묶음(화면의 tbody 하나)
for i, r in enumerate(rows):
if i and r["section"] == rows[i - 1]["section"]:
blocks[-1].append(ids[i])
else:
blocks.append([ids[i]])
b = next(n for n, blk in enumerate(blocks) if item_id in blk)
j = b + (1 if direction > 0 else -1)
if not 0 <= j < len(blocks):
return
blocks[b], blocks[j] = blocks[j], blocks[b]
order = [x for blk in blocks for x in blk]
for n, x in enumerate(order):
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
def goal_month_targets(self, *, year: int, month: int) -> dict[str, Any]:
"""회의록 머리 — 그 달 매출 목표·실적, 로아스 목표(목표 표 숫자), 매출 단위. 목표 표가 없으면 빈 값."""
with self._pool.connection() as conn: