package com.kt.event.participation.application.dto;

import com.kt.event.participation.domain.participant.Participant;
import lombok.*;

import java.time.LocalDateTime;

/**
 * 이벤트 참여 응답 DTO
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ParticipationResponse {

    private String participantId;
    private String eventId;
    private String name;
    private String phoneNumber;
    private String email;
    private String channel;
    private LocalDateTime participatedAt;
    private Boolean storeVisited;
    private Integer bonusEntries;
    private Boolean isWinner;

    public static ParticipationResponse from(Participant participant) {
        return ParticipationResponse.builder()
            .participantId(participant.getParticipantId())
            .eventId(participant.getEventId())
            .name(participant.getName())
            .phoneNumber(participant.getPhoneNumber())
            .email(participant.getEmail())
            .channel(participant.getChannel())
            .participatedAt(participant.getCreatedAt())
            .storeVisited(participant.getStoreVisited())
            .bonusEntries(participant.getBonusEntries())
            .isWinner(participant.getIsWinner())
            .build();
    }
}
