@rentman/rm-core 63.3.0 → 63.4.0-RM-47279
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/Functie/FunctieTravelDistanceFromLocationBusinessLogicRule.d.ts +18 -0
- package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieTravelDistanceUnlinkLocationBusinessLogicRule.d.ts +17 -0
- package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieTravelTimeFromLocationBusinessLogicRule.d.ts +23 -0
- package/dist/types/src/classes/BusinessLogicManager/Functie/functieTravelDistanceUtils.d.ts +9 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalChangePeriodBusinessLogicRule.d.ts +19 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalCreatePeriodBusinessLogicRule.d.ts +18 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalMateriaalCatPeriodBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalPeriodBusinessLogicRuleBase.d.ts +17 -0
- package/dist/types/src/classes/BusinessLogicManager/registeredBusinessLogicRules.d.ts +7 -1
- package/package.json +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
3
|
+
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
4
|
+
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
5
|
+
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
6
|
+
import { FunctieTravelDistanceDependency } from './functieTravelDistanceUtils';
|
|
7
|
+
type ConditionResult = ItemId[];
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* When the `afstand_van_locatie` field is updated to true, we want to calculate the distance based on the linked location.
|
|
11
|
+
* If `twoway` is true, we want to multiply that distance by 2.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FunctieTravelDistanceFromLocationBusinessLogicRule extends BusinessLogicRule<ConditionResult, FunctieTravelDistanceDependency> {
|
|
14
|
+
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
15
|
+
dependency(transaction: TransactionCache, conditionResult: ConditionResult): Promise<FunctieTravelDistanceDependency>;
|
|
16
|
+
apply(context: BusinessLogicRuleApplyContext, dependencies: FunctieTravelDistanceDependency): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
3
|
+
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
4
|
+
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
5
|
+
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
6
|
+
import { FunctieTravelDistanceDependency } from './functieTravelDistanceUtils';
|
|
7
|
+
type ConditionResult = ItemId[];
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* When we set a distance manually, we want to set afstand_van_locatie to false if the new distance doesn't match the distance of the location
|
|
11
|
+
*/
|
|
12
|
+
export declare class FunctieTravelDistanceUnlinkLocationBusinessLogicRule extends BusinessLogicRule<ConditionResult, FunctieTravelDistanceDependency> {
|
|
13
|
+
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
14
|
+
dependency(transaction: TransactionCache, conditionResult: ConditionResult): Promise<FunctieTravelDistanceDependency>;
|
|
15
|
+
apply(context: BusinessLogicRuleApplyContext, dependencies: FunctieTravelDistanceDependency): void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ItemResource } from '../../../models/ItemResource';
|
|
3
|
+
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
4
|
+
import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
|
+
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
|
+
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
+
type ConditionResult = ItemId[];
|
|
8
|
+
declare const functieColumns: readonly [{
|
|
9
|
+
readonly subproject: readonly [{
|
|
10
|
+
readonly locatie: readonly ["reistijd"];
|
|
11
|
+
}];
|
|
12
|
+
}];
|
|
13
|
+
type Dependency = ItemResource<'Functie', typeof functieColumns>[];
|
|
14
|
+
/**
|
|
15
|
+
* @description
|
|
16
|
+
* When the `reistijd_van_locatie` field is updated to true, we want to calculate the travel times (reistijd_vooraf, reistijd_achteraf) based on the linked location.
|
|
17
|
+
*/
|
|
18
|
+
export declare class FunctieTravelTimeFromLocationBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
19
|
+
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
20
|
+
dependency(transaction: TransactionCache, conditionResult: ConditionResult): Promise<Dependency>;
|
|
21
|
+
apply(context: BusinessLogicRuleApplyContext, dependencies: Dependency): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ItemResource } from '../../../models/ItemResource';
|
|
2
|
+
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
3
|
+
export declare const functieTravelDistanceColumns: readonly ["twoway", {
|
|
4
|
+
readonly subproject: readonly [{
|
|
5
|
+
readonly locatie: readonly ["kilometers"];
|
|
6
|
+
}];
|
|
7
|
+
}];
|
|
8
|
+
export type FunctieTravelDistanceDependency = ItemResource<'Functie', typeof functieTravelDistanceColumns>[];
|
|
9
|
+
export declare function calculateTravelDistance(context: BusinessLogicRuleApplyContext, functieResource: FunctieTravelDistanceDependency[number]): number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ItemResource } from '../../../models/ItemResource';
|
|
3
|
+
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
4
|
+
import { BLR_SKIP_RULE } from '../BusinessLogicRule';
|
|
5
|
+
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
|
+
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
+
import { BusinessLogicRuleContextBase, LatestItem } from '../BusinessLogicRuleContextBase';
|
|
8
|
+
import { materiaalCatColumns, PlanningmateriaalPeriodBusinessLogicRuleBase } from './PlanningmateriaalPeriodBusinessLogicRuleBase';
|
|
9
|
+
type ConditionResult = ItemId<'Planningmateriaal'>[];
|
|
10
|
+
type Dependency = {
|
|
11
|
+
relatedMateriaalCats: LatestItem<'MateriaalCat', typeof materiaalCatColumns>[];
|
|
12
|
+
changedItems: ItemResource<'Planningmateriaal', readonly ['categorie']>[];
|
|
13
|
+
};
|
|
14
|
+
export declare class PlanningmateriaalChangePeriodBusinessLogicRule extends PlanningmateriaalPeriodBusinessLogicRuleBase<ConditionResult, Dependency> {
|
|
15
|
+
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
16
|
+
dependency(transaction: TransactionCache, conditionResult: ConditionResult, context: BusinessLogicRuleContextBase): Promise<Dependency>;
|
|
17
|
+
apply(context: BusinessLogicRuleApplyContext, dependencyResources: Dependency): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
2
|
+
import { ChangesDeltaItemCreateDelta } from '../../CreatedChangesDelta';
|
|
3
|
+
import { BLR_SKIP_RULE } from '../BusinessLogicRule';
|
|
4
|
+
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
5
|
+
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
6
|
+
import { BusinessLogicRuleContextBase, LatestItem } from '../BusinessLogicRuleContextBase';
|
|
7
|
+
import { materiaalCatColumns, PlanningmateriaalPeriodBusinessLogicRuleBase } from './PlanningmateriaalPeriodBusinessLogicRuleBase';
|
|
8
|
+
type ConditionResult = ChangesDeltaItemCreateDelta<'Planningmateriaal'>[];
|
|
9
|
+
type Dependency = {
|
|
10
|
+
relatedMateriaalCats: LatestItem<'MateriaalCat', typeof materiaalCatColumns>[];
|
|
11
|
+
createdItems: ChangesDeltaItemCreateDelta<'Planningmateriaal'>[];
|
|
12
|
+
};
|
|
13
|
+
export declare class PlanningmateriaalCreatePeriodBusinessLogicRule extends PlanningmateriaalPeriodBusinessLogicRuleBase<ConditionResult, Dependency> {
|
|
14
|
+
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
15
|
+
dependency(_transaction: TransactionCache, createdItems: ConditionResult, context: BusinessLogicRuleContextBase): Promise<Dependency>;
|
|
16
|
+
apply(context: BusinessLogicRuleApplyContext, { createdItems, relatedMateriaalCats, }: Dependency): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ItemResource } from '../../../models/ItemResource';
|
|
3
|
+
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
4
|
+
import { BLR_SKIP_RULE } from '../BusinessLogicRule';
|
|
5
|
+
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
|
+
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
+
import { BusinessLogicRuleContextBase, LatestItem } from '../BusinessLogicRuleContextBase';
|
|
8
|
+
import { materiaalCatColumns, PlanningmateriaalPeriodBusinessLogicRuleBase } from './PlanningmateriaalPeriodBusinessLogicRuleBase';
|
|
9
|
+
declare const planningmateriaalColumns: readonly ["categorie", "duur", "schema_gt", "schema_gv", "schema_pt", "schema_pv", "schema_gt_begin", "schema_gv_begin", "schema_pt_begin", "schema_pv_begin"];
|
|
10
|
+
type ConditionResult = ItemId<'MateriaalCat'>[];
|
|
11
|
+
type Dependency = {
|
|
12
|
+
changedMateriaalCats: LatestItem<'MateriaalCat', typeof materiaalCatColumns>[];
|
|
13
|
+
affectedPlanningmateriaal: ItemResource<'Planningmateriaal', typeof planningmateriaalColumns>[];
|
|
14
|
+
};
|
|
15
|
+
export declare class PlanningmateriaalMateriaalCatPeriodBusinessLogicRule extends PlanningmateriaalPeriodBusinessLogicRuleBase<ConditionResult, Dependency> {
|
|
16
|
+
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
17
|
+
dependency(transaction: TransactionCache, changedMateriaalCatIds: ConditionResult, context: BusinessLogicRuleContextBase): Promise<Dependency>;
|
|
18
|
+
apply(context: BusinessLogicRuleApplyContext, dependency: Dependency): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BusinessLogicRule } from '../BusinessLogicRule';
|
|
2
|
+
import { LatestItem } from '../BusinessLogicRuleContextBase';
|
|
3
|
+
export declare const sharedTimeRelatedColumns: readonly ["duur", "schema_gt", "schema_gv", "schema_pt", "schema_pv", "schema_gt_begin", "schema_gv_begin", "schema_pt_begin", "schema_pv_begin"];
|
|
4
|
+
export declare const materiaalCatColumns: readonly ["id", "duur", "schema_gt", "schema_gv", "schema_pt", "schema_pv", "schema_gt_begin", "schema_gv_begin", "schema_pt_begin", "schema_pv_begin"];
|
|
5
|
+
export declare abstract class PlanningmateriaalPeriodBusinessLogicRuleBase<ConditionResult, Dependency> extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
6
|
+
protected getAllPeriodFieldsDataMap(relatedMateriaalCat: LatestItem<'MateriaalCat', typeof materiaalCatColumns>): {
|
|
7
|
+
readonly duur: import("moment").Duration;
|
|
8
|
+
readonly schema_gt: number | null;
|
|
9
|
+
readonly schema_gv: number | null;
|
|
10
|
+
readonly schema_pt: number | null;
|
|
11
|
+
readonly schema_pv: number | null;
|
|
12
|
+
readonly schema_gt_begin: boolean;
|
|
13
|
+
readonly schema_gv_begin: boolean;
|
|
14
|
+
readonly schema_pt_begin: boolean;
|
|
15
|
+
readonly schema_pv_begin: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -13,6 +13,9 @@ import { FactuurNumberseriesBusinessLogicRule } from './Factuur/FactuurNumberser
|
|
|
13
13
|
import { FilesNameExtensionBusinessLogicRule } from './Files/FilesNameExtensionBusinessLogicRule';
|
|
14
14
|
import { FunctieNaaminternBusinessLogicRule } from './Functie/FunctieNaaminternBusinessLogicRule';
|
|
15
15
|
import { FunctieRecureindBusinessLogicRule } from './Functie/FunctieRecureindBusinessLogicRule';
|
|
16
|
+
import { FunctieTravelDistanceFromLocationBusinessLogicRule } from './Functie/FunctieTravelDistanceFromLocationBusinessLogicRule';
|
|
17
|
+
import { FunctieTravelDistanceUnlinkLocationBusinessLogicRule } from './Functie/FunctieTravelDistanceUnlinkLocationBusinessLogicRule';
|
|
18
|
+
import { FunctieTravelTimeFromLocationBusinessLogicRule } from './Functie/FunctieTravelTimeFromLocationBusinessLogicRule';
|
|
16
19
|
import { FunctieTwowayBusinessLogicRule } from './Functie/FunctieTwowayBusinessLogicRule';
|
|
17
20
|
import { FunctiegroepSubprojectBusinessLogicRule } from './Functiegroep/FunctiegroepSubprojectBusinessLogicRule';
|
|
18
21
|
import { InhuurmateriaalAantalBusinessLogicRule } from './Inhuurmateriaal/InhuurmateriaalAantalBusinessLogicRule';
|
|
@@ -65,4 +68,7 @@ import { TaakDeadlineTypeBusinessLogicRule } from './Taak/TaakDeadlineTypeBusine
|
|
|
65
68
|
import { TaakDeadlineOffsetBusinessLogicRule } from './Taak/TaakDeadlineOffsetBusinessLogicRule';
|
|
66
69
|
import { TijdNameChangedBusinessLogicRule } from './Tijd/TijdNameChangedBusinessLogicRule';
|
|
67
70
|
import { TijdSubprojectChangedBusinessLogicRule } from './Tijd/TijdSubprojectChangedBusinessLogicRule';
|
|
68
|
-
|
|
71
|
+
import { PlanningmateriaalMateriaalCatPeriodBusinessLogicRule } from './Planningmateriaal/PlanningmateriaalMateriaalCatPeriodBusinessLogicRule';
|
|
72
|
+
import { PlanningmateriaalChangePeriodBusinessLogicRule } from './Planningmateriaal/PlanningmateriaalChangePeriodBusinessLogicRule';
|
|
73
|
+
import { PlanningmateriaalCreatePeriodBusinessLogicRule } from './Planningmateriaal/PlanningmateriaalCreatePeriodBusinessLogicRule';
|
|
74
|
+
export declare const registeredBusinessLogicRules: readonly [typeof DefaultContactPersonUpdateBusinessLogicRule, typeof ContactAddressBusinessLogicRule, typeof CustomFieldLinkedItemTypeBusinessLogicRule, typeof CustomFieldTypeBusinessLogicRule, typeof DocumentTemplateBusinessLogicRule, typeof ExemplaarAanschafdatumBusinessLogicRule, typeof ExemplaarBarcodeDeleteBusinessLogicRule, typeof FactuurBetalingsconditieBusinessLogicRule, typeof FactuurDatumBusinessLogicRule, typeof FactuurNumberseriesBusinessLogicRule, typeof FilesNameExtensionBusinessLogicRule, typeof FunctieNaaminternBusinessLogicRule, typeof FunctieTravelDistanceFromLocationBusinessLogicRule, typeof FunctieTravelDistanceUnlinkLocationBusinessLogicRule, typeof FunctieTravelTimeFromLocationBusinessLogicRule, typeof FunctieTwowayBusinessLogicRule, typeof FunctieRecureindBusinessLogicRule, typeof FunctiegroepSubprojectBusinessLogicRule, typeof InhuurmateriaalAantaltotaalBusinessLogicRule, typeof InhuurmateriaalAantalBusinessLogicRule, typeof MateriaalIsCombinationBusinessLogicRule, typeof MateriaalIsPhysicalCombinationBulkBusinessLogicRule, typeof MateriaalToVirtualBusinessLogicRule, typeof MateriaalToPhysicalBusinessLogicRule, typeof MateriaalBulkToSerialBusinessLogicRule, typeof MateriaalSerialToBulkBusinessLogicRule, typeof MateriaalTypePropertiesBusinessLogicRule, typeof MateriaalVerhuurBusinessLogicRule, typeof SurfaceArticleSizeBusinessLogicRule, typeof LinkedTimeItemDurationBusinessLogicRule, typeof LinkedTimeItemTimeSchemeBusinessLogicRule, typeof LinkedTimeItemTimeSchemeStartBusinessLogicRule, typeof LinkedTimeItemTimeValueStartBusinessLogicRule, typeof LinkedTimeItemSubprojectBusinessLogicRule, typeof LinkedTimeItemMateriaalCatBusinessLogicRule, typeof OfferteContractDatumBusinessLogicRule, typeof PlanningmateriaalAantalBusinessLogicRule, typeof PlanningmateriaalAantaltotaalBusinessLogicRule, typeof PlanningmateriaalOptieBusinessLogicRule, typeof PlanningmateriaalParentBusinessLogicRule, typeof PlanningmateriaalStaysAtLocationBusinessLogicRule, typeof PlanningmateriaalChangePeriodBusinessLogicRule, typeof PlanningmateriaalCreatePeriodBusinessLogicRule, typeof PlanningmateriaalMateriaalCatPeriodBusinessLogicRule, typeof PlanningPersoneelTransportBusinessLogicRule, typeof ProjectClientChangedBusinessLogicRule, typeof ProjectContactProjectNoteBusinessLogicRule, typeof ProjectOneSubLocationAlignBusinessLogicRule, typeof ProjectSubprojectDefaultTimeBusinessLogicRule, typeof PurchaseOrderOwnerBusinessLogicRule, typeof PurchaseOrderApprovalStatusBusinessLogicRule, typeof RateUpdatedBusinessLogicRule, typeof ReparatiesExemplaarAantalBusinessLogicRule, typeof ReparatieLostItemExemplaarLocationBusinessLogicRule, typeof RolEditOwnDataBusinessLogicRule, typeof RolFileAccessBusinessLogicRule, typeof RolPersoneelsplannerToegangBusinessLogicRule, typeof RolProjectenBewerkenBusinessLogicRule, typeof RolProjectenToegangBusinessLogicRule, typeof RolVisibilityFinancialsBusinessLogicRule, typeof RolWarehouseTrackingLogAccessBusinessLogicRule, typeof RolPurchaseOrderAttachPlanningBusinessLogicRule, typeof SetinhoudCreateFixedBusinessLogicRule, typeof SetinhoudUpdateFixedBusinessLogicRule, typeof SubprojectOneSubLocationAlignBusinessLogicRule, typeof SubprojectOneSubNameAlignBusinessLogicRule, typeof SubprojectInPlanningBusinessLogicRule, typeof TaakDeadlineTypeBusinessLogicRule, typeof TaakDeadlineOffsetBusinessLogicRule, typeof TijdSubprojectChangedBusinessLogicRule, typeof TijdNameChangedBusinessLogicRule, typeof AfspraakRecureindBusinessLogicRule, typeof BeschikbaarheidRecureindBusinessLogicRule];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rentman/rm-core",
|
|
3
|
-
"version": "63.
|
|
3
|
+
"version": "63.4.0-RM-47279",
|
|
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.849.0-30-ge19de76559",
|
|
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",
|