package com.oqpo.api.entity.oper;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.Collection;

@Getter
@Setter
@ToString
public class MemberEntity implements Serializable, UserDetails {

    private static final long serialVersionUID = -2882112399794371036L;

    private String userId;
    private String userNm;
    private String telNo;
    private String email;
    private String password;
    private String authNm;
    private String superAdminYn;
    private String systemAdminYn;
    private String firstLoginDt;
    private String lastLoginDt;
    private String pwErrCnt;
    private String userStatCd;
    private String userStatDt;
    private Integer idCnt;
    private String afflShopId;
    private String brandId;
    private String authTpNm;
    private String authTpCd;

    private Collection<? extends GrantedAuthority> authorities;

    @Override
    public String getUsername() {
        return getUserNm();
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
