import { Types } from 'mongoose'; import { IAddress, IBase, IContact, IDictionaryEmbedded, II18n, IUserScope } from '../../../..'; export interface IRole extends IBase { keyword: string; name?: II18n; description?: II18n; permissions: IPermission[]; default?: boolean; initial?: boolean; } export interface ICredentials { username: string; password: string; } export interface IPermission extends IBase { name?: II18n; description?: II18n; keyword: string; } export interface IProfInfo { subjects: IDictionaryEmbedded[]; } export interface ICompleteRole { _id: Types.ObjectId | string; keyword: string; name?: any; description?: any; permissions: IPermission[]; default?: boolean; initial?: boolean; } export interface IClient extends IBase { originId: Types.ObjectId | string; type: IDictionaryEmbedded; parent: Types.ObjectId | IClient; name: II18n; address: IAddress; highland: boolean; code: string; contacts: IContact[]; region: IDictionaryEmbedded; district: IDictionaryEmbedded; languageSectors: IDictionaryEmbedded[]; levels: IDictionaryEmbedded[]; } export interface IClientThin { _id: Types.ObjectId | string; originId: Types.ObjectId | string; type: IDictionaryEmbedded; parent: Types.ObjectId | IClient; name: II18n; address: IAddress; highland: boolean; code: string; contacts: IContact[]; region: IDictionaryEmbedded; district: IDictionaryEmbedded; languageSectors: IDictionaryEmbedded[]; levels: IDictionaryEmbedded[]; } export interface ICompleteUserData { _id: Types.ObjectId | string; person: IPerson; contacts: IContact[]; clients: ICompleteUserClient[]; credentials: ICredentials; scope: IUserScope; address: string; } export interface IUser extends IBase { person: IPerson; contacts: IContact[]; clients: IUserClient[]; profInfo: IProfInfo; credentials: ICredentials; level: IDictionaryEmbedded; address?: string; } export interface ICompleteUserClient { client: IClient; roles: ICompleteRole[]; subjects: IDictionaryEmbedded[]; languageSectors: IDictionaryEmbedded[]; } export interface IUserClient { client: Types.ObjectId | IClient; roles: Types.ObjectId[] | IRole[]; subjects: IDictionaryEmbedded[]; languageSectors: IDictionaryEmbedded[]; } export interface IUserPersonInfo { _id: Types.ObjectId | string; person: IPerson; } export interface IPerson { pid: string; firstName: string; lastName: string; gender: number; birthDate: Date; }