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

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


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

    @ApiModelProperty(value = "결과코드")
    private String code;

    @ApiModelProperty(value = "결과메세지")
    private String message;

    @ApiModelProperty(value = "브랜드코드")
    private String brandCd;

    @ApiModelProperty(value = "매장번호")
    private String storeNo;

    @ApiModelProperty(value = "수발주브랜드아이디")
    private String brandId;

    @ApiModelProperty(value = "수발주매장아이디")
    private String storeId;


    public static BoStoreChgInfoResponse toDTO(StoreBaseInfoEntity entity) {
        if (entity == null) return null;
        return BoStoreChgInfoResponse.builder()
                .code(entity.getCode())
                .message(entity.getMessage() == null ? "" : entity.getMessage())
                .brandCd(entity.getOqBrandId() == null ? "" : entity.getOqBrandId())
                .storeNo(entity.getOqStoreId() == null ? "" : entity.getOqStoreId())
                .brandId(entity.getBrandId() == null ? "" : entity.getBrandId())
                .storeId(entity.getStoreId() == null ? "" : entity.getStoreId())
                .build();
    }
}
