package com.yc.ship.module.product.controller.admin.productBase.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yc.ship.framework.excel.core.annotations.DictFormat;
import com.yc.ship.framework.excel.core.convert.DictConvert;
import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceRespVO;
import com.yc.ship.module.resource.controller.admin.checkchannel.vo.CheckChannelRespVO;
import com.yc.ship.module.resource.controller.admin.resource.vo.ResourceSimpleRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 基础产品 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ProductBaseRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3854")
    private Long id;

    @Schema(description = "名称", example = "赵六")
    @ExcelProperty("名称")
    private String name;

    @Schema(description = "简称", example = "张三")
    private String shortName;

    @Schema(description = "项目ID", example = "16652")
    private Long projectId;

    @Schema(description = "所属资源ID", example = "16652")
    private Long resourceCategoryId;

    @Schema(description = "优先资源ID")
    private Long firstResourceId;

    @Schema(description = "固定使用资源ID")
    private Long fixedResourceId;

    @Schema(description = "资源类型")
    @ExcelProperty("资源类型")
    private String resourceName;

    @Schema(description = "所属项目")
    @ExcelProperty("所属项目")
    private String projectName;

    @Schema(description = "最低成本价", example = "99")
    @ExcelProperty("最低成本价")
    private BigDecimal costPrice;

    @Schema(description = "最低销售价", example = "199")
    @ExcelProperty("最低销售价")
    private BigDecimal salePrice;

    @DictFormat("yes_no")
    @ExcelProperty(value = "能否退票", converter = DictConvert.class)
    @Schema(description = "是否可以退票;0不可退，1可退")
    private Integer isRefund;

    @ExcelProperty("产品库存")
    @Schema(description = "产品库存(不设置为无限)")
    private Integer stock;

    @DictFormat("use_status")
    @ExcelProperty(value = "状态", converter = DictConvert.class)
    @Schema(description = "是否启用0否 1是", example = "1")
    private Integer useStatus;

    @ColumnWidth(value = 20)
    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @DictFormat("yes_no")
    @ExcelProperty(value="能否重复购买", converter = DictConvert.class)
    @Schema(description = "能否重复购买:0不可以，1可以")
    private Integer canRepeatBuy;

    @Schema(description = "有效期次数")
    @ExcelProperty("有效期次数")
    private Integer checkTimes;

    @ExcelProperty("游玩天数")
    @Schema(description = "游玩天数")
    private Integer daySort;

    @DictFormat("yes_no")
    @ExcelProperty(value = "自动检票", converter = DictConvert.class)
    @Schema(description = "是否自动检票;开启时只要组合票中有一张子票核销，该产品自动核销")
    private Integer isAutoCheck;

    @DictFormat("yes_no")
    @ExcelProperty(value = "购买即核销", converter = DictConvert.class)
    @Schema(description = "是否购买即核销")
    private Integer isBuyCheck;

    @Schema(description = "检票计算方式;(1.按基础票检票次数计算 2.按通道检票次数计算", example = "1")
    private Integer checkType;

    @Schema(description = "开始点位", example = "1209")
    private Long startPoint;

    @Schema(description = "结束点位", example = "6830")
    private Long endPoint;

    @Schema(description = "线路ID", example = "6830")
    private Long routeId;

    @Schema(description = " 产品检票通道")
    private List<CheckChannelRespVO> checkChannelList;

    @Schema(description = " 基础产品价格")
    private List<ProductBasePriceRespVO> basePriceList;

    @Schema(description = "资源列表")
    private List<ResourceSimpleRespVO> resourceList;

    @Schema(description = " 是否一口价")
    private Integer isOnly;

    @Schema(description = "一口价")
    private BigDecimal priceOnly;


}