package com.oqpo.api.web.dto.response.session;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.oqpo.api.entity.oper.MemberEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

@Getter
@Setter
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@JsonInclude(JsonInclude.Include.ALWAYS)
public class FindPwResponse {

    @ApiModelProperty(value = "사용자ID")
    private String userId;

    @ApiModelProperty(value = "패스워드")
    private String newPw;

    public static FindPwResponse toDTO(MemberEntity entity) {
        if (entity == null) return null;
        return FindPwResponse.builder()
                .userId(entity.getUserId())
                .newPw(entity.getPassword())
                .build();
    }
}
