orbitx-core-models 11.180.0 → 11.182.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/helpers/invoiceDocument.js +1 -1
- package/dist/helpers/myUpdates.d.ts +4 -1
- package/dist/helpers/myUpdates.d.ts.map +1 -1
- package/dist/helpers/myUpdates.js +4 -3
- package/dist/helpers/ownActivity.js +4 -4
- package/dist/helpers/portalLive.d.ts +31 -0
- package/dist/helpers/portalLive.d.ts.map +1 -0
- package/dist/helpers/portalLive.js +190 -0
- package/dist/helpers/retainerBilling.d.ts +30 -0
- package/dist/helpers/retainerBilling.d.ts.map +1 -0
- package/dist/helpers/retainerBilling.js +133 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/interfaces/audit.interface.d.ts +18 -1
- package/dist/interfaces/audit.interface.d.ts.map +1 -1
- package/dist/interfaces/companySettings.interface.d.ts +2 -0
- package/dist/interfaces/companySettings.interface.d.ts.map +1 -1
- package/dist/interfaces/leadLedger.interface.d.ts +1 -0
- package/dist/interfaces/leadLedger.interface.d.ts.map +1 -1
- package/dist/interfaces/retainer.interface.d.ts +23 -0
- package/dist/interfaces/retainer.interface.d.ts.map +1 -1
- package/dist/interfaces/tierConfig.interface.d.ts +1 -1
- package/dist/interfaces/tierConfig.interface.d.ts.map +1 -1
- package/dist/interfaces/update.interface.d.ts +1 -1
- package/dist/interfaces/update.interface.d.ts.map +1 -1
- package/dist/models/companySettings.model.d.ts.map +1 -1
- package/dist/models/companySettings.model.js +2 -0
- package/dist/models/invoice.model.js +1 -1
- package/dist/models/lead.model.d.ts.map +1 -1
- package/dist/models/lead.model.js +11 -1
- package/dist/models/leadLedger.model.d.ts.map +1 -1
- package/dist/models/leadLedger.model.js +5 -0
- package/dist/models/monthlyTierSnapshot.model.js +1 -1
- package/dist/models/retainer.model.d.ts.map +1 -1
- package/dist/models/retainer.model.js +12 -0
- package/dist/models/tierConfig.model.js +1 -1
- package/dist/models/update.model.d.ts.map +1 -1
- package/dist/models/update.model.js +3 -0
- package/dist/permissions/trees/ops.tree.d.ts.map +1 -1
- package/dist/permissions/trees/ops.tree.js +3 -0
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ function createInvoiceDocuments({ stripe }) {
|
|
|
35
35
|
const CompanyModel = company_model_1.Company;
|
|
36
36
|
const CounterModel = counter_model_1.Counter;
|
|
37
37
|
const LeadLedgerModel = leadLedger_model_1.LeadLedger;
|
|
38
|
-
/** "INV-2026-0001": sequential across
|
|
38
|
+
/** "INV-2026-0001": sequential across ORBITXPRO, starting again each year. */
|
|
39
39
|
async function nextInvoiceNumber(at = new Date()) {
|
|
40
40
|
const year = at.getFullYear();
|
|
41
41
|
const counter = await CounterModel.findByIdAndUpdate(`invoiceNumber_${year}`, { $inc: { seq: 1 } }, { new: true, upsert: true });
|
|
@@ -3,7 +3,10 @@ export declare function createMyUpdatesController({ dashboard, audience, ownerKe
|
|
|
3
3
|
audience: string;
|
|
4
4
|
ownerKey: string;
|
|
5
5
|
sse: {
|
|
6
|
-
addClient: (res: any
|
|
6
|
+
addClient: (res: any, who?: {
|
|
7
|
+
userId?: unknown;
|
|
8
|
+
ownerId?: unknown;
|
|
9
|
+
}) => void;
|
|
7
10
|
removeClient: (res: any) => void;
|
|
8
11
|
};
|
|
9
12
|
}): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"myUpdates.d.ts","sourceRoot":"","sources":["../../src/helpers/myUpdates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"myUpdates.d.ts","sourceRoot":"","sources":["../../src/helpers/myUpdates.ts"],"names":[],"mappings":"AAaA,wBAAgB,yBAAyB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE;QAAE,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,OAAO,CAAC;YAAC,OAAO,CAAC,EAAE,OAAO,CAAA;SAAE,KAAK,IAAI,CAAC;QAAC,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;KAAE,CAAC;CACzH;;;;;yBA2D6B,GAAG,OAAO,GAAG;EAyB1C"}
|
|
@@ -9,7 +9,8 @@ exports.createMyUpdatesController = createMyUpdatesController;
|
|
|
9
9
|
* read by link, and the live "something changed" stream. Shared by the Client and Partner backends:
|
|
10
10
|
* module.exports = createMyUpdatesController({ dashboard: "client", audience: "company", ownerKey: "companyId", sse });
|
|
11
11
|
* module.exports = createMyUpdatesController({ dashboard: "partner", audience: "partner", ownerKey: "partnerId", sse });
|
|
12
|
-
* `sse` is the backend's own stream service ({ addClient(res), removeClient(res) })
|
|
12
|
+
* `sse` is the backend's own stream service ({ addClient(res, who), removeClient(res) }) -- see createPortalLive,
|
|
13
|
+
* which uses `who` to send each event only to the account or person it concerns.
|
|
13
14
|
*/
|
|
14
15
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
15
16
|
const update_model_1 = require("../models/update.model");
|
|
@@ -67,7 +68,7 @@ function createMyUpdatesController({ dashboard, audience, ownerKey, sse }) {
|
|
|
67
68
|
const result = await UpdateModel.updateMany({ ...myUpdatesQuery(req.user._id, req.user.owner), link, readBy: { $ne: req.user._id } }, { $addToSet: { readBy: req.user._id } });
|
|
68
69
|
res.status(_http_1.HTTP.OK).json({ success: true, data: { marked: result.modifiedCount || 0 } });
|
|
69
70
|
});
|
|
70
|
-
//
|
|
71
|
+
// Bare "something changed" signals; the page reacts by reloading its own feed or list.
|
|
71
72
|
const streamUpdates = (req, res) => {
|
|
72
73
|
res.writeHead(_http_1.HTTP.OK, {
|
|
73
74
|
"Content-Type": "text/event-stream",
|
|
@@ -76,7 +77,7 @@ function createMyUpdatesController({ dashboard, audience, ownerKey, sse }) {
|
|
|
76
77
|
"X-Accel-Buffering": "no",
|
|
77
78
|
});
|
|
78
79
|
res.write("\n");
|
|
79
|
-
sse.addClient(res);
|
|
80
|
+
sse.addClient(res, { userId: req.user._id, ownerId: req.user.owner });
|
|
80
81
|
const heartbeat = setInterval(() => {
|
|
81
82
|
try {
|
|
82
83
|
res.write(": ping\n\n");
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createOwnActivityController = createOwnActivityController;
|
|
7
7
|
/**
|
|
8
|
-
* A portal's own Activity log: everything done on its account, by its own users and by
|
|
8
|
+
* A portal's own Activity log: everything done on its account, by its own users and by ORBITXPRO staff (HIPAA: an
|
|
9
9
|
* account must be able to see everyone who touched its data). Shown only after Ops turns on the account's access
|
|
10
10
|
* (activityLogAccess). Shared by the Client and Partner backends:
|
|
11
11
|
* createOwnActivityController({ kind: "client" }) // Company accounts, logs filed under `company`
|
|
@@ -39,7 +39,7 @@ function createOwnActivityController({ kind }) {
|
|
|
39
39
|
const listActivity = (0, _http_1.catchAsync)(async (req, res, next) => {
|
|
40
40
|
const account = await Account.findById(accountIdOf(req)).select("activityLogAccess").lean();
|
|
41
41
|
if (!(account === null || account === void 0 ? void 0 : account.activityLogAccess)) {
|
|
42
|
-
return next(new errors_1.AppError("Your Activity log isn't turned on. Please ask
|
|
42
|
+
return next(new errors_1.AppError("Your Activity log isn't turned on. Please ask ORBITXPRO support to turn it on.", _http_1.HTTP.FORBIDDEN));
|
|
43
43
|
}
|
|
44
44
|
const q = req.query;
|
|
45
45
|
const page = Math.max(1, Number(q.page) || 1);
|
|
@@ -78,12 +78,12 @@ function createOwnActivityController({ kind }) {
|
|
|
78
78
|
.lean(),
|
|
79
79
|
ActivityLogModel.countDocuments(filter),
|
|
80
80
|
]);
|
|
81
|
-
//
|
|
81
|
+
// ORBITXPRO staff show by name and team; their work email and network address stay internal.
|
|
82
82
|
const items = rows.map((r) => {
|
|
83
83
|
var _a, _b, _c;
|
|
84
84
|
return ((_a = r.actor) === null || _a === void 0 ? void 0 : _a.kind) === kind
|
|
85
85
|
? r
|
|
86
|
-
: { ...r, actor: { kind: (_b = r.actor) === null || _b === void 0 ? void 0 : _b.kind, name: ((_c = r.actor) === null || _c === void 0 ? void 0 : _c.name) || "
|
|
86
|
+
: { ...r, actor: { kind: (_b = r.actor) === null || _b === void 0 ? void 0 : _b.kind, name: ((_c = r.actor) === null || _c === void 0 ? void 0 : _c.name) || "ORBITXPRO", team: "ORBITXPRO" }, ip: undefined };
|
|
87
87
|
});
|
|
88
88
|
res.status(_http_1.HTTP.OK).json({
|
|
89
89
|
success: true,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface PortalLiveSource {
|
|
2
|
+
/** The name a page listens for, e.g. "tickets". */
|
|
3
|
+
source: string;
|
|
4
|
+
Model: any;
|
|
5
|
+
/** The account (company or partner id) a document belongs to. Null/undefined = not one of this dashboard's. */
|
|
6
|
+
ownerOf: (doc: any) => unknown;
|
|
7
|
+
/** Fields this dashboard never shows: an update that touches nothing else stays silent. */
|
|
8
|
+
hiddenFields?: string[];
|
|
9
|
+
/** For a busy collection (chats): only an update that sets one of these top-level fields is read at all. */
|
|
10
|
+
watchFields?: string[];
|
|
11
|
+
/** For a record with a conversation ("ticket", "request"): a new message also sends a `thread` event. */
|
|
12
|
+
threadKind?: string;
|
|
13
|
+
/** Messages this dashboard never shows (an internal note): they send nothing. */
|
|
14
|
+
messageHidden?: (message: any) => boolean;
|
|
15
|
+
}
|
|
16
|
+
type Who = {
|
|
17
|
+
userId?: unknown;
|
|
18
|
+
ownerId?: unknown;
|
|
19
|
+
};
|
|
20
|
+
export declare function createPortalLive({ dashboard, audience, ownerKey, sources }: {
|
|
21
|
+
dashboard: string;
|
|
22
|
+
audience: string;
|
|
23
|
+
ownerKey: string;
|
|
24
|
+
sources: PortalLiveSource[];
|
|
25
|
+
}): {
|
|
26
|
+
addClient: (res: any, who?: Who) => void;
|
|
27
|
+
removeClient: (res: any) => void;
|
|
28
|
+
start: () => void;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=portalLive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portalLive.d.ts","sourceRoot":"","sources":["../../src/helpers/portalLive.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,+GAA+G;IAC/G,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;IAC/B,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,4GAA4G;IAC5G,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,yGAAyG;IACzG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;CAC3C;AAED,KAAK,GAAG,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAQnD,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;qBAGyB,GAAG,QAAO,GAAG;wBAGV,GAAG;;EAoJ/B"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createPortalLive = createPortalLive;
|
|
7
|
+
/**
|
|
8
|
+
* Live pushes for the Client and Partner dashboards, sent over the Updates stream each one already keeps open
|
|
9
|
+
* (Server-Sent Events). It watches the database itself, so it does not matter which service made a change: an
|
|
10
|
+
* Ops reply on a ticket reaches the client's open page the same way their own reply does.
|
|
11
|
+
*
|
|
12
|
+
* Every event is a bare signal, sent only to people signed in to the account the record belongs to:
|
|
13
|
+
* update {} the Updates feed and its badges changed
|
|
14
|
+
* listing { source } one of the account's lists changed ("tickets", "leads", ...)
|
|
15
|
+
* thread { kind, id } a message they can see landed on one ticket / request
|
|
16
|
+
* The page reacts by calling the endpoint it always used, so what a person may see is still decided there.
|
|
17
|
+
*
|
|
18
|
+
* const live = createPortalLive({ dashboard: "client", audience: "company", ownerKey: "companyId", sources: [...] });
|
|
19
|
+
* live.start(); // once, at boot
|
|
20
|
+
* createMyUpdatesController({ dashboard, audience, ownerKey, sse: live });
|
|
21
|
+
*/
|
|
22
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
23
|
+
const update_model_1 = require("../models/update.model");
|
|
24
|
+
const FIRST_DELAY_MS = 150;
|
|
25
|
+
const MIN_GAP_MS = 1000; // at most about one list refresh a second per account and list
|
|
26
|
+
const same = (a, b) => a != null && b != null && String(a) === String(b);
|
|
27
|
+
const under = (field, name) => field === name || field.startsWith(`${name}.`);
|
|
28
|
+
function createPortalLive({ dashboard, audience, ownerKey, sources }) {
|
|
29
|
+
const clients = new Map();
|
|
30
|
+
const addClient = (res, who = {}) => {
|
|
31
|
+
clients.set(res, who);
|
|
32
|
+
};
|
|
33
|
+
const removeClient = (res) => {
|
|
34
|
+
clients.delete(res);
|
|
35
|
+
};
|
|
36
|
+
const write = (res, event, data) => {
|
|
37
|
+
try {
|
|
38
|
+
res.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
clients.delete(res);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const sendWhere = (matches, event, data) => {
|
|
45
|
+
for (const [res, who] of clients)
|
|
46
|
+
if (matches(who))
|
|
47
|
+
write(res, event, data);
|
|
48
|
+
};
|
|
49
|
+
const anyoneFrom = (ownerId) => {
|
|
50
|
+
for (const who of clients.values())
|
|
51
|
+
if (same(who.ownerId, ownerId))
|
|
52
|
+
return true;
|
|
53
|
+
return false;
|
|
54
|
+
};
|
|
55
|
+
// A burst of changes to one list becomes one refresh.
|
|
56
|
+
const waiting = new Map();
|
|
57
|
+
const lastSent = new Map();
|
|
58
|
+
const pingListing = (ownerId, source) => {
|
|
59
|
+
const key = `${String(ownerId)}:${source}`;
|
|
60
|
+
if (waiting.has(key))
|
|
61
|
+
return;
|
|
62
|
+
const wait = Math.max(FIRST_DELAY_MS, MIN_GAP_MS - (Date.now() - (lastSent.get(key) || 0)));
|
|
63
|
+
waiting.set(key, setTimeout(() => {
|
|
64
|
+
waiting.delete(key);
|
|
65
|
+
if (!anyoneFrom(ownerId)) {
|
|
66
|
+
lastSent.delete(key);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
lastSent.set(key, Date.now());
|
|
70
|
+
sendWhere((who) => same(who.ownerId, ownerId), "listing", { source });
|
|
71
|
+
}, wait));
|
|
72
|
+
};
|
|
73
|
+
const onRecordChange = (src, change) => {
|
|
74
|
+
const doc = change.fullDocument;
|
|
75
|
+
if (!doc)
|
|
76
|
+
return; // a delete, or gone before it could be read: the next load shows it
|
|
77
|
+
const ownerId = src.ownerOf(doc);
|
|
78
|
+
if (ownerId == null || !anyoneFrom(ownerId))
|
|
79
|
+
return;
|
|
80
|
+
let listChanged = change.operationType !== "update";
|
|
81
|
+
let messageLanded = false;
|
|
82
|
+
if (change.operationType === "update") {
|
|
83
|
+
const description = change.updateDescription || {};
|
|
84
|
+
const touched = Object.keys(description.updatedFields || {}).concat(description.removedFields || []);
|
|
85
|
+
for (const field of touched) {
|
|
86
|
+
if (field === "updatedAt" || (src.hiddenFields || []).some((hidden) => under(field, hidden)))
|
|
87
|
+
continue;
|
|
88
|
+
if (src.threadKind && under(field, "messages")) {
|
|
89
|
+
// "messages.4" is one added message; anything else (the whole array rewritten) counts as visible.
|
|
90
|
+
const index = /^messages\.(\d+)$/.exec(field);
|
|
91
|
+
const message = index ? (doc.messages || [])[Number(index[1])] : null;
|
|
92
|
+
if (message && src.messageHidden && src.messageHidden(message))
|
|
93
|
+
continue;
|
|
94
|
+
messageLanded = true;
|
|
95
|
+
}
|
|
96
|
+
listChanged = true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (listChanged)
|
|
100
|
+
pingListing(ownerId, src.source);
|
|
101
|
+
if (messageLanded)
|
|
102
|
+
sendWhere((who) => same(who.ownerId, ownerId), "thread", { kind: src.threadKind, id: String(doc._id) });
|
|
103
|
+
};
|
|
104
|
+
// An Update is aimed at everyone on this dashboard, one account, or one person.
|
|
105
|
+
const onUpdateCreated = (change) => {
|
|
106
|
+
const doc = change.fullDocument;
|
|
107
|
+
if (!doc || doc.dashboard !== dashboard)
|
|
108
|
+
return;
|
|
109
|
+
if (doc.audience === "broadcast")
|
|
110
|
+
sendWhere(() => true, "update", {});
|
|
111
|
+
else if (doc.audience === audience)
|
|
112
|
+
sendWhere((who) => same(who.ownerId, doc[ownerKey]), "update", {});
|
|
113
|
+
else if (doc.audience === "user")
|
|
114
|
+
sendWhere((who) => same(who.userId, doc.userId), "update", {});
|
|
115
|
+
};
|
|
116
|
+
// Nothing thrown here may reach the process: a stream error is logged and the stream reopened.
|
|
117
|
+
const watch = (name, Model, pipeline, options, onChange) => {
|
|
118
|
+
let retryMs = 2000;
|
|
119
|
+
let stream = null;
|
|
120
|
+
let reopening = false;
|
|
121
|
+
const reopen = (why) => {
|
|
122
|
+
if (reopening)
|
|
123
|
+
return;
|
|
124
|
+
reopening = true;
|
|
125
|
+
try {
|
|
126
|
+
if (stream)
|
|
127
|
+
stream.close().catch(() => { });
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
/* already closed */
|
|
131
|
+
}
|
|
132
|
+
console.error(`[portalLive:${dashboard}] ${name} stream stopped (${why}); reopening in ${retryMs}ms`);
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
reopening = false;
|
|
135
|
+
open();
|
|
136
|
+
}, retryMs).unref();
|
|
137
|
+
retryMs = Math.min(retryMs * 2, 60000);
|
|
138
|
+
};
|
|
139
|
+
const open = () => {
|
|
140
|
+
try {
|
|
141
|
+
stream = Model.watch(pipeline, options);
|
|
142
|
+
stream.on("change", (change) => {
|
|
143
|
+
retryMs = 2000;
|
|
144
|
+
try {
|
|
145
|
+
onChange(change);
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
console.error(`[portalLive:${dashboard}] ${name} change ignored:`, (err === null || err === void 0 ? void 0 : err.message) || err);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
stream.on("error", (err) => reopen((err === null || err === void 0 ? void 0 : err.message) || "error"));
|
|
152
|
+
stream.on("close", () => reopen("closed"));
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
reopen((err === null || err === void 0 ? void 0 : err.message) || "could not open");
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
open();
|
|
159
|
+
};
|
|
160
|
+
let started = false;
|
|
161
|
+
/** Starts watching once the database is connected. Safe to call more than once. */
|
|
162
|
+
const start = () => {
|
|
163
|
+
if (started)
|
|
164
|
+
return;
|
|
165
|
+
started = true;
|
|
166
|
+
const begin = () => {
|
|
167
|
+
watch("updates", update_model_1.Update, [{ $match: { operationType: "insert", "fullDocument.dashboard": dashboard } }], {}, onUpdateCreated);
|
|
168
|
+
for (const src of sources) {
|
|
169
|
+
const match = src.watchFields
|
|
170
|
+
? {
|
|
171
|
+
$or: [
|
|
172
|
+
{ operationType: { $in: ["insert", "replace"] } },
|
|
173
|
+
{
|
|
174
|
+
operationType: "update",
|
|
175
|
+
$or: src.watchFields.map((field) => ({ [`updateDescription.updatedFields.${field}`]: { $exists: true } })),
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
}
|
|
179
|
+
: { operationType: { $in: ["insert", "update", "replace"] } };
|
|
180
|
+
watch(src.source, src.Model, [{ $match: match }], { fullDocument: "updateLookup" }, (change) => onRecordChange(src, change));
|
|
181
|
+
}
|
|
182
|
+
console.log(`[portalLive:${dashboard}] watching updates, ${sources.map((s) => s.source).join(", ")}`);
|
|
183
|
+
};
|
|
184
|
+
if (mongoose_1.default.connection.readyState === 1)
|
|
185
|
+
begin();
|
|
186
|
+
else
|
|
187
|
+
mongoose_1.default.connection.once("open", begin);
|
|
188
|
+
};
|
|
189
|
+
return { addClient, removeClient, start };
|
|
190
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const DEFAULT_RETAINER_PRICE_CENTS = 4999;
|
|
2
|
+
/** Where a retainer's charge stands, read from the ledger itself (so a change made in the Ledger tab shows too). */
|
|
3
|
+
export type RetainerChargeState = "none" | "unbilled" | "invoiced" | "removed" | "credited";
|
|
4
|
+
/** What this company pays for each signed retainer: its own price if Ops set one, otherwise the standard price. */
|
|
5
|
+
export declare function retainerPriceFor(companyId: unknown): Promise<number>;
|
|
6
|
+
/**
|
|
7
|
+
* Called when a retainer has just been signed: marks it "pending confirmation" and puts its charge on the ledger.
|
|
8
|
+
* Safe to call more than once -- only the first call writes the charge. Returns what happened; it never throws
|
|
9
|
+
* for a company with no subscription (the retainer is still signed, just not charged).
|
|
10
|
+
*/
|
|
11
|
+
export declare function chargeSignedRetainer(retainerObjectId: unknown): Promise<{
|
|
12
|
+
charged: boolean;
|
|
13
|
+
reason?: string;
|
|
14
|
+
}>;
|
|
15
|
+
/** Where this retainer's charge stands (see RetainerChargeState). Pass the lean retainer. */
|
|
16
|
+
export declare function retainerCharge(retainer: any): Promise<{
|
|
17
|
+
state: RetainerChargeState;
|
|
18
|
+
price: number | null;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Takes a rejected retainer's charge back: off the ledger if it has not been invoiced yet, otherwise a credit for
|
|
22
|
+
* the same amount on the next invoice. Does nothing when there is no charge, or it was already taken back.
|
|
23
|
+
*/
|
|
24
|
+
export declare function reverseRetainerCharge(retainer: any, { reason, userId }: {
|
|
25
|
+
reason: string;
|
|
26
|
+
userId?: unknown;
|
|
27
|
+
}): Promise<RetainerChargeState>;
|
|
28
|
+
/** A signed retainer with no decision yet reads as pending, including ones signed before this check existed. */
|
|
29
|
+
export declare const retainerConfirmationStatus: (retainer: any) => "pending" | "confirmed" | "rejected" | null;
|
|
30
|
+
//# sourceMappingURL=retainerBilling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retainerBilling.d.ts","sourceRoot":"","sources":["../../src/helpers/retainerBilling.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,oHAAoH;AACpH,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,UAAU,GACV,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAOf,mHAAmH;AACnH,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAI1E;AAWD;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAsCpH;AAID,6FAA6F;AAC7F,wBAAsB,cAAc,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,mBAAmB,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CASjH;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA+BjJ;AAED,gHAAgH;AAChH,eAAO,MAAM,0BAA0B,GAAI,UAAU,GAAG,KAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,IACf,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.retainerConfirmationStatus = exports.DEFAULT_RETAINER_PRICE_CENTS = void 0;
|
|
4
|
+
exports.retainerPriceFor = retainerPriceFor;
|
|
5
|
+
exports.chargeSignedRetainer = chargeSignedRetainer;
|
|
6
|
+
exports.retainerCharge = retainerCharge;
|
|
7
|
+
exports.reverseRetainerCharge = reverseRetainerCharge;
|
|
8
|
+
/**
|
|
9
|
+
* Billing for signed retainers. A retainer is charged the moment it is signed: one "add" entry goes on the
|
|
10
|
+
* company's ledger and is invoiced with the rest of that month. Ops then confirms the retainer or rejects it; a
|
|
11
|
+
* rejection takes the charge back by itself. Used by the Employee backend (signing) and the Ops backend
|
|
12
|
+
* (confirm / reject), so both follow the same rules. The price is one setting per company; a retainer keeps the
|
|
13
|
+
* price it was signed at.
|
|
14
|
+
*
|
|
15
|
+
* Amounts are in cents, like every ledger entry.
|
|
16
|
+
*/
|
|
17
|
+
const retainer_model_1 = require("../models/retainer.model");
|
|
18
|
+
const leadLedger_model_1 = require("../models/leadLedger.model");
|
|
19
|
+
const subscription_model_1 = require("../models/subscription.model");
|
|
20
|
+
const companySettings_model_1 = require("../models/companySettings.model");
|
|
21
|
+
exports.DEFAULT_RETAINER_PRICE_CENTS = 4999;
|
|
22
|
+
const RetainerModel = retainer_model_1.Retainer;
|
|
23
|
+
const LedgerModel = leadLedger_model_1.LeadLedger;
|
|
24
|
+
const SubscriptionModel = subscription_model_1.Subscription;
|
|
25
|
+
const SettingsModel = companySettings_model_1.CompanySettings;
|
|
26
|
+
/** What this company pays for each signed retainer: its own price if Ops set one, otherwise the standard price. */
|
|
27
|
+
async function retainerPriceFor(companyId) {
|
|
28
|
+
var _a;
|
|
29
|
+
const doc = await SettingsModel.findOne({ company: companyId }).select("retainerConfig.pricePerRetainer").lean();
|
|
30
|
+
const price = (_a = doc === null || doc === void 0 ? void 0 : doc.retainerConfig) === null || _a === void 0 ? void 0 : _a.pricePerRetainer;
|
|
31
|
+
return typeof price === "number" && price >= 0 ? price : exports.DEFAULT_RETAINER_PRICE_CENTS;
|
|
32
|
+
}
|
|
33
|
+
// The subscription a manual ledger charge goes on: a billable one first, otherwise the company's latest
|
|
34
|
+
// (e.g. still on its trial) -- the same rule as Ops' "Add Charge".
|
|
35
|
+
async function ledgerSubscription(companyId) {
|
|
36
|
+
return ((await SubscriptionModel.findOne({ company: companyId, status: { $in: ["active", "grace_period", "overdue"] } }).lean()) ||
|
|
37
|
+
(await SubscriptionModel.findOne({ company: companyId, status: { $ne: "cancelled" } }).sort({ createdAt: -1 }).lean()));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Called when a retainer has just been signed: marks it "pending confirmation" and puts its charge on the ledger.
|
|
41
|
+
* Safe to call more than once -- only the first call writes the charge. Returns what happened; it never throws
|
|
42
|
+
* for a company with no subscription (the retainer is still signed, just not charged).
|
|
43
|
+
*/
|
|
44
|
+
async function chargeSignedRetainer(retainerObjectId) {
|
|
45
|
+
var _a;
|
|
46
|
+
// Whoever sets chargeClaimedAt first is the one writer.
|
|
47
|
+
const retainer = await RetainerModel.findOneAndUpdate({ _id: retainerObjectId, status: "signed", chargeClaimedAt: { $exists: false } }, { $set: { chargeClaimedAt: new Date() } }, { new: true }).lean();
|
|
48
|
+
if (!retainer)
|
|
49
|
+
return { charged: false, reason: "already handled" };
|
|
50
|
+
if (!((_a = retainer.confirmation) === null || _a === void 0 ? void 0 : _a.status)) {
|
|
51
|
+
await RetainerModel.updateOne({ _id: retainer._id, "confirmation.status": { $exists: false } }, { $set: { "confirmation.status": "pending" } });
|
|
52
|
+
}
|
|
53
|
+
const price = await retainerPriceFor(retainer.company);
|
|
54
|
+
const subscription = await ledgerSubscription(retainer.company);
|
|
55
|
+
if (!subscription) {
|
|
56
|
+
await RetainerModel.updateOne({ _id: retainer._id }, { $set: { price } });
|
|
57
|
+
return { charged: false, reason: "no subscription" };
|
|
58
|
+
}
|
|
59
|
+
if (price <= 0) {
|
|
60
|
+
await RetainerModel.updateOne({ _id: retainer._id }, { $set: { price } });
|
|
61
|
+
return { charged: false, reason: "price is zero" };
|
|
62
|
+
}
|
|
63
|
+
const entry = await LedgerModel.create({
|
|
64
|
+
companyId: retainer.company,
|
|
65
|
+
subscriptionId: subscription._id,
|
|
66
|
+
retainerId: retainer._id,
|
|
67
|
+
type: "add",
|
|
68
|
+
status: "active",
|
|
69
|
+
unitPrice: price,
|
|
70
|
+
quantity: 1,
|
|
71
|
+
billingPeriodStart: subscription.startDate,
|
|
72
|
+
billingPeriodEnd: subscription.renewalDate,
|
|
73
|
+
note: `Signed retainer ${retainer.retainerId}`,
|
|
74
|
+
});
|
|
75
|
+
await RetainerModel.updateOne({ _id: retainer._id }, { $set: { price, ledgerEntry: entry._id } });
|
|
76
|
+
return { charged: true };
|
|
77
|
+
}
|
|
78
|
+
const onInvoice = (entry) => !!(entry === null || entry === void 0 ? void 0 : entry.invoiceId) || (entry === null || entry === void 0 ? void 0 : entry.status) === "invoiced";
|
|
79
|
+
/** Where this retainer's charge stands (see RetainerChargeState). Pass the lean retainer. */
|
|
80
|
+
async function retainerCharge(retainer) {
|
|
81
|
+
const price = typeof (retainer === null || retainer === void 0 ? void 0 : retainer.price) === "number" ? retainer.price : null;
|
|
82
|
+
if (!(retainer === null || retainer === void 0 ? void 0 : retainer.ledgerEntry))
|
|
83
|
+
return { state: "none", price };
|
|
84
|
+
const entry = await LedgerModel.findById(retainer.ledgerEntry).select("status invoiceId unitPrice").lean();
|
|
85
|
+
if (!entry)
|
|
86
|
+
return { state: "none", price };
|
|
87
|
+
if (retainer.creditEntry)
|
|
88
|
+
return { state: "credited", price: entry.unitPrice };
|
|
89
|
+
if (entry.status === "discarded")
|
|
90
|
+
return { state: "removed", price: entry.unitPrice };
|
|
91
|
+
if (onInvoice(entry))
|
|
92
|
+
return { state: "invoiced", price: entry.unitPrice };
|
|
93
|
+
return { state: "unbilled", price: entry.unitPrice };
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Takes a rejected retainer's charge back: off the ledger if it has not been invoiced yet, otherwise a credit for
|
|
97
|
+
* the same amount on the next invoice. Does nothing when there is no charge, or it was already taken back.
|
|
98
|
+
*/
|
|
99
|
+
async function reverseRetainerCharge(retainer, { reason, userId }) {
|
|
100
|
+
if (!(retainer === null || retainer === void 0 ? void 0 : retainer.ledgerEntry))
|
|
101
|
+
return "none";
|
|
102
|
+
if (retainer.creditEntry)
|
|
103
|
+
return "credited";
|
|
104
|
+
const entry = await LedgerModel.findById(retainer.ledgerEntry).lean();
|
|
105
|
+
if (!entry)
|
|
106
|
+
return "none";
|
|
107
|
+
if (entry.status === "discarded")
|
|
108
|
+
return "removed";
|
|
109
|
+
if (!onInvoice(entry)) {
|
|
110
|
+
const removed = await LedgerModel.findOneAndUpdate({ _id: entry._id, status: "active", invoiceId: null }, { $set: { status: "discarded", discardedAt: new Date(), discardReason: `Retainer ${retainer.retainerId} rejected: ${reason}`, discardedBy: userId } }).lean();
|
|
111
|
+
if (removed)
|
|
112
|
+
return "removed";
|
|
113
|
+
// It went onto an invoice between the two reads: fall through to a credit.
|
|
114
|
+
}
|
|
115
|
+
const credit = await LedgerModel.create({
|
|
116
|
+
companyId: entry.companyId,
|
|
117
|
+
subscriptionId: entry.subscriptionId,
|
|
118
|
+
retainerId: retainer._id,
|
|
119
|
+
type: "deduct",
|
|
120
|
+
status: "active",
|
|
121
|
+
unitPrice: entry.unitPrice,
|
|
122
|
+
quantity: entry.quantity || 1,
|
|
123
|
+
billingPeriodStart: entry.billingPeriodStart,
|
|
124
|
+
billingPeriodEnd: entry.billingPeriodEnd,
|
|
125
|
+
note: `Credit: retainer ${retainer.retainerId} rejected`,
|
|
126
|
+
createdBy: userId,
|
|
127
|
+
});
|
|
128
|
+
await RetainerModel.updateOne({ _id: retainer._id }, { $set: { creditEntry: credit._id } });
|
|
129
|
+
return "credited";
|
|
130
|
+
}
|
|
131
|
+
/** A signed retainer with no decision yet reads as pending, including ones signed before this check existed. */
|
|
132
|
+
const retainerConfirmationStatus = (retainer) => { var _a; return (retainer === null || retainer === void 0 ? void 0 : retainer.status) === "signed" ? ((_a = retainer.confirmation) === null || _a === void 0 ? void 0 : _a.status) || "pending" : null; };
|
|
133
|
+
exports.retainerConfirmationStatus = retainerConfirmationStatus;
|
package/dist/index.d.ts
CHANGED
|
@@ -116,6 +116,8 @@ export * from "./helpers/privateFiles";
|
|
|
116
116
|
export * from "./helpers/emailTemplates";
|
|
117
117
|
export * from "./helpers/avatars";
|
|
118
118
|
export * from "./helpers/myUpdates";
|
|
119
|
+
export * from "./helpers/portalLive";
|
|
120
|
+
export * from "./helpers/retainerBilling";
|
|
119
121
|
export * from "./helpers/ownActivity";
|
|
120
122
|
export * from "./helpers/sessions";
|
|
121
123
|
export { normalizeIp, isPrivateIp, requestLocation, describeDevice, cleanDeviceName } from "./helpers/requestInfo";
|
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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c,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -186,6 +186,8 @@ __exportStar(require("./helpers/privateFiles"), exports);
|
|
|
186
186
|
__exportStar(require("./helpers/emailTemplates"), exports);
|
|
187
187
|
__exportStar(require("./helpers/avatars"), exports);
|
|
188
188
|
__exportStar(require("./helpers/myUpdates"), exports);
|
|
189
|
+
__exportStar(require("./helpers/portalLive"), exports);
|
|
190
|
+
__exportStar(require("./helpers/retainerBilling"), exports);
|
|
189
191
|
__exportStar(require("./helpers/ownActivity"), exports);
|
|
190
192
|
__exportStar(require("./helpers/sessions"), exports);
|
|
191
193
|
var requestInfo_1 = require("./helpers/requestInfo");
|
|
@@ -32,7 +32,9 @@ export interface IAuditTask extends Document {
|
|
|
32
32
|
/** The auditor's decision on one lead. */
|
|
33
33
|
export type LeadAuditDecision = "correct" | "resend";
|
|
34
34
|
/** The Ops reviewer's answer to a resend request ("sending" only while the lead is being sent). */
|
|
35
|
-
export type LeadAuditReviewStatus = "pending" | "sending" | "declined" | "sent";
|
|
35
|
+
export type LeadAuditReviewStatus = "pending" | "sending" | "declined" | "sent" | "disputed";
|
|
36
|
+
/** How a dispute was settled. "upheld" is final -- the auditor can't dispute it again. */
|
|
37
|
+
export type LeadAuditDisputeResolution = "upheld" | "overturned";
|
|
36
38
|
export interface ILeadAudit {
|
|
37
39
|
/** assigned: in an open task, no decision yet. audited: decided. Missing = Not Assigned. */
|
|
38
40
|
status?: "assigned" | "audited";
|
|
@@ -51,6 +53,21 @@ export interface ILeadAudit {
|
|
|
51
53
|
at?: Date;
|
|
52
54
|
/** Required when declining. */
|
|
53
55
|
note?: string;
|
|
56
|
+
/** Set when the auditor challenges a decline (requires the audit.resolveDisputes permission to
|
|
57
|
+
* resolve, separate from audit.resendRequests so the pool of resolvers can differ). */
|
|
58
|
+
dispute?: {
|
|
59
|
+
/** Why the auditor thinks the decline was wrong. Required to raise one. */
|
|
60
|
+
note?: string;
|
|
61
|
+
/** The auditor who raised it. */
|
|
62
|
+
by?: Types.ObjectId;
|
|
63
|
+
at?: Date;
|
|
64
|
+
resolution?: LeadAuditDisputeResolution;
|
|
65
|
+
/** The Ops user who resolved it. */
|
|
66
|
+
resolvedBy?: Types.ObjectId;
|
|
67
|
+
resolvedAt?: Date;
|
|
68
|
+
/** Required when upholding or overturning. */
|
|
69
|
+
resolutionNote?: string;
|
|
70
|
+
};
|
|
54
71
|
};
|
|
55
72
|
/** The lead's type before it was sent as Sales. */
|
|
56
73
|
originalType?: "Sales" | "Service" | "Others";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/audit.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAM3C,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,CAAC;AAE/F,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAC1C,IAAI,EAAE,aAAa,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,oCAAoC;IACpC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC3B,2DAA2D;IAC3D,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,wCAAwC;IACxC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,uEAAuE;IACvE,YAAY,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAChC,mDAAmD;IACnD,OAAO,CAAC,EAAE,KAAK,CAAC,QA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C,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;CAC/C"}
|
|
@@ -27,6 +27,8 @@ export interface IRetainerConfig {
|
|
|
27
27
|
emailSignedCopy?: boolean;
|
|
28
28
|
/** Months the signed files are kept (counted from sending) before permanent deletion. Default 3. */
|
|
29
29
|
retentionMonths?: number;
|
|
30
|
+
/** What this company is charged for each signed retainer, in cents. Unset = the standard price ($49.99). */
|
|
31
|
+
pricePerRetainer?: number;
|
|
30
32
|
}
|
|
31
33
|
export interface ILeadFields {
|
|
32
34
|
visitorName?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companySettings.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/companySettings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,KAAK,EACL,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAM7B,MAAM,WAAW,oBAAoB;IACnC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAMD,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oGAAoG;IACpG,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6HAA6H;IAC7H,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAMD,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oGAAoG;IACpG,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"companySettings.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/companySettings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,KAAK,EACL,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAM7B,MAAM,WAAW,oBAAoB;IACnC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAMD,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oGAAoG;IACpG,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6HAA6H;IAC7H,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAMD,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oGAAoG;IACpG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4GAA4G;IAC5G,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAMD,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CA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jectId;
|
|
4
4
|
subscriptionId: Types.ObjectId;
|
|
5
5
|
leadId?: Types.ObjectId;
|
|
6
|
+
retainerId?: Types.ObjectId;
|
|
6
7
|
invoiceId?: Types.ObjectId;
|
|
7
8
|
type: "lead" | "add" | "deduct";
|
|
8
9
|
status: "active" | "discarded" | "disputed" | "invoiced" | "credited";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadLedger.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/leadLedger.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC/B,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAE3B,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAKhC,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IAOtE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,EAAE,IAAI,CAAC;IACzB,gBAAgB,EAAE,IAAI,CAAC;IAGvB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAG7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAE3B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
1
|
+
{"version":3,"file":"leadLedger.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/leadLedger.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC/B,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAE3B,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAKhC,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IAOtE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,EAAE,IAAI,CAAC;IACzB,gBAAgB,EAAE,IAAI,CAAC;IAGvB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAG7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAE3B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -25,6 +25,12 @@ export interface IRetainerContract extends Document {
|
|
|
25
25
|
updatedAt?: Date;
|
|
26
26
|
}
|
|
27
27
|
export type RetainerStatus = "sent" | "opened" | "started" | "signed" | "declined" | "expired" | "cancelled";
|
|
28
|
+
/**
|
|
29
|
+
* Ops checks every signed retainer by hand: it starts as "pending" the moment it is signed, then Ops confirms
|
|
30
|
+
* it or rejects it with a note. This is separate from billing -- a signed retainer is charged straight away,
|
|
31
|
+
* and a rejection takes that charge back.
|
|
32
|
+
*/
|
|
33
|
+
export type RetainerConfirmationStatus = "pending" | "confirmed" | "rejected";
|
|
28
34
|
export type RetainerDeliveryMode = "chat" | "sms";
|
|
29
35
|
export interface IRetainerFieldValue {
|
|
30
36
|
name: string;
|
|
@@ -73,6 +79,23 @@ export interface IRetainer extends Document {
|
|
|
73
79
|
forwardedAt?: Date;
|
|
74
80
|
forwardedBy?: Types.ObjectId;
|
|
75
81
|
forwardedTo?: string[];
|
|
82
|
+
/** Set when the retainer is signed (see RetainerConfirmationStatus). */
|
|
83
|
+
confirmation?: {
|
|
84
|
+
status: RetainerConfirmationStatus;
|
|
85
|
+
/** The Ops user who confirmed or rejected it. */
|
|
86
|
+
by?: Types.ObjectId;
|
|
87
|
+
at?: Date;
|
|
88
|
+
/** Why it was rejected (required to reject). */
|
|
89
|
+
note?: string;
|
|
90
|
+
};
|
|
91
|
+
/** What the client is charged for this retainer, in cents: the company's price when it was signed. */
|
|
92
|
+
price?: number;
|
|
93
|
+
/** The charge on the company's ledger, written when the retainer is signed. */
|
|
94
|
+
ledgerEntry?: Types.ObjectId;
|
|
95
|
+
/** The credit written when a retainer whose charge was already on an invoice is rejected. */
|
|
96
|
+
creditEntry?: Types.ObjectId;
|
|
97
|
+
/** Set by whichever writer gets to create the charge, so it is only ever created once. */
|
|
98
|
+
chargeClaimedAt?: Date;
|
|
76
99
|
createdAt?: Date;
|
|
77
100
|
updatedAt?: Date;
|
|
78
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retainer.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/retainer.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAQ3C,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE1C,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AAErE,gFAAgF;AAChF,MA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,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,WAAW,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC7B,6FAA6F;IAC7F,WAAW,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC7B,0FAA0F;IAC1F,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tierConfig.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/tierConfig.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,MAAM,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"tierConfig.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/tierConfig.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -13,7 +13,7 @@ export type UpdateDashboard = "ops" | "client" | "partner" | "employee";
|
|
|
13
13
|
* "broadcast" -- everyone on the given dashboard (an announcement with no specific target).
|
|
14
14
|
*/
|
|
15
15
|
export type UpdateAudience = "user" | "company" | "partner" | "broadcast" | "agent";
|
|
16
|
-
export type UpdateType = "ticket_assigned" | "ticket_message" | "ticket_mentioned" | "request_assigned" | "request_message" | "announcement" | "wallet_event" | "new_referral" | "review_status" | "billing_event" | "chat_flagged" | "lead_email" | "audit_assigned" | "audit_reviewed" | "audit_task_changed" | "audit_resend_request";
|
|
16
|
+
export type UpdateType = "ticket_assigned" | "ticket_message" | "ticket_mentioned" | "request_assigned" | "request_message" | "announcement" | "wallet_event" | "new_referral" | "review_status" | "billing_event" | "chat_flagged" | "lead_email" | "audit_assigned" | "audit_reviewed" | "audit_task_changed" | "audit_resend_request" | "audit_dispute";
|
|
17
17
|
export interface IUpdate extends Document {
|
|
18
18
|
dashboard: UpdateDashboard;
|
|
19
19
|
audience: UpdateAudience;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/update.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAEpF,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,gBAAgB,GAMhB,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,cAAc,GACd,eAAe,GAIf,eAAe,GAEf,cAAc,GAEd,YAAY,GAEZ,gBAAgB,GAChB,gBAAgB,GAChB,oBAAoB,GACpB,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"update.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/update.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAA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I,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companySettings.model.d.ts","sourceRoot":"","sources":["../../src/models/companySettings.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAA2B,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,gBAAgB,EASjB,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"companySettings.model.d.ts","sourceRoot":"","sources":["../../src/models/companySettings.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAA2B,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,gBAAgB,EASjB,MAAM,yCAAyC,CAAC;AAyUjD,eAAO,MAAM,eAAe;;;;OAG3B,CAAC;AACF,eAAe,eAAe,CAAC"}
|
|
@@ -178,6 +178,8 @@ const retainerConfigSchema = new mongoose_1.Schema({
|
|
|
178
178
|
oneActivePerChat: { type: Boolean, default: true },
|
|
179
179
|
emailSignedCopy: { type: Boolean, default: true },
|
|
180
180
|
retentionMonths: { type: Number, min: 1, max: 12, default: 3 },
|
|
181
|
+
// What this company is charged for each signed retainer, in cents. Unset = the standard price.
|
|
182
|
+
pricePerRetainer: { type: Number, min: 0 },
|
|
181
183
|
}, { _id: false });
|
|
182
184
|
// ─────────────────────────────────────────────
|
|
183
185
|
// LEAD FIELDS SUB-SCHEMA
|
|
@@ -107,7 +107,7 @@ const invoiceSchema = new mongoose_1.Schema({
|
|
|
107
107
|
required: [true, "Total due is required"],
|
|
108
108
|
min: 0,
|
|
109
109
|
},
|
|
110
|
-
// The number printed on the invoice: "INV-2026-0001", sequential across
|
|
110
|
+
// The number printed on the invoice: "INV-2026-0001", sequential across ORBITXPRO per year.
|
|
111
111
|
invoiceNumber: {
|
|
112
112
|
type: String,
|
|
113
113
|
trim: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lead.model.d.ts","sourceRoot":"","sources":["../../src/models/lead.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAa,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"lead.model.d.ts","sourceRoot":"","sources":["../../src/models/lead.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAa,MAAM,8BAA8B,CAAC;AAuOhE,eAAO,MAAM,IAAI;;;;OAA4C,CAAC;AAC9D,eAAe,IAAI,CAAC"}
|
|
@@ -145,10 +145,20 @@ const leadSchema = new mongoose_1.Schema({
|
|
|
145
145
|
note: { type: String, trim: true, maxlength: 1000 },
|
|
146
146
|
decidedAt: Date,
|
|
147
147
|
review: {
|
|
148
|
-
status: { type: String, enum: ["pending", "sending", "declined", "sent"] },
|
|
148
|
+
status: { type: String, enum: ["pending", "sending", "declined", "sent", "disputed"] },
|
|
149
149
|
by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
150
150
|
at: Date,
|
|
151
151
|
note: { type: String, trim: true, maxlength: 1000 },
|
|
152
|
+
// The auditor challenging a decline. "upheld" is final -- it can't be disputed again.
|
|
153
|
+
dispute: {
|
|
154
|
+
note: { type: String, trim: true, maxlength: 1000 },
|
|
155
|
+
by: { type: mongoose_1.Schema.Types.ObjectId, ref: "Agent" },
|
|
156
|
+
at: Date,
|
|
157
|
+
resolution: { type: String, enum: ["upheld", "overturned"] },
|
|
158
|
+
resolvedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
159
|
+
resolvedAt: Date,
|
|
160
|
+
resolutionNote: { type: String, trim: true, maxlength: 1000 },
|
|
161
|
+
},
|
|
152
162
|
},
|
|
153
163
|
originalType: { type: String, enum: ["Sales", "Service", "Others"] },
|
|
154
164
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadLedger.model.d.ts","sourceRoot":"","sources":["../../src/models/leadLedger.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"leadLedger.model.d.ts","sourceRoot":"","sources":["../../src/models/leadLedger.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAiIjE,eAAO,MAAM,UAAU;;;;OAGtB,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -57,6 +57,11 @@ const leadLedgerSchema = new mongoose_1.Schema({
|
|
|
57
57
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
58
58
|
ref: "Lead",
|
|
59
59
|
},
|
|
60
|
+
// The signed retainer this charge (or its credit) is for -- see helpers/retainerBilling.ts.
|
|
61
|
+
retainerId: {
|
|
62
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
63
|
+
ref: "Retainer",
|
|
64
|
+
},
|
|
60
65
|
invoiceId: {
|
|
61
66
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
62
67
|
ref: "Invoice",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retainer.model.d.ts","sourceRoot":"","sources":["../../src/models/retainer.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"retainer.model.d.ts","sourceRoot":"","sources":["../../src/models/retainer.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAqE7D,eAAO,MAAM,QAAQ;;;;OAAwD,CAAC"}
|
|
@@ -79,6 +79,18 @@ const retainerSchema = new mongoose_1.Schema({
|
|
|
79
79
|
forwardedAt: { type: Date },
|
|
80
80
|
forwardedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
81
81
|
forwardedTo: { type: [String], default: undefined },
|
|
82
|
+
// Ops' own check of a signed retainer: pending until confirmed, or rejected with a note.
|
|
83
|
+
confirmation: {
|
|
84
|
+
status: { type: String, enum: ["pending", "confirmed", "rejected"] },
|
|
85
|
+
by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
86
|
+
at: { type: Date },
|
|
87
|
+
note: { type: String, trim: true, maxlength: 1000 },
|
|
88
|
+
},
|
|
89
|
+
// The charge for a signed retainer (cents) and its ledger entries -- see helpers/retainerBilling.ts.
|
|
90
|
+
price: { type: Number, min: 0 },
|
|
91
|
+
ledgerEntry: { type: mongoose_1.Schema.Types.ObjectId, ref: "LeadLedger" },
|
|
92
|
+
creditEntry: { type: mongoose_1.Schema.Types.ObjectId, ref: "LeadLedger" },
|
|
93
|
+
chargeClaimedAt: { type: Date },
|
|
82
94
|
}, { timestamps: true });
|
|
83
95
|
retainerSchema.index({ company: 1, createdAt: -1 });
|
|
84
96
|
retainerSchema.index({ chat: 1, createdAt: -1 });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.model.d.ts","sourceRoot":"","sources":["../../src/models/update.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,uBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"update.model.d.ts","sourceRoot":"","sources":["../../src/models/update.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,uBAAqB,CAAC;AA+E/C,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
|
|
@@ -85,6 +85,9 @@ const updateSchema = new mongoose_1.Schema({
|
|
|
85
85
|
"audit_reviewed",
|
|
86
86
|
"audit_task_changed",
|
|
87
87
|
"audit_resend_request",
|
|
88
|
+
// Ops only: an auditor disputed a decline (to whoever resolves disputes), and the outcome
|
|
89
|
+
// (to the reviewer who declined). The auditor's own outcome arrives as "audit_reviewed".
|
|
90
|
+
"audit_dispute",
|
|
88
91
|
],
|
|
89
92
|
required: true,
|
|
90
93
|
index: true,
|
|
@@ -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,EAoMnC,CAAC"}
|
|
@@ -195,6 +195,9 @@ exports.opsTree = [
|
|
|
195
195
|
{ key: "audit.analytics", label: "Analytics" },
|
|
196
196
|
{ key: "audit.tasks", label: "Manage Tasks" },
|
|
197
197
|
{ key: "audit.resendRequests", label: "Resend Requests" },
|
|
198
|
+
// Separate from Resend Requests on purpose: when an auditor disputes a decline, the person
|
|
199
|
+
// settling it doesn't have to be drawn from the same pool as whoever can decline one.
|
|
200
|
+
{ key: "audit.resolveDisputes", label: "Resolve Disputes" },
|
|
198
201
|
],
|
|
199
202
|
},
|
|
200
203
|
{ key: "settings", label: "Settings" },
|