package com.cool.store.request.close.store;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * <p>
 * 三方闭店申请Request
 * </p>
 *
 * @author wangff
 * @since 2025/10/23
 */
@Data
public class ThirdCloseStoreApplyRequest {
    @ApiModelProperty("计划关店时间")
    @NotNull(message = "计划关店时间不能为空")
    private Date planCloseDate;

    @ApiModelProperty("关店原因")
    @NotNull(message = "闭店原因不能为空")
    private Integer closeReason;

    @ApiModelProperty("闭店原因说明")
    private String reasonDescription;

    @ApiModelProperty("门店编码")
    @NotBlank(message = "门店编码不能为空")
    private String storeNum;

    @ApiModelProperty(value = "闭店发起方式", hidden = true)
    private Integer closeType;

    public CloseStoreApplyRequest convert(String storeId) {
        return CloseStoreApplyRequest.builder()
                .planCloseDate(planCloseDate)
                .closeReason(closeReason)
                .reasonDescription(reasonDescription)
                .storeId(storeId)
                .closeType(closeType)
                .build();
    }
}
