@mj-biz-apps/sales-server 6.9.0 → 6.9.1
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/custom/won-deal-order-detector.action.d.ts +18 -0
- package/dist/custom/won-deal-order-detector.action.d.ts.map +1 -0
- package/dist/custom/won-deal-order-detector.action.js +71 -0
- package/dist/custom/won-deal-order-detector.action.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `Sales.DetectWonDealsWithUnconfirmedOrders` — the nightly finance exception check for
|
|
3
|
+
* won deals whose order was never confirmed (golive #279, type 3).
|
|
4
|
+
*
|
|
5
|
+
* Call the detector, report tallies as outputs, never throw at the caller. A refused raise is a failed
|
|
6
|
+
* run, so the job log shows it rather than a green night with nothing written.
|
|
7
|
+
*
|
|
8
|
+
* @module @mj-biz-apps/sales-server
|
|
9
|
+
*/
|
|
10
|
+
import { BaseAction } from '@memberjunction/actions';
|
|
11
|
+
import type { ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
12
|
+
export declare class DetectWonDealsWithUnconfirmedOrdersAction extends BaseAction {
|
|
13
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
14
|
+
private detect;
|
|
15
|
+
}
|
|
16
|
+
/** Anti-tree-shaking anchor — `@RegisterClass` is a side effect of import. */
|
|
17
|
+
export declare function LoadDetectWonDealsWithUnconfirmedOrdersAction(): void;
|
|
18
|
+
//# sourceMappingURL=won-deal-order-detector.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"won-deal-order-detector.action.d.ts","sourceRoot":"","sources":["../../src/custom/won-deal-order-detector.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAe,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA0BrG,qBACa,yCAA0C,SAAQ,UAAU;cACrD,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;YAYzE,MAAM;CAgBvB;AAED,8EAA8E;AAC9E,wBAAgB,6CAA6C,IAAI,IAAI,CAEpE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview `Sales.DetectWonDealsWithUnconfirmedOrders` — the nightly finance exception check for
|
|
9
|
+
* won deals whose order was never confirmed (golive #279, type 3).
|
|
10
|
+
*
|
|
11
|
+
* Call the detector, report tallies as outputs, never throw at the caller. A refused raise is a failed
|
|
12
|
+
* run, so the job log shows it rather than a green night with nothing written.
|
|
13
|
+
*
|
|
14
|
+
* @module @mj-biz-apps/sales-server
|
|
15
|
+
*/
|
|
16
|
+
import { BaseAction } from '@memberjunction/actions';
|
|
17
|
+
import { Metadata } from '@memberjunction/core';
|
|
18
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
19
|
+
import { DetectWonDealsWithUnconfirmedOrders, } from '@mj-biz-apps/sales-core-entities-server';
|
|
20
|
+
function setOutput(params, name, value) {
|
|
21
|
+
const existing = params.Params?.find((p) => p.Name?.toLowerCase() === name.toLowerCase());
|
|
22
|
+
if (existing) {
|
|
23
|
+
existing.Value = value;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
params.Params = params.Params ?? [];
|
|
27
|
+
params.Params.push({ Name: name, Value: value, Type: 'Output' });
|
|
28
|
+
}
|
|
29
|
+
function describe(result) {
|
|
30
|
+
const tallies = `Found ${result.Found} won deal(s) with an unconfirmed order: created ${result.Created}, `
|
|
31
|
+
+ `already raised ${result.AlreadyRaised}, skipped by accounting ${result.SkippedByAccounting}, `
|
|
32
|
+
+ `creator unresolved ${result.CreatorUnresolved}.`;
|
|
33
|
+
return result.Issues.length ? `${tallies} Issues: ${result.Issues.join(' | ')}` : tallies;
|
|
34
|
+
}
|
|
35
|
+
let DetectWonDealsWithUnconfirmedOrdersAction = class DetectWonDealsWithUnconfirmedOrdersAction extends BaseAction {
|
|
36
|
+
async InternalRunAction(params) {
|
|
37
|
+
try {
|
|
38
|
+
return await this.detect(params);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return {
|
|
42
|
+
Success: false,
|
|
43
|
+
ResultCode: 'ERROR',
|
|
44
|
+
Message: `The won-deal finance exception check failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async detect(params) {
|
|
49
|
+
const result = await DetectWonDealsWithUnconfirmedOrders(Metadata.Provider, params.ContextUser);
|
|
50
|
+
setOutput(params, 'Found', result.Found);
|
|
51
|
+
setOutput(params, 'Created', result.Created);
|
|
52
|
+
setOutput(params, 'AlreadyRaised', result.AlreadyRaised);
|
|
53
|
+
setOutput(params, 'SkippedByAccounting', result.SkippedByAccounting);
|
|
54
|
+
setOutput(params, 'CreatorUnresolved', result.CreatorUnresolved);
|
|
55
|
+
setOutput(params, 'Issues', JSON.stringify(result.Issues));
|
|
56
|
+
return {
|
|
57
|
+
Success: result.Success,
|
|
58
|
+
ResultCode: result.Outcome,
|
|
59
|
+
Message: result.Outcome === 'SKIPPED' ? result.Issues.join(' ') : describe(result),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
DetectWonDealsWithUnconfirmedOrdersAction = __decorate([
|
|
64
|
+
RegisterClass(BaseAction, 'Sales.DetectWonDealsWithUnconfirmedOrders')
|
|
65
|
+
], DetectWonDealsWithUnconfirmedOrdersAction);
|
|
66
|
+
export { DetectWonDealsWithUnconfirmedOrdersAction };
|
|
67
|
+
/** Anti-tree-shaking anchor — `@RegisterClass` is a side effect of import. */
|
|
68
|
+
export function LoadDetectWonDealsWithUnconfirmedOrdersAction() {
|
|
69
|
+
void DetectWonDealsWithUnconfirmedOrdersAction;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=won-deal-order-detector.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"won-deal-order-detector.action.js","sourceRoot":"","sources":["../../src/custom/won-deal-order-detector.action.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACH,mCAAmC,GAEtC,MAAM,yCAAyC,CAAC;AAEjD,SAAS,SAAS,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;IACpE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1F,IAAI,QAAQ,EAAE,CAAC;QACX,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;QACvB,OAAO;IACX,CAAC;IACD,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IACp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EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,SAAS,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QACzD,SAAS,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACrE,SAAS,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACjE,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAE3D,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,UAAU,EAAE,MAAM,CAAC,OAAO;YAC1B,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;SACrF,CAAC;IACN,CAAC;CACJ,CAAA;AA7BY,yCAAyC;IADrD,aAAa,CAAC,UAAU,EAAE,2CAA2C,CAAC;GAC1D,yCAAyC,CA6BrD;;AAED,8EAA8E;AAC9E,MAAM,UAAU,6CAA6C;IACzD,KAAK,yCAAyC,CAAC;AACnD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -23,4 +23,5 @@ export declare const RESOLVER_PATHS: string[];
|
|
|
23
23
|
export declare function LoadBizAppsSalesServer(): void;
|
|
24
24
|
export { CaptureForecastSnapshotAction, LoadCaptureForecastSnapshotAction, } from './custom/forecast-snapshot.action.js';
|
|
25
25
|
export { LogActivityAction, LoadLogActivityAction } from './custom/log-activity.action.js';
|
|
26
|
+
export { DetectWonDealsWithUnconfirmedOrdersAction, LoadDetectWonDealsWithUnconfirmedOrdersAction, } from './custom/won-deal-order-detector.action.js';
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,6BAA6B,CAAC;AACrC,OAAO,4BAA4B,CAAC;AAOpC,OAAO,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,6BAA6B,CAAC;AACrC,OAAO,4BAA4B,CAAC;AAOpC,OAAO,yCAAyC,CAAC;AAOjD,OAAO,0BAA0B,CAAC;AAMlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAOlF;;;GAGG;AACH,eAAO,MAAM,cAAc,UAG1B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAiC7C;AAED,OAAO,EACH,6BAA6B,EAC7B,iCAAiC,GACpC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EACH,yCAAyC,EACzC,6CAA6C,GAChD,MAAM,4CAA4C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import '@mj-biz-apps/sales-core-entities-server';
|
|
|
17
17
|
import { LoadDealLockOrderLineVeto, LoadSalesCoreEntitiesServer } from '@mj-biz-apps/sales-core-entities-server';
|
|
18
18
|
import { LoadCaptureForecastSnapshotAction } from './custom/forecast-snapshot.action.js';
|
|
19
19
|
import { LoadLogActivityAction } from './custom/log-activity.action.js';
|
|
20
|
+
import { LoadDetectWonDealsWithUnconfirmedOrdersAction } from './custom/won-deal-order-detector.action.js';
|
|
20
21
|
// Import generated GraphQL resolvers
|
|
21
22
|
import './generated/generated.js';
|
|
22
23
|
// Import generated class registrations manifest
|
|
@@ -65,9 +66,11 @@ export function LoadBizAppsSalesServer() {
|
|
|
65
66
|
LoadDealLockOrderLineVeto();
|
|
66
67
|
LoadCaptureForecastSnapshotAction();
|
|
67
68
|
LoadLogActivityAction();
|
|
69
|
+
LoadDetectWonDealsWithUnconfirmedOrdersAction();
|
|
68
70
|
// Referenced so the manifest import is not elided; MJ reads it during registration.
|
|
69
71
|
void CLASS_REGISTRATIONS;
|
|
70
72
|
}
|
|
71
73
|
export { CaptureForecastSnapshotAction, LoadCaptureForecastSnapshotAction, } from './custom/forecast-snapshot.action.js';
|
|
72
74
|
export { LogActivityAction, LoadLogActivityAction } from './custom/log-activity.action.js';
|
|
75
|
+
export { DetectWonDealsWithUnconfirmedOrdersAction, LoadDetectWonDealsWithUnconfirmedOrdersAction, } from './custom/won-deal-order-detector.action.js';
|
|
73
76
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,yEAAyE;AACzE,OAAO,6BAA6B,CAAC;AACrC,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,wGAAwG;AACxG,yGAAyG;AACzG,uGAAuG;AACvG,kGAAkG;AAClG,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACjH,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,yEAAyE;AACzE,OAAO,6BAA6B,CAAC;AACrC,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,wGAAwG;AACxG,yGAAyG;AACzG,uGAAuG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,EAC7B,iCAAiC,GACpC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EACH,yCAAyC,EACzC,6CAA6C,GAChD,MAAM,4CAA4C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mj-biz-apps/sales-server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.9.
|
|
4
|
+
"version": "6.9.1",
|
|
5
5
|
"description": "BizApps Sales server bootstrap - GraphQL resolvers and class registrations for the deal-pipeline Open App",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"typescript": "^5.9.3"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mj-biz-apps/sales-actions": "6.9.
|
|
23
|
-
"@mj-biz-apps/sales-core-entities-server": "6.9.
|
|
24
|
-
"@mj-biz-apps/sales-entities": "6.9.
|
|
22
|
+
"@mj-biz-apps/sales-actions": "6.9.1",
|
|
23
|
+
"@mj-biz-apps/sales-core-entities-server": "6.9.1",
|
|
24
|
+
"@mj-biz-apps/sales-entities": "6.9.1",
|
|
25
25
|
"class-validator": "^0.14.3"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|