package sgc.portal.com.sym.user.model;

import sgc.portal.security.model.Authority;
import sgc.portal.security.model.AuthorityCriterion;
import sgc.portal.security.model.SystemAuthority;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 로그인 사용자 세션정보
 * 세션 무엇을 담을지는 프로젝트 진행하면서 추가
 *
 * @author YongSang
 */
@Data
public class UserDetails implements Serializable {
    private String userId;

    //법인코드
    private String cmpnCd;
    private String cmpnNm;
    private String corpCd;

    private String userNm;
    private String userNmEngs;
    private String lginId;
    private String empNo;
    private String emlAddr;
    private String hpNo;
    private String grpwareId;
    private String bsuCd;
    private String deptCd;
    private String deptNm;
    private String deptDtilCd;
    private String deptDtilNm;
    private String clpoDcd;
    private String dutyDcd;
    private String baduDcd;
    private String joseDcd;
    private String exptUserDcd;
    private String topMenu;
    private String pswdEddt;

    private String jobGroupCd;
    private String jobGroupNm;
    private String jobFunctionCd;
    private String jobFunctionNm;
    private String dutyCd;
    private String jobTypeCd;
    private String jobTypeNm;
    private String jobGradeCd;
    private String jobGradeNm;

    private String bsiteCd;
    private String bsiteCdNm;
    private String bsiteClsnCd;
    private String bsiteClsnCdNm;

    private String gruprsrtYn;
    private String custNo;
    
    private String saupDeptCd;
    private String pDeptCd;

    //접속 IP
    private String connIp;
    private String connBrowser;
    
    /** 협력업체 대표 현장 */
    private String connSiteCd;
 
    /** 협력업체 Push 사용여부 */
    private String pushUseYn;

    /** 협력업체 Push 키 */
    private String pushKey;

    /** 모바일 도메인 아이디 */
    private String domainId;
   
    //영업장 코드
    private String outletCd;
    private String outletNm;
    //영업장 그룹 코드
    private String outletDivCd;
    private String outletDivNm;

    //마스킹 여부
    private String maskYn;
    private String psnlinfoIqryn;

    //프로그램명
    private String prgNm;

    private boolean alreadyUsed;

    /**
     * 협력사 여부 
     */
    private boolean isAsMember;

	private String covendId;
    
    private String wkwebUseyn;

    private String cmsUseyn;
    
    private String authSiteYn;
 
    private List<String> allowedExtensions;
    private List<String> imgAllowedExtensions;
    private Long maxFileSize;

    private List<Authority> authorities; //권한
    private List<AuthorityCriterion> authorityCriteria; //기준권한
    private List<SystemAuthority> systemAuthorities; //상세권한

    private String activeProfile;       //application.yml active profiles에 따른 디버그메뉴 사용여부
    

    /**
     * Sets bsu cd.
     *
     * @param bsuCd the bsu cd
     */
    public void setBsuCd(String bsuCd) {
        this.bsuCd = bsuCd;
        this.corpCd = bsuCd;
    }

    /**
     * Set bsite cd.
     *
     * @param bsiteCd the bsite cd
     */
    public void setBsiteCd(String bsiteCd){
        this.bsiteCd = bsiteCd;
        this.outletCd = bsiteCd;
    }

    /**
     * Set bsite cd nm.
     *
     * @param bsiteCdNm the bsite cd nm
     */
    public void setBsiteCdNm(String bsiteCdNm){
        this.bsiteCdNm = bsiteCdNm;
        this.outletNm = bsiteCdNm;
    }

    /**
     * Set bsite clsn cd.
     *
     * @param bsiteClsnCd the bsite clsn cd
     */
    public void setBsiteClsnCd(String bsiteClsnCd){
        this.bsiteClsnCd = bsiteClsnCd;
        this.outletDivCd = bsiteClsnCd;
    }

    /**
     * Set bsite clsn cd nm.
     *
     * @param bsiteClsnCdNm the bsite clsn cd nm
     */
    public void setBsiteClsnCdNm(String bsiteClsnCdNm){
        this.bsiteClsnCdNm = bsiteClsnCdNm;
        this.outletDivNm = bsiteClsnCdNm;
    }

}