package com.cf.imes.module.system.controller.admin.organ.vo.organ;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.cf.imes.framework.excel.core.annotations.DictFormat;
import com.cf.imes.framework.excel.core.convert.DictConvert;
import com.cf.imes.framework.jackson.core.databind.LocalDateSerializer;
import com.cf.imes.module.system.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 组织 Response VO")
@Data
@ExcelIgnoreUnannotated
public class OrganRespVO {

    @Schema(description = "组织编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("组织编号")
    private Long id;

    @Schema(description = "组织名", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
    @ExcelProperty("组织名")
    private String name;

    @Schema(description = "组织代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "chenfeng")
    private String code;

    @Schema(description = "地址", requiredMode = Schema.RequiredMode.REQUIRED)
    private String address;

    @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
    @ExcelProperty("联系人")
    private String contactName;

    @Schema(description = "联系手机", example = "15601691300")
    @ExcelProperty("联系手机")
    private String contactMobile;

    @Schema(description = "组织状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty(value = "状态", converter = DictConvert.class)
    @DictFormat(DictTypeConstants.COMMON_STATUS)
    private Integer status;

    @Schema(description = "绑定域名", example = "https://www.cf.com")
    private String website;

    @Schema(description = "组织套餐编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long packageId;

    @Schema(description = "组织套餐名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private String packageName;

    @Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonSerialize(using = LocalDateSerializer.class)
    private LocalDate expireTime;

    @Schema(description = "账号数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Integer accountCount;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "备注")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "省")
    @ExcelProperty("省")
    private String province;

    @Schema(description = "市")
    @ExcelProperty("市")
    private String city;

    @Schema(description = "区")
    @ExcelProperty("区")
    private String county;

    @Schema(description = "地区编码")
    @ExcelProperty("地区编码")
    private String areaCode;

    @Schema(description = "经度")
    @ExcelProperty("经度")
    private String longitude;

    @Schema(description = "纬度")
    @ExcelProperty("纬度")
    private String latitude;

    @Schema(description = "产品购买记录")
    @ExcelIgnore
    private List<OrganPagePurchaseRespVO> organPurchaseList;
}
