package com.izouma.immall.security;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class VipAuthority implements Serializable  {
    public enum NAMES {
        //超值大礼包，面膜，护肤，洗护，洁面乳
        VIP_FULL, VIP_MASK, VIP_SKINCARE, VIP_WASH, VIP_CLEANSER, NO_VIP;
    }

    @Id
    @Size(max = 50)
    @NotNull
    private String name;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        VipAuthority authority = (VipAuthority) o;

        return Objects.equals(name, authority.name);
    }

    @Override
    public int hashCode() {
        return name != null ? name.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "VipAuthority{" +
                "name='" + name + '\'' +
                "}";
    }

}
