orbitx-core-models 11.139.0 → 11.141.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/permissions/trees/ops.tree.d.ts.map +1 -1
- package/dist/permissions/trees/ops.tree.js +5 -1
- package/dist/routing/ticketRouting.d.ts +15 -0
- package/dist/routing/ticketRouting.d.ts.map +1 -0
- package/dist/routing/ticketRouting.js +88 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ import { Role } from "./models/role.model";
|
|
|
37
37
|
import { AiSummarySettings } from "./models/aiSummarySettings.model";
|
|
38
38
|
import { AiSummaryUsage } from "./models/aiSummaryUsage.model";
|
|
39
39
|
import { Update } from "./models/update.model";
|
|
40
|
+
import { resolveTicketRouting, pickFromGroup, OPEN_TICKET_STATUSES } from "./routing/ticketRouting";
|
|
40
41
|
import { IChat } from "./interfaces/chat.interface";
|
|
41
42
|
import { IMacro } from "./interfaces/macro.interface";
|
|
42
43
|
import { IVertical } from "./interfaces/vertical.interface";
|
|
@@ -74,6 +75,7 @@ import { ITicket, ITicketAttachment, ITicketActivityEntry, TicketCategory, Clien
|
|
|
74
75
|
import { IRole } from "./interfaces/role.interface";
|
|
75
76
|
import { IAiSummarySettings, IAiSummaryExample, IAiSummaryUsage, AiSummaryLength } from "./interfaces/aiSummary.interface";
|
|
76
77
|
import { IUpdate, UpdateDashboard, UpdateAudience, UpdateType } from "./interfaces/update.interface";
|
|
78
|
+
import { TicketRoutingInput, TicketRoutingResult } from "./routing/ticketRouting";
|
|
77
79
|
import { Dashboard, PermissionNode, DASHBOARDS } from "./permissions/types";
|
|
78
80
|
import { opsTree } from "./permissions/trees/ops.tree";
|
|
79
81
|
import { employeeTree } from "./permissions/trees/employee.tree";
|
|
@@ -82,6 +84,6 @@ import { clientTree } from "./permissions/trees/client.tree";
|
|
|
82
84
|
import { getTree, getAllKeys, getParentKey, getAncestorKeys } from "./permissions/treeUtils";
|
|
83
85
|
import { resolveEffectivePermissions, hasPermission, validateGrantedKeys, validateExtraKeys, getFullAccessKeys, PermissionSource, ValidationResult } from "./permissions/resolve";
|
|
84
86
|
import { roleSeeds, RoleSeed } from "./permissions/seeds/roles.seed";
|
|
85
|
-
export { Chat, Message, User, Vertical, Macro, Partner, Company, CompanySettings, Review, Wallet, StripeLog, Transaction, Lead, TierConfig, TierProgress, MonthlyTierSnapshot, Product, Plan, PlanOption, Addon, Subscription, Coupon, Visitor, Group, Agent, LeadLedger, Invoice, LeadDispute, Session, LoginOtp, Counter, Employee, CallSession, Request, REQUEST_CATEGORIES, REQUEST_SUBCATEGORIES_BY_CATEGORY, Ticket, CLIENT_TICKET_CATEGORIES, PARTNER_TICKET_CATEGORIES, TICKET_STATUS_CLIENT_VIEW, Role, AiSummarySettings, AiSummaryUsage, Update, opsTree, employeeTree, partnerTree, clientTree, DASHBOARDS, getTree, getAllKeys, getParentKey, getAncestorKeys, resolveEffectivePermissions, hasPermission, validateGrantedKeys, validateExtraKeys, getFullAccessKeys, roleSeeds, };
|
|
86
|
-
export type { IChat, IMessage, IUser, IVertical, IMacro, IPartner, ICompany, IOnboardingStep, ITwilioConfig, ICompanySettings, ICallConnectSettings, ILeadConfig, ILeadFields, IReview, IReviewStatusHistoryEntry, IWallet, IStripeLog, ITransaction, ILead, ITierConfig, ITierProgress, IMonthlyTierSnapshot, IProduct, IPlan, IPlanOption, IAddon, ISubscription, ICoupon, CouponDiscountType, IVisitor, IGroup, IAgent, ILeadLedger, IInvoice, ILeadDispute, ISession, ILoginOtp, IEmployee, ICallSession, CallSessionStatus, CallSessionDirection, IRequest, IRequestAttachment, IRequestMessage, IRequestActivityEntry, RequestCategory, RequestStatus, ITicket, ITicketAttachment, ITicketActivityEntry, TicketCategory, ClientTicketCategory, PartnerTicketCategory, TicketOwnerType, TicketSource, TicketStatus, TicketPriority, IRole, IAiSummarySettings, IAiSummaryExample, IAiSummaryUsage, AiSummaryLength, IUpdate, UpdateDashboard, UpdateAudience, UpdateType, Dashboard, PermissionNode, PermissionSource, ValidationResult, RoleSeed, };
|
|
87
|
+
export { Chat, Message, User, Vertical, Macro, Partner, Company, CompanySettings, Review, Wallet, StripeLog, Transaction, Lead, TierConfig, TierProgress, MonthlyTierSnapshot, Product, Plan, PlanOption, Addon, Subscription, Coupon, Visitor, Group, Agent, LeadLedger, Invoice, LeadDispute, Session, LoginOtp, Counter, Employee, CallSession, Request, REQUEST_CATEGORIES, REQUEST_SUBCATEGORIES_BY_CATEGORY, Ticket, CLIENT_TICKET_CATEGORIES, PARTNER_TICKET_CATEGORIES, TICKET_STATUS_CLIENT_VIEW, Role, AiSummarySettings, AiSummaryUsage, Update, resolveTicketRouting, pickFromGroup, OPEN_TICKET_STATUSES, opsTree, employeeTree, partnerTree, clientTree, DASHBOARDS, getTree, getAllKeys, getParentKey, getAncestorKeys, resolveEffectivePermissions, hasPermission, validateGrantedKeys, validateExtraKeys, getFullAccessKeys, roleSeeds, };
|
|
88
|
+
export type { IChat, IMessage, IUser, IVertical, IMacro, IPartner, ICompany, IOnboardingStep, ITwilioConfig, ICompanySettings, ICallConnectSettings, ILeadConfig, ILeadFields, IReview, IReviewStatusHistoryEntry, IWallet, IStripeLog, ITransaction, ILead, ITierConfig, ITierProgress, IMonthlyTierSnapshot, IProduct, IPlan, IPlanOption, IAddon, ISubscription, ICoupon, CouponDiscountType, IVisitor, IGroup, IAgent, ILeadLedger, IInvoice, ILeadDispute, ISession, ILoginOtp, IEmployee, ICallSession, CallSessionStatus, CallSessionDirection, IRequest, IRequestAttachment, IRequestMessage, IRequestActivityEntry, RequestCategory, RequestStatus, ITicket, ITicketAttachment, ITicketActivityEntry, TicketCategory, ClientTicketCategory, PartnerTicketCategory, TicketOwnerType, TicketSource, TicketStatus, TicketPriority, IRole, IAiSummarySettings, IAiSummaryExample, IAiSummaryUsage, AiSummaryLength, IUpdate, UpdateDashboard, UpdateAudience, UpdateType, TicketRoutingInput, TicketRoutingResult, Dashboard, PermissionNode, PermissionSource, ValidationResult, RoleSeed, };
|
|
87
89
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,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,EACpB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,OAAO,EACP,eAAe,EACf,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,GACT,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.roleSeeds = exports.getFullAccessKeys = exports.validateExtraKeys = exports.validateGrantedKeys = exports.hasPermission = exports.resolveEffectivePermissions = exports.getAncestorKeys = exports.getParentKey = exports.getAllKeys = void 0;
|
|
3
|
+
exports.partnerTree = exports.employeeTree = exports.opsTree = exports.OPEN_TICKET_STATUSES = exports.pickFromGroup = exports.resolveTicketRouting = exports.Update = exports.AiSummaryUsage = exports.AiSummarySettings = exports.Role = exports.TICKET_STATUS_CLIENT_VIEW = exports.PARTNER_TICKET_CATEGORIES = exports.CLIENT_TICKET_CATEGORIES = exports.Ticket = exports.REQUEST_SUBCATEGORIES_BY_CATEGORY = exports.REQUEST_CATEGORIES = exports.Request = exports.CallSession = exports.Employee = exports.Counter = exports.LoginOtp = exports.Session = exports.LeadDispute = exports.Invoice = exports.LeadLedger = exports.Agent = exports.Group = exports.Visitor = exports.Coupon = exports.Subscription = exports.Addon = exports.PlanOption = exports.Plan = exports.Product = exports.MonthlyTierSnapshot = exports.TierProgress = exports.TierConfig = exports.Lead = exports.Transaction = exports.StripeLog = exports.Wallet = exports.Review = exports.CompanySettings = exports.Company = exports.Partner = exports.Macro = exports.Vertical = exports.User = exports.Message = exports.Chat = void 0;
|
|
4
|
+
exports.roleSeeds = exports.getFullAccessKeys = exports.validateExtraKeys = exports.validateGrantedKeys = exports.hasPermission = exports.resolveEffectivePermissions = exports.getAncestorKeys = exports.getParentKey = exports.getAllKeys = exports.getTree = exports.DASHBOARDS = exports.clientTree = void 0;
|
|
5
5
|
// MODELS
|
|
6
6
|
const chat_model_1 = require("./models/chat.model");
|
|
7
7
|
Object.defineProperty(exports, "Chat", { enumerable: true, get: function () { return chat_model_1.Chat; } });
|
|
@@ -81,6 +81,10 @@ const aiSummaryUsage_model_1 = require("./models/aiSummaryUsage.model");
|
|
|
81
81
|
Object.defineProperty(exports, "AiSummaryUsage", { enumerable: true, get: function () { return aiSummaryUsage_model_1.AiSummaryUsage; } });
|
|
82
82
|
const update_model_1 = require("./models/update.model");
|
|
83
83
|
Object.defineProperty(exports, "Update", { enumerable: true, get: function () { return update_model_1.Update; } });
|
|
84
|
+
const ticketRouting_1 = require("./routing/ticketRouting");
|
|
85
|
+
Object.defineProperty(exports, "resolveTicketRouting", { enumerable: true, get: function () { return ticketRouting_1.resolveTicketRouting; } });
|
|
86
|
+
Object.defineProperty(exports, "pickFromGroup", { enumerable: true, get: function () { return ticketRouting_1.pickFromGroup; } });
|
|
87
|
+
Object.defineProperty(exports, "OPEN_TICKET_STATUSES", { enumerable: true, get: function () { return ticketRouting_1.OPEN_TICKET_STATUSES; } });
|
|
84
88
|
const request_interface_1 = require("./interfaces/request.interface");
|
|
85
89
|
Object.defineProperty(exports, "REQUEST_CATEGORIES", { enumerable: true, get: function () { return request_interface_1.REQUEST_CATEGORIES; } });
|
|
86
90
|
Object.defineProperty(exports, "REQUEST_SUBCATEGORIES_BY_CATEGORY", { enumerable: true, get: function () { return request_interface_1.REQUEST_SUBCATEGORIES_BY_CATEGORY; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ops.tree.d.ts","sourceRoot":"","sources":["../../../src/permissions/trees/ops.tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQ1C,eAAO,MAAM,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"ops.tree.d.ts","sourceRoot":"","sources":["../../../src/permissions/trees/ops.tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQ1C,eAAO,MAAM,OAAO,EAAE,cAAc,EAuKnC,CAAC"}
|
|
@@ -166,7 +166,11 @@ exports.opsTree = [
|
|
|
166
166
|
{ key: "scripts.deleteVertical", label: "Delete Vertical" },
|
|
167
167
|
],
|
|
168
168
|
},
|
|
169
|
-
{
|
|
169
|
+
{
|
|
170
|
+
key: "updates",
|
|
171
|
+
label: "Updates",
|
|
172
|
+
children: [{ key: "updates.createAnnouncement", label: "Send Announcement" }],
|
|
173
|
+
},
|
|
170
174
|
{ key: "settings", label: "Settings" },
|
|
171
175
|
// Reserved: feature not yet specified/built. No route is gated on this today.
|
|
172
176
|
{ key: "chatFlux", label: "Chat Flux" },
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
import { TicketOwnerType, TicketCategory } from "../interfaces/ticket.interface";
|
|
3
|
+
export declare const OPEN_TICKET_STATUSES: readonly ["open", "in_progress", "awaiting_client", "awaiting_internal"];
|
|
4
|
+
export interface TicketRoutingInput {
|
|
5
|
+
ownerType: TicketOwnerType;
|
|
6
|
+
ownerId: Types.ObjectId | string;
|
|
7
|
+
category?: TicketCategory;
|
|
8
|
+
}
|
|
9
|
+
export interface TicketRoutingResult {
|
|
10
|
+
assigneeId?: Types.ObjectId;
|
|
11
|
+
followerIds: Types.ObjectId[];
|
|
12
|
+
}
|
|
13
|
+
export declare function pickFromGroup(groupId: Types.ObjectId | string): Promise<Types.ObjectId | undefined>;
|
|
14
|
+
export declare function resolveTicketRouting(ticket: TicketRoutingInput): Promise<TicketRoutingResult>;
|
|
15
|
+
//# sourceMappingURL=ticketRouting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticketRouting.d.ts","sourceRoot":"","sources":["../../src/routing/ticketRouting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAMjC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAoBjF,eAAO,MAAM,oBAAoB,0EAKvB,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;CAC/B;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC,CA2BzG;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA0BnG"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OPEN_TICKET_STATUSES = void 0;
|
|
4
|
+
exports.pickFromGroup = pickFromGroup;
|
|
5
|
+
exports.resolveTicketRouting = resolveTicketRouting;
|
|
6
|
+
const company_model_1 = require("../models/company.model");
|
|
7
|
+
const partner_model_1 = require("../models/partner.model");
|
|
8
|
+
const group_model_1 = require("../models/group.model");
|
|
9
|
+
const user_model_1 = require("../models/user.model");
|
|
10
|
+
const ticket_model_1 = require("../models/ticket.model");
|
|
11
|
+
// Resolves who a ticket should go to, per the support-desk plan's ordered routing rules --
|
|
12
|
+
// implemented as far as the real category taxonomy currently allows (a richer category list --
|
|
13
|
+
// Technical Support, Account Support and their sub-options -- is still "Planned", so the "Account
|
|
14
|
+
// Support goes straight to the Account Manager" rule can't be expressed yet; it becomes a one-line
|
|
15
|
+
// addition here once that taxonomy exists).
|
|
16
|
+
//
|
|
17
|
+
// Order:
|
|
18
|
+
// 1. The ticket owner's own Group (Company.groupId), if active -- e.g. a "Law" group.
|
|
19
|
+
// 2. A Group that handles this ticket's category (Group.handlesTicketCategories), if active.
|
|
20
|
+
// 3. Otherwise unassigned -- left for the pool, a team lead notices it in "Unassigned" (Phase 28).
|
|
21
|
+
// Whoever gets picked is the User in that group's membership (User.groupIds) with the fewest
|
|
22
|
+
// currently-open tickets, among those still under their own maxOpenTickets. A Company's own
|
|
23
|
+
// Account Manager is always added as a follower, whoever ends up assigned.
|
|
24
|
+
//
|
|
25
|
+
// Shared by every backend that creates or re-triages a Ticket (Ops, Client, Partner) so all three
|
|
26
|
+
// apply the exact same rule instead of three copies drifting apart -- Ops's own
|
|
27
|
+
// `POST /:id/auto-assign` and its triage-time re-route inside `updateTicket` both call this too.
|
|
28
|
+
exports.OPEN_TICKET_STATUSES = [
|
|
29
|
+
"open",
|
|
30
|
+
"in_progress",
|
|
31
|
+
"awaiting_client",
|
|
32
|
+
"awaiting_internal",
|
|
33
|
+
];
|
|
34
|
+
async function pickFromGroup(groupId) {
|
|
35
|
+
var _a;
|
|
36
|
+
const members = await user_model_1.User.find({ groupIds: groupId, lockedOut: { $ne: true } })
|
|
37
|
+
.select("_id maxOpenTickets")
|
|
38
|
+
.lean();
|
|
39
|
+
if (members.length === 0)
|
|
40
|
+
return undefined;
|
|
41
|
+
const counts = await ticket_model_1.Ticket.aggregate([
|
|
42
|
+
{
|
|
43
|
+
$match: {
|
|
44
|
+
assigneeId: { $in: members.map((m) => m._id) },
|
|
45
|
+
status: { $in: exports.OPEN_TICKET_STATUSES },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{ $group: { _id: "$assigneeId", count: { $sum: 1 } } },
|
|
49
|
+
]);
|
|
50
|
+
const openByUser = new Map(counts.map((c) => [String(c._id), c.count]));
|
|
51
|
+
const eligible = members
|
|
52
|
+
.map((m) => {
|
|
53
|
+
var _a;
|
|
54
|
+
return ({
|
|
55
|
+
id: m._id,
|
|
56
|
+
open: openByUser.get(String(m._id)) || 0,
|
|
57
|
+
limit: (_a = m.maxOpenTickets) !== null && _a !== void 0 ? _a : 15,
|
|
58
|
+
});
|
|
59
|
+
})
|
|
60
|
+
.filter((m) => m.open < m.limit)
|
|
61
|
+
.sort((a, b) => a.open - b.open);
|
|
62
|
+
return (_a = eligible[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
63
|
+
}
|
|
64
|
+
async function resolveTicketRouting(ticket) {
|
|
65
|
+
const followerIds = [];
|
|
66
|
+
let assigneeId;
|
|
67
|
+
// `any` here deliberately -- Company and Partner are two distinct Mongoose models with
|
|
68
|
+
// differently-typed findById overloads that TS can't unify through a variable holding either.
|
|
69
|
+
const Owner = ticket.ownerType === "Partner" ? partner_model_1.Partner : company_model_1.Company;
|
|
70
|
+
const owner = await Owner.findById(ticket.ownerId).select("groupId accountManager").lean();
|
|
71
|
+
if (owner === null || owner === void 0 ? void 0 : owner.accountManager)
|
|
72
|
+
followerIds.push(owner.accountManager);
|
|
73
|
+
// Rule 1: the owner's own group (Company only today -- Partner has no groupId field yet).
|
|
74
|
+
if (ticket.ownerType === "Company" && (owner === null || owner === void 0 ? void 0 : owner.groupId)) {
|
|
75
|
+
const group = await group_model_1.Group.findOne({ _id: owner.groupId, isActive: true }).select("_id").lean();
|
|
76
|
+
if (group)
|
|
77
|
+
assigneeId = await pickFromGroup(group._id);
|
|
78
|
+
}
|
|
79
|
+
// Rule 2: a group that specifically handles this ticket's category.
|
|
80
|
+
if (!assigneeId && ticket.category) {
|
|
81
|
+
const team = await group_model_1.Group.findOne({ isActive: true, handlesTicketCategories: ticket.category })
|
|
82
|
+
.select("_id")
|
|
83
|
+
.lean();
|
|
84
|
+
if (team)
|
|
85
|
+
assigneeId = await pickFromGroup(team._id);
|
|
86
|
+
}
|
|
87
|
+
return { assigneeId, followerIds };
|
|
88
|
+
}
|