feat(프로젝트): 매일 하는 업무 — 날짜 팝업 [매일]·반복 아이콘·시각별 알림

- 마이그레이션 033 tasks.repeat_daily — [매일]이면 마감일·시각 비움, 마감일을 고르면 꺼짐(미적용이면 버튼 숨김·PUT 503)
- 마감 칸(카드·목록·내 업무·세부 업무·업무 창)에 반복 아이콘 + "매일"
- reminders.run_daily_alerts: 영업일, Project 옵션 daily_alert_times 중 지난 가장 늦은 시각마다 담당자(없으면 협업자)에게 type=daily 알림(task_reminders 로 중복 방지, 데몬 1분 주기)
- 큰 알림 팝업·PC 알림 프로그램에서 매일 업무 줄은 노란 배경
- Project 옵션 "알림" 분류: 알림 시각 여러 개 추가·삭제(최대 12)
- 도움말·모듈 CLAUDE.md·DEPLOYMENT(033) 갱신, 테스트 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 14:35:59 +09:00
parent 3045bc6f99
commit 7f94e5efe7
26 changed files with 451 additions and 75 deletions
+33 -3
View File
@@ -888,6 +888,14 @@ class ProjectStore:
for k in ("start_time", "due_time"):
if k in fields:
clean[k] = store.validate_time(fields[k])
# 매일 하는 업무(033) — 켜면 마감일·마감 시각을 비운다(마감일 없이 매일).
if "repeat_daily" in fields:
if not isinstance(fields["repeat_daily"], bool):
raise ValueError("매일 반복 값이 올바르지 않습니다.")
clean["repeat_daily"] = fields["repeat_daily"]
if fields["repeat_daily"]:
clean["due_date"] = None
clean["due_time"] = None
newly_assigned: str | None = None
newly_completed = False
@@ -899,7 +907,11 @@ class ProjectStore:
prev = self._serialize(row)
sets: list[str] = []
params: list[Any] = []
for k in ("title", "description", "priority", "start_date", "due_date", "start_time", "due_time"):
# 마감일을 고르면 매일 반복은 꺼진다(열이 있을 때만 — 033 미적용이면 키가 없다)
if clean.get("due_date") and prev.get("repeat_daily") and "repeat_daily" not in clean:
clean["repeat_daily"] = False
for k in ("title", "description", "priority", "start_date", "due_date", "start_time", "due_time",
"repeat_daily"):
if k in clean:
sets.append(f"{k} = %s")
params.append(clean[k])
@@ -2268,9 +2280,27 @@ class ProjectStore:
).fetchall()
return [self._serialize(r) for r in rows]
def list_open_daily_tasks(self) -> list[dict[str, Any]]:
"""매일 하는 업무(033 repeat_daily) 중 미완료 + 팔로워 목록. 보관 프로젝트는 뺀다.
033 미적용이면 psycopg_errors.UndefinedColumn(알림 데몬이 그날은 건너뜀)."""
with self._pool.connection() as conn:
rows = conn.execute(
"""
SELECT t.id, t.title, t.assignee_email, t.project_id, t.parent_task_id, p.name AS project_name,
COALESCE((SELECT array_agg(f.user_email ORDER BY f.user_email)
FROM task_followers f WHERE f.task_id = t.id),
'{}'::text[]) AS followers
FROM tasks t
JOIN projects p ON p.id = t.project_id
WHERE t.repeat_daily AND t.completed_at IS NULL AND p.status <> 'archived'
ORDER BY t.id
""",
).fetchall()
return [self._serialize(r) for r in rows]
def add_reminder_notification(
self, *, task_id: int, kind: str, due_date: str, recipient_email: str,
project_id: int | None, title: str, body: str,
project_id: int | None, title: str, body: str, ntype: str | None = None,
) -> bool:
"""마감 알림 발송 기록 + 수신함 알림을 한 트랜잭션에. 처음이면 둘 다 넣고 True,
이미 보냈으면(UNIQUE) False. 알림 생성이 실패하면 발송 기록도 되돌려져 다음 실행에서
@@ -2289,7 +2319,7 @@ class ProjectStore:
"INSERT INTO project_notifications "
"(recipient_email, actor_email, project_id, task_id, type, title, body) "
"VALUES (%s,'',%s,%s,%s,%s,%s)",
(rcpt, project_id, task_id, kind, store.norm_str(title), store.norm_str(body)),
(rcpt, project_id, task_id, ntype or kind, store.norm_str(title), store.norm_str(body)),
)
return True