orbitx-core-models 11.140.0 → 11.142.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/constants/ticketCategories.d.ts +43 -0
- package/dist/constants/ticketCategories.d.ts.map +1 -0
- package/dist/constants/ticketCategories.js +121 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -2
- package/dist/interfaces/ticket.interface.d.ts +37 -7
- package/dist/interfaces/ticket.interface.d.ts.map +1 -1
- package/dist/interfaces/ticket.interface.js +10 -2
- package/dist/models/ticket.model.d.ts.map +1 -1
- package/dist/models/ticket.model.js +35 -2
- 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/dist/utils/ticketSanitize.d.ts +18 -0
- package/dist/utils/ticketSanitize.d.ts.map +1 -0
- package/dist/utils/ticketSanitize.js +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the Phase 28 ticket category taxonomy -- imported by the Client and
|
|
3
|
+
* Partner ticket-creation forms, both dashboards' ticket controllers (validation), and Ops's
|
|
4
|
+
* Group "handles these ticket categories" checkbox list, so all four places stay in sync without
|
|
5
|
+
* a real settings-editable admin screen. That screen (add/edit a category without a code
|
|
6
|
+
* release) was asked for in the same Phase 28 batch and is deliberately NOT built here -- it's
|
|
7
|
+
* its own admin CRUD + cache-invalidation feature across three frontends, left for a dedicated
|
|
8
|
+
* pass. This file is the interim single source instead of four separate hardcoded copies.
|
|
9
|
+
*
|
|
10
|
+
* Old tickets keep whatever legacy category they were filed under (chat-dispute,
|
|
11
|
+
* dashboard-technical-issue, payout-issue, referral-issue, review-submission-issue, other) --
|
|
12
|
+
* see CLIENT_TICKET_CATEGORIES_LEGACY/PARTNER_TICKET_CATEGORIES_LEGACY in ticket.interface.ts.
|
|
13
|
+
* Per the "no remapping" decision, those are shown as Legacy and never migrated.
|
|
14
|
+
*/
|
|
15
|
+
export interface TicketSubCategoryOption {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TicketCategoryOption {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
/** Shown under the category as its own dropdown when present; omitted categories skip it. */
|
|
23
|
+
subCategories?: TicketSubCategoryOption[];
|
|
24
|
+
/** The requester picks their own Chat/Lead ID from their own records (locked, not free text). */
|
|
25
|
+
requiresChatId?: boolean;
|
|
26
|
+
/** The requester picks their own Invoice ID from their own records. */
|
|
27
|
+
requiresInvoiceId?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare const CLIENT_TICKET_CATEGORY_OPTIONS: TicketCategoryOption[];
|
|
30
|
+
export declare const PARTNER_TICKET_CATEGORY_OPTIONS: TicketCategoryOption[];
|
|
31
|
+
/** Old category values, still valid on old tickets, shown as "(Legacy)" and never offered on the
|
|
32
|
+
* "create a new ticket" form again. Ops's category dropdowns (triage/reassign) still need to
|
|
33
|
+
* accept and display these so an old ticket can be looked at, filtered and re-triaged. */
|
|
34
|
+
export declare const CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY: TicketCategoryOption[];
|
|
35
|
+
export declare const PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY: TicketCategoryOption[];
|
|
36
|
+
/** Every category value that can appear on any ticket, old or new -- what a Group's
|
|
37
|
+
* "handles these ticket categories" checkbox list offers, so routing can still target a legacy
|
|
38
|
+
* category on an old, not-yet-resolved ticket as well as the new taxonomy. */
|
|
39
|
+
export declare const ALL_TICKET_CATEGORY_OPTIONS: TicketCategoryOption[];
|
|
40
|
+
/** Looks a category value up across every list (new + legacy, client + partner) -- for anywhere
|
|
41
|
+
* that just needs the label/shape without caring which dashboard it came from. */
|
|
42
|
+
export declare function findTicketCategoryOption(value?: string | null): TicketCategoryOption | undefined;
|
|
43
|
+
//# sourceMappingURL=ticketCategories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticketCategories.d.ts","sourceRoot":"","sources":["../../src/constants/ticketCategories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,aAAa,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAC1C,iGAAiG;IACjG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,8BAA8B,EAAE,oBAAoB,EAqChE,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,oBAAoB,EAgCjE,CAAC;AAEF;;0FAE0F;AAC1F,eAAO,MAAM,qCAAqC,EAAE,oBAAoB,EAEvE,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,oBAAoB,EAMxE,CAAC;AAEF;;8EAE8E;AAC9E,eAAO,MAAM,2BAA2B,EAAE,oBAAoB,EAK7D,CAAC;AAOF;kFACkF;AAClF,wBAAgB,wBAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,oBAAoB,GAAG,SAAS,CAEhG"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Single source of truth for the Phase 28 ticket category taxonomy -- imported by the Client and
|
|
4
|
+
* Partner ticket-creation forms, both dashboards' ticket controllers (validation), and Ops's
|
|
5
|
+
* Group "handles these ticket categories" checkbox list, so all four places stay in sync without
|
|
6
|
+
* a real settings-editable admin screen. That screen (add/edit a category without a code
|
|
7
|
+
* release) was asked for in the same Phase 28 batch and is deliberately NOT built here -- it's
|
|
8
|
+
* its own admin CRUD + cache-invalidation feature across three frontends, left for a dedicated
|
|
9
|
+
* pass. This file is the interim single source instead of four separate hardcoded copies.
|
|
10
|
+
*
|
|
11
|
+
* Old tickets keep whatever legacy category they were filed under (chat-dispute,
|
|
12
|
+
* dashboard-technical-issue, payout-issue, referral-issue, review-submission-issue, other) --
|
|
13
|
+
* see CLIENT_TICKET_CATEGORIES_LEGACY/PARTNER_TICKET_CATEGORIES_LEGACY in ticket.interface.ts.
|
|
14
|
+
* Per the "no remapping" decision, those are shown as Legacy and never migrated.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ALL_TICKET_CATEGORY_OPTIONS = exports.PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY = exports.CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY = exports.PARTNER_TICKET_CATEGORY_OPTIONS = exports.CLIENT_TICKET_CATEGORY_OPTIONS = void 0;
|
|
18
|
+
exports.findTicketCategoryOption = findTicketCategoryOption;
|
|
19
|
+
exports.CLIENT_TICKET_CATEGORY_OPTIONS = [
|
|
20
|
+
{
|
|
21
|
+
value: "dispute-billable-lead",
|
|
22
|
+
label: "Dispute Billable Lead",
|
|
23
|
+
requiresChatId: true,
|
|
24
|
+
subCategories: [
|
|
25
|
+
{ value: "out-of-service", label: "Out of Service" },
|
|
26
|
+
{ value: "out-of-coverage", label: "Out of Coverage" },
|
|
27
|
+
{ value: "invalid", label: "Invalid" },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "invoice-dispute",
|
|
32
|
+
label: "Invoice Dispute",
|
|
33
|
+
requiresInvoiceId: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: "technical-support",
|
|
37
|
+
label: "Technical Support",
|
|
38
|
+
subCategories: [
|
|
39
|
+
{ value: "login-access", label: "Login / Access" },
|
|
40
|
+
{ value: "bug-error", label: "Bug / Error" },
|
|
41
|
+
{ value: "performance", label: "Performance / Slowness" },
|
|
42
|
+
{ value: "integration", label: "Integration" },
|
|
43
|
+
{ value: "other", label: "Other" },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: "account-support",
|
|
48
|
+
label: "Account Support",
|
|
49
|
+
subCategories: [
|
|
50
|
+
{ value: "billing-invoice", label: "Billing / Invoice" },
|
|
51
|
+
{ value: "profile-settings", label: "Profile / Settings" },
|
|
52
|
+
{ value: "users-permissions", label: "Users & Permissions" },
|
|
53
|
+
{ value: "other", label: "Other" },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
exports.PARTNER_TICKET_CATEGORY_OPTIONS = [
|
|
58
|
+
{
|
|
59
|
+
value: "failed-withdrawal",
|
|
60
|
+
label: "Failed Withdrawal",
|
|
61
|
+
requiresInvoiceId: true,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
value: "failed-transfer",
|
|
65
|
+
label: "Failed Transfer",
|
|
66
|
+
requiresInvoiceId: true,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: "technical-support",
|
|
70
|
+
label: "Technical Support",
|
|
71
|
+
subCategories: [
|
|
72
|
+
{ value: "login-access", label: "Login / Access" },
|
|
73
|
+
{ value: "bug-error", label: "Bug / Error" },
|
|
74
|
+
{ value: "performance", label: "Performance / Slowness" },
|
|
75
|
+
{ value: "integration", label: "Integration" },
|
|
76
|
+
{ value: "other", label: "Other" },
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
value: "account-support",
|
|
81
|
+
label: "Account Support",
|
|
82
|
+
subCategories: [
|
|
83
|
+
{ value: "billing-invoice", label: "Billing / Invoice" },
|
|
84
|
+
{ value: "profile-settings", label: "Profile / Settings" },
|
|
85
|
+
{ value: "users-permissions", label: "Users & Permissions" },
|
|
86
|
+
{ value: "other", label: "Other" },
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
/** Old category values, still valid on old tickets, shown as "(Legacy)" and never offered on the
|
|
91
|
+
* "create a new ticket" form again. Ops's category dropdowns (triage/reassign) still need to
|
|
92
|
+
* accept and display these so an old ticket can be looked at, filtered and re-triaged. */
|
|
93
|
+
exports.CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY = [
|
|
94
|
+
{ value: "chat-dispute", label: "Chat Dispute (Legacy)", requiresChatId: true },
|
|
95
|
+
];
|
|
96
|
+
exports.PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY = [
|
|
97
|
+
{ value: "dashboard-technical-issue", label: "Dashboard / Technical Issue (Legacy)" },
|
|
98
|
+
{ value: "payout-issue", label: "Payout Issue (Legacy)" },
|
|
99
|
+
{ value: "referral-issue", label: "Referral Issue (Legacy)" },
|
|
100
|
+
{ value: "review-submission-issue", label: "Review Submission Error (Legacy)" },
|
|
101
|
+
{ value: "other", label: "Other (Legacy)" },
|
|
102
|
+
];
|
|
103
|
+
/** Every category value that can appear on any ticket, old or new -- what a Group's
|
|
104
|
+
* "handles these ticket categories" checkbox list offers, so routing can still target a legacy
|
|
105
|
+
* category on an old, not-yet-resolved ticket as well as the new taxonomy. */
|
|
106
|
+
exports.ALL_TICKET_CATEGORY_OPTIONS = [
|
|
107
|
+
...exports.CLIENT_TICKET_CATEGORY_OPTIONS,
|
|
108
|
+
...exports.PARTNER_TICKET_CATEGORY_OPTIONS,
|
|
109
|
+
...exports.CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY,
|
|
110
|
+
...exports.PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY,
|
|
111
|
+
];
|
|
112
|
+
function findOption(list, value) {
|
|
113
|
+
if (!value)
|
|
114
|
+
return undefined;
|
|
115
|
+
return list.find((o) => o.value === value);
|
|
116
|
+
}
|
|
117
|
+
/** Looks a category value up across every list (new + legacy, client + partner) -- for anywhere
|
|
118
|
+
* that just needs the label/shape without caring which dashboard it came from. */
|
|
119
|
+
function findTicketCategoryOption(value) {
|
|
120
|
+
return findOption(exports.ALL_TICKET_CATEGORY_OPTIONS, value);
|
|
121
|
+
}
|
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";
|
|
@@ -70,10 +71,13 @@ import { ILoginOtp } from "./interfaces/loginOtp.interface";
|
|
|
70
71
|
import { IEmployee } from "./interfaces/employee.interface";
|
|
71
72
|
import { ICallSession, CallSessionStatus, CallSessionDirection } from "./interfaces/callSession.interface";
|
|
72
73
|
import { IRequest, IRequestAttachment, IRequestMessage, IRequestActivityEntry, RequestCategory, RequestStatus, REQUEST_CATEGORIES, REQUEST_SUBCATEGORIES_BY_CATEGORY } from "./interfaces/request.interface";
|
|
73
|
-
import { ITicket, ITicketAttachment, ITicketActivityEntry, TicketCategory, ClientTicketCategory, PartnerTicketCategory, TicketOwnerType, TicketSource, TicketStatus, TicketPriority, TICKET_STATUS_CLIENT_VIEW, CLIENT_TICKET_CATEGORIES, PARTNER_TICKET_CATEGORIES } from "./interfaces/ticket.interface";
|
|
74
|
+
import { ITicket, ITicketAttachment, ITicketActivityEntry, ITicketMessage, TicketCategory, ClientTicketCategory, ClientTicketCategoryLegacy, PartnerTicketCategory, PartnerTicketCategoryLegacy, TicketOwnerType, TicketSource, TicketStatus, TicketPriority, TICKET_STATUS_CLIENT_VIEW, CLIENT_TICKET_CATEGORIES, CLIENT_TICKET_CATEGORIES_LEGACY, PARTNER_TICKET_CATEGORIES, PARTNER_TICKET_CATEGORIES_LEGACY } from "./interfaces/ticket.interface";
|
|
75
|
+
import { TicketCategoryOption, TicketSubCategoryOption, CLIENT_TICKET_CATEGORY_OPTIONS, PARTNER_TICKET_CATEGORY_OPTIONS, CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY, PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY, ALL_TICKET_CATEGORY_OPTIONS, findTicketCategoryOption } from "./constants/ticketCategories";
|
|
74
76
|
import { IRole } from "./interfaces/role.interface";
|
|
75
77
|
import { IAiSummarySettings, IAiSummaryExample, IAiSummaryUsage, AiSummaryLength } from "./interfaces/aiSummary.interface";
|
|
76
78
|
import { IUpdate, UpdateDashboard, UpdateAudience, UpdateType } from "./interfaces/update.interface";
|
|
79
|
+
import { TicketRoutingInput, TicketRoutingResult } from "./routing/ticketRouting";
|
|
80
|
+
import { sanitizeTicketForRequester } from "./utils/ticketSanitize";
|
|
77
81
|
import { Dashboard, PermissionNode, DASHBOARDS } from "./permissions/types";
|
|
78
82
|
import { opsTree } from "./permissions/trees/ops.tree";
|
|
79
83
|
import { employeeTree } from "./permissions/trees/employee.tree";
|
|
@@ -82,6 +86,6 @@ import { clientTree } from "./permissions/trees/client.tree";
|
|
|
82
86
|
import { getTree, getAllKeys, getParentKey, getAncestorKeys } from "./permissions/treeUtils";
|
|
83
87
|
import { resolveEffectivePermissions, hasPermission, validateGrantedKeys, validateExtraKeys, getFullAccessKeys, PermissionSource, ValidationResult } from "./permissions/resolve";
|
|
84
88
|
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, };
|
|
89
|
+
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, CLIENT_TICKET_CATEGORIES_LEGACY, PARTNER_TICKET_CATEGORIES, PARTNER_TICKET_CATEGORIES_LEGACY, CLIENT_TICKET_CATEGORY_OPTIONS, PARTNER_TICKET_CATEGORY_OPTIONS, CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY, PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY, ALL_TICKET_CATEGORY_OPTIONS, findTicketCategoryOption, TICKET_STATUS_CLIENT_VIEW, sanitizeTicketForRequester, Role, AiSummarySettings, AiSummaryUsage, Update, resolveTicketRouting, pickFromGroup, OPEN_TICKET_STATUSES, opsTree, employeeTree, partnerTree, clientTree, DASHBOARDS, getTree, getAllKeys, getParentKey, getAncestorKeys, resolveEffectivePermissions, hasPermission, validateGrantedKeys, validateExtraKeys, getFullAccessKeys, roleSeeds, };
|
|
90
|
+
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, ITicketMessage, TicketCategory, ClientTicketCategory, ClientTicketCategoryLegacy, PartnerTicketCategory, PartnerTicketCategoryLegacy, TicketCategoryOption, TicketSubCategoryOption, TicketOwnerType, TicketSource, TicketStatus, TicketPriority, IRole, IAiSummarySettings, IAiSummaryExample, IAiSummaryUsage, AiSummaryLength, IUpdate, UpdateDashboard, UpdateAudience, UpdateType, TicketRoutingInput, TicketRoutingResult, Dashboard, PermissionNode, PermissionSource, ValidationResult, RoleSeed, };
|
|
87
91
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@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L,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,QAAQ,EACR,KAAK,EACL,WAAW,EACX,MAAM,EACN,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,MAAM,EACN,MAAM,EACN,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,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.Role = exports.sanitizeTicketForRequester = exports.TICKET_STATUS_CLIENT_VIEW = exports.findTicketCategoryOption = exports.ALL_TICKET_CATEGORY_OPTIONS = exports.PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY = exports.CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY = exports.PARTNER_TICKET_CATEGORY_OPTIONS = exports.CLIENT_TICKET_CATEGORY_OPTIONS = exports.PARTNER_TICKET_CATEGORIES_LEGACY = exports.PARTNER_TICKET_CATEGORIES = exports.CLIENT_TICKET_CATEGORIES_LEGACY = 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 = exports.partnerTree = exports.employeeTree = exports.opsTree = exports.OPEN_TICKET_STATUSES = exports.pickFromGroup = exports.resolveTicketRouting = exports.Update = exports.AiSummaryUsage = exports.AiSummarySettings = 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,13 +81,28 @@ 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; } });
|
|
87
91
|
const ticket_interface_1 = require("./interfaces/ticket.interface");
|
|
88
92
|
Object.defineProperty(exports, "TICKET_STATUS_CLIENT_VIEW", { enumerable: true, get: function () { return ticket_interface_1.TICKET_STATUS_CLIENT_VIEW; } });
|
|
89
93
|
Object.defineProperty(exports, "CLIENT_TICKET_CATEGORIES", { enumerable: true, get: function () { return ticket_interface_1.CLIENT_TICKET_CATEGORIES; } });
|
|
94
|
+
Object.defineProperty(exports, "CLIENT_TICKET_CATEGORIES_LEGACY", { enumerable: true, get: function () { return ticket_interface_1.CLIENT_TICKET_CATEGORIES_LEGACY; } });
|
|
90
95
|
Object.defineProperty(exports, "PARTNER_TICKET_CATEGORIES", { enumerable: true, get: function () { return ticket_interface_1.PARTNER_TICKET_CATEGORIES; } });
|
|
96
|
+
Object.defineProperty(exports, "PARTNER_TICKET_CATEGORIES_LEGACY", { enumerable: true, get: function () { return ticket_interface_1.PARTNER_TICKET_CATEGORIES_LEGACY; } });
|
|
97
|
+
const ticketCategories_1 = require("./constants/ticketCategories");
|
|
98
|
+
Object.defineProperty(exports, "CLIENT_TICKET_CATEGORY_OPTIONS", { enumerable: true, get: function () { return ticketCategories_1.CLIENT_TICKET_CATEGORY_OPTIONS; } });
|
|
99
|
+
Object.defineProperty(exports, "PARTNER_TICKET_CATEGORY_OPTIONS", { enumerable: true, get: function () { return ticketCategories_1.PARTNER_TICKET_CATEGORY_OPTIONS; } });
|
|
100
|
+
Object.defineProperty(exports, "CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY", { enumerable: true, get: function () { return ticketCategories_1.CLIENT_TICKET_CATEGORY_OPTIONS_LEGACY; } });
|
|
101
|
+
Object.defineProperty(exports, "PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY", { enumerable: true, get: function () { return ticketCategories_1.PARTNER_TICKET_CATEGORY_OPTIONS_LEGACY; } });
|
|
102
|
+
Object.defineProperty(exports, "ALL_TICKET_CATEGORY_OPTIONS", { enumerable: true, get: function () { return ticketCategories_1.ALL_TICKET_CATEGORY_OPTIONS; } });
|
|
103
|
+
Object.defineProperty(exports, "findTicketCategoryOption", { enumerable: true, get: function () { return ticketCategories_1.findTicketCategoryOption; } });
|
|
104
|
+
const ticketSanitize_1 = require("./utils/ticketSanitize");
|
|
105
|
+
Object.defineProperty(exports, "sanitizeTicketForRequester", { enumerable: true, get: function () { return ticketSanitize_1.sanitizeTicketForRequester; } });
|
|
91
106
|
// PERMISSIONS
|
|
92
107
|
const types_1 = require("./permissions/types");
|
|
93
108
|
Object.defineProperty(exports, "DASHBOARDS", { enumerable: true, get: function () { return types_1.DASHBOARDS; } });
|
|
@@ -7,18 +7,32 @@ import { Document, Types } from "mongoose";
|
|
|
7
7
|
* A ticket in this category just gives Ops a place to see the report and
|
|
8
8
|
* manually open the real Dispute tool once they've identified the invoice
|
|
9
9
|
* line item. Revisit auto-linking as a later phase.
|
|
10
|
+
*
|
|
11
|
+
* 2026-09-22 Phase 28 taxonomy pass: "chat-dispute" is retired from the
|
|
12
|
+
* creation form (folded into "dispute-billable-lead", which now carries its
|
|
13
|
+
* own sub-category) and "technical-support"/"account-support" are new. Old
|
|
14
|
+
* tickets already filed under "chat-dispute" or any legacy value are left
|
|
15
|
+
* alone and shown as Legacy -- see CLIENT_TICKET_CATEGORIES_LEGACY below --
|
|
16
|
+
* per the "no remapping" decision.
|
|
10
17
|
*/
|
|
11
|
-
export type ClientTicketCategory = "dispute-billable-lead" | "
|
|
18
|
+
export type ClientTicketCategory = "dispute-billable-lead" | "invoice-dispute" | "technical-support" | "account-support";
|
|
19
|
+
export type ClientTicketCategoryLegacy = "chat-dispute";
|
|
12
20
|
/**
|
|
13
21
|
* Partner Dashboard's categories -- a partner has no leads/invoices of their
|
|
14
|
-
* own to dispute (that's the Client side); their issues are about
|
|
15
|
-
*
|
|
16
|
-
*
|
|
22
|
+
* own to dispute (that's the Client side); their issues are about a failed
|
|
23
|
+
* payout, a failed transfer, the dashboard itself, or their own account.
|
|
24
|
+
*
|
|
25
|
+
* 2026-09-22 Phase 28 taxonomy pass: replaces the old
|
|
26
|
+
* dashboard-technical-issue/payout-issue/referral-issue/review-submission-issue/other
|
|
27
|
+
* list (kept below as PARTNER_TICKET_CATEGORIES_LEGACY, same "no remapping" decision).
|
|
17
28
|
*/
|
|
18
|
-
export type PartnerTicketCategory = "
|
|
19
|
-
export type
|
|
29
|
+
export type PartnerTicketCategory = "failed-withdrawal" | "failed-transfer" | "technical-support" | "account-support";
|
|
30
|
+
export type PartnerTicketCategoryLegacy = "dashboard-technical-issue" | "payout-issue" | "referral-issue" | "review-submission-issue" | "other";
|
|
31
|
+
export type TicketCategory = ClientTicketCategory | ClientTicketCategoryLegacy | PartnerTicketCategory | PartnerTicketCategoryLegacy;
|
|
20
32
|
export declare const CLIENT_TICKET_CATEGORIES: ClientTicketCategory[];
|
|
33
|
+
export declare const CLIENT_TICKET_CATEGORIES_LEGACY: ClientTicketCategoryLegacy[];
|
|
21
34
|
export declare const PARTNER_TICKET_CATEGORIES: PartnerTicketCategory[];
|
|
35
|
+
export declare const PARTNER_TICKET_CATEGORIES_LEGACY: PartnerTicketCategoryLegacy[];
|
|
22
36
|
/** Who this ticket belongs to -- Company (Client Dashboard) or Partner. */
|
|
23
37
|
export type TicketOwnerType = "Company" | "Partner";
|
|
24
38
|
/**
|
|
@@ -73,6 +87,12 @@ export interface ITicketMessage {
|
|
|
73
87
|
authorName?: string;
|
|
74
88
|
body: string;
|
|
75
89
|
isInternal: boolean;
|
|
90
|
+
/** Files attached to this specific reply -- separate from the ticket-level `attachments`
|
|
91
|
+
* captured at creation. Client/partner-authored messages can carry these too. */
|
|
92
|
+
attachments?: ITicketAttachment[];
|
|
93
|
+
/** Ops Users @mentioned in an internal note (never set on a client-visible reply). Each one
|
|
94
|
+
* gets a live Update and the ticket's activityLog gets a matching "mentioned" entry. */
|
|
95
|
+
mentionedUserIds?: Types.ObjectId[];
|
|
76
96
|
createdAt: Date;
|
|
77
97
|
}
|
|
78
98
|
export interface ITicket extends Document {
|
|
@@ -82,11 +102,21 @@ export interface ITicket extends Document {
|
|
|
82
102
|
source: TicketSource;
|
|
83
103
|
/** Required when source is "dashboard"; left unset for "email" until an agent triages it. */
|
|
84
104
|
category?: TicketCategory;
|
|
105
|
+
/** The category's own sub-reason, e.g. dispute-billable-lead's Out of Service/Out of
|
|
106
|
+
* Coverage/Invalid, or technical-support's/account-support's issue type. See
|
|
107
|
+
* TICKET_CATEGORY_OPTIONS in constants/ticketCategories.ts for the valid list per category --
|
|
108
|
+
* not every category has sub-categories, so this is left unset for those. */
|
|
109
|
+
subCategory?: string;
|
|
85
110
|
/** Client dashboard, dispute-billable-lead / chat-dispute only */
|
|
86
111
|
disputeReason?: string;
|
|
87
112
|
/** Client dashboard, dispute-billable-lead / chat-dispute only */
|
|
88
113
|
chatId?: string;
|
|
89
|
-
/**
|
|
114
|
+
/** The lead this ticket disputes, when raised from the client's own Lead record (locked, not
|
|
115
|
+
* free text) -- distinct from the free-text `chatId` display field. See raiseDispute in
|
|
116
|
+
* client-backend's dispute.service.js. */
|
|
117
|
+
leadId?: Types.ObjectId;
|
|
118
|
+
/** Client dashboard invoice-dispute, and Partner dashboard failed-withdrawal/failed-transfer
|
|
119
|
+
* where it applies -- free-text reference, matches the UI's free-text/picker field. */
|
|
90
120
|
invoiceId?: string;
|
|
91
121
|
description?: string;
|
|
92
122
|
attachments: ITicketAttachment[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticket.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/ticket.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"ticket.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/ticket.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,CAAC;AAEtB,MAAM,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAC7B,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,CAAC;AAEtB,MAAM,MAAM,2BAA2B,GACnC,2BAA2B,GAC3B,cAAc,GACd,gBAAgB,GAChB,yBAAyB,GACzB,OAAO,CAAC;AAEZ,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,0BAA0B,GAC1B,qBAAqB,GACrB,2BAA2B,CAAC;AAEhC,eAAO,MAAM,wBAAwB,EAAE,oBAAoB,EAK1D,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,0BAA0B,EAAqB,CAAC;AAE9F,eAAO,MAAM,yBAAyB,EAAE,qBAAqB,EAK5D,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,2BAA2B,EAMzE,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,eAAe,GAAG,SA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CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC5B,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TICKET_STATUS_CLIENT_VIEW = exports.PARTNER_TICKET_CATEGORIES = exports.CLIENT_TICKET_CATEGORIES = void 0;
|
|
3
|
+
exports.TICKET_STATUS_CLIENT_VIEW = exports.PARTNER_TICKET_CATEGORIES_LEGACY = exports.PARTNER_TICKET_CATEGORIES = exports.CLIENT_TICKET_CATEGORIES_LEGACY = exports.CLIENT_TICKET_CATEGORIES = void 0;
|
|
4
4
|
exports.CLIENT_TICKET_CATEGORIES = [
|
|
5
5
|
"dispute-billable-lead",
|
|
6
|
-
"chat-dispute",
|
|
7
6
|
"invoice-dispute",
|
|
7
|
+
"technical-support",
|
|
8
|
+
"account-support",
|
|
8
9
|
];
|
|
10
|
+
exports.CLIENT_TICKET_CATEGORIES_LEGACY = ["chat-dispute"];
|
|
9
11
|
exports.PARTNER_TICKET_CATEGORIES = [
|
|
12
|
+
"failed-withdrawal",
|
|
13
|
+
"failed-transfer",
|
|
14
|
+
"technical-support",
|
|
15
|
+
"account-support",
|
|
16
|
+
];
|
|
17
|
+
exports.PARTNER_TICKET_CATEGORIES_LEGACY = [
|
|
10
18
|
"dashboard-technical-issue",
|
|
11
19
|
"payout-issue",
|
|
12
20
|
"referral-issue",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticket.model.d.ts","sourceRoot":"","sources":["../../src/models/ticket.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAE5C,OAAO,EACL,OAAO,EAIR,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"ticket.model.d.ts","sourceRoot":"","sources":["../../src/models/ticket.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAE5C,OAAO,EACL,OAAO,EAIR,MAAM,gCAAgC,CAAC;AAwPxC,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
|
|
@@ -49,6 +49,15 @@ const ticketMessageSchema = new mongoose_1.Schema({
|
|
|
49
49
|
authorName: { type: String, trim: true },
|
|
50
50
|
body: { type: String, required: true, trim: true, maxlength: 5000 },
|
|
51
51
|
isInternal: { type: Boolean, default: false },
|
|
52
|
+
attachments: {
|
|
53
|
+
type: [ticketAttachmentSchema],
|
|
54
|
+
default: [],
|
|
55
|
+
},
|
|
56
|
+
mentionedUserIds: {
|
|
57
|
+
type: [mongoose_1.Schema.Types.ObjectId],
|
|
58
|
+
ref: "User",
|
|
59
|
+
default: [],
|
|
60
|
+
},
|
|
52
61
|
createdAt: { type: Date, default: Date.now },
|
|
53
62
|
}, { _id: true });
|
|
54
63
|
const ticketActivityEntrySchema = new mongoose_1.Schema({
|
|
@@ -100,9 +109,18 @@ const ticketSchema = new mongoose_1.Schema({
|
|
|
100
109
|
category: {
|
|
101
110
|
type: String,
|
|
102
111
|
enum: [
|
|
112
|
+
// Client -- current taxonomy
|
|
103
113
|
"dispute-billable-lead",
|
|
104
|
-
"chat-dispute",
|
|
105
114
|
"invoice-dispute",
|
|
115
|
+
"technical-support",
|
|
116
|
+
"account-support",
|
|
117
|
+
// Client -- legacy, kept valid for old tickets only (never offered on new-ticket forms)
|
|
118
|
+
"chat-dispute",
|
|
119
|
+
// Partner -- current taxonomy
|
|
120
|
+
"failed-withdrawal",
|
|
121
|
+
"failed-transfer",
|
|
122
|
+
// "technical-support"/"account-support" above are shared with Client
|
|
123
|
+
// Partner -- legacy, kept valid for old tickets only
|
|
106
124
|
"dashboard-technical-issue",
|
|
107
125
|
"payout-issue",
|
|
108
126
|
"referral-issue",
|
|
@@ -111,8 +129,10 @@ const ticketSchema = new mongoose_1.Schema({
|
|
|
111
129
|
],
|
|
112
130
|
index: true,
|
|
113
131
|
},
|
|
132
|
+
subCategory: { type: String, trim: true, maxlength: 100 },
|
|
114
133
|
disputeReason: { type: String, trim: true, maxlength: 150 },
|
|
115
134
|
chatId: { type: String, trim: true, maxlength: 150 },
|
|
135
|
+
leadId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Lead" },
|
|
116
136
|
invoiceId: { type: String, trim: true, maxlength: 150 },
|
|
117
137
|
description: {
|
|
118
138
|
type: String,
|
|
@@ -177,8 +197,21 @@ const ticketSchema = new mongoose_1.Schema({
|
|
|
177
197
|
toJSON: { virtuals: true },
|
|
178
198
|
toObject: { virtuals: true },
|
|
179
199
|
});
|
|
180
|
-
|
|
200
|
+
// "technical-support"/"account-support" are shared category values, valid on both dashboards --
|
|
201
|
+
// deliberately listed in both arrays below rather than pulled out, so each array alone still
|
|
202
|
+
// reads as "every category this ownerType may use."
|
|
203
|
+
const CLIENT_ONLY_CATEGORIES = [
|
|
204
|
+
"dispute-billable-lead",
|
|
205
|
+
"chat-dispute",
|
|
206
|
+
"invoice-dispute",
|
|
207
|
+
"technical-support",
|
|
208
|
+
"account-support",
|
|
209
|
+
];
|
|
181
210
|
const PARTNER_ONLY_CATEGORIES = [
|
|
211
|
+
"failed-withdrawal",
|
|
212
|
+
"failed-transfer",
|
|
213
|
+
"technical-support",
|
|
214
|
+
"account-support",
|
|
182
215
|
"dashboard-technical-issue",
|
|
183
216
|
"payout-issue",
|
|
184
217
|
"referral-issue",
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ITicket, ITicketMessage } from "../interfaces/ticket.interface";
|
|
2
|
+
/**
|
|
3
|
+
* The single place that decides what a Client/Partner Dashboard is allowed to see about their
|
|
4
|
+
* own ticket. Used by client-backend's and partner-dashboard-backend's ticket controllers on
|
|
5
|
+
* every response that includes a ticket -- previously each backend only filtered internal
|
|
6
|
+
* messages (isInternal) and still returned the whole rest of the document as-is, which leaked
|
|
7
|
+
* Ops-internal fields the requester was never meant to see: activityLog (reassignment history
|
|
8
|
+
* and internal actor names), followerIds/assigneeId (raw Ops User references), and priority (an
|
|
9
|
+
* internal triage signal, not something a requester should read into). None of that is exposed
|
|
10
|
+
* anywhere in either dashboard's own UI today, but the raw API response carried it regardless --
|
|
11
|
+
* open to anyone opening devtools. This is a plain object mutation (works on both a Mongoose
|
|
12
|
+
* document's `.toObject()`/`.lean()` result and a plain object), not a defensive copy -- callers
|
|
13
|
+
* that still need the untouched ticket for their own internal use should sanitize a clone.
|
|
14
|
+
*/
|
|
15
|
+
export declare function sanitizeTicketForRequester<T extends Partial<ITicket> & {
|
|
16
|
+
messages?: ITicketMessage[];
|
|
17
|
+
}>(ticket: T | null | undefined): T | null | undefined;
|
|
18
|
+
//# sourceMappingURL=ticketSanitize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticketSanitize.d.ts","sourceRoot":"","sources":["../../src/utils/ticketSanitize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,OAAO,CAAC,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;CAAE,EACrG,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3B,CAAC,GAAG,IAAI,GAAG,SAAS,CAkBtB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sanitizeTicketForRequester = sanitizeTicketForRequester;
|
|
4
|
+
/**
|
|
5
|
+
* The single place that decides what a Client/Partner Dashboard is allowed to see about their
|
|
6
|
+
* own ticket. Used by client-backend's and partner-dashboard-backend's ticket controllers on
|
|
7
|
+
* every response that includes a ticket -- previously each backend only filtered internal
|
|
8
|
+
* messages (isInternal) and still returned the whole rest of the document as-is, which leaked
|
|
9
|
+
* Ops-internal fields the requester was never meant to see: activityLog (reassignment history
|
|
10
|
+
* and internal actor names), followerIds/assigneeId (raw Ops User references), and priority (an
|
|
11
|
+
* internal triage signal, not something a requester should read into). None of that is exposed
|
|
12
|
+
* anywhere in either dashboard's own UI today, but the raw API response carried it regardless --
|
|
13
|
+
* open to anyone opening devtools. This is a plain object mutation (works on both a Mongoose
|
|
14
|
+
* document's `.toObject()`/`.lean()` result and a plain object), not a defensive copy -- callers
|
|
15
|
+
* that still need the untouched ticket for their own internal use should sanitize a clone.
|
|
16
|
+
*/
|
|
17
|
+
function sanitizeTicketForRequester(ticket) {
|
|
18
|
+
if (!ticket)
|
|
19
|
+
return ticket;
|
|
20
|
+
if (Array.isArray(ticket.messages)) {
|
|
21
|
+
ticket.messages = ticket.messages
|
|
22
|
+
.filter((m) => !m.isInternal)
|
|
23
|
+
.map((m) => {
|
|
24
|
+
const { mentionedUserIds, ...rest } = m;
|
|
25
|
+
return rest;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
delete ticket.activityLog;
|
|
29
|
+
delete ticket.followerIds;
|
|
30
|
+
delete ticket.assigneeId;
|
|
31
|
+
delete ticket.priority;
|
|
32
|
+
return ticket;
|
|
33
|
+
}
|