package com.tzy.common.dto.group;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.github.dozermapper.core.Mapping;
import com.tzy.common.constant.Constants;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.teasoft.bee.osql.annotation.Entity;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@Entity("card_group_goods")
public class SimpleGroupGoodsDTO implements Serializable {

    private Integer id;

    private Long groupInfoId;
    //买队 一级 分类
    private String playerName;

    /** 球队英文 */
    private String team;
    /**球队简称*/
    private String simpleTeamName;
    /**
     * 球队中文
     */
    @Mapping("team_zn")
    private String znTeam;
    /**队伍id*/
    private Integer teamId;
    /**卡密所属车次*/
    private Integer copiesType;
    /**区域*/
    private String conference;

    private BigDecimal price;

    private Integer userId;

    private Integer userOrderId;

    public String getConference() {
        if(StringUtils.isEmpty(this.conference)) {
            return Constants.OTHER_STR;
        }
        return conference;
    }
}