@mj-biz-apps/sales-core-entities-server 6.8.2 → 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/finance-exceptions/FinanceExceptionBridge.d.ts +66 -0
- package/dist/finance-exceptions/FinanceExceptionBridge.d.ts.map +1 -0
- package/dist/finance-exceptions/FinanceExceptionBridge.js +61 -0
- package/dist/finance-exceptions/FinanceExceptionBridge.js.map +1 -0
- package/dist/finance-exceptions/WonDealOrderDetector.d.ts +74 -0
- package/dist/finance-exceptions/WonDealOrderDetector.d.ts.map +1 -0
- package/dist/finance-exceptions/WonDealOrderDetector.js +277 -0
- package/dist/finance-exceptions/WonDealOrderDetector.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one place sales reaches into accounting's finance exception operations (golive #279).
|
|
3
|
+
*
|
|
4
|
+
* Accounting owns the exception tables and the operations that read and write them. Sales resolves
|
|
5
|
+
* those operations BY NAME through the class factory, with no build-time dependency on the accounting
|
|
6
|
+
* server package, the same way bizapps-orders reaches `Accounting.CreateJournalEntries`. The input and
|
|
7
|
+
* output shapes below are the agreed contract, declared here structurally; they are not imported.
|
|
8
|
+
*
|
|
9
|
+
* An unregistered operation throws: a detector that quietly did nothing because accounting was not
|
|
10
|
+
* loaded would look exactly like a night with no exceptions.
|
|
11
|
+
*/
|
|
12
|
+
import { type IMetadataProvider, type UserInfo } from '@memberjunction/core';
|
|
13
|
+
export declare const OP_GET_FINANCE_EXCEPTION_TYPES = "Accounting.GetFinanceExceptionTypes";
|
|
14
|
+
export declare const OP_RAISE_FINANCE_EXCEPTIONS = "Accounting.RaiseFinanceExceptions";
|
|
15
|
+
export interface FinanceExceptionError {
|
|
16
|
+
Index?: number;
|
|
17
|
+
Code: string;
|
|
18
|
+
Message: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetFinanceExceptionTypesInput {
|
|
21
|
+
Codes?: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface FinanceExceptionTypeInfo {
|
|
24
|
+
Code: string;
|
|
25
|
+
IsActive: boolean;
|
|
26
|
+
Configuration: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface GetFinanceExceptionTypesOutput {
|
|
29
|
+
Success: boolean;
|
|
30
|
+
Types: FinanceExceptionTypeInfo[];
|
|
31
|
+
Errors?: FinanceExceptionError[];
|
|
32
|
+
}
|
|
33
|
+
export interface FinanceExceptionToRaise {
|
|
34
|
+
TypeCode: string;
|
|
35
|
+
/** MJ entity name; accounting resolves it to SourceEntityID. */
|
|
36
|
+
SourceEntityName: string;
|
|
37
|
+
SourceRecordID: string;
|
|
38
|
+
CompanyID: string;
|
|
39
|
+
Amount?: number | null;
|
|
40
|
+
/** YYYY-MM-DD. */
|
|
41
|
+
ExceptionDate: string;
|
|
42
|
+
Summary: string;
|
|
43
|
+
DedupeKey: string;
|
|
44
|
+
SourceCreatedByUserID?: string | null;
|
|
45
|
+
/** True when a creator exists but no single login is linked to it. */
|
|
46
|
+
CreatorUnresolved?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface RaiseFinanceExceptionsInput {
|
|
49
|
+
Exceptions: FinanceExceptionToRaise[];
|
|
50
|
+
}
|
|
51
|
+
export interface RaiseFinanceExceptionResult {
|
|
52
|
+
Index: number;
|
|
53
|
+
FinanceExceptionID?: string;
|
|
54
|
+
Created: boolean;
|
|
55
|
+
Skipped?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface RaiseFinanceExceptionsOutput {
|
|
58
|
+
Success: boolean;
|
|
59
|
+
Results: RaiseFinanceExceptionResult[];
|
|
60
|
+
Errors?: FinanceExceptionError[];
|
|
61
|
+
}
|
|
62
|
+
export declare function GetFinanceExceptionTypes(input: GetFinanceExceptionTypesInput, provider: IMetadataProvider, user: UserInfo): Promise<GetFinanceExceptionTypesOutput>;
|
|
63
|
+
export declare function RaiseFinanceExceptions(input: RaiseFinanceExceptionsInput, provider: IMetadataProvider, user: UserInfo): Promise<RaiseFinanceExceptionsOutput>;
|
|
64
|
+
/** One line per payload error, for a job log. */
|
|
65
|
+
export declare function DescribeFinanceExceptionErrors(errors: FinanceExceptionError[] | undefined): string;
|
|
66
|
+
//# sourceMappingURL=FinanceExceptionBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FinanceExceptionBridge.d.ts","sourceRoot":"","sources":["../../src/finance-exceptions/FinanceExceptionBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAA0B,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrG,eAAO,MAAM,8BAA8B,wCAAwC,CAAC;AACpF,eAAO,MAAM,2BAA2B,sCAAsC,CAAC;AAE/E,MAAM,WAAW,qBAAqB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,6BAA6B;IAC1C,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,8BAA8B;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,kBAAkB;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,2BAA2B;IACxC,UAAU,EAAE,uBAAuB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,2BAA2B,EAAE,CAAC;IACvC,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACpC;AA+CD,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,QAAQ,GACf,OAAO,CAAC,8BAA8B,CAAC,CAOzC;AAED,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,2BAA2B,EAClC,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,QAAQ,GACf,OAAO,CAAC,4BAA4B,CAAC,CAOvC;AAED,iDAAiD;AACjD,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,SAAS,GAAG,MAAM,CAIlG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one place sales reaches into accounting's finance exception operations (golive #279).
|
|
3
|
+
*
|
|
4
|
+
* Accounting owns the exception tables and the operations that read and write them. Sales resolves
|
|
5
|
+
* those operations BY NAME through the class factory, with no build-time dependency on the accounting
|
|
6
|
+
* server package, the same way bizapps-orders reaches `Accounting.CreateJournalEntries`. The input and
|
|
7
|
+
* output shapes below are the agreed contract, declared here structurally; they are not imported.
|
|
8
|
+
*
|
|
9
|
+
* An unregistered operation throws: a detector that quietly did nothing because accounting was not
|
|
10
|
+
* loaded would look exactly like a night with no exceptions.
|
|
11
|
+
*/
|
|
12
|
+
import { BaseRemotableOperation } from '@memberjunction/core';
|
|
13
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
14
|
+
export const OP_GET_FINANCE_EXCEPTION_TYPES = 'Accounting.GetFinanceExceptionTypes';
|
|
15
|
+
export const OP_RAISE_FINANCE_EXCEPTIONS = 'Accounting.RaiseFinanceExceptions';
|
|
16
|
+
/**
|
|
17
|
+
* Resolve an accounting operation by key, throwing when accounting's server package is not loaded.
|
|
18
|
+
*
|
|
19
|
+
* `TryCreateInstance`, not `CreateInstance`: `BaseRemotableOperation` is not marked as requiring a
|
|
20
|
+
* subclass, so `CreateInstance` for an unregistered key returns a hollow base instance rather than
|
|
21
|
+
* null, and a null check never fires.
|
|
22
|
+
*/
|
|
23
|
+
function resolveOperation(key) {
|
|
24
|
+
const res = MJGlobal.Instance.ClassFactory.TryCreateInstance(BaseRemotableOperation, key);
|
|
25
|
+
if (!res.Resolved || !res.Instance) {
|
|
26
|
+
throw new Error(`The '${key}' operation is not registered. The BizApps Accounting server package must be `
|
|
27
|
+
+ 'loaded before sales can read or raise finance exceptions.');
|
|
28
|
+
}
|
|
29
|
+
return res.Instance;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Run an accounting operation and return its payload.
|
|
33
|
+
*
|
|
34
|
+
* The envelope reports transport and authorization failure and is thrown. The payload's own
|
|
35
|
+
* `Success` is the accounting-domain outcome and is returned for the caller to judge, because a
|
|
36
|
+
* nightly detector reports a refused raise rather than dying on it.
|
|
37
|
+
*/
|
|
38
|
+
async function executeOperation(key, input, provider, user) {
|
|
39
|
+
const op = resolveOperation(key);
|
|
40
|
+
const result = await op.Execute(input, { provider, user });
|
|
41
|
+
if (!result.Success) {
|
|
42
|
+
throw new Error(`${key} did not execute: ${result.ErrorMessage ?? result.ResultCode ?? 'unknown error'}`);
|
|
43
|
+
}
|
|
44
|
+
if (!result.Output) {
|
|
45
|
+
throw new Error(`${key} returned no payload.`);
|
|
46
|
+
}
|
|
47
|
+
return result.Output;
|
|
48
|
+
}
|
|
49
|
+
export function GetFinanceExceptionTypes(input, provider, user) {
|
|
50
|
+
return executeOperation(OP_GET_FINANCE_EXCEPTION_TYPES, input, provider, user);
|
|
51
|
+
}
|
|
52
|
+
export function RaiseFinanceExceptions(input, provider, user) {
|
|
53
|
+
return executeOperation(OP_RAISE_FINANCE_EXCEPTIONS, input, provider, user);
|
|
54
|
+
}
|
|
55
|
+
/** One line per payload error, for a job log. */
|
|
56
|
+
export function DescribeFinanceExceptionErrors(errors) {
|
|
57
|
+
return (errors ?? [])
|
|
58
|
+
.map((e) => `${e.Index === undefined ? '' : `[${e.Index}] `}${e.Code}: ${e.Message}`)
|
|
59
|
+
.join('; ');
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=FinanceExceptionBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FinanceExceptionBridge.js","sourceRoot":"","sources":["../../src/finance-exceptions/FinanceExceptionBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,sBAAsB,EAAyC,MAAM,sBAAsB,CAAC;AACrG,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,CAAC,MAAM,8BAA8B,GAAG,qCAAqC,CAAC;AACpF,MAAM,CAAC,MAAM,2BAA2B,GAAG,mCAAmC,CAAC;AAyD/E;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAO,GAAW;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,iBAAiB,CACxD,sBAA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O,CAAC,MAAM,IAAI,EAAE,CAAC;SAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;SACpF,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nightly detector for finance exception type 3, WON_DEAL_ORDER_NOT_CONFIRMED (golive #279).
|
|
3
|
+
*
|
|
4
|
+
* A deal closed Won whose order is missing or never confirmed is never billed. The saved query
|
|
5
|
+
* `Sales: Won Deals With Unconfirmed Orders` finds them; this raises one finance exception per deal
|
|
6
|
+
* through accounting, keyed on the deal so a deal found again tomorrow is not raised twice.
|
|
7
|
+
*
|
|
8
|
+
* The threshold (`MinDaysSinceClose`) is read from the exception type's Configuration in accounting.
|
|
9
|
+
* A missing or inactive type means the check is switched off, and the run skips. It never falls back
|
|
10
|
+
* to a default of its own.
|
|
11
|
+
*/
|
|
12
|
+
import { type IMetadataProvider, type UserInfo } from '@memberjunction/core';
|
|
13
|
+
import { type FinanceExceptionTypeInfo } from './FinanceExceptionBridge.js';
|
|
14
|
+
export declare const WON_DEAL_ORDER_NOT_CONFIRMED = "WON_DEAL_ORDER_NOT_CONFIRMED";
|
|
15
|
+
export declare const WON_DEALS_QUERY_NAME = "Sales: Won Deals With Unconfirmed Orders";
|
|
16
|
+
export declare const WON_DEALS_QUERY_CATEGORY = "Sales";
|
|
17
|
+
export declare const DEAL_ENTITY_NAME = "MJ_BizApps_Sales: Deals";
|
|
18
|
+
export type WonDealDetectionOutcome = 'RAISED' | 'NONE_FOUND' | 'SKIPPED' | 'TYPES_UNREADABLE' | 'CONFIG_INVALID' | 'QUERY_FAILED' | 'USER_LOOKUP_FAILED' | 'RAISE_FAILED';
|
|
19
|
+
export interface WonDealDetectionResult {
|
|
20
|
+
Success: boolean;
|
|
21
|
+
Outcome: WonDealDetectionOutcome;
|
|
22
|
+
/** Deals the query returned. */
|
|
23
|
+
Found: number;
|
|
24
|
+
/** Exceptions accounting created on this run. */
|
|
25
|
+
Created: number;
|
|
26
|
+
/** Deals that already had an exception of this type, in any status. */
|
|
27
|
+
AlreadyRaised: number;
|
|
28
|
+
/** Exceptions accounting skipped, which it does when the type is inactive. */
|
|
29
|
+
SkippedByAccounting: number;
|
|
30
|
+
/** Deals whose owner has no single linked login. */
|
|
31
|
+
CreatorUnresolved: number;
|
|
32
|
+
Issues: string[];
|
|
33
|
+
}
|
|
34
|
+
/** One query row, read defensively: a provider can hand back a number as a string. */
|
|
35
|
+
interface WonDealRow {
|
|
36
|
+
DealID: string;
|
|
37
|
+
DealNumber: string | null;
|
|
38
|
+
CompanyID: string;
|
|
39
|
+
OwnerEmployeeID: string | null;
|
|
40
|
+
OwnerName: string | null;
|
|
41
|
+
CloseDate: string | null;
|
|
42
|
+
DaysSinceClose: number | null;
|
|
43
|
+
DealAmount: number | null;
|
|
44
|
+
OrderID: string | null;
|
|
45
|
+
OrderStatus: string | null;
|
|
46
|
+
}
|
|
47
|
+
/** The owner's login, or why there is not exactly one. */
|
|
48
|
+
interface CreatorResolution {
|
|
49
|
+
UserID: string | null;
|
|
50
|
+
Unresolved: boolean;
|
|
51
|
+
LinkedLogins: number;
|
|
52
|
+
}
|
|
53
|
+
/** The threshold from the type's Configuration, or null when it is absent or not a whole non-negative number. */
|
|
54
|
+
export declare function ReadMinDaysSinceClose(type: FinanceExceptionTypeInfo): number | null;
|
|
55
|
+
export declare function ReadWonDealRow(raw: Record<string, unknown>): WonDealRow | null;
|
|
56
|
+
/**
|
|
57
|
+
* Plain description of the defect in the data: the deal number, never the deal or account name.
|
|
58
|
+
* When the owner's login cannot be resolved the owner is named, because accounting shows this
|
|
59
|
+
* summary when it refuses to clear the row, and whoever sees it needs to know whose login to link.
|
|
60
|
+
*/
|
|
61
|
+
export declare function BuildWonDealSummary(row: WonDealRow, creator: CreatorResolution): string;
|
|
62
|
+
/**
|
|
63
|
+
* Every login linked to each owner, in one batched lookup (chunked only to bound the IN list).
|
|
64
|
+
* Returns a map from employee key to the linked user IDs, or an error message.
|
|
65
|
+
*/
|
|
66
|
+
export declare function LoadLoginsByEmployee(employeeIDs: string[], user: UserInfo): Promise<Map<string, string[]> | string>;
|
|
67
|
+
export declare function ResolveCreator(ownerEmployeeID: string | null, logins: Map<string, string[]>): CreatorResolution;
|
|
68
|
+
/**
|
|
69
|
+
* Detect won deals with unconfirmed orders and raise one finance exception per deal.
|
|
70
|
+
* Throws only when accounting's operations are not registered or do not execute.
|
|
71
|
+
*/
|
|
72
|
+
export declare function DetectWonDealsWithUnconfirmedOrders(provider: IMetadataProvider, user: UserInfo): Promise<WonDealDetectionResult>;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=WonDealOrderDetector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WonDealOrderDetector.d.ts","sourceRoot":"","sources":["../../src/finance-exceptions/WonDealOrderDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAgC,KAAK,iBAAiB,EAAsB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE/H,OAAO,EAKH,KAAK,wBAAwB,EAEhC,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,oBAAoB,6CAA6C,CAAC;AAC/E,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAChD,eAAO,MAAM,gBAAgB,4BAA4B,CAAC;AAM1D,MAAM,MAAM,uBAAuB,GAC7B,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,gBAAgB,GAChB,cAAc,GACd,oBAAoB,GACpB,cAAc,CAAC;AAErB,MAAM,WA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BvF;AAkED;;;GAGG;AACH,wBAAsB,oBAAoB,CACtC,WAAW,EAAE,MAAM,EAAE,EACrB,IAAI,EAAE,QAAQ,GACf,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,CAiCzC;AAED,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,iBAAiB,CAS/G;AAiDD;;;GAGG;AACH,wBAAsB,mCAAmC,CACrD,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,QAAQ,GACf,OAAO,CAAC,sBAAsB,CAAC,CA+BjC"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nightly detector for finance exception type 3, WON_DEAL_ORDER_NOT_CONFIRMED (golive #279).
|
|
3
|
+
*
|
|
4
|
+
* A deal closed Won whose order is missing or never confirmed is never billed. The saved query
|
|
5
|
+
* `Sales: Won Deals With Unconfirmed Orders` finds them; this raises one finance exception per deal
|
|
6
|
+
* through accounting, keyed on the deal so a deal found again tomorrow is not raised twice.
|
|
7
|
+
*
|
|
8
|
+
* The threshold (`MinDaysSinceClose`) is read from the exception type's Configuration in accounting.
|
|
9
|
+
* A missing or inactive type means the check is switched off, and the run skips. It never falls back
|
|
10
|
+
* to a default of its own.
|
|
11
|
+
*/
|
|
12
|
+
import { LogStatus, RunQuery, RunView } from '@memberjunction/core';
|
|
13
|
+
import { BusinessTimeZoneEngine } from '@mj-biz-apps/common-entities';
|
|
14
|
+
import { DescribeFinanceExceptionErrors, GetFinanceExceptionTypes, RaiseFinanceExceptions, } from './FinanceExceptionBridge.js';
|
|
15
|
+
export const WON_DEAL_ORDER_NOT_CONFIRMED = 'WON_DEAL_ORDER_NOT_CONFIRMED';
|
|
16
|
+
export const WON_DEALS_QUERY_NAME = 'Sales: Won Deals With Unconfirmed Orders';
|
|
17
|
+
export const WON_DEALS_QUERY_CATEGORY = 'Sales';
|
|
18
|
+
export const DEAL_ENTITY_NAME = 'MJ_BizApps_Sales: Deals';
|
|
19
|
+
const USER_ENTITY_NAME = 'MJ: Users';
|
|
20
|
+
/** Keeps each user lookup's IN list well inside SQL Server's parameter and statement limits. */
|
|
21
|
+
const USER_LOOKUP_CHUNK = 500;
|
|
22
|
+
const SUMMARY_MAX = 1000;
|
|
23
|
+
function emptyResult(outcome, success, issue) {
|
|
24
|
+
return {
|
|
25
|
+
Success: success,
|
|
26
|
+
Outcome: outcome,
|
|
27
|
+
Found: 0,
|
|
28
|
+
Created: 0,
|
|
29
|
+
AlreadyRaised: 0,
|
|
30
|
+
SkippedByAccounting: 0,
|
|
31
|
+
CreatorUnresolved: 0,
|
|
32
|
+
Issues: issue ? [issue] : [],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function text(value) {
|
|
36
|
+
if (value === null || value === undefined) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const s = String(value).trim();
|
|
40
|
+
return s === '' ? null : s;
|
|
41
|
+
}
|
|
42
|
+
function numberOrNull(value) {
|
|
43
|
+
if (value === null || value === undefined || value === '') {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const n = Number(value);
|
|
47
|
+
return Number.isFinite(n) ? n : null;
|
|
48
|
+
}
|
|
49
|
+
function dayText(value) {
|
|
50
|
+
if (value instanceof Date) {
|
|
51
|
+
return Number.isNaN(value.getTime()) ? null : value.toISOString().slice(0, 10);
|
|
52
|
+
}
|
|
53
|
+
const s = text(value);
|
|
54
|
+
return s ? s.slice(0, 10) : null;
|
|
55
|
+
}
|
|
56
|
+
/** GUIDs compare case-insensitively; SQL Server returns upper case, JavaScript callers often lower. */
|
|
57
|
+
function idKey(id) {
|
|
58
|
+
return id.trim().toLowerCase();
|
|
59
|
+
}
|
|
60
|
+
/** The threshold from the type's Configuration, or null when it is absent or not a whole non-negative number. */
|
|
61
|
+
export function ReadMinDaysSinceClose(type) {
|
|
62
|
+
const raw = type.Configuration?.MinDaysSinceClose;
|
|
63
|
+
const n = typeof raw === 'number' ? raw : typeof raw === 'string' && raw.trim() !== '' ? Number(raw) : NaN;
|
|
64
|
+
return Number.isInteger(n) && n >= 0 ? n : null;
|
|
65
|
+
}
|
|
66
|
+
export function ReadWonDealRow(raw) {
|
|
67
|
+
const dealID = text(raw.DealID);
|
|
68
|
+
const companyID = text(raw.CompanyID);
|
|
69
|
+
if (!dealID || !companyID) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
DealID: dealID,
|
|
74
|
+
DealNumber: text(raw.DealNumber),
|
|
75
|
+
CompanyID: companyID,
|
|
76
|
+
OwnerEmployeeID: text(raw.OwnerEmployeeID),
|
|
77
|
+
OwnerName: text(raw.OwnerName),
|
|
78
|
+
CloseDate: dayText(raw.CloseDate),
|
|
79
|
+
DaysSinceClose: numberOrNull(raw.DaysSinceClose),
|
|
80
|
+
DealAmount: numberOrNull(raw.DealAmount),
|
|
81
|
+
OrderID: text(raw.OrderID),
|
|
82
|
+
OrderStatus: text(raw.OrderStatus),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Plain description of the defect in the data: the deal number, never the deal or account name.
|
|
87
|
+
* When the owner's login cannot be resolved the owner is named, because accounting shows this
|
|
88
|
+
* summary when it refuses to clear the row, and whoever sees it needs to know whose login to link.
|
|
89
|
+
*/
|
|
90
|
+
export function BuildWonDealSummary(row, creator) {
|
|
91
|
+
const deal = row.DealNumber ? `Deal ${row.DealNumber}` : `Deal ${row.DealID}`;
|
|
92
|
+
const closed = row.CloseDate
|
|
93
|
+
? ` closed Won on ${row.CloseDate}${row.DaysSinceClose === null ? '' : ` (${row.DaysSinceClose} days ago)`}`
|
|
94
|
+
: ' closed Won';
|
|
95
|
+
const order = !row.OrderID
|
|
96
|
+
? 'has no order'
|
|
97
|
+
: row.OrderStatus
|
|
98
|
+
? `has an order that is ${row.OrderStatus}, not Confirmed`
|
|
99
|
+
: 'has an order that could not be read';
|
|
100
|
+
let summary = `${deal}${closed} and ${order}, so it will not be billed.`;
|
|
101
|
+
const owner = row.OwnerName ? `The deal owner, ${row.OwnerName},` : 'The deal owner';
|
|
102
|
+
if (creator.LinkedLogins > 1) {
|
|
103
|
+
summary += ` ${owner} is linked to ${creator.LinkedLogins} logins, so the creator could not be resolved to one; `
|
|
104
|
+
+ 'leave exactly one login linked to their employee record.';
|
|
105
|
+
}
|
|
106
|
+
else if (creator.Unresolved) {
|
|
107
|
+
summary += ` ${owner} has no linked login; link their employee record to their login.`;
|
|
108
|
+
}
|
|
109
|
+
return summary.length > SUMMARY_MAX ? `${summary.slice(0, SUMMARY_MAX - 1)}…` : summary;
|
|
110
|
+
}
|
|
111
|
+
/** Read the type; a null result with an outcome means the run stops there. */
|
|
112
|
+
async function readType(provider, user) {
|
|
113
|
+
const types = await GetFinanceExceptionTypes({ Codes: [WON_DEAL_ORDER_NOT_CONFIRMED] }, provider, user);
|
|
114
|
+
if (!types.Success) {
|
|
115
|
+
return emptyResult('TYPES_UNREADABLE', false, `Accounting could not read the finance exception types. ${DescribeFinanceExceptionErrors(types.Errors)}`);
|
|
116
|
+
}
|
|
117
|
+
const type = (types.Types ?? []).find((t) => t.Code === WON_DEAL_ORDER_NOT_CONFIRMED);
|
|
118
|
+
if (!type || !type.IsActive) {
|
|
119
|
+
const why = !type ? 'does not exist' : 'is inactive';
|
|
120
|
+
const message = `Finance exception type ${WON_DEAL_ORDER_NOT_CONFIRMED} ${why}; the won-deal check was skipped.`;
|
|
121
|
+
LogStatus(message);
|
|
122
|
+
return emptyResult('SKIPPED', true, message);
|
|
123
|
+
}
|
|
124
|
+
const threshold = ReadMinDaysSinceClose(type);
|
|
125
|
+
if (threshold === null) {
|
|
126
|
+
return emptyResult('CONFIG_INVALID', false, `Finance exception type ${WON_DEAL_ORDER_NOT_CONFIRMED} has no usable MinDaysSinceClose in its `
|
|
127
|
+
+ 'Configuration (a whole number of days, 0 or more). Nothing was checked.');
|
|
128
|
+
}
|
|
129
|
+
return { Threshold: threshold };
|
|
130
|
+
}
|
|
131
|
+
async function runQuery(threshold, user) {
|
|
132
|
+
const result = await new RunQuery().RunQuery({
|
|
133
|
+
QueryName: WON_DEALS_QUERY_NAME,
|
|
134
|
+
CategoryPath: WON_DEALS_QUERY_CATEGORY,
|
|
135
|
+
Parameters: { MinDaysSinceClose: threshold },
|
|
136
|
+
}, user);
|
|
137
|
+
if (!result?.Success) {
|
|
138
|
+
return emptyResult('QUERY_FAILED', false, `The query '${WON_DEALS_QUERY_NAME}' did not run: ${result?.ErrorMessage ?? 'unknown error'}`);
|
|
139
|
+
}
|
|
140
|
+
const rows = [];
|
|
141
|
+
const issues = [];
|
|
142
|
+
for (const raw of result.Results ?? []) {
|
|
143
|
+
const row = ReadWonDealRow(raw);
|
|
144
|
+
if (row) {
|
|
145
|
+
rows.push(row);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
issues.push('A query row carried no DealID or CompanyID and was not raised.');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return { Rows: rows, Issues: issues };
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Every login linked to each owner, in one batched lookup (chunked only to bound the IN list).
|
|
155
|
+
* Returns a map from employee key to the linked user IDs, or an error message.
|
|
156
|
+
*/
|
|
157
|
+
export async function LoadLoginsByEmployee(employeeIDs, user) {
|
|
158
|
+
const unique = [...new Map(employeeIDs.map((id) => [idKey(id), id])).values()];
|
|
159
|
+
const byEmployee = new Map();
|
|
160
|
+
if (unique.length === 0) {
|
|
161
|
+
return byEmployee;
|
|
162
|
+
}
|
|
163
|
+
const params = [];
|
|
164
|
+
for (let i = 0; i < unique.length; i += USER_LOOKUP_CHUNK) {
|
|
165
|
+
const list = unique
|
|
166
|
+
.slice(i, i + USER_LOOKUP_CHUNK)
|
|
167
|
+
.map((id) => `'${id.replace(/'/g, "''")}'`)
|
|
168
|
+
.join(',');
|
|
169
|
+
params.push({
|
|
170
|
+
EntityName: USER_ENTITY_NAME,
|
|
171
|
+
ExtraFilter: `EmployeeID IN (${list})`,
|
|
172
|
+
Fields: ['ID', 'EmployeeID'],
|
|
173
|
+
ResultType: 'simple',
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const results = await new RunView().RunViews(params, user);
|
|
177
|
+
for (const r of results) {
|
|
178
|
+
if (!r.Success) {
|
|
179
|
+
return `The owner login lookup failed: ${r.ErrorMessage ?? 'unknown error'}`;
|
|
180
|
+
}
|
|
181
|
+
for (const u of (r.Results ?? [])) {
|
|
182
|
+
if (!u.EmployeeID) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const key = idKey(u.EmployeeID);
|
|
186
|
+
byEmployee.set(key, [...(byEmployee.get(key) ?? []), u.ID]);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return byEmployee;
|
|
190
|
+
}
|
|
191
|
+
export function ResolveCreator(ownerEmployeeID, logins) {
|
|
192
|
+
if (!ownerEmployeeID) {
|
|
193
|
+
return { UserID: null, Unresolved: false, LinkedLogins: 0 };
|
|
194
|
+
}
|
|
195
|
+
const linked = logins.get(idKey(ownerEmployeeID)) ?? [];
|
|
196
|
+
if (linked.length === 1) {
|
|
197
|
+
return { UserID: linked[0], Unresolved: false, LinkedLogins: 1 };
|
|
198
|
+
}
|
|
199
|
+
return { UserID: null, Unresolved: true, LinkedLogins: linked.length };
|
|
200
|
+
}
|
|
201
|
+
function buildException(row, creator, today) {
|
|
202
|
+
return {
|
|
203
|
+
TypeCode: WON_DEAL_ORDER_NOT_CONFIRMED,
|
|
204
|
+
SourceEntityName: DEAL_ENTITY_NAME,
|
|
205
|
+
SourceRecordID: row.DealID,
|
|
206
|
+
CompanyID: row.CompanyID,
|
|
207
|
+
Amount: row.DealAmount,
|
|
208
|
+
ExceptionDate: today,
|
|
209
|
+
Summary: BuildWonDealSummary(row, creator),
|
|
210
|
+
DedupeKey: row.DealID,
|
|
211
|
+
SourceCreatedByUserID: creator.UserID,
|
|
212
|
+
CreatorUnresolved: creator.Unresolved,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/** Fold accounting's answer into the run's tallies. Errors are named by deal, not by array index. */
|
|
216
|
+
function applyRaiseOutput(result, output, rows) {
|
|
217
|
+
if (!output.Success) {
|
|
218
|
+
const detail = (output.Errors ?? [])
|
|
219
|
+
.map((e) => {
|
|
220
|
+
const row = e.Index === undefined ? undefined : rows[e.Index];
|
|
221
|
+
return `${row ? `deal ${row.DealNumber ?? row.DealID}: ` : ''}${e.Code}: ${e.Message}`;
|
|
222
|
+
})
|
|
223
|
+
.join('; ');
|
|
224
|
+
return {
|
|
225
|
+
...result,
|
|
226
|
+
Success: false,
|
|
227
|
+
Outcome: 'RAISE_FAILED',
|
|
228
|
+
Issues: [...result.Issues, `Accounting refused the batch and wrote nothing. ${detail || 'No detail given.'}`],
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
for (const r of output.Results ?? []) {
|
|
232
|
+
if (r.Skipped) {
|
|
233
|
+
result.SkippedByAccounting++;
|
|
234
|
+
}
|
|
235
|
+
else if (r.Created) {
|
|
236
|
+
result.Created++;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
result.AlreadyRaised++;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return { ...result, Success: true, Outcome: 'RAISED' };
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Detect won deals with unconfirmed orders and raise one finance exception per deal.
|
|
246
|
+
* Throws only when accounting's operations are not registered or do not execute.
|
|
247
|
+
*/
|
|
248
|
+
export async function DetectWonDealsWithUnconfirmedOrders(provider, user) {
|
|
249
|
+
const type = await readType(provider, user);
|
|
250
|
+
if ('Outcome' in type) {
|
|
251
|
+
return type;
|
|
252
|
+
}
|
|
253
|
+
const query = await runQuery(type.Threshold, user);
|
|
254
|
+
if ('Outcome' in query) {
|
|
255
|
+
return query;
|
|
256
|
+
}
|
|
257
|
+
const result = { ...emptyResult('NONE_FOUND', true), Found: query.Rows.length, Issues: query.Issues };
|
|
258
|
+
if (query.Rows.length === 0) {
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
261
|
+
const owners = query.Rows.map((r) => r.OwnerEmployeeID).filter((id) => id !== null);
|
|
262
|
+
const logins = await LoadLoginsByEmployee(owners, user);
|
|
263
|
+
if (typeof logins === 'string') {
|
|
264
|
+
return { ...result, Success: false, Outcome: 'USER_LOOKUP_FAILED', Issues: [...result.Issues, logins] };
|
|
265
|
+
}
|
|
266
|
+
await BusinessTimeZoneEngine.Instance.Config(false, user, provider);
|
|
267
|
+
const exceptions = query.Rows.map((row) => {
|
|
268
|
+
const creator = ResolveCreator(row.OwnerEmployeeID, logins);
|
|
269
|
+
if (creator.Unresolved) {
|
|
270
|
+
result.CreatorUnresolved++;
|
|
271
|
+
}
|
|
272
|
+
return buildException(row, creator, BusinessTimeZoneEngine.Instance.Today(row.CompanyID));
|
|
273
|
+
});
|
|
274
|
+
const output = await RaiseFinanceExceptions({ Exceptions: exceptions }, provider, user);
|
|
275
|
+
return applyRaiseOutput(result, output, query.Rows);
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=WonDealOrderDetector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WonDealOrderDetector.js","sourceRoot":"","sources":["../../src/finance-exceptions/WonDealOrderDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAA6D,MAAM,sBAAsB,CAAC;AAC/H,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACH,8BAA8B,EAC9B,wBAAwB,EACxB,sBAAsB,GAIzB,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC;AAC3E,MAAM,CA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C,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;IAClG,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACxD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAC5G,CAAC;IAED,MAAM,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpE,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC5D,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,sBAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxF,OAAO,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;AACxD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,12 @@ export * from './forecast/ForecastSource.js';
|
|
|
96
96
|
export * from './forecast/FixtureForecastSource.js';
|
|
97
97
|
export * from './forecast/QueryForecastSource.js';
|
|
98
98
|
export * from './forecast/ForecastSnapshotJob.js';
|
|
99
|
+
/**
|
|
100
|
+
* FINANCE EXCEPTIONS (golive #279). Accounting's operations reached by name, and the nightly
|
|
101
|
+
* won-deal detector (type 3) the `Sales.DetectWonDealsWithUnconfirmedOrders` Action calls.
|
|
102
|
+
*/
|
|
103
|
+
export * from './finance-exceptions/FinanceExceptionBridge.js';
|
|
104
|
+
export * from './finance-exceptions/WonDealOrderDetector.js';
|
|
99
105
|
/**
|
|
100
106
|
* Anchor for the server-side entity subclasses, called from the sales-server bootstrap.
|
|
101
107
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AAExC;;;GAGG;AACH,cAAc,0BAA0B,CAAC;AAEzC,mGAAmG;AACnG,cAAc,wBAAwB,CAAC;AAEvC;;;;;;;GAOG;AACH,cAAc,0BAA0B,CAAC;AAEzC;;;;;GAKG;AACH;;;;;;;;;;;GAWG;AACH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,OAAO,EACH,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,GAC9B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACR,kBAAkB,EAClB,eAAe,EACf,cAAc,GACjB,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AAExC;;;GAGG;AACH,cAAc,0BAA0B,CAAC;AAEzC,mGAAmG;AACnG,cAAc,wBAAwB,CAAC;AAEvC;;;;;;;GAOG;AACH,cAAc,0BAA0B,CAAC;AAEzC;;;;;GAKG;AACH;;;;;;;;;;;GAWG;AACH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,OAAO,EACH,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,GAC9B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACR,kBAAkB,EAClB,eAAe,EACf,cAAc,GACjB,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAElD;;;GAGG;AACH,cAAc,gDAAgD,CAAC;AAC/D,cAAc,8CAA8C,CAAC;AAO7D;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAOlD"}
|
package/dist/index.js
CHANGED
|
@@ -95,6 +95,12 @@ export * from './forecast/ForecastSource.js';
|
|
|
95
95
|
export * from './forecast/FixtureForecastSource.js';
|
|
96
96
|
export * from './forecast/QueryForecastSource.js';
|
|
97
97
|
export * from './forecast/ForecastSnapshotJob.js';
|
|
98
|
+
/**
|
|
99
|
+
* FINANCE EXCEPTIONS (golive #279). Accounting's operations reached by name, and the nightly
|
|
100
|
+
* won-deal detector (type 3) the `Sales.DetectWonDealsWithUnconfirmedOrders` Action calls.
|
|
101
|
+
*/
|
|
102
|
+
export * from './finance-exceptions/FinanceExceptionBridge.js';
|
|
103
|
+
export * from './finance-exceptions/WonDealOrderDetector.js';
|
|
98
104
|
import { LoadActivitySyncEngine } from '@mj-biz-apps/common-activity-sync';
|
|
99
105
|
import { DealEntityServer } from './DealEntityServer.js';
|
|
100
106
|
import { CloseDealOperation, ReopenDealOperation } from './CloseDealOperation.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AAExC;;;GAGG;AACH,cAAc,0BAA0B,CAAC;AAEzC,mGAAmG;AACnG,cAAc,wBAAwB,CAAC;AAEvC;;;;;;;GAOG;AACH,cAAc,0BAA0B,CAAC;AAEzC;;;;;GAKG;AACH;;;;;;;;;;;GAWG;AACH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,OAAO,EACH,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,GAC9B,MAAM,mCAAmC,CAAC;AAO3C;;;GAGG;AACH,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,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C,CAAC;AAElD;;;GAGG;AACH,cAAc,gDAAgD,CAAC;AAC/D,cAAc,8CAA8C,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,UAAU,2BAA2B;IACvC,sBAAsB,EAAE,CAAC;IACzB,mEAAmE;IACnE,MAAM,OAAO,GAAc,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IAC5G,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;IAChG,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mj-biz-apps/sales-core-entities-server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.9.1",
|
|
5
5
|
"description": "Server-side entity subclasses for BizApps Sales — the close lock (L-17), the OwnerEmployeeID denormalized stamp, and deal lifecycle hooks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@mj-biz-apps/common-activity-sync": "^5.44.0",
|
|
23
23
|
"@mj-biz-apps/common-entities": "^5.44.0",
|
|
24
|
-
"@mj-biz-apps/orders-entities": "^5.
|
|
25
|
-
"@mj-biz-apps/sales-entities": "6.
|
|
24
|
+
"@mj-biz-apps/orders-entities": "^5.18.0",
|
|
25
|
+
"@mj-biz-apps/sales-entities": "6.9.1",
|
|
26
26
|
"@mj-biz-apps/tasks-core": "^1.4.1",
|
|
27
27
|
"@mj-biz-apps/tasks-entities": "^1.4.1"
|
|
28
28
|
},
|