@rentman/rm-core 63.4.1-blr-01 → 63.4.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/rm-core.js +1 -1
- package/dist/rm-core.js.map +1 -1
- package/dist/types/src/classes/BusinessLogicManager/AantalBusinessLogicRuleBase.d.ts +11 -9
- package/dist/types/src/classes/BusinessLogicManager/AantaltotaalBusinessLogicRuleBase.d.ts +11 -12
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicManager.d.ts +7 -6
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRule.d.ts +9 -2
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRuleApplyContext.d.ts +10 -3
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRuleConditionContext.d.ts +17 -5
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRuleContextBase.d.ts +55 -4
- package/dist/types/src/classes/BusinessLogicManager/Customfield/CustomFieldLinkedItemTypeBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Customfield/CustomFieldTypeBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/DefaultContactPersonUpdateBusinessLogicRule.d.ts +13 -34
- package/dist/types/src/classes/BusinessLogicManager/Documents/DocumentTemplateBusinessLogicRule.d.ts +2 -3
- package/dist/types/src/classes/BusinessLogicManager/Exemplaar/ExemplaarAanschafdatumBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurBetalingsconditieBusinessLogicRule.d.ts +6 -11
- package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurDatumBusinessLogicRule.d.ts +4 -5
- package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurNumberseriesBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Files/FilesNameExtensionBusinessLogicRule.d.ts +2 -3
- package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieNaaminternBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieTwowayBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Functie/functieTravelDistanceUtils.d.ts +1 -1
- package/dist/types/src/classes/BusinessLogicManager/Functiegroep/FunctiegroepSubprojectBusinessLogicRule.d.ts +3 -9
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalBulkToSerialBusinessLogicRule.d.ts +2 -4
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalSerialToBulkBusinessLogicRule.d.ts +2 -4
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalVerhuurBusinessLogicRule.d.ts +2 -2
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/SurfaceArticleSizeBusinessLogicRule.d.ts +10 -2
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemBusinessLogicRuleBase.d.ts +17 -10
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemDurationBusinessLogicRule.d.ts +4 -4
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemMateriaalCatBusinessLogicRule.d.ts +7 -6
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemSubprojectBusinessLogicRule.d.ts +20 -5
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemTimeSchemeBusinessLogicRule.d.ts +5 -7
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemTimeSchemeStartBusinessLogicRule.d.ts +5 -7
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemTimeValueStartBusinessLogicRule.d.ts +5 -6
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/TimeColumnUtil.d.ts +1 -1
- package/dist/types/src/classes/BusinessLogicManager/OfferteContract/OfferteContractDatumBusinessLogicRule.d.ts +2 -3
- package/dist/types/src/classes/BusinessLogicManager/PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule.d.ts +4 -6
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalOptieBusinessLogicRule.d.ts +1 -1
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalParentBusinessLogicRule.d.ts +3 -1
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalStaysAtLocationBusinessLogicRule.d.ts +10 -3
- package/dist/types/src/classes/BusinessLogicManager/Project/ProjectContactProjectNoteBusinessLogicRule.d.ts +3 -5
- package/dist/types/src/classes/BusinessLogicManager/Project/ProjectOneSubLocationAlignBusinessRule.d.ts +2 -4
- package/dist/types/src/classes/BusinessLogicManager/Rate/RateDeactivateExistingOnCreateBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieExemplaarAantalBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieLostItemExemplaarLocationBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolEditOwnDataBusinessLogicRule.d.ts +3 -2
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolPersoneelsplannerToegangBusinessLogicRule.d.ts +3 -2
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenBewerkenBusinessLogicRule.d.ts +3 -2
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenToegangBusinessLogicRule.d.ts +4 -2
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolVisibilityFinancialsBusinessLogicRule.d.ts +7 -2
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolWarehosueTrackingLogAccessBusinessLogicRule.d.ts +3 -2
- package/dist/types/src/classes/BusinessLogicManager/Setinhoud/SetinhoudCreateFixedBusinessLogicRule.d.ts +4 -4
- package/dist/types/src/classes/BusinessLogicManager/Subproject/SubprojectInPlanningBusinessLogicRule.d.ts +1 -2
- package/dist/types/src/classes/BusinessLogicManager/Subproject/SubprojectOneSubLocationAlignBusinessRule.d.ts +2 -4
- package/dist/types/src/classes/BusinessLogicManager/Subproject/SubprojectOneSubNameAlignBusinessRule.d.ts +2 -4
- package/dist/types/src/classes/BusinessLogicManager/Taak/TaakDeadlineOffsetBusinessLogicRule.d.ts +2 -2
- package/dist/types/src/classes/BusinessLogicManager/Tijd/TijdPropagateNameToFunctiegroepBusinessLogicRule.d.ts +2 -4
- package/dist/types/src/classes/BusinessLogicManager/Tijd/TijdSubprojectChangedBusinessLogicRule.d.ts +2 -6
- package/dist/types/src/classes/BusinessLogicManager/Uren/HoursTypeBusinessLogicRuleBase.d.ts +2 -1
- package/dist/types/src/classes/ChangesDelta.d.ts +9 -7
- package/dist/types/src/classes/ChangesDeltaBase.d.ts +14 -11
- package/dist/types/src/classes/ChangesProcessor.d.ts +3 -3
- package/dist/types/src/classes/ChildChangesDelta.d.ts +7 -18
- package/dist/types/src/classes/CreatedChangesDelta.d.ts +2 -2
- package/dist/types/src/classes/ParentChangesDelta.d.ts +6 -7
- package/dist/types/src/classes/SocketMessageHandler.d.ts +2 -4
- package/dist/types/src/classes/Util.d.ts +0 -1
- package/dist/types/src/classes/cache/AbstractCache.d.ts +6 -1
- package/dist/types/src/classes/cache/server/ServerCache.d.ts +2 -4
- package/dist/types/src/classes/cache/transaction/TransactionCache.d.ts +23 -69
- package/dist/types/src/core.d.ts +2 -0
- package/dist/types/src/factories/ChangesCompilationFactory.d.ts +5 -0
- package/dist/types/src/interfaces/ServerCacheDependencyInterface.d.ts +2 -1
- package/dist/types/src/internal.d.ts +1 -0
- package/package.json +2 -2
|
@@ -5,8 +5,16 @@ import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
7
|
type ConditionResult = ItemId[];
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
type DependencyColumns = [
|
|
9
|
+
'width',
|
|
10
|
+
'height',
|
|
11
|
+
'oppervlakteartikel',
|
|
12
|
+
'nieuwprijs',
|
|
13
|
+
'inhuurprijs',
|
|
14
|
+
'verhuurprijs',
|
|
15
|
+
'naam'
|
|
16
|
+
];
|
|
17
|
+
type Dependency = ItemResource<'Materiaal', DependencyColumns>[];
|
|
10
18
|
export declare class SurfaceArticleSizeBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
11
19
|
condition({ previousChangesDelta, }: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
12
20
|
dependency(transaction: TransactionCache, materiaalIds: ConditionResult): Promise<Dependency>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ItemEntry } from '../../../models/ItemEntry';
|
|
2
2
|
import { ItemResource } from '../../../models/ItemResource';
|
|
3
|
-
import { ApiRequestColumnArray } from '../../../types/ItemTypesCollection';
|
|
3
|
+
import { ApiRequestColumnArray, GetFieldValueType } from '../../../types/ItemTypesCollection';
|
|
4
4
|
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
5
|
+
import { ChangesDeltaItemCreateDelta } from '../../CreatedChangesDelta';
|
|
5
6
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
6
7
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
8
|
import { LinkedTimeItemType, TimeColumnId } from './TimeColumnUtil';
|
|
@@ -16,24 +17,30 @@ type LinkedTimeItemRequestColumnsMapToItemResourceMap<RequestColumnsMap extends
|
|
|
16
17
|
export type LinkedTimeItemResourceMap<RequestColumns extends ApiRequestColumnArray<LinkedTimeItemType>> = {
|
|
17
18
|
[ItemType in LinkedTimeItemType]: ItemResource<ItemType, RequestColumns>[];
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
export type LinkedTimeItemBusinessLogicRuleBaseColumnMap<RequestColumns extends LinkedTimeItemColumnArray> = {
|
|
23
|
-
[ItemType in LinkedTimeItemType]: Map<ItemEntry<LinkedTimeItemType>, RequestColumns[number][]>;
|
|
20
|
+
type CreatedTupleMap = {
|
|
21
|
+
[ItemType in LinkedTimeItemType]: ChangesDeltaItemCreateDelta<ItemType>[];
|
|
24
22
|
};
|
|
23
|
+
export type LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<RequestColumns extends LinkedTimeItemColumnArray> = {
|
|
24
|
+
[ItemType in LinkedTimeItemType]: UpdatedTuple<LinkedTimeItemType, RequestColumns[number]>[];
|
|
25
|
+
};
|
|
26
|
+
interface UpdatedTuple<ItemTypeType extends LinkedTimeItemType, ColumnId extends LinkedTimeItemColumn = LinkedTimeItemColumn> {
|
|
27
|
+
itemEntry: ItemEntry<ItemTypeType>;
|
|
28
|
+
columnId: ColumnId;
|
|
29
|
+
newValue: GetFieldValueType<ItemTypeType, ColumnId>;
|
|
30
|
+
}
|
|
25
31
|
export declare abstract class LinkedTimeItemBusinessLogicRuleBase<ConditionColumns extends LinkedTimeItemColumnArray, ConditionResult, Dependency> extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
26
32
|
protected conditionColumns: ConditionColumns;
|
|
33
|
+
protected extractCreatedTuples(context: BusinessLogicRuleConditionContext): CreatedTupleMap;
|
|
27
34
|
/**
|
|
28
35
|
* Extract updated fields of functions / function groups / equipment groups, using the columns specified in
|
|
29
36
|
* `conditionColumns`.
|
|
30
37
|
*/
|
|
31
|
-
protected extractUpdatedTuples(context: BusinessLogicRuleConditionContext
|
|
38
|
+
protected extractUpdatedTuples(context: BusinessLogicRuleConditionContext): LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<ConditionColumns>;
|
|
32
39
|
/**
|
|
33
40
|
* Like {@link extractUpdatedTuples}, but returns `undefined` when no fields have been updated.
|
|
34
41
|
*/
|
|
35
|
-
protected extractUpdatedTuplesCondition(context: BusinessLogicRuleConditionContext):
|
|
36
|
-
protected fetchLinkedItemResourcesWithColumns<RequestColumnsMap extends LinkedTimeItemRequestColumnsMap>(transaction: TransactionCache,
|
|
37
|
-
protected fetchLinkedItemResources<RequestColumns extends ApiRequestColumnArray<LinkedTimeItemType>>(transaction: TransactionCache,
|
|
42
|
+
protected extractUpdatedTuplesCondition(context: BusinessLogicRuleConditionContext): LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<ConditionColumns> | typeof BLR_SKIP_RULE;
|
|
43
|
+
protected fetchLinkedItemResourcesWithColumns<RequestColumnsMap extends LinkedTimeItemRequestColumnsMap>(transaction: TransactionCache, updatedTuples: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<any>, requestColumnsMap: RequestColumnsMap): Promise<LinkedTimeItemRequestColumnsMapToItemResourceMap<RequestColumnsMap>>;
|
|
44
|
+
protected fetchLinkedItemResources<RequestColumns extends ApiRequestColumnArray<LinkedTimeItemType>>(transaction: TransactionCache, updatedTuples: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<any>, requestColumns: RequestColumns): Promise<LinkedTimeItemResourceMap<RequestColumns>>;
|
|
38
45
|
}
|
|
39
46
|
export {};
|
|
@@ -2,16 +2,16 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
2
2
|
import { BLR_SKIP_RULE } from '../BusinessLogicRule';
|
|
3
3
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
4
4
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
5
|
-
import { LinkedTimeItemBusinessLogicRuleBase,
|
|
5
|
+
import { LinkedTimeItemBusinessLogicRuleBase, LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples, LinkedTimeItemResourceMap } from './LinkedTimeItemBusinessLogicRuleBase';
|
|
6
6
|
declare const conditionColumns: readonly ["gebruikvan", "gebruiktot"];
|
|
7
7
|
declare const requestColumns: readonly ["gebruikvan", "gebruiktot", "duur"];
|
|
8
8
|
/**
|
|
9
9
|
* When changing 'gebruikvan' or 'gebruiktot', and both fields are valid, set the duration.
|
|
10
10
|
*/
|
|
11
|
-
export declare class LinkedTimeItemDurationBusinessLogicRule extends LinkedTimeItemBusinessLogicRuleBase<typeof conditionColumns,
|
|
11
|
+
export declare class LinkedTimeItemDurationBusinessLogicRule extends LinkedTimeItemBusinessLogicRuleBase<typeof conditionColumns, LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof conditionColumns>, LinkedTimeItemResourceMap<typeof requestColumns>> {
|
|
12
12
|
protected conditionColumns: readonly ["gebruikvan", "gebruiktot"];
|
|
13
|
-
condition(context: BusinessLogicRuleConditionContext):
|
|
13
|
+
condition(context: BusinessLogicRuleConditionContext): LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof conditionColumns> | typeof BLR_SKIP_RULE;
|
|
14
14
|
apply(context: BusinessLogicRuleApplyContext, dependencies: LinkedTimeItemResourceMap<typeof requestColumns>): void;
|
|
15
|
-
dependency(transaction: TransactionCache, conditionResult:
|
|
15
|
+
dependency(transaction: TransactionCache, conditionResult: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof conditionColumns>): Promise<LinkedTimeItemResourceMap<typeof requestColumns>>;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -4,9 +4,8 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare const materiaalCatColumns: readonly ["id", "gebruikvan", "planvan", "gebruiktot", "plantot", "schema_gv_begin", "schema_gt_begin", "schema_pv_begin", "schema_pt_begin", {
|
|
7
|
+
type ConditionResult = ItemId<'MateriaalCat'>[];
|
|
8
|
+
declare const changedMateriaalCatResourceColumns: readonly ["gebruikvan", "gebruiktot", "planvan", "plantot", {
|
|
10
9
|
readonly schema_pv: readonly ["van", "tot", "is_absolute_times_substitute"];
|
|
11
10
|
}, {
|
|
12
11
|
readonly schema_pt: readonly ["van", "tot", "is_absolute_times_substitute"];
|
|
@@ -15,10 +14,12 @@ declare const materiaalCatColumns: readonly ["id", "gebruikvan", "planvan", "geb
|
|
|
15
14
|
}, {
|
|
16
15
|
readonly schema_gt: readonly ["van", "tot", "is_absolute_times_substitute"];
|
|
17
16
|
}];
|
|
18
|
-
type Dependency =
|
|
17
|
+
type Dependency = {
|
|
18
|
+
changedResources: ItemResource<'MateriaalCat', typeof changedMateriaalCatResourceColumns>[];
|
|
19
|
+
};
|
|
19
20
|
export declare class LinkedTimeItemMateriaalCatBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
20
21
|
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
21
|
-
dependency(transaction: TransactionCache,
|
|
22
|
-
apply(context: BusinessLogicRuleApplyContext, dependency: Dependency
|
|
22
|
+
dependency(transaction: TransactionCache, changedMateriaalCatItemIds: ConditionResult): Promise<Dependency>;
|
|
23
|
+
apply(context: BusinessLogicRuleApplyContext, dependency: Dependency): void;
|
|
23
24
|
}
|
|
24
25
|
export {};
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { ItemEntry } from '../../../models/ItemEntry';
|
|
2
|
+
import { ChangesDeltaItemCreateDelta } from '../../CreatedChangesDelta';
|
|
2
3
|
import { BLR_SKIP_RULE } from '../BusinessLogicRule';
|
|
3
4
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
4
5
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
5
6
|
import { LinkedTimeItemBusinessLogicRuleBase } from './LinkedTimeItemBusinessLogicRuleBase';
|
|
6
7
|
import { LinkedTimeItemType } from './TimeColumnUtil';
|
|
7
8
|
declare const conditionColumns: readonly ["project", "subproject"];
|
|
9
|
+
/**
|
|
10
|
+
* Function items are the only linked time item that have a 'timeframe' field, which, like the 'schema_**' fields,
|
|
11
|
+
* refers to a project time.
|
|
12
|
+
*/
|
|
8
13
|
declare const schemeValueTimeFrameColumnIds: readonly ["schema_gv", "schema_pv", "schema_gt", "schema_pt", "timeframe"];
|
|
9
14
|
type SchemeValueTimeFrameColumnId = (typeof schemeValueTimeFrameColumnIds)[number];
|
|
10
|
-
type
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
type CreatedUpdatedTuple<ItemTypeType extends LinkedTimeItemType> = {
|
|
16
|
+
created: {
|
|
17
|
+
item: ChangesDeltaItemCreateDelta<ItemTypeType>;
|
|
18
|
+
invalidTimes: SchemeValueTimeFrameColumnId[];
|
|
19
|
+
}[];
|
|
20
|
+
updated: {
|
|
21
|
+
item: ItemEntry<ItemTypeType>;
|
|
22
|
+
invalidTimes: SchemeValueTimeFrameColumnId[];
|
|
23
|
+
}[];
|
|
13
24
|
};
|
|
14
25
|
export type LinkedTimeItemSubprojectBusinessLogicRuleConditionResult = {
|
|
15
|
-
[ItemType in LinkedTimeItemType]:
|
|
26
|
+
[ItemType in LinkedTimeItemType]: CreatedUpdatedTuple<ItemType>;
|
|
16
27
|
};
|
|
17
28
|
/**
|
|
18
29
|
* When updating the subproject of a function / function group / equipment group, or creating a new
|
|
@@ -28,6 +39,10 @@ export declare class LinkedTimeItemSubprojectBusinessLogicRule extends LinkedTim
|
|
|
28
39
|
private validateLinkedTimes;
|
|
29
40
|
private getInvalidTimeColumnIds;
|
|
30
41
|
private extractTimeItemIds;
|
|
31
|
-
|
|
42
|
+
/**
|
|
43
|
+
* The iterator includes the IDs of all times linked to the items in the updated or created items.
|
|
44
|
+
*/
|
|
45
|
+
private getCreatedItemTimeIdIterator;
|
|
46
|
+
private getUpdatedItemTimeIdIterator;
|
|
32
47
|
}
|
|
33
48
|
export {};
|
|
@@ -3,8 +3,7 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
3
3
|
import { BLR_SKIP_RULE } from '../BusinessLogicRule';
|
|
4
4
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
5
5
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
6
|
-
import {
|
|
7
|
-
import { LinkedTimeItemBusinessLogicRuleBase, LinkedTimeItemBusinessLogicRuleBaseColumnMap, LinkedTimeItemResourceMap } from './LinkedTimeItemBusinessLogicRuleBase';
|
|
6
|
+
import { LinkedTimeItemBusinessLogicRuleBase, LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples, LinkedTimeItemResourceMap } from './LinkedTimeItemBusinessLogicRuleBase';
|
|
8
7
|
import { TimeColumnUtil } from './TimeColumnUtil';
|
|
9
8
|
declare const requestColumns: readonly ["gebruikvan", "planvan", "gebruiktot", "plantot", "schema_gv_begin", "schema_gt_begin", "schema_pv_begin", "schema_pt_begin"];
|
|
10
9
|
export declare const timeColumns: readonly ["id", "van", "tot"];
|
|
@@ -12,18 +11,17 @@ interface Dependency {
|
|
|
12
11
|
timeResources: ItemResource<'Tijd', typeof timeColumns>[];
|
|
13
12
|
linkedTimeItemResources: LinkedTimeItemResourceMap<typeof requestColumns>;
|
|
14
13
|
}
|
|
15
|
-
type SchemeValueColumnIds = typeof TimeColumnUtil.schemeValueColumnIds;
|
|
16
14
|
/**
|
|
17
15
|
* - When setting 'schema_gv', set 'gebruikvan' to the corresponding time, and 'schema_gv_begin' to `true`.
|
|
18
16
|
* - When setting 'schema_gt', set 'gebruiktot' to the corresponding time, and 'schema_gt_begin' to `false`.
|
|
19
17
|
* - When setting 'schema_pv', set 'planvan' to the corresponding time, and 'schema_pv_begin' to `true`.
|
|
20
18
|
* - When setting 'schema_pt', set 'plantot' to the corresponding time, and 'schema_pt_begin' to `false`.
|
|
21
19
|
*/
|
|
22
|
-
export declare class LinkedTimeItemTimeSchemeBusinessLogicRule extends LinkedTimeItemBusinessLogicRuleBase<
|
|
20
|
+
export declare class LinkedTimeItemTimeSchemeBusinessLogicRule extends LinkedTimeItemBusinessLogicRuleBase<typeof TimeColumnUtil.schemeValueColumnIds, LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.schemeValueColumnIds>, Dependency> {
|
|
23
21
|
protected conditionColumns: readonly ["schema_gv", "schema_pv", "schema_gt", "schema_pt"];
|
|
24
|
-
condition(context: BusinessLogicRuleConditionContext):
|
|
25
|
-
dependency(transaction: TransactionCache, conditionResult:
|
|
26
|
-
apply(context: BusinessLogicRuleApplyContext, dependency: Dependency, conditionResult:
|
|
22
|
+
condition(context: BusinessLogicRuleConditionContext): LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.schemeValueColumnIds> | typeof BLR_SKIP_RULE;
|
|
23
|
+
dependency(transaction: TransactionCache, conditionResult: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.schemeValueColumnIds>): Promise<Dependency>;
|
|
24
|
+
apply(context: BusinessLogicRuleApplyContext, dependency: Dependency, conditionResult: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.schemeValueColumnIds>): void;
|
|
27
25
|
private getTimeItemIds;
|
|
28
26
|
}
|
|
29
27
|
export {};
|
|
@@ -2,19 +2,17 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
2
2
|
import { BLR_SKIP_RULE } from '../BusinessLogicRule';
|
|
3
3
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
4
4
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
5
|
-
import { LinkedTimeItemBusinessLogicRuleBase,
|
|
5
|
+
import { LinkedTimeItemBusinessLogicRuleBase, LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples, LinkedTimeItemResourceMap } from './LinkedTimeItemBusinessLogicRuleBase';
|
|
6
6
|
import { TimeColumnUtil } from './TimeColumnUtil';
|
|
7
|
-
type SchemeValueStartColumnIds = typeof TimeColumnUtil.schemeValueStartColumnIds;
|
|
8
7
|
/**
|
|
9
8
|
* - If 'schema_gv' changes, while 'schema_gv_start' is `true`, and previously, 'schema_gv' and 'schema_gt' had the same
|
|
10
9
|
* value, set 'schema_gt' to the new value of 'schema_gv'.
|
|
11
10
|
* - If 'schema_pv' changes, while 'schema_pv_start' is `true` and previously, 'schema_pv' and 'schema_pt' had the same
|
|
12
11
|
* value, set 'schema_pt' to the new value of 'schema_pv'.
|
|
13
12
|
*/
|
|
14
|
-
export declare class LinkedTimeItemTimeSchemeStartBusinessLogicRule extends LinkedTimeItemBusinessLogicRuleBase<
|
|
13
|
+
export declare class LinkedTimeItemTimeSchemeStartBusinessLogicRule extends LinkedTimeItemBusinessLogicRuleBase<typeof TimeColumnUtil.schemeValueStartColumnIds, LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.schemeValueStartColumnIds>, LinkedTimeItemResourceMap<typeof TimeColumnUtil.schemeValueColumnIds>> {
|
|
15
14
|
protected conditionColumns: readonly ["schema_gv", "schema_pv"];
|
|
16
|
-
condition(context: BusinessLogicRuleConditionContext):
|
|
17
|
-
dependency(transaction: TransactionCache, conditionResult:
|
|
18
|
-
apply(context: BusinessLogicRuleApplyContext,
|
|
15
|
+
condition(context: BusinessLogicRuleConditionContext): LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.schemeValueStartColumnIds> | typeof BLR_SKIP_RULE;
|
|
16
|
+
dependency(transaction: TransactionCache, conditionResult: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.schemeValueStartColumnIds>): Promise<LinkedTimeItemResourceMap<typeof TimeColumnUtil.schemeValueColumnIds>>;
|
|
17
|
+
apply(context: BusinessLogicRuleApplyContext, _dependencies: LinkedTimeItemResourceMap<typeof TimeColumnUtil.schemeValueColumnIds>, conditionResult: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.schemeValueStartColumnIds>): void;
|
|
19
18
|
}
|
|
20
|
-
export {};
|
|
@@ -2,20 +2,19 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
2
2
|
import { BLR_SKIP_RULE } from '../BusinessLogicRule';
|
|
3
3
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
4
4
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
5
|
-
import { LinkedTimeItemBusinessLogicRuleBase,
|
|
5
|
+
import { LinkedTimeItemBusinessLogicRuleBase, LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples, LinkedTimeItemResourceMap } from './LinkedTimeItemBusinessLogicRuleBase';
|
|
6
6
|
import { TimeColumnUtil } from './TimeColumnUtil';
|
|
7
7
|
declare const requestColumns: readonly ["gebruikvan", "planvan", "gebruiktot", "plantot", "schema_gt", "schema_pt"];
|
|
8
|
-
type ValueStartColumnIds = typeof TimeColumnUtil.valueStartColumnIds;
|
|
9
8
|
/**
|
|
10
9
|
* - When 'gebruikvan' changes, and 'gebruiktot' is invalid or equal to the previous value of 'gebruikvan',
|
|
11
10
|
* and 'schema_gt' is `null` (not referring to a time), set 'gebruiktot' to the new value of 'gebruikvan'.
|
|
12
11
|
* - When 'planvan' changes, and 'plantot' is invalid or equal to the previous value of 'planvan',
|
|
13
12
|
* and 'schema_pt' is `null` (not referring to a time), set 'plantot' to the new value of 'planvan'.
|
|
14
13
|
*/
|
|
15
|
-
export declare class LinkedTimeItemTimeValueStartBusinessLogicRule extends LinkedTimeItemBusinessLogicRuleBase<
|
|
14
|
+
export declare class LinkedTimeItemTimeValueStartBusinessLogicRule extends LinkedTimeItemBusinessLogicRuleBase<typeof TimeColumnUtil.valueStartColumnIds, LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.valueStartColumnIds>, LinkedTimeItemResourceMap<typeof requestColumns>> {
|
|
16
15
|
protected conditionColumns: readonly ["gebruikvan", "planvan"];
|
|
17
|
-
condition(context: BusinessLogicRuleConditionContext):
|
|
18
|
-
dependency(transaction: TransactionCache, conditionResult:
|
|
19
|
-
apply(context: BusinessLogicRuleApplyContext,
|
|
16
|
+
condition(context: BusinessLogicRuleConditionContext): LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.valueStartColumnIds> | typeof BLR_SKIP_RULE;
|
|
17
|
+
dependency(transaction: TransactionCache, conditionResult: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.valueStartColumnIds>): Promise<LinkedTimeItemResourceMap<typeof requestColumns>>;
|
|
18
|
+
apply(context: BusinessLogicRuleApplyContext, _dependencies: LinkedTimeItemResourceMap<typeof requestColumns>, conditionResult: LinkedTimeItemBusinessLogicRuleBaseUpdatedTuples<typeof TimeColumnUtil.valueStartColumnIds>): void;
|
|
20
19
|
}
|
|
21
20
|
export {};
|
|
@@ -15,7 +15,7 @@ type TimeItemFields = {
|
|
|
15
15
|
van: moment.Moment;
|
|
16
16
|
tot: moment.Moment;
|
|
17
17
|
};
|
|
18
|
-
export declare const LINKED_TIME_ITEM_TYPES: ["MateriaalCat", "Functie", "Functiegroep"];
|
|
18
|
+
export declare const LINKED_TIME_ITEM_TYPES: readonly ["MateriaalCat", "Functie", "Functiegroep"];
|
|
19
19
|
export type LinkedTimeItemType = (typeof LINKED_TIME_ITEM_TYPES)[number];
|
|
20
20
|
export type LinkedItemTypeFieldMap<ItemTypeType extends LinkedTimeItemType> = ItemTypeType extends 'Functie' ? FieldMap<'Functie', TimeColumnId[]> : FieldMap<ItemTypeType, TimeColumnIdExcludingTimeFrame[]>;
|
|
21
21
|
declare const nonReferenceProperties: readonly ["type", "isStart", "defaultValue"];
|
|
@@ -4,14 +4,13 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const requestColumns: readonly ["vervaldatum", "datum"];
|
|
8
7
|
type ConditionResult = {
|
|
9
8
|
Offerte: ItemId[];
|
|
10
9
|
Contract: ItemId[];
|
|
11
10
|
};
|
|
12
11
|
type Dependency = {
|
|
13
|
-
Offerte: ItemResource<'Offerte',
|
|
14
|
-
Contract: ItemResource<'Contract',
|
|
12
|
+
Offerte: ItemResource<'Offerte', ['vervaldatum']>[];
|
|
13
|
+
Contract: ItemResource<'Contract', ['vervaldatum']>[];
|
|
15
14
|
};
|
|
16
15
|
export declare class OfferteContractDatumBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
17
16
|
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
@@ -4,23 +4,21 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const planningColumns: readonly ["vervoer", "functie", "planvan", "plantot"];
|
|
8
|
-
declare const functieColumns: readonly ["id", "reistijd_vooraf", "reistijd_achteraf"];
|
|
9
7
|
type ConditionResult = {
|
|
10
8
|
Planningpersoneel: ItemId[];
|
|
11
9
|
Planningtransport: ItemId[];
|
|
12
10
|
};
|
|
13
11
|
type Dependency = {
|
|
14
|
-
Planningpersoneel: ItemResource<'Planningpersoneel',
|
|
15
|
-
Planningtransport: ItemResource<'Planningtransport',
|
|
12
|
+
Planningpersoneel: ItemResource<'Planningpersoneel', ['vervoer', 'functie', 'planvan', 'plantot']>[];
|
|
13
|
+
Planningtransport: ItemResource<'Planningtransport', ['vervoer', 'functie', 'planvan', 'plantot']>[];
|
|
16
14
|
Functie: {
|
|
17
|
-
[functieId: string]: ItemResource<'Functie',
|
|
15
|
+
[functieId: string]: ItemResource<'Functie', ['reistijd_vooraf', 'reistijd_achteraf']>;
|
|
18
16
|
};
|
|
19
17
|
};
|
|
20
18
|
export declare class PlanningPersoneelTransportBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
21
19
|
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
22
20
|
dependency(transaction: TransactionCache, itemIdMap: ConditionResult): Promise<Dependency>;
|
|
23
|
-
apply({ destinationChangesDelta, }: BusinessLogicRuleApplyContext, items: Dependency): void;
|
|
21
|
+
apply({ transaction, mergedChangesDelta, destinationChangesDelta, }: BusinessLogicRuleApplyContext, items: Dependency): void;
|
|
24
22
|
private updatePlanningColumns;
|
|
25
23
|
}
|
|
26
24
|
export {};
|
|
@@ -7,7 +7,7 @@ import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleCondition
|
|
|
7
7
|
type ConditionResult = ItemId[];
|
|
8
8
|
declare const childPlanningmateriaalColumns: readonly ["id", "optie", "parent"];
|
|
9
9
|
declare const changedPlanningMateriaalColumns: readonly ["id", "optie", "categorie", "parent", {
|
|
10
|
-
readonly materiaal: readonly ["
|
|
10
|
+
readonly materiaal: readonly ["type"];
|
|
11
11
|
}];
|
|
12
12
|
type Dependency = {
|
|
13
13
|
childPlanningmateriaalResourcesInCategories: ItemResource<'Planningmateriaal', typeof childPlanningmateriaalColumns>[];
|
|
@@ -4,7 +4,9 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const planningmateriaalColumns: readonly ["parent",
|
|
7
|
+
declare const planningmateriaalColumns: readonly ["parent", {
|
|
8
|
+
readonly setcontent: readonly ["is_fixed"];
|
|
9
|
+
}];
|
|
8
10
|
type ConditionResult = ItemId<'Planningmateriaal'>[];
|
|
9
11
|
type Dependency = ItemResource<'Planningmateriaal', typeof planningmateriaalColumns>[];
|
|
10
12
|
export declare class PlanningmateriaalParentBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ItemId } from '@rentman/backend-types';
|
|
2
2
|
import { ItemResource } from '../../../models/ItemResource';
|
|
3
3
|
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
4
|
+
import { ChangesDeltaItemCreateDelta } from '../../CreatedChangesDelta';
|
|
4
5
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
6
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
7
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
type ConditionResult =
|
|
8
|
+
type ConditionResult = {
|
|
9
|
+
changedItems: ItemId[];
|
|
10
|
+
createdItems: ChangesDeltaItemCreateDelta[];
|
|
11
|
+
};
|
|
8
12
|
declare const planningMateriaalColumns: readonly ["aantaltotaal", "stays_at_location", {
|
|
9
13
|
readonly categorie: readonly [{
|
|
10
14
|
readonly project: readonly [{
|
|
@@ -12,7 +16,10 @@ declare const planningMateriaalColumns: readonly ["aantaltotaal", "stays_at_loca
|
|
|
12
16
|
}];
|
|
13
17
|
}];
|
|
14
18
|
}];
|
|
15
|
-
type Dependency =
|
|
19
|
+
type Dependency = {
|
|
20
|
+
changedPlanningMateriaalResources: ItemResource<'Planningmateriaal', typeof planningMateriaalColumns>[];
|
|
21
|
+
createdItems: ChangesDeltaItemCreateDelta<'Planningmateriaal'>[];
|
|
22
|
+
};
|
|
16
23
|
/**
|
|
17
24
|
* @description
|
|
18
25
|
* If the planningmateriaal 'aantaltotaal' is changed in a transfer project, stays_at_location should copy this value.
|
|
@@ -20,6 +27,6 @@ type Dependency = ItemResource<'Planningmateriaal', typeof planningMateriaalColu
|
|
|
20
27
|
export declare class PlanningmateriaalStaysAtLocationBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
21
28
|
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
22
29
|
dependency(transaction: TransactionCache, conditionResult: ConditionResult): Promise<Dependency>;
|
|
23
|
-
apply(context: BusinessLogicRuleApplyContext,
|
|
30
|
+
apply(context: BusinessLogicRuleApplyContext, dependency: Dependency): void;
|
|
24
31
|
}
|
|
25
32
|
export {};
|
|
@@ -5,18 +5,16 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
5
5
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
6
6
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
7
7
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
8
|
-
declare const contactColumns: readonly ["projectnotitie_naam", "projectnotitie"];
|
|
9
|
-
declare const projectnotitieColumns: readonly ["naam", "omschrijving"];
|
|
10
8
|
type ConditionResult = {
|
|
11
9
|
projectId: ItemId;
|
|
12
|
-
updatedContactIds: Set<ItemId
|
|
10
|
+
updatedContactIds: Set<ItemId>;
|
|
13
11
|
}[];
|
|
14
12
|
type Dependency = {
|
|
15
13
|
template: Template<'Projectnotitie'>;
|
|
16
14
|
projectTuples: {
|
|
17
15
|
projectId: ItemId;
|
|
18
|
-
Contact: ItemResource<'Contact',
|
|
19
|
-
Projectnotitie: ItemResource<'Projectnotitie',
|
|
16
|
+
Contact: ItemResource<'Contact', ['projectnotitie_naam', 'projectnotitie']>[];
|
|
17
|
+
Projectnotitie: ItemResource<'Projectnotitie', ['naam', 'omschrijving']>[];
|
|
20
18
|
}[];
|
|
21
19
|
};
|
|
22
20
|
export declare class ProjectContactProjectNoteBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
@@ -4,13 +4,11 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const subprojectColumns: readonly ["id", "locatie"];
|
|
8
|
-
declare const projectColumns: readonly ["id", "locatie", "locatie_persoon"];
|
|
9
7
|
type ConditionResult = ItemId[];
|
|
10
8
|
type Dependency = {
|
|
11
9
|
[projectId: number]: {
|
|
12
|
-
subprojectResources: ItemResource<'Subproject',
|
|
13
|
-
projectResource: ItemResource<'Project',
|
|
10
|
+
subprojectResources: ItemResource<'Subproject', ['id', 'locatie']>[];
|
|
11
|
+
projectResource: ItemResource<'Project', ['id', 'locatie', 'locatie_persoon']>;
|
|
14
12
|
};
|
|
15
13
|
};
|
|
16
14
|
/**
|
|
@@ -4,9 +4,8 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const rateColumns: readonly ["rate_group", "active", "id"];
|
|
8
7
|
type ConditionResult = Set<ItemId>;
|
|
9
|
-
type Dependency = ItemResource<'Rate',
|
|
8
|
+
type Dependency = ItemResource<'Rate', ['rate_group', 'active', 'id']>[];
|
|
10
9
|
/**
|
|
11
10
|
* When new Rate items are created within a rate group, this rule deactivates all existing
|
|
12
11
|
* active rates in those groups by setting their `active` field to false.
|
|
@@ -4,9 +4,8 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const reparatieColumns: readonly ["aantal"];
|
|
8
7
|
type ConditionResult = ItemId[];
|
|
9
|
-
type Dependency = ItemResource<'Reparatie',
|
|
8
|
+
type Dependency = ItemResource<'Reparatie', ['aantal']>[];
|
|
10
9
|
export declare class ReparatiesExemplaarAantalBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
11
10
|
condition({ previousChangesDelta, }: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
12
11
|
dependency(transaction: TransactionCache, reparatieIds: ConditionResult): Promise<Dependency>;
|
|
@@ -5,14 +5,13 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
5
5
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
6
6
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
7
7
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
8
|
-
declare const exemplaarColumns: readonly ["id", "asset_location"];
|
|
9
8
|
type ConditionResult = {
|
|
10
9
|
entry: ItemEntry<'Reparatie' | 'MateriaalLost'>;
|
|
11
10
|
exemplaar: ItemId;
|
|
12
11
|
}[];
|
|
13
12
|
type Dependency = {
|
|
14
13
|
entries: ItemEntry<'Reparatie' | 'MateriaalLost'>[];
|
|
15
|
-
exemplaarResources: ItemResource<'Exemplaar',
|
|
14
|
+
exemplaarResources: ItemResource<'Exemplaar', ['id', 'asset_location']>[];
|
|
16
15
|
};
|
|
17
16
|
export declare class ReparatieLostItemExemplaarLocationBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
18
17
|
condition({ previousChangesDelta, }: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
package/dist/types/src/classes/BusinessLogicManager/Rol/RolEditOwnDataBusinessLogicRule.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const rolColumns: readonly ["general_eigen_medewerker_edit"];
|
|
8
7
|
type ConditionResult = ItemId[];
|
|
9
|
-
type Dependency = ItemResource<'Rol',
|
|
8
|
+
type Dependency = ItemResource<'Rol', [
|
|
9
|
+
'general_eigen_medewerker_edit'
|
|
10
|
+
]>[];
|
|
10
11
|
/**
|
|
11
12
|
* @description
|
|
12
13
|
* If you can access update crew data, you can also always update your own data
|
|
@@ -4,9 +4,10 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const rolColumns: readonly ["projecten_toegang"];
|
|
8
7
|
type ConditionResult = ItemId[];
|
|
9
|
-
type Dependency = ItemResource<'Rol',
|
|
8
|
+
type Dependency = ItemResource<'Rol', [
|
|
9
|
+
'projecten_toegang'
|
|
10
|
+
]>[];
|
|
10
11
|
/**
|
|
11
12
|
* @description
|
|
12
13
|
* If you can enter the crew planner you can also access projects
|
package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenBewerkenBusinessLogicRule.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const rolColumns: readonly ["materialen_tijdlijn"];
|
|
8
7
|
type ConditionResult = ItemId[];
|
|
9
|
-
type Dependency = ItemResource<'Rol',
|
|
8
|
+
type Dependency = ItemResource<'Rol', [
|
|
9
|
+
'materialen_tijdlijn'
|
|
10
|
+
]>[];
|
|
10
11
|
/**
|
|
11
12
|
* @description
|
|
12
13
|
* If you can edit projects you should be able to see the equipment availability
|
package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenToegangBusinessLogicRule.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const rolColumns: readonly ["uren_kosten", "visibility_financials"];
|
|
8
7
|
type ConditionResult = ItemId[];
|
|
9
|
-
type Dependency = ItemResource<'Rol',
|
|
8
|
+
type Dependency = ItemResource<'Rol', [
|
|
9
|
+
'uren_kosten',
|
|
10
|
+
'visibility_financials'
|
|
11
|
+
]>[];
|
|
10
12
|
/**
|
|
11
13
|
* @description
|
|
12
14
|
* If you have access to projects you should be able to make costs for registered hours
|
|
@@ -4,9 +4,14 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const rolColumns: readonly ["visibility_financials", "facturen_toegang", "projecten_facturen_maken", "projecten_offertes_maken", "projecten_toegang"];
|
|
8
7
|
type ConditionResult = ItemId[];
|
|
9
|
-
type Dependency = ItemResource<'Rol',
|
|
8
|
+
type Dependency = ItemResource<'Rol', [
|
|
9
|
+
'visibility_financials',
|
|
10
|
+
'facturen_toegang',
|
|
11
|
+
'projecten_facturen_maken',
|
|
12
|
+
'projecten_offertes_maken',
|
|
13
|
+
'projecten_toegang'
|
|
14
|
+
]>[];
|
|
10
15
|
/**
|
|
11
16
|
* @description
|
|
12
17
|
* If you're not allowed to see financials, then you should not have the permission to
|
|
@@ -5,8 +5,9 @@ import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
7
|
type ConditionResult = ItemId[];
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
type Dependency = ItemResource<'Rol', [
|
|
9
|
+
'magazijn_toegang'
|
|
10
|
+
]>[];
|
|
10
11
|
/**
|
|
11
12
|
* @description
|
|
12
13
|
* If you can enter access the Warehouse Tracking Log, you can also access Warehouse module
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ItemResource } from '../../../models/ItemResource';
|
|
2
1
|
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
3
|
-
import {
|
|
2
|
+
import { ChangesDeltaItemCreateDelta } from '../../CreatedChangesDelta';
|
|
4
3
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
4
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
5
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
6
|
+
import { LatestItem } from '../BusinessLogicRuleContextBase';
|
|
7
7
|
declare const materiaalColumns: readonly ["id", "type", "is_combination", "is_physical", "telexemplaren", "verhuur"];
|
|
8
|
-
type ConditionResult =
|
|
9
|
-
type Dependency = Record<string,
|
|
8
|
+
type ConditionResult = ChangesDeltaItemCreateDelta<'Setinhoud'>[];
|
|
9
|
+
type Dependency = Record<string, LatestItem<'Materiaal', typeof materiaalColumns>>;
|
|
10
10
|
/**
|
|
11
11
|
* Legacy users won't have the `FUNCTIONALITY_FLEXIBLE_COMBINATION_IN_PLANNING` flag, meaning the `is_fixed` column from `Setinhoud` column isn't editable
|
|
12
12
|
* With this business rule we enforce the correct (default) value based on the equipment properties (Backend enforces this as well)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ItemId } from '@rentman/backend-types';
|
|
2
2
|
import { BLR_SKIP_RULE, BusinessLogicRule, BusinessLogicRuleApplyContext, BusinessLogicRuleConditionContext, ItemResource, TransactionCache } from '../../../internal';
|
|
3
|
-
|
|
4
|
-
type Dependency = Map<ItemId<'Subproject'>, ItemResource<'Functie', typeof functieColumns>[]>;
|
|
3
|
+
type Dependency = Map<ItemId<'Subproject'>, ItemResource<'Functie', ['subproject', 'inplanning']>[]>;
|
|
5
4
|
type ConditionResult = Map<ItemId<'Subproject'>, boolean>;
|
|
6
5
|
/**
|
|
7
6
|
* Whenever the 'inplanning' field of a subproject changes, set the 'inplanning' field of all functions in the
|
|
@@ -4,13 +4,11 @@ import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
|
4
4
|
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
5
|
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
6
|
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
-
declare const subprojectColumns: readonly ["id", "project", "locatie", "locatie_persoon"];
|
|
8
|
-
declare const projectColumns: readonly ["id", "locatie"];
|
|
9
7
|
type ConditionResult = ItemId[];
|
|
10
8
|
type Dependency = {
|
|
11
9
|
[projectId: number]: {
|
|
12
|
-
Subproject: ItemResource<'Subproject',
|
|
13
|
-
Project: ItemResource<'Project',
|
|
10
|
+
Subproject: ItemResource<'Subproject', ['id', 'project', 'locatie', 'locatie_persoon']>;
|
|
11
|
+
Project: ItemResource<'Project', ['id', 'locatie']>;
|
|
14
12
|
amountOfSubprojects: number;
|
|
15
13
|
};
|
|
16
14
|
};
|