package co.yixiang.yshop.module.shop.controller.admin.shop.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 门店 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class ShopBaseVO {

    @Schema(description = "门店名称", required = true, example = "yshop")
    @NotNull(message = "门店名称不能为空")
    private String storeName;

    @Schema(description = "门店简介", required = true)
    @NotNull(message = "门店简介不能为空")
    private String storeIntro;

    @Schema(description = "门店手机", required = true)
    @NotNull(message = "门店手机不能为空")
    private String storePhone;

    @Schema(description = "门店logo", example = "https://www.yixiang.co")
    private String iconUrl;

    @Schema(description = "门店地址", required = true)
    @NotNull(message = "门店地址不能为空")
    private String address;

    @Schema(description = "精度", required = true)
    @NotNull(message = "精度不能为空")
    private Double lon;

    @Schema(description = "纬度", required = true)
    @NotNull(message = "纬度不能为空")
    private Double lat;

    @Schema(description = "核销开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime writeOffStartTime;

    @Schema(description = "核销结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime writeOffEndTime;

    @Schema(description = "营业开始时间", required = true)
    @NotNull(message = "营业开始时间不能为空")
    private String businessStartTime;

    @Schema(description = "营业结束时间", required = true)
    @NotNull(message = "营业结束时间不能为空")
    private String businessEndTime;

    @Schema(description = "状态", required = true, example = "1")
    @NotNull(message = "状态不能为空")
    private Boolean status;

}
