feat(realestate-lab): 종료(완료) 청약 공고 일괄 삭제 API

- db.delete_closed_announcements(): status='완료' 공고 일괄 삭제
- DELETE /api/realestate/announcements/closed 엔드포인트 추가
- {ann_id} 라우트보다 먼저 등록 (FastAPI prefix 매칭 순서)
- 반환: {"ok": True, "deleted": <count>}

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 04:14:47 +09:00
parent 916b04af6a
commit 57b7a4921d
2 changed files with 15 additions and 1 deletions

View File

@@ -401,6 +401,13 @@ def delete_announcement(ann_id: int) -> bool:
return cur.rowcount > 0
def delete_closed_announcements() -> int:
"""status='완료' 공고 일괄 삭제. 삭제된 건수 반환."""
with _conn() as conn:
cur = conn.execute("DELETE FROM announcements WHERE status = '완료'")
return cur.rowcount
def update_all_statuses():
"""모든 진행중 공고의 status를 날짜 기반으로 재계산."""
with _conn() as conn: