feat(project): weekly meetings editable by anyone, admin completes to lock
Meeting write APIs now accept any project user; deleting a meeting and the
new POST /api/goals/meetings/{week}/complete (complete/reopen) stay admin
only. A completed meeting (migration 022: completed_at, completed_by)
rejects edits with 409; last-week result fields follow the next meeting's
lock instead. The page shows a complete button / locked badge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -747,7 +747,8 @@ def test_goal_meetings():
|
||||
except KeyError:
|
||||
pass
|
||||
try:
|
||||
assert req("POST", f"/project/api/goals/meetings/{w1}", BOB, json={"year": w1.year}).status_code == 403
|
||||
# 회의 완료(잠금)는 관리자만 — 회의록 만들기·고치기는 누구나(2026-10-07)
|
||||
assert req("POST", f"/project/api/goals/meetings/{w1}/complete", BOB, json={"done": True}).status_code == 403
|
||||
assert req("POST", f"/project/api/goals/meetings/{w1 + timedelta(days=1)}", ADMIN, json={}).status_code == 400
|
||||
r = req("POST", f"/project/api/goals/meetings/{w1}", ADMIN, json={"year": w1.year})
|
||||
assert r.status_code == 201 and r.json()["created"] is True, r.text
|
||||
@@ -771,7 +772,7 @@ def test_goal_meetings():
|
||||
assert r.status_code == 400
|
||||
assert put(coupang["id"], {"target_amount": "1,200만"}).json()["item"]["target_amount"] == 12_000_000
|
||||
assert put(coupang["id"], {"status": "bogus"}).status_code == 400
|
||||
assert put(coupang["id"], {"content": "x"}, BOB).status_code == 403
|
||||
assert put(coupang["id"], {"content": "추석 타임딜"}, BOB).status_code == 200 # 누구나 수정
|
||||
assert req("PUT", f"/project/api/goals/meetings/{w1}", ADMIN,
|
||||
json={"week_target": "3천만", "attendees": "대표", "notes": "메모"}).status_code == 200
|
||||
# 다음 주 — 줄을 이어받고 전주 칸(prev)에 지난주 할 일·목표
|
||||
@@ -781,6 +782,14 @@ def test_goal_meetings():
|
||||
c2 = next(it for it in m2["items"] if it["carry_from"] == coupang["id"])
|
||||
assert c2["prev"]["content"] == "추석 타임딜" and c2["prev"]["target_amount"] == 12_000_000
|
||||
assert m2["prev_meeting"] == {"week_start": w1.isoformat(), "week_target": 30_000_000}
|
||||
# 회의 완료(022) — w1 을 잠그면 w1 의 주요 업무는 못 고치지만, 지난주 결과는 다음 주(w2)가 열려 있으니 적을 수 있다
|
||||
r = req("POST", f"/project/api/goals/meetings/{w1}/complete", ADMIN, json={"done": True})
|
||||
if r.status_code == 200:
|
||||
assert put(coupang["id"], {"content": "잠김"}, BOB).status_code == 409
|
||||
assert put(coupang["id"], {"result_amount": "100"}, BOB).status_code == 200
|
||||
assert req("POST", f"/project/api/goals/meetings/{w1}/complete", ADMIN, json={"done": False}).json()["completed"] is False
|
||||
else:
|
||||
assert r.status_code == 503, r.text # 022 미적용
|
||||
# 지난주 결과·평가는 지난 회의록 줄에 저장
|
||||
assert put(coupang["id"], {"result_amount": "1.5억", "status": "done"}).json()["item"]["result_amount"] == 150_000_000
|
||||
# 줄 추가(기준 줄 아래)·이동(같은 구역 안)·삭제, 새 구역
|
||||
|
||||
Reference in New Issue
Block a user