Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ public WaitingResult enterWaiting(EnterWaitingCommand command) {
command.restaurantId(), waiting.getToken().value()
);

if (position == null) {
Waiting updated = waitingRepository.findById(saved.getId())
.orElseThrow(() -> new WaitingException(WaitingErrorCode.NOT_FOUND));
return WaitingResult.of(updated);
}

return WaitingResult.of(saved, position);

} catch (Exception e) {
Expand Down Expand Up @@ -138,6 +144,9 @@ public void completeWaiting(UUID waitingId){
waitingRepository.softDelete(waitingId, SYSTEM_UUID);

waitingActivationPort.remove(waiting.getRestaurantId(), waiting.getToken().value());

// 예약 완료 후 재등록 가능하도록 유저 플래그 제거
waitingActivationPort.removeUser(waiting.getRestaurantId(), waiting.getUserId());
}

// 스케줄러 - N명씩 입장 허용
Expand Down Expand Up @@ -184,9 +193,6 @@ public void activateNextBatch(UUID restaurantId){

activeSaved = true;

// ACTIVE 전환 후 예약 완료 시 재등록 가능하도록 플래그 제거
waitingActivationPort.removeUser(restaurantId, waiting.getUserId());

// 3. 동일한 Outbox 인스턴스 PROCESSED 로 update
outbox.markProcessed(LocalDateTime.now());
waitingOutboxRepository.update(outbox);
Expand Down
Loading