import { FilterQuery, InsertManyOptions, MongooseUpdateQueryOptions, QueryOptions } from 'mongoose'; import { BulkCreateOptions, CountOptions, CreateOptions, FindOptions, FindOrCreateOptions, UpdateOptions, WhereOptions } from 'sequelize'; export interface IDefaultAttributes { createdBy?: string; updatedBy?: string; createdAt?: Date; updatedAt?: Date; deletedBy?: string; deletedAt?: Date | string; } export interface IEmailOptions { from?: string; to: string | string[]; cc?: string | string[]; bcc?: string | string[]; subject: string; text?: string; html?: string; attachments?: { filename: string; path: string; }[]; } export interface ICommanDao { findAll: (where: WhereOptions, options?: FindOptions) => Promise; findOne(where: WhereOptions, options?: FindOptions): Promise; update: (where: WhereOptions, updateData: Partial, options: Omit, 'where'>) => Promise<[affectedCount: number]>; create: (createData: TCreationAttributes, options: CreateOptions) => Promise; bulkCreate: (createData: TCreationAttributes[], options: BulkCreateOptions) => Promise; } export interface ICountDao { count: (where: WhereOptions, options?: CountOptions) => Promise; } export interface IDeleteDao { delete: (where: WhereOptions, options?: CountOptions) => Promise; } export interface IFindAllDao { findAll: (where: WhereOptions, options?: FindOptions) => Promise; } export interface IFindOneDao { findOne(where: WhereOptions, options?: FindOptions): Promise; } export interface IUpsertDao { upsert: (where: WhereOptions, updateData: FindOrCreateOptions, options: Omit, 'where'>) => Promise<[IModelAttributes, boolean]>; } export interface ICommanMongoDao { findAll: (where: FilterQuery, options?: QueryOptions) => Promise; findOne(where: FilterQuery, options?: QueryOptions): Promise; update: (where: FilterQuery, updateData: Partial, options?: MongooseUpdateQueryOptions | null) => Promise; create: (createData: TCreationAttributes, options?: CreateOptions) => Promise; bulkCreate: (createData: TCreationAttributes[], options?: InsertManyOptions) => Promise; }