package com.zhongshu.card.client.model.school;

import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.type.CardCancelState;
import com.zhongshu.card.client.type.school.CardType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author TRX
 * @date 2024/7/30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CardInfoPoolModel extends SuperModel {

    @Schema(description = "卡片名称")
    private String name;

    @Schema(description = "卡片类型")
    private CardType cardType;

    private String cardTypeStr;

    public String getCardTypeStr() {
        if (cardType == null) {
            return cardType.getRemark();
        }
        return "";
    }

    @Schema(description = "卡片号码,唯一标识, 卡号")
    private String code;

    @Schema(description = "uid是什么")
    private String uid;

    @Schema(description = "是否已使用")
    private Boolean isUsed = Boolean.FALSE;

    private String usedStr;

    public String getUsedStr() {
        if (isUsed != null) {
            if (isUsed) {
                return "已使用";
            }
            return "未使用";
        }
        return "";
    }

    @Schema(description = "使用绑定时间")
    private Long useTime;

    @Schema(description = "绑定用户userId")
    private String useUserId;

    @Schema(description = "作废状态")
    private CardCancelState cardCancelState = CardCancelState.Common;

    private String cardCancelStateStr;

    public String getCardCancelStateStr() {
        if (cardCancelState != null) {
            return cardCancelState.getRemark();
        }
        return "";
    }

}
