package com.taais.mf.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.taais.common.excel.annotation.ExcelDictFormat;
import com.taais.common.excel.convert.ExcelDictConvert;
import com.taais.common.orm.core.domain.BaseEntity;
import com.taais.mf.domain.Customer;
import com.taais.mf.domain.Goods;
import com.mybatisflex.annotation.RelationOneToMany;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 客户主表视图对象 mf_customer
 *
 * @author wgk
 * @date 2024-01-06
 */
@Data
@ExcelIgnoreUnannotated
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = Customer.class)
public class CustomerVo extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 客户id
     */
    @ExcelProperty(value = "客户id")
    private Long customerId;

    /**
     * 客户姓名
     */
    @ExcelProperty(value = "客户姓名")
    private String customerName;

    /**
     * 手机号码
     */
    @ExcelProperty(value = "手机号码")
    private String phonenumber;

    /**
     * 客户性别
     */
    @ExcelProperty(value = "客户性别", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_user_gender")
    private String gender;

    /**
     * 客户生日
     */
    @ExcelProperty(value = "客户生日")
    private Date birthday;

    /**
     * 客户描述
     */
    @ExcelProperty(value = "客户描述")
    private String remark;

    /**
     * 逻辑删除标志（0代表存在 1代表删除）
     */
    @ExcelProperty(value = "逻辑删除标志（0代表存在 1代表删除）")
    private Integer delFlag;


    /**
     * 商品子信息
     */
    @RelationOneToMany(selfField = "customerId", targetField = "customerId")
    private List<Goods> goodsList;

}
