Skip to content

fix: 판매자 주문 구독 이벤트에 확정 마감 시각 추가 - #593

Merged
chanwoo7 merged 1 commit into
developfrom
fix/seller-order-update-confirm-deadline
Nov 19, 2026
Merged

chanwoo7 merged 1 commit into
developfrom
fix/seller-order-update-confirm-deadline

Conversation

@chanwoo7

Copy link
Copy Markdown
Member

개요

판매자 주문 구독 이벤트 SellerOrderUpdate에 확정 마감 시각 confirmDeadlineAt을 더합니다. 판매자 앱이 D84②(확정 마감 2시간 미만 접수 주문은 '새 주문' 알림에 마감 시각 표시)를 포그라운드에서 지키지 못하던 막힘을 푸는 fix입니다.

  • 앱을 연 상태에서는 sellerOrderUpdated의 '새 주문' 토스트가 먼저 뜨고, 같은 키의 푸시는 중복 제거로 버려집니다.
  • 푸시(buildOrderSubmittedPush)는 이미 마감 시각을 넣지만 구독 이벤트에는 마감이 없어 토스트에 넣을 수 없었습니다.

변경 사항

  • SDL(추가만, nullable)
    • SellerOrderUpdate.confirmDeadlineAt: DateTime
    • 설명: 확정 마감 시각. 이때까지 확정하지 않으면 자동 취소되고, 접수(SUBMITTED) 상태가 아니거나 결제 도입 전 주문이면 null입니다.
  • 매퍼 toSellerOrderUpdateEvent
    • SellerOrderUpdateRow에 confirm_deadline_at, 출력 SellerOrderUpdateEvent에 confirmDeadlineAt: string | null(ISO)을 더했습니다.
    • 확정·취소 뒤에도 행에 마감이 남으므로 접수 상태일 때만 값을 내고 그 밖은 null입니다. 판매자 주문 목록·상세의 confirmDeadlineAt과 같은 규칙입니다.
  • 발행 경로
    • 입금 확인(SUBMITTED), 판매자 상태 변경·취소, 관리자 취소, 구매자 취소, 자동 전이, 픽업 변경이 모두 이 매퍼를 거칩니다.
    • 각 경로의 행은 include 기반이라 스칼라가 이미 들어 있어 조회 변경은 없습니다(tsc로 확인).
    • 접수 주문의 픽업을 바꾸면 다시 잰 마감이 이벤트에 실립니다.

테스트

  • 매퍼 단위 spec 신설(order-events-mappers.helper.spec.ts)
    • 필드 매핑 전체
    • 마감이 남은 주문의 OrderStatus 7값 전수 표: SUBMITTED만 값, 나머지 6값은 null
    • 마감 없는 접수 주문(결제 도입 전) null, 품목 없음
  • real DB
    • 입금 확인으로 접수될 때 SUBMITTED 이벤트에 마감(접수 + 24시간)이 실립니다.
    • 판매자 확정 이벤트는 행에 마감이 남아 있어도 null입니다.
    • 확정 마감 자동 취소 이벤트도 null입니다.
    • 접수 주문 픽업 변경 이벤트는 새 픽업 기준으로 다시 잰 마감을 싣습니다.
    • 관리자 취소 이벤트 고정값, 실 Redis 왕복(ISO 보존), 구독 서비스 고정값에 필드를 반영했습니다.
  • 가드 반증: 매퍼의 상태 조건을 빼면 8건 실패(비접수 6상태 표, 판매자 확정, 자동 취소)하는 것을 확인하고 되돌렸습니다.
  • 경로 지정 실행: order 서비스 spec 8개 스위트 219건 통과
  • 정적 검사: lint·tsc·dto:check·docs:check·arch:check·graphql:codegen 통과. 전체 jest는 pre-push에서 돕니다.

플랜 대조

결정 이 PR에서 한 일 상태
D84② 마감 2시간 미만 접수 주문의 '새 주문' 알림에 마감 시각: 포그라운드 구독 이벤트에도 confirmDeadlineAt 제공 한 것

- 무엇·왜
  - 판매자 앱은 포그라운드에서 sellerOrderUpdated의 새 주문 토스트를 먼저 띄우고, 같은 키의 푸시는 중복 제거로 버린다.
  - D84②(확정 마감 2시간 미만 접수 주문은 새 주문 알림에 마감 시각 표시)를 푸시는 이미 지키지만 구독 이벤트에는 마감이 없어 포그라운드 토스트에 넣을 수 없었다.
- 변경점
  - SDL: SellerOrderUpdate.confirmDeadlineAt: DateTime 추가(접수 상태가 아니거나 결제 도입 전 주문이면 null).
  - 매퍼: SellerOrderUpdateRow에 confirm_deadline_at, SellerOrderUpdateEvent에 confirmDeadlineAt(string | null).
  - 확정·취소 뒤에도 행에 마감이 남으므로 접수(SUBMITTED)일 때만 값을 내고 그 밖은 null(주문 목록·상세의 confirmDeadlineAt과 같은 규칙).
  - 발행 경로(입금 확인·판매자 상태 변경·취소·자동 전이·픽업 변경)의 행은 include 기반이라 select 변경은 없다.
- 테스트
  - 매퍼 단위 spec 신설: 필드 매핑, OrderStatus 7값 전수 표, 마감 없는 접수 주문 null, 품목 없음.
  - real DB: 입금 확인 SUBMITTED 이벤트에 마감 실림, 판매자 확정·자동 취소 이벤트는 행에 마감이 남아도 null, 접수 주문 픽업 변경 이벤트는 다시 잰 마감을 실음.
  - 기존 이벤트 고정값(관리자 취소·Redis 왕복·구독 서비스)에 필드 반영.
  - 반증: 상태 조건을 빼면 8건 실패(비접수 6상태 표, 판매자 확정, 자동 취소).
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T00:54:45.805892Z 5984cb0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

🩺 NestJS Doctor — 90/100 (Excellent)

진단 539건 (error 14).

Category error warning info
architecture 2 2 46
correctness 0 295 0
performance 0 44 29
schema 0 0 87
security 12 22 0
architecture / security 상위 항목
  • error security/security/no-hardcoded-secrets: Variable 'SEED_PASSWORD' appears to contain a hardcoded secret.
  • error architecture/architecture/no-manual-instantiation: Manual instantiation of 'AccountNumberReencryptRepository' detected. Use dependency injection instead.
  • warning security/security/no-weak-crypto: Weak hashing algorithm 'md5' used in createHash().
  • error architecture/architecture/no-manual-instantiation: Manual instantiation of 'OutboxRepository' detected. Use dependency injection instead.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal type 'IAuditLogRepository'.
  • warning security/security/no-exposed-env-vars: Direct 'process.env.NODE_ENV' access in 'AuthController'. Use ConfigService instead.
  • warning security/security/require-guards-on-endpoints: Endpoint 'start' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'callback' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'refresh' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'logout' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerLogin' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerRefresh' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerLogout' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'devIssueToken' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'adminLogin' has no @UseGuards() at class or method level.

오탐 포함 가능 · 기준 docs/guide/architecture-conventions.md

@github-actions

Copy link
Copy Markdown

🧹 knip — dead-code 리포트

Unused exports (1)
Unused exported types (4)
전체 리포트
Unused exports (1)
effectiveLeadTimeMinutes  src/features/store/index.ts:20:10
Unused exported types (4)
OrderPickupRescheduledPayload  type  src/features/order/index.ts:44:8  
ProductCustomIssue             type  src/features/product/index.ts:11:8
ThreeDDesignSource             type  src/features/product/index.ts:16:8
ThreeDDesignV1                 type  src/features/product/index.ts:17:8

청소 후보(오탐 가능) · 기준 docs/guide/architecture-conventions.md

@github-actions

Copy link
Copy Markdown

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements
98.44% (+0% 🔼)
13420/13632
🟢 Branches
93.84% (+0% 🔼)
5258/5603
🟢 Functions 98.08% 2712/2765
🟢 Lines
98.91% (+0% 🔼)
12212/12346

Test suite run success

6656 tests passing in 445 suites.

Report generated by 🧪jest coverage report action from 5984cb0

@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chanwoo7
chanwoo7 merged commit bc91188 into develop Nov 19, 2026
18 checks passed
@chanwoo7
chanwoo7 deleted the fix/seller-order-update-confirm-deadline branch November 19, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant