-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathILivechatDepartmentModel.ts
More file actions
78 lines (68 loc) · 3.77 KB
/
ILivechatDepartmentModel.ts
File metadata and controls
78 lines (68 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import type { ILivechatDepartment } from '@rocket.chat/core-typings';
import type { FindOptions, FindCursor, Filter, UpdateResult, Document } from 'mongodb';
import type { IBaseModel } from './IBaseModel';
export interface ILivechatDepartmentModel extends IBaseModel<ILivechatDepartment> {
countTotal(): Promise<number>;
findInIds(departmentsIds: string[], options: FindOptions<ILivechatDepartment>): FindCursor<ILivechatDepartment>;
findByNameRegexWithExceptionsAndConditions(
searchTerm: string,
exceptions: string[],
conditions: Filter<ILivechatDepartment>,
options: FindOptions<ILivechatDepartment>,
): FindCursor<ILivechatDepartment>;
findByBusinessHourId(businessHourId: string, options: FindOptions<ILivechatDepartment>): FindCursor<ILivechatDepartment>;
countByBusinessHourIdExcludingDepartmentId(businessHourId: string, departmentId: string): Promise<number>;
findEnabledByBusinessHourId(businessHourId: string, options: FindOptions<ILivechatDepartment>): FindCursor<ILivechatDepartment>;
findEnabledByListOfBusinessHourIdsAndDepartmentIds(
businessHourIds: string[],
departmentIds: string[],
options: FindOptions<ILivechatDepartment>,
): FindCursor<ILivechatDepartment>;
findActiveDepartmentsWithoutBusinessHour(options: FindOptions<ILivechatDepartment>): FindCursor<ILivechatDepartment>;
addBusinessHourToDepartmentsByIds(ids: string[], businessHourId: string): Promise<Document | UpdateResult>;
removeBusinessHourFromDepartmentsByIdsAndBusinessHourId(ids: string[], businessHourId: string): Promise<Document | UpdateResult>;
removeBusinessHourFromDepartmentsByBusinessHourId(businessHourId: string): Promise<Document | UpdateResult>;
createOrUpdateDepartment(
_id: string | null,
data: {
enabled: boolean;
name: string;
description?: string;
showOnRegistration: boolean;
email: string;
showOnOfflineForm: boolean;
requestTagBeforeClosingChat?: boolean;
chatClosingTags?: string[];
fallbackForwardDepartment?: string;
departmentsAllowedToForward?: string[];
},
): Promise<ILivechatDepartment>;
unsetFallbackDepartmentByDepartmentId(departmentId: string): Promise<Document | UpdateResult>;
removeDepartmentFromForwardListById(_departmentId: string): Promise<void>;
updateById(_id: string, update: Partial<ILivechatDepartment>): Promise<Document | UpdateResult>;
updateNumAgentsById(_id: string, numAgents: number): Promise<Document | UpdateResult>;
decreaseNumberOfAgentsByIds(_ids: string[]): Promise<Document | UpdateResult>;
findEnabledWithAgents<T extends Partial<ILivechatDepartment> = ILivechatDepartment>(
projection?: FindOptions<ILivechatDepartment>['projection'],
): FindCursor<T>;
findEnabledWithAgentsAndBusinessUnit<T extends Partial<ILivechatDepartment> = ILivechatDepartment>(
_: any,
projection: FindOptions<T>['projection'],
): Promise<FindCursor<T>>;
findOneByIdOrName(_idOrName: string, options?: FindOptions<ILivechatDepartment>): Promise<ILivechatDepartment | null>;
findByUnitIds(unitIds: string[], options?: FindOptions<ILivechatDepartment>): FindCursor<ILivechatDepartment>;
findActiveByUnitIds(unitIds: string[], options?: FindOptions<ILivechatDepartment>): FindCursor<ILivechatDepartment>;
findNotArchived(options?: FindOptions<ILivechatDepartment>): FindCursor<ILivechatDepartment>;
getBusinessHoursWithDepartmentStatuses(): Promise<
{
_id: string;
validDepartments: string[];
invalidDepartments: string[];
}[]
>;
checkIfMonitorIsMonitoringDepartmentById(monitorId: string, departmentId: string): Promise<boolean>;
countArchived(): Promise<number>;
findEnabledInIds(departmentsIds: string[], options?: FindOptions<ILivechatDepartment>): FindCursor<ILivechatDepartment>;
archiveDepartment(_id: string): Promise<Document | UpdateResult>;
unarchiveDepartment(_id: string): Promise<Document | UpdateResult>;
}