@rentman/rm-core 62.1.1 → 63.0.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/rm-core.js +1 -1
- package/dist/rm-core.js.map +1 -1
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicManager.d.ts +2 -2
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRule.d.ts +3 -2
- package/dist/types/src/classes/BusinessLogicManager/OfferteContract/OfferteContractDatumBusinessLogicRule.d.ts +0 -1
- package/dist/types/src/classes/BusinessLogicManager/businessLogicRule.decorator.d.ts +2 -2
- package/dist/types/src/types/ItemTypesCollection.d.ts +2 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiModuleFunctionResponse } from '@rentman/backend-types';
|
|
2
2
|
import { ErrorHandlerInterface } from '../../interfaces/ErrorHandlerInterface';
|
|
3
|
-
import { HasFlagFn } from '../../types/ItemTypesCollection';
|
|
3
|
+
import { GetAccountSettignsFn, HasFlagFn } from '../../types/ItemTypesCollection';
|
|
4
4
|
import { TransactionCache } from '../cache/transaction/TransactionCache';
|
|
5
5
|
import { ChangesDelta } from '../ChangesDelta';
|
|
6
6
|
import { BusinessLogicRule, BusinessLogicRuleConditionConfirmFn, BusinessLogicRuleConfirmFnWithDependency } from './BusinessLogicRule';
|
|
@@ -22,7 +22,7 @@ export declare class BusinessLogicManager {
|
|
|
22
22
|
* of rules.
|
|
23
23
|
*/
|
|
24
24
|
businessLogicRuleInstances: readonly BusinessLogicRule<any, any, any>[]);
|
|
25
|
-
static constructBusinessLogicRules(locals: ApiModuleFunctionResponse<'locals', 'getLocals'>, hasFlagFn: HasFlagFn, businessLogicRuleClasses?: readonly BusinessLogicRuleConstructor[]): BusinessLogicRule<any, any, any>[];
|
|
25
|
+
static constructBusinessLogicRules(locals: ApiModuleFunctionResponse<'locals', 'getLocals'>, hasFlagFn: HasFlagFn, getAccountSettingsFn: GetAccountSettignsFn, businessLogicRuleClasses?: readonly BusinessLogicRuleConstructor[]): BusinessLogicRule<any, any, any>[];
|
|
26
26
|
/**
|
|
27
27
|
* @description
|
|
28
28
|
* Allows the implementer to add a confirm function which is called after the condition of the business rule has fired
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiItemType, ApiModuleFunctionResponse, ResponseColumn } from '@rentman/backend-types';
|
|
2
2
|
import { ItemEntry } from '../../models/ItemEntry';
|
|
3
|
-
import { GetFieldValueType, HasFlagFn, ItemTypeColumnId } from '../../types/ItemTypesCollection';
|
|
3
|
+
import { GetAccountSettignsFn, GetFieldValueType, HasFlagFn, ItemTypeColumnId } from '../../types/ItemTypesCollection';
|
|
4
4
|
import { TransactionCache } from '../cache/transaction/TransactionCache';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from './BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from './BusinessLogicRuleConditionContext';
|
|
@@ -43,9 +43,10 @@ export type BusinessLogicConditionResult<ItemTypeType extends ApiItemType, Colum
|
|
|
43
43
|
export declare abstract class BusinessLogicRule<ConditionResult, DependencyType, ConfirmResult = undefined> {
|
|
44
44
|
protected readonly locals: ApiModuleFunctionResponse<'locals', 'getLocals'>;
|
|
45
45
|
protected readonly hasFlag: HasFlagFn;
|
|
46
|
+
protected readonly getAccountSettings: GetAccountSettignsFn;
|
|
46
47
|
confirm: BusinessLogicRuleConditionConfirmFn<ConditionResult, ConfirmResult> | null;
|
|
47
48
|
postDependencyConfirm: BusinessLogicRuleConfirmFnWithDependency<ConditionResult, DependencyType, ConfirmResult> | null;
|
|
48
|
-
constructor(locals: ApiModuleFunctionResponse<'locals', 'getLocals'>, hasFlag: HasFlagFn);
|
|
49
|
+
constructor(locals: ApiModuleFunctionResponse<'locals', 'getLocals'>, hasFlag: HasFlagFn, getAccountSettings: GetAccountSettignsFn);
|
|
49
50
|
/**
|
|
50
51
|
* @description
|
|
51
52
|
* The {@link BusinessLogicRule.dependency `dependency`} function gets the result of the
|
|
@@ -11,7 +11,6 @@ type ConditionResult = {
|
|
|
11
11
|
type Dependency = {
|
|
12
12
|
Offerte: ItemResource<'Offerte', ['vervaldatum']>[];
|
|
13
13
|
Contract: ItemResource<'Contract', ['vervaldatum']>[];
|
|
14
|
-
State: ItemResource<'State', ['geldigheidofferte']>;
|
|
15
14
|
};
|
|
16
15
|
export declare class OfferteContractDatumBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
17
16
|
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiModuleFunctionResponse } from '@rentman/backend-types';
|
|
2
|
-
import { HasFlagFn } from '../../types/ItemTypesCollection';
|
|
2
|
+
import { GetAccountSettignsFn, HasFlagFn } from '../../types/ItemTypesCollection';
|
|
3
3
|
import { BusinessLogicRule } from './BusinessLogicRule';
|
|
4
|
-
export type BusinessLogicRuleConstructor<BusinessLogicRuleType extends BusinessLogicRule<any, any> = BusinessLogicRule<any, any>> = new (locals: ApiModuleFunctionResponse<'locals', 'getLocals'>, hasFlagFn: HasFlagFn) => BusinessLogicRuleType;
|
|
4
|
+
export type BusinessLogicRuleConstructor<BusinessLogicRuleType extends BusinessLogicRule<any, any> = BusinessLogicRule<any, any>> = new (locals: ApiModuleFunctionResponse<'locals', 'getLocals'>, hasFlagFn: HasFlagFn, getAccountSettingsFn: GetAccountSettignsFn) => BusinessLogicRuleType;
|
|
5
5
|
export type BusinessLogicRuleConstructorName = BusinessLogicRuleConstructor & {
|
|
6
6
|
__name: string;
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signal } from '@angular/core';
|
|
2
|
-
import { ApiEnumApiType, ApiFields, ApiItemType, GetColumnType, ItemId, RequestParameters as BackendTypesRequestParameters, ResponseColumnItem, RmLoginInfoFlag } from '@rentman/backend-types';
|
|
2
|
+
import { ApiEnumApiType, ApiFields, ApiItemType, ApiModuleFunctionResponse, GetColumnType, ItemId, RequestParameters as BackendTypesRequestParameters, ResponseColumnItem, RmLoginInfoFlag } from '@rentman/backend-types';
|
|
3
3
|
import { UnknownResponseColumn } from '@rentman/backend-types/dist/manual/api-response-column';
|
|
4
4
|
import moment from 'moment';
|
|
5
5
|
import { ApiQuery, ChangesDeltaItemUpdateMode, ItemEntry, ItemResource, RequestColumnExpansion } from '../internal';
|
|
@@ -348,6 +348,7 @@ export type RequestToItemColumns<U extends ApiItemType, T extends ApiRequestColu
|
|
|
348
348
|
export type RequestColumnsFieldMap<ItemTypeType extends ApiItemType, Columns extends ApiRequestColumns<ItemTypeType>> = FieldMap<ItemTypeType, RequestToItemColumns<ItemTypeType, Columns>>;
|
|
349
349
|
export type RequestColumnsSignalFieldMap<ItemTypeType extends ApiItemType, Columns extends ApiRequestColumns<ItemTypeType>> = SignalFieldMap<ItemTypeType, RequestToItemColumns<ItemTypeType, Columns>>;
|
|
350
350
|
export type HasFlagFn = (flag: RmLoginInfoFlag) => boolean;
|
|
351
|
+
export type GetAccountSettignsFn = () => ApiModuleFunctionResponse<'settings', 'getAccountSettings'>;
|
|
351
352
|
type JoinPath<Prefix extends string, Suffix extends string> = Prefix extends '' ? Suffix : `${Prefix}>${Suffix}`;
|
|
352
353
|
type Add1<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends 2 ? 3 : T extends 3 ? 4 : T extends 4 ? 5 : never;
|
|
353
354
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rentman/rm-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "63.0.0",
|
|
4
4
|
"description": "Rentman core functionalities",
|
|
5
5
|
"main": "./dist/rm-core.js",
|
|
6
6
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@angular/core": "^20",
|
|
17
17
|
"@eslint/js": "^9.8.0",
|
|
18
|
-
"@rentman/backend-types": "4.
|
|
18
|
+
"@rentman/backend-types": "4.818.0-28-gc3d424afbb",
|
|
19
19
|
"@stylistic/eslint-plugin-ts": "^2.7.2",
|
|
20
20
|
"@types/eslint__js": "^8.42.3",
|
|
21
21
|
"clean-webpack-plugin": "^0.1.19",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@angular/core": "^20",
|
|
37
|
-
"@rentman/backend-types": ">=4.
|
|
37
|
+
"@rentman/backend-types": ">=4.818.0-28-gc3d424afbb",
|
|
38
38
|
"moment": "^2.30.1",
|
|
39
39
|
"rxjs": "^7"
|
|
40
40
|
},
|