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

import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.model.org.OrganizationUserModel;
import com.zhongshu.card.client.model.org.UserCountModel;
import com.zhongshu.card.client.type.CardCancelState;
import com.zhongshu.card.client.type.school.CardState;
import com.zhongshu.card.client.type.school.CardType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @author TRX
 * @date 2024/6/13
 */
@Data
public class CardInfoModel extends SuperModel {

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

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

    @Schema(description = "卡片号码")
    private String code;

    @Schema(description = "卡片状态")
    private CardState cardState;

    private String cardStateStr;

    public String getCardStateStr() {
        if (cardState != null) {
            return cardState.getRemark();
        }
        return "";
    }

    @Schema(description = "所属用户")
    private UserCountModel userAccount;

    @Schema(description = "所属用户UserId")
    private String userId;

    @Schema(description = "学校oid")
    private String schoolOid;

    @Schema(description = "机构用户信息")
    private OrganizationUserModel organizationUser;

    @Schema(description = "是否作废")
    private Boolean isCanceled = Boolean.FALSE;

    @Schema(description = "作废时间")
    private Long cancelTime;

    @Schema(description = "作废时间")
    private String cancelUserId;

}
