import { ISubscription } from "../subscriptions/subscriptions.interface";
import { USER_ROLE } from "./users.constant";
import { Types } from "mongoose";
import { Language } from "src/shared/language/language.interface";

export interface IUser {
    _id?: string;
    name: string;
    email: string;
    password: string;
    role?: TUserRole;
	imageUrl?: string;
    isVerified?: boolean;
    isBlocked?: boolean;
    isDeleted?: boolean;
    subscription?: string | ISubscription;
	settings?: IUserSettings;


    googleDrive: {
        accessToken: string;
        refreshToken: string;
        expiresAt: number;
    };}

export interface IFullUser extends IUser {
    _id: string;
    role: TUserRole;
    groupTag?: string;
    isVerified: boolean;
    isBlocked: boolean;
    isDeleted: boolean;
	language?: Language;
    subscription: ISubscription;
	settings: IUserSettings;
	whatsappId?: string;
	phoneNumber?: string;
    timezone: string;
    createdAt: Date;
    updatedAt: Date;
    memory: IMemoryItem[];
}

export interface IUserSettings {
	isFilter: boolean;
	isImageInsideChat: boolean;
}


export interface IMemoryItem {
    content: string;
    date_created: Date;
    messageId?: Types.ObjectId;
}

export interface IUserFromToken {
    _id: string;
    email: string;
    role: TUserRole;
    imageUrl: string | null;
    language: 'EN' | 'HB';
    iat: number;
    exp: number;
}

export type TUserRole = keyof typeof USER_ROLE;
