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

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

import java.math.BigDecimal;

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

    @ApiModelProperty(value = "브랜드아이디")
    private String brandId;
    @ApiModelProperty(value = "브랜드명")
    private String brandNm;
    @ApiModelProperty(value = "품목아이디")
    private String itemId;
    @ApiModelProperty(value = "품목명")
    private String itemNm;
    @ApiModelProperty(value = "단위")
    private String unit;
    @ApiModelProperty(value = "재고수량")
    private int stckQty;
    @ApiModelProperty(value = "출고대기수량")
    private int waitQty;

    public static BarcodeWhsItemInfoResponse toDTO(StckMgntBaseInfoEntity entity) {
        if (entity == null) return null;
        return BarcodeWhsItemInfoResponse.builder()
                .brandId(entity.getBrandId())
                .brandNm(entity.getBrandNm())
                .itemId(entity.getItemId())
                .itemNm(entity.getItemNm())
                .unit(entity.getUnit())
                .stckQty(entity.getStckQty())
                .waitQty(entity.getWaitQty())
                .build();
    }
}
