change(B03): 업로드/분석 알림 메일을 초기 설계 완료 시점 한 통으로 통합
같은 업로드 한 번에 업로드 완료 메일과 지표면 분석 완료 메일이 두 통 도착했다. 사용자가 실제로 화면을 볼 수 있는 시점은 초기 설계(B04 전처리 + B05 종단 + B06 횡단)까지 끝난 때 하나뿐이므로 그 시점에 통합 메일 한 통만 보낸다. - send_initial_analysis_complete_email 신설: 지표면 요약 + 노선 연장/측점 수 + 종단설계 화면 링크. 자동 체인 미실행/실패 시 전처리 요약만 싣고 안내 문구 전환 - run_auto_design_chain이 요약(route_id/length_m/cross_section_count) 반환 - WF1 서비스: 체인 실행 -> 통합 메일 순으로 재배치 - 업로드 직후 메일 발송 호출 제거(일반·청크 두 경로). 발송 함수는 프로젝트 생성 전 임시 보관함 안내용으로 남겨 두고 주석으로 용도 명시 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,11 @@ def _total_chunks(size_bytes: int, chunk_size_bytes: int) -> int:
|
||||
|
||||
|
||||
def _is_point_cloud_result(result: UploadedFileResult) -> bool:
|
||||
"""포인트클라우드 결과인지 — 임시 보관함 안내 메일 경로에서 쓴다.
|
||||
|
||||
프로젝트 업로드 경로는 더 이상 이 판정으로 메일을 보내지 않는다
|
||||
([[_send_upload_complete_notification]] 주석 참고).
|
||||
"""
|
||||
return result.file_type.lower() in _POINT_CLOUD_FILE_TYPES
|
||||
|
||||
|
||||
@@ -196,6 +201,12 @@ async def _send_upload_complete_notification(
|
||||
project_id: UUID,
|
||||
uploaded_file: UploadedFileResult,
|
||||
) -> None:
|
||||
"""저장만 끝났을 때 보내는 안내.
|
||||
|
||||
프로젝트 업로드 경로에서는 호출하지 않는다 — 그 흐름은 초기 설계까지 마친 뒤
|
||||
통합 메일 한 통으로 알린다. 프로젝트 생성 전 임시 보관함 업로드에서 쓸 예정이라
|
||||
지워두지 않았다(2026-08-08 사용자 지시).
|
||||
"""
|
||||
pool = get_db_pool()
|
||||
async with pool.acquire() as connection:
|
||||
project_info = await _get_project_notification_info(connection, project_id)
|
||||
@@ -324,18 +335,8 @@ async def upload_project_files(
|
||||
workflow_path = project_root / "workflow.json"
|
||||
if not workflow_path.exists():
|
||||
atomic_write_json(workflow_path, load_project_workflow(project_root))
|
||||
point_cloud_result = next(
|
||||
(result for result in results if _is_point_cloud_result(result)),
|
||||
None,
|
||||
)
|
||||
if point_cloud_result:
|
||||
_schedule_background_task(
|
||||
_send_upload_complete_notification(
|
||||
project_id=project_id,
|
||||
uploaded_file=point_cloud_result,
|
||||
),
|
||||
task_name=f"b03-upload-email-{project_id}",
|
||||
)
|
||||
# 업로드 직후 안내 메일은 보내지 않는다 — 초기 설계(B04~B06)까지 마친 뒤
|
||||
# WF1 서비스가 통합 메일 한 통을 보낸다(2026-08-08 사용자 지시).
|
||||
if point_cloud_input_id is not None:
|
||||
_schedule_background_task(
|
||||
trigger_wf1_analysis_and_email(
|
||||
@@ -558,14 +559,7 @@ async def finalize_project_upload(
|
||||
)
|
||||
stage_root = project_root / "B03_FileInput"
|
||||
_write_stage_metadata(stage_root, project_id, [result])
|
||||
if _is_point_cloud_result(result):
|
||||
_schedule_background_task(
|
||||
_send_upload_complete_notification(
|
||||
project_id=project_id,
|
||||
uploaded_file=result,
|
||||
),
|
||||
task_name=f"b03-upload-email-{project_id}",
|
||||
)
|
||||
# 업로드 직후 안내 메일은 보내지 않는다 — 위 일반 업로드 경로와 같은 이유.
|
||||
if point_cloud_input_id is not None:
|
||||
_schedule_background_task(
|
||||
trigger_wf1_analysis_and_email(
|
||||
|
||||
Reference in New Issue
Block a user