Skip to content

refactor: 견적 제안 및 반려 알림 수정 - #78

Merged
soooob43 merged 3 commits into
devfrom
refactor/mover-estimate
Aug 3, 2026
Merged

refactor: 견적 제안 및 반려 알림 수정#78
soooob43 merged 3 commits into
devfrom
refactor/mover-estimate

Conversation

@soooob43

@soooob43 soooob43 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

📌 작업 내용

✅ 변경 사항

  • createNotification(input, tx)를 핵심 DB 작업과 같은 runTransaction() 안에서 호출
  • 트랜잭션 결과로 notification 반환
  • 커밋 완료 후 sendNotification(userId, notification) 호출
  • 알림 저장 실패 시 견적 제안/반려 작업도 함께 롤백

🧪 테스트

  • 서버 실행 확인
  • API 동작 확인
  • DB 연동 확인
  • 로그 확인
  • 기타:

테스트 방법

📷 스크린샷 (선택)

🔥 체크리스트

  • 코드 컨벤션을 준수했습니다.
  • 불필요한 console.log를 제거했습니다.
  • ESLint 오류가 없습니다.
  • 변경 사항을 직접 테스트했습니다.
  • 관련 문서를 업데이트했습니다. (필요 시)

🙏 To Reviewer

  • 현재 NotificastionService 때문에 해당 호출부에서 타입 오류가 나는 것 같은데 해당 오류는 민주님께서 변경 머지해주시면 해소될 것으로 보입니다. 이후에도 오류 해결되지 않으면 그때 원인 찾아서 수정하겠습니다.

Summary by CodeRabbit

  • 개선 사항
    • 견적 발송 및 반려 시 알림이 안정적으로 생성되도록 처리 흐름을 개선했습니다.
    • 관련 작업이 완료된 후 알림이 비동기로 발송되도록 변경했습니다.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

견적 발송 및 반려 알림 생성을 트랜잭션 내부로 이동했습니다. 트랜잭션 결과는 알림 객체를 반환합니다. 커밋 후 반환된 알림을 비동기로 발송합니다.

Changes

견적 알림 처리

Layer / File(s) Summary
견적 발송 알림의 트랜잭션 처리
src/modules/estimate/mover/mover-estimate.service.ts
견적 생성 트랜잭션에서 알림 객체를 생성합니다. 커밋 후 알림을 발송합니다. 기존 개별 반환 필드를 알림 객체로 대체했습니다.
견적 반려 알림의 트랜잭션 처리
src/modules/estimate/mover/mover-estimate.service.ts
견적 반려 트랜잭션에서 알림 객체와 생성·만료 시각을 계산합니다. 커밋 후 알림을 발송합니다. 기존 기사명 반환값을 알림 객체로 대체했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: wkdalswn11

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 견적 제안 및 반려 알림 수정이라는 PR의 주요 변경 내용을 명확하고 간결하게 설명합니다.
Description check ✅ Passed 변경 사항과 리뷰 참고 내용은 작성되었지만 테스트 방법과 일부 테스트 체크 항목은 미작성 상태입니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/mover-estimate

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/modules/estimate/mover/mover-estimate.service.ts`:
- Around line 259-278: Update the notification flow around createNotification
and sendNotification: use the transaction-supported notification creation path
with tx, and replace notificationService.sendNotification with
notificationSseService.sendNotification. Ensure the created NotificationItem
remains compatible with the send method’s argument type.
- Line 278: `notificationService`를 통한 `sendNotification` 호출을 `mover-estimate`
흐름에서 모두 제거하세요. `createNotification`이 이미
`notificationSseService.sendNotification`을 호출하므로 해당 중복 전송과 TypeScript 컴파일 오류가 함께
해결되도록 278행과 378행의 호출을 삭제하세요.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 354874b6-63b1-45d5-aeda-cc8176e40a81

📥 Commits

Reviewing files that changed from the base of the PR and between 75c7e69 and fec1705.

📒 Files selected for processing (1)
  • src/modules/estimate/mover/mover-estimate.service.ts

Comment thread src/modules/estimate/mover/mover-estimate.service.ts
Comment thread src/modules/estimate/mover/mover-estimate.service.ts

@wkdalswn11 wkdalswn11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

견적 제안과 반려 모두 핵심 DB 작업과
createNotification(input, tx)를 동일 트랜잭션에 포함하고,
생성된 알림을 트랜잭션 결과로 반환한 뒤
커밋 이후 sendNotification()으로 SSE를 전송하도록
의도한 구조에 맞게 수정된 것 같습니다.

고생하셨습니다¡

@coderabbitai coderabbitai Bot mentioned this pull request Aug 3, 2026
10 tasks
@soooob43
soooob43 merged commit 8dcabb0 into dev Aug 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants