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

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

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

    @ApiModelProperty(value = "브랜드아이디")
    private String brandId;
    @ApiModelProperty(value = "브랜드명")
    private String brandNm;
    @ApiModelProperty(value = "창고아이디")
    private String whsId;
    @ApiModelProperty(value = "창고명")
    private String whsNm;
    @ApiModelProperty(value = "창고관리구분(본사,매장)")
    private String whsDvsn;
    @ApiModelProperty(value = "창고관리명")
    private String whsDvsnNm;
    @ApiModelProperty(value = "담당자명")
    private String mgrNm;
    @ApiModelProperty(value = "담당자전화번호")
    private String mgrTelNo;
    @ApiModelProperty(value = "우편번호")
    private String zipNo;
    @ApiModelProperty(value = "주소1")
    private String addr1;
    @ApiModelProperty(value = "주소2")
    private String addr2;
    @ApiModelProperty(value = "창고상태코드")
    private String whsStCd;
    @ApiModelProperty(value = "창고상태명")
    private String whsStNm;
    @ApiModelProperty(value = "매장아이디")
    private String storeId;
    @ApiModelProperty(value = "매장명")
    private String storeNm;
    @ApiModelProperty(value = "시스템등록일시")
    private String sysRegDttm;
    @ApiModelProperty(value = "시스템등록아이디")
    private String sysRegId;
    @ApiModelProperty(value = "시스템변경일시")
    private String sysChgDttm;
    @ApiModelProperty(value = "시스템변경아이디")
    private String sysChgId;

    @ApiModelProperty(value = "창고기본여부")
    private String baseYn;

    public static WhsMngInfoResponse toDTO(WhsMgntBaseInfoEntity entity) {
        if (entity == null) return null;
        return WhsMngInfoResponse.builder()
                .brandId(entity.getBrandId())
                .brandNm(entity.getBrandNm())
                .whsId(entity.getWhsId())
                .whsNm(entity.getWhsNm())
                .whsDvsn(entity.getWhsDvsn())
                .whsDvsnNm(entity.getWhsDvsnNm())
                .mgrNm(entity.getMgrNm())
                .mgrTelNo(entity.getMgrTelNo())
                .zipNo(entity.getZipNo())
                .addr1(entity.getAddr1())
                .addr2(entity.getAddr2())
                .whsStCd(entity.getWhsStCd())
                .whsStNm(entity.getWhsStNm())
                .storeId(entity.getStoreId())
                .storeNm(entity.getStoreNm())
                .sysRegDttm(entity.getSysRegDttm())
                .sysRegId(entity.getSysRegId())
                .sysChgDttm(entity.getSysChgDttm())
                .sysChgId(entity.getSysChgId())
                .baseYn(entity.getBaseYn())
                .build();
    }

}
