feat(realestate): 결과발표 공고 매칭 점수 보존

run_matching() 대상을 '청약예정/청약중/결과발표'로 확장.
삭제는 '완료' 상태만 — 결과발표 단계의 매칭 기록은 유지.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-01 10:32:58 +09:00
parent 86a6b75124
commit 8411e2c73e

View File

@@ -205,7 +205,7 @@ def run_matching():
profile = _profile_row_to_dict(profile_row) profile = _profile_row_to_dict(profile_row)
anns = conn.execute( anns = conn.execute(
"SELECT * FROM announcements WHERE status IN ('청약예정', '청약중')" "SELECT * FROM announcements WHERE status IN ('청약예정', '청약중', '결과발표')"
).fetchall() ).fetchall()
for ann_row in anns: for ann_row in anns:
@@ -235,10 +235,10 @@ def run_matching():
json.dumps(result["score_breakdown"]), json.dumps(result["score_breakdown"]),
)) ))
# Clean up stale match results for completed announcements # 완료 상태 공고의 매칭 결과만 삭제 (결과발표는 보존)
conn.execute( conn.execute(
"DELETE FROM match_results WHERE announcement_id NOT IN " "DELETE FROM match_results WHERE announcement_id IN "
"(SELECT id FROM announcements WHERE status IN ('청약예정', '청약중'))" "(SELECT id FROM announcements WHERE status = '완료')"
) )
logger.info("매칭 완료") logger.info("매칭 완료")