feat(project): 담당자는 협업자에서 제외·세부 업무 추가 칸 아이콘·내 업무 오른쪽 창
- 협업자 = 담당자 외의 멤버: add_followers 가 담당자를 거르고, 담당자 지정 시 같은 트랜잭션에서 협업자에서 뺌, 담당자 협업자 추가는 400 - 마이그레이션 028: 이미 겹친 task_followers 행 정리(스키마 변경 없음, 멱등) - 업무 창 세부 업무 추가 칸: 담당자·협업자·마감일을 동그라미 아이콘 버튼으로, 제목 칸을 넓게 - 내 업무 화면: 줄 클릭 시 화면 이동 없이 오른쪽 업무 창(iframe), 닫으면 목록 다시 받기 - 대시보드 "미완료 업무 합계(섹션별)" 카드 삭제 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1418,6 +1418,36 @@ def test_create_with_followers_and_my_overdue():
|
||||
assert not [x for x in req("GET", "/project/api/my-overdue", BOB).json()["tasks"] if x["project_id"] == p["id"]]
|
||||
|
||||
|
||||
def test_assignee_is_never_follower():
|
||||
"""담당자는 협업자가 아니다(2026-10-13) — 만들 때·배정할 때·협업자 추가 API·정리 SQL(028)."""
|
||||
import pathlib
|
||||
p = _project("P-asgfol", ADMIN, (ALICE, BOB, CAROL))
|
||||
s = _stage(p["id"], by=ADMIN)
|
||||
url = f"/project/api/projects/{p['id']}/tasks"
|
||||
# 만든 사람이 담당자 + 고른 협업자에 담당자가 섞여도 → 담당자는 빠진다
|
||||
t = req("POST", url, ALICE, json={"title": "규칙", "stage_id": s["id"], "assignee_email": ALICE,
|
||||
"followers": [ALICE, BOB]}).json()["task"]
|
||||
assert ST.list_followers(task_id=t["id"]) == [BOB]
|
||||
# 담당자를 협업자로 직접 넣으면 400
|
||||
assert req("POST", f"/project/api/tasks/{t['id']}/followers", ALICE, json={"email": ALICE}).status_code == 400
|
||||
assert req("POST", f"/project/api/tasks/{t['id']}/followers", ALICE, json={}).status_code == 400 # 나 = 담당자
|
||||
# 협업자(BOB)를 담당자로 바꾸면 협업자에서 빠진다 — 예전 담당자(ALICE)는 자동으로 들어가지 않는다
|
||||
assert req("PUT", f"/project/api/tasks/{t['id']}", ALICE, json={"assignee_email": BOB}).status_code == 200
|
||||
assert ST.list_followers(task_id=t["id"]) == []
|
||||
# 댓글 단 담당자도 협업자가 되지 않는다(댓글 쓴 사람 자동 협업자 규칙보다 우선)
|
||||
req("POST", f"/project/api/tasks/{t['id']}/comments", BOB, json={"body": "담당자 댓글"})
|
||||
req("POST", f"/project/api/tasks/{t['id']}/comments", CAROL, json={"body": "협업자 댓글"})
|
||||
assert ST.list_followers(task_id=t["id"]) == [CAROL]
|
||||
# 정리 SQL — 예전 데이터(담당자가 협업자에도 있음)를 지운다, 두 번 돌려도 같다
|
||||
with ST._pool.connection() as conn: # noqa: SLF001
|
||||
conn.execute("INSERT INTO task_followers (task_id, user_email) VALUES (%s, %s)", (t["id"], BOB))
|
||||
sql = (pathlib.Path(__file__).resolve().parent.parent / "scripts" / "sql" / "project_db_028_followers_exclude_assignee.sql").read_text(encoding="utf-8")
|
||||
for _ in range(2):
|
||||
with ST._pool.connection() as conn: # noqa: SLF001
|
||||
conn.execute(sql)
|
||||
assert ST.list_followers(task_id=t["id"]) == [CAROL]
|
||||
|
||||
|
||||
def test_move_task_to_other_project():
|
||||
"""업무를 다른 프로젝트로 옮기기(2026-10-13) — 세부 업무 함께, 대상 섹션·기본 담당자·완료 섹션, 연결 정리, 권한."""
|
||||
a = _project("P-mvA", ADMIN, (ALICE, BOB))
|
||||
|
||||
Reference in New Issue
Block a user