edit all sequence
This commit is contained in:
@@ -30,7 +30,7 @@ activate Gateway
|
||||
Gateway -> PartService: POST /participations/register\n{이름, 전화번호, 참여경로, 개인정보동의}
|
||||
activate PartService
|
||||
|
||||
PartService -> PartDB: SELECT * FROM participants\nWHERE phone_number = ? AND event_id = ?
|
||||
PartService -> PartDB: 참여자 중복 확인\n(전화번호, 이벤트ID로 조회)
|
||||
activate PartDB
|
||||
PartDB --> PartService: 중복 참여 여부 반환
|
||||
deactivate PartDB
|
||||
@@ -45,7 +45,7 @@ alt 중복 참여인 경우
|
||||
else 신규 참여인 경우
|
||||
PartService -> PartService: 응모 번호 생성\n(UUID 또는 시퀀스 기반)
|
||||
|
||||
PartService -> PartDB: INSERT INTO participants\n(name, phone_number, entry_path,\napplication_number, participated_at)
|
||||
PartService -> PartDB: 참여자 정보 저장\n(이름, 전화번호, 참여경로,\n응모번호, 참여일시)
|
||||
activate PartDB
|
||||
PartDB --> PartService: 저장 완료
|
||||
deactivate PartDB
|
||||
@@ -94,19 +94,19 @@ activate Gateway
|
||||
Gateway -> PartService: POST /events/{eventId}/draw-winners\n{winnerCount, visitBonus}
|
||||
activate PartService
|
||||
|
||||
PartService -> PartDB: SELECT * FROM participants\nWHERE event_id = ? AND is_winner = false
|
||||
PartService -> PartDB: 미당첨 참여자 목록 조회\n(이벤트ID로 당첨되지 않은 참여자 조회)
|
||||
activate PartDB
|
||||
PartDB --> PartService: 전체 참여자 목록 반환
|
||||
deactivate PartDB
|
||||
|
||||
PartService -> PartService: 당첨자 추첨 알고리즘 실행\n1. 난수 생성 (Crypto.randomBytes)\n2. 매장방문 가산점 적용 (옵션)\n3. Fisher-Yates Shuffle\n4. 당첨인원만큼 선정
|
||||
|
||||
PartService -> PartDB: UPDATE participants\nSET is_winner = true, won_at = NOW()\nWHERE participant_id IN (당첨자IDs)
|
||||
PartService -> PartDB: 당첨자 정보 업데이트\n(당첨 여부를 true로 설정, 당첨 일시 기록)
|
||||
activate PartDB
|
||||
PartDB --> PartService: 업데이트 완료
|
||||
deactivate PartDB
|
||||
|
||||
PartService -> PartDB: INSERT INTO draw_logs\n(event_id, draw_method, winner_count,\nalgorithm, drawn_at)
|
||||
PartService -> PartDB: 추첨 로그 저장\n(이벤트ID, 추첨방법, 당첨인원,\n알고리즘, 추첨일시)
|
||||
activate PartDB
|
||||
note right of PartDB
|
||||
추첨 로그 저장:
|
||||
|
||||
Reference in New Issue
Block a user