feat(project): 세부 업무 협업자 등록·대시보드 프로젝트별·마감 지난 업무 알림
- 세부 업무를 만들 때 협업자도 같이(업무 창 추가 칸·보드 카드 새 줄) — POST tasks 의 followers, 비멤버면 400 - 보드 카드 세부 업무 줄에도 협업자 아이콘, 업무 창 줄의 빈 협업자 아이콘은 늘 보이게 - 협업자 메뉴는 고를 때마다 다시 열려 여러 명을 이어서 지정(openFollowerMenu 공용) - 대시보드 "업무 합계(프로젝트별)" 카드 — 완료 상태별 카드 왼쪽, 프로젝트별 완료/전체·완료율 - 마감 지난 내 업무 위쪽 알림(ERP 모든 화면, erp-overdue.js, GET /project/api/my-overdue) — 닫으면 1시간 뒤 다시, 새로 지난 업무는 바로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1387,6 +1387,37 @@ def test_subtask_followers_and_reaction_alert():
|
||||
assert _count(q, ALICE, t["id"]) == 1
|
||||
|
||||
|
||||
def test_create_with_followers_and_my_overdue():
|
||||
"""세부 업무를 만들 때 협업자 같이 등록(비멤버면 400, 아무것도 안 만듦) + 마감 지난 내 업무 API(2026-10-13)."""
|
||||
p = _project("P-crfol", ADMIN, (ALICE, BOB))
|
||||
s = _stage(p["id"], by=ADMIN)
|
||||
t = ST.create_task(project_id=p["id"], title="부모", stage_id=s["id"], created_by=ALICE)
|
||||
url = f"/project/api/projects/{p['id']}/tasks"
|
||||
r = req("POST", url, ALICE, json={"title": "세부-협업", "parent_task_id": t["id"], "followers": [BOB, BOB.upper()]})
|
||||
assert r.status_code == 201
|
||||
assert sorted(ST.list_followers(task_id=r.json()["task"]["id"])) == sorted([ALICE, BOB])
|
||||
n_before = _count("SELECT COUNT(*) AS n FROM tasks WHERE parent_task_id=%s", t["id"])
|
||||
assert req("POST", url, ALICE, json={"title": "x", "parent_task_id": t["id"], "followers": [DAVE]}).status_code == 400
|
||||
assert req("POST", url, ALICE, json={"title": "x", "parent_task_id": t["id"], "followers": "bob"}).status_code == 400
|
||||
assert _count("SELECT COUNT(*) AS n FROM tasks WHERE parent_task_id=%s", t["id"]) == n_before
|
||||
|
||||
# 마감 지난 내 업무 — 어제 마감 미완료(세부 포함)만, 오늘·완료·남의 업무·볼 수 없게 된 업무는 빠짐
|
||||
y = (today_kst() - timedelta(days=1)).isoformat()
|
||||
old = ST.create_task(project_id=p["id"], title="지난-메인", stage_id=s["id"], assignee_email=BOB, due_date=y, created_by=ALICE)
|
||||
sub = ST.create_task(project_id=p["id"], title="지난-세부", parent_task_id=t["id"], assignee_email=BOB, due_date=y, created_by=ALICE)
|
||||
ST.create_task(project_id=p["id"], title="오늘", stage_id=s["id"], assignee_email=BOB, due_date=today_kst().isoformat(), created_by=ALICE)
|
||||
done = ST.create_task(project_id=p["id"], title="끝난", stage_id=s["id"], assignee_email=BOB, due_date=y, created_by=ALICE)
|
||||
ST.update_task(task_id=done["id"], fields={"completed": True}, actor=ALICE)
|
||||
ST.create_task(project_id=p["id"], title="남의", stage_id=s["id"], assignee_email=ALICE, due_date=y, created_by=ALICE)
|
||||
got = req("GET", "/project/api/my-overdue", BOB).json()
|
||||
mine = {x["id"]: x for x in got["tasks"] if x["project_id"] == p["id"]}
|
||||
assert set(mine) == {old["id"], sub["id"]}, mine
|
||||
assert mine[sub["id"]]["parent_title"] == "부모" and got["today"] == today_kst().isoformat()
|
||||
assert req("GET", "/project/api/my-overdue", EVE).status_code == 403 # Project 권한 없음 → 화면 알림은 조용히 멈춤
|
||||
ST.remove_member(project_id=p["id"], user_email=BOB)
|
||||
assert not [x for x in req("GET", "/project/api/my-overdue", BOB).json()["tasks"] if x["project_id"] == p["id"]]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not ENABLED:
|
||||
print("SKIP: PROJECT_TEST_DB_URL(localhost) not set")
|
||||
|
||||
Reference in New Issue
Block a user