[D2C-43] 이벤트 로그 저장 방식 구현#21
Merged
Merged
Conversation
- add event_logs table schema and migration - add event log request and response schemas - implement shared event recording service - add POST /events API for frontend behavior events - add event log API tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
D2C-43에서는 사용자 행동 이벤트와 백엔드 도메인 이벤트를 저장하기 위한 공통 이벤트 로그 저장 기반을 구현했습니다.
본 PR에서는
event_logs테이블, 이벤트 로그 요청/응답 스키마, 공통 이벤트 저장 서비스,POST /eventsAPI, 이벤트 로그 API 테스트를 추가하여 이후 로그/검증 단계에서 사용할 이벤트 원천 저장 구조를 마련합니다.포함 범위
이벤트 로그 DB 스키마
event_logs테이블 추가schema.sql반영properties컬럼을 JSONB 타입으로 구성기존 스키마 보완
orders테이블 쿠폰 인덱스 컬럼명 오류 수정applied_coupon_id참조 제거coupon_id기준으로 인덱스 수정이벤트 로그 스키마
이벤트 로그 저장 서비스
이벤트 로그 API
POST /eventsAPI 추가201 Created반환400 Bad Request반환400 Bad Request반환라우터 등록
/events엔드포인트 접근 가능하도록 구성테스트 추가
POST /events정상 요청 시201 Created반환 검증400 Bad Request반환 검증400 Bad Request반환 검증검증 결과
백엔드 이벤트 로그 API 테스트를 실행하여 정상 통과를 확인했습니다.
백엔드 전체 테스트를 실행하여 정상 통과를 확인했습니다.
수동 확인 항목:
POST /events요청 시 이벤트 로그 저장 확인201 Created응답 확인event_id포함 여부 확인occurred_at포함 여부 확인created_at포함 여부 확인Event log recorded successfully메시지 포함 여부 확인event_type요청 시400 Bad Request반환 확인source요청 시400 Bad Request반환 확인event_logs테이블 생성 확인event_logs의 UTC 기준 timestamp 저장 정책 확인브랜치 통합 방식
이번 PR의 통합 흐름은 아래와 같습니다.
develop병합 후에는 이벤트 로그 저장 기반이 로그/검증 스프린트에 반영됩니다.향후 브랜치 운영 원칙
로그/검증 단계에서는 아래 브랜치 운영 원칙을 유지합니다.
develop에서 분기develop으로 개별 PR 생성develop을main에 병합main은 배포 기준 브랜치로 유지체크리스트
develop기준으로 분기event_logs테이블 추가schema.sql반영orders쿠폰 인덱스 컬럼명 오류 수정POST /eventsAPI 추가POST /events정상 요청 테스트 통과 확인