import { Types } from 'mongoose';

export interface SanitizedUser {
  id: Types.ObjectId;

  firstName: string;
  lastName: string;
  email: string;
  phone: {
    dialCode: number;
    number: number;
  };

  joiningDate: string;
  isEmailVerified: boolean;
  isDeleted: boolean;
  status: string;
  memberType: string;
  userType: string;
  team: Types.ObjectId[];

  createdAt: string;
  updatedAt: string;

  companyId: Types.ObjectId;
  companyName: string;
  companyType: string;
  roleIds: string[];
  subCompanyRoleIds: string[];
}

export interface AuthenticatedUserResponse {
  user: SanitizedUser;
  permissions: string[];
}

export interface SetPasswordEmailData {
  user: {
    id: Types.ObjectId;
    firstName: string;
    lastName: string;
    userType: string;
    email: string;
  };
  company: {
    id: Types.ObjectId;
    name: string;
  };
  type?: string;
}

export interface SetPasswordEmailResult {
  setPasswordLink: string;
  emailContent: string;
  token: string;
}

export type SendSetPasswordEmailPayload = {
  user: {
    id: Types.ObjectId;
    firstName: string;
    lastName: string;
    email: string;
    userType: string;
  };
  company: { id: Types.ObjectId; name: string };
  type: string;
  templateId: number;
  createdBy?:
    | {
        id: Types.ObjectId;
        firstName: string;
        lastName: string;
        email: string;
      }
    | Types.ObjectId;
};
