import { UserMenuPermissionData } from '@/entities/user/model/types';

export enum AccountTabKeys {
  UserManage = 'UserManage',
  PasswordManage = 'PasswordManage',
};
export interface AccountTabProps {
  activeTab: AccountTabKeys;
};
export enum AccountUserTabKeys {
  LoginAuthInfo = 'LoginAuthInfo',
  AccountAuth = 'AccountAuth',
};
export interface AccountUserTabProps {
  activeTab: AccountUserTabKeys;
  mid?: string;
  usrid?: string;
  idCL?: string;
  status?: string;
};

export interface UserManageAuthListProps {
  userItems: Array<UserManageAuthItemProps>;
  mid: string;
};
export interface UserManageAuthItemProps {
  usrid?: string;
  mid?: string;
  idCL?: string;
  status?: string;
};
export interface UserLoginAuthInfoWrapProps {
  mid: string;
  usrid: string;
};
export interface UserAccountAuthWrapProps {
  mid: string;
  usrid: string;
  idCL: string;
  status: string;
};
export interface PermItem {
  menuId?: number;
  menuName?: string;
  subMenu?: Array<PermItem>;
};
export interface UserAccountAuthPermListProps {
  mid: string;
  usrid: string;
  idCL: string;
  status: string;
  menuItems: Array<PermItem>;
  menuGrants: Array<UserMenuPermissionData>;
};
export interface UserAccountAuthPermItemProps extends PermItem {
  mid: string;
  usrid: string;
  idCL: string;
  status: string;
  menuName: string;
  subMenu: Array<PermItem>;
  menuGrants: Array<UserMenuPermissionData>;
};

export interface VerificationItem {
  type: string;
  contact: string;
}

export interface UserCreateRequest {
  mid: string;
  usrid: string;
  password?: string;
  loginRange: string;
  verifications: Array<VerificationItem>;
}

export interface UserCreateResponse {
  status: boolean;
  error?: {
    root: string;
    errKey: string;
    code: string;
    message: string;
    timestamp: string;
    details: Record<string, string>;
  };
  data?: {
    user: {
      usrid: string;
      mid: string;
      gid: string;
      aid: string;
      pw: string;
      authCd: string;
      status: string;
      regDt: string;
      memo: string;
      changeDt: string;
      failCnt: number;
      oldPw1: string;
      oldPw2: string;
      oldPw3: string;
      oldPw4: string;
      worker: string;
      loginCd: string;
      pwWorkIp: string;
      pwCheckYn: string;
      loginFailDt: string;
      loginFailTm: string;
      loginFailIp: string;
      desaYn: string;
      desaAccType: string;
      desaAccIp: string;
      desaProcType: string;
      desaFormat: string;
      desaSvcCl: string;
      emailAuth1: string;
      emailAuth2: string;
      emailAuth3: string;
      authDt: string;
      authTm: string;
      userAidGroupYn: string;
      userAidGroupId: string;
      subNm: string;
      subLevel: string;
      multiAccessYn: string;
      duplicateAccessYn: string;
    };
  };
}