package com.kospo.talk.payload;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.kospo.talk.model.PiUser;
import com.kospo.talk.model.SmUser;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(name = "PiUserDto", description = "PI관리")
public class PIUserDto {
    @Schema(name = "sabun", description = "사번")
    private String sabun;

    @Schema(name = "name", description = "이름")
    private String name;

    @Schema(name = "workId", description = "업무아이디")
    private String workId;

    @Schema(name = "workNm", description = "업무명")
    private String workNm;

    @Schema(name = "onlineYn", description = "온라인여부")
    private Boolean onlineYn;



    public static PIUserDto to(PiUser piUser) {
        return PIUserDto.builder()
                .sabun(piUser.getId().getSabun())
                .name(piUser.getName())
                .workId(piUser.getId().getWorkId()).build();
    }
}