package com.icomsys.main_vm.biz.common.system.vo;

import com.icomsys.main_vm.db.jpa.entity.system.TbIcsCustInfo;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
public class SystemIcsCustInfoRes {

    private String custCode;
    private String custName;
    private String custTel;
    private String custServiceMent;
    private String useYn;
    private String registId;
    private LocalDateTime registDate;
    private String updateId;
    private LocalDateTime updateDate;

    @Builder
    public SystemIcsCustInfoRes(String custCode, String custName, String custTel, String custServiceMent, String useYn, String registId, LocalDateTime registDate, String updateId, LocalDateTime updateDate) {
        this.custCode = custCode;
        this.custName = custName;
        this.custTel = custTel;
        this.custServiceMent = custServiceMent;
        this.useYn = useYn;
        this.registId = registId;
        this.registDate = registDate;
        this.updateId = updateId;
        this.updateDate = updateDate;
    }

    public SystemIcsCustInfoRes toIcsCustInfoRes(TbIcsCustInfo dto){
        this.custCode = dto.getCustCode();
        this.custName = dto.getCustName();
        this.custTel = dto.getCustTel();
        this.custServiceMent = dto.getCustServiceMent();
        this.useYn = dto.getUseYn();
        this.registId = dto.getRegistId();
        this.registDate = dto.getRegistDate();
        this.updateId = dto.getUpdateId();
        this.updateDate = dto.getUpdateDate();
        return this;
    }
}
