package com.kospo.talk.payload;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(name = "ChatMemberDto", description = "채팅멤버")
public class TalkMemberDto {
    @Schema(name = "talkId", description = "채팅아이디")
    private String talkId;
    @Schema(name = "sabun", description = "사번")
    private String sabun;
    @Schema(name = "name", description = "이름")
    private String name;
    @Schema(name = "markYn", description = "마크여부")
    private Boolean markYn;
    @Schema(name = "deleteYn", description = "삭제여부")
    private Boolean deleteYn;
    @Schema(name = "onlineYn", description = "온라인여부")
    private Boolean onlineYn;
    @Schema(name = "dummyYn", description = "더미 유저")
    private Boolean dummyYn;

    public static TalkMemberDto from(ITalkMemberDto iTalkMemberDto) {
        return TalkMemberDto.builder()
                .talkId(iTalkMemberDto.getTalkId())
                .sabun(iTalkMemberDto.getSabun())
                .name(iTalkMemberDto.getName())
                .markYn(iTalkMemberDto.getMarkYn())
                .deleteYn(iTalkMemberDto.getDeleteYn())
                .onlineYn(iTalkMemberDto.getOnlineYn())
                .dummyYn(iTalkMemberDto.getDummyYn()).build();
    }
}
