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

import com.fasterxml.jackson.annotation.JsonInclude;
import com.oqpo.api.entity.stockmng.DmandFrcstCndtInfoEntity;
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 DmandFrcstInfoResponse {

    @ApiModelProperty(value = "브랜드아이디")
    private String brandId;
    @ApiModelProperty(value = "기간수(최대6)")
    private Integer termCnt;
    @ApiModelProperty(value = "가중치1(가중치의합은1)")
    private Float weightVal1;
    @ApiModelProperty(value = "가중치2(가중치의합은1)")
    private Float weightVal2;
    @ApiModelProperty(value = "가중치3(가중치의합은1)")
    private Float weightVal3;
    @ApiModelProperty(value = "가중치4(가중치의합은1)")
    private Float weightVal4;
    @ApiModelProperty(value = "가중치5(가중치의합은1)")
    private Float weightVal5;
    @ApiModelProperty(value = "가중치6(가중치의합은1)")
    private Float weightVal6;
    @ApiModelProperty(value = "평활계수(0과1사이)")
    private Float coefficient;

    public static DmandFrcstInfoResponse toDTO(DmandFrcstCndtInfoEntity entity) {
        if (entity == null) return null;
        return DmandFrcstInfoResponse.builder()
                .brandId(entity.getBrandId())
                .termCnt(entity.getTermCnt())
                .weightVal1(entity.getWeightVal1())
                .weightVal2(entity.getWeightVal2())
                .weightVal3(entity.getWeightVal3())
                .weightVal4(entity.getWeightVal4())
                .weightVal5(entity.getWeightVal5())
                .weightVal6(entity.getWeightVal6())
                .coefficient(entity.getCoefficient())
                .build();
    }

}
