@rentman/rm-core 66.10.0 → 67.0.0-beta.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 +2 -1
- package/dist/rm-core.js.LICENSE.txt +3 -0
- package/dist/rm-core.js.map +1 -1
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRule.d.ts +1 -1
- package/dist/types/src/classes/BusinessLogicManager/{MateriaalCatFunctieFunctiegroep → FunctieFunctiegroep}/LinkedTimeItemSubprojectBusinessLogicRule.d.ts +2 -2
- package/dist/types/src/classes/BusinessLogicManager/{MateriaalCatFunctieFunctiegroep → FunctieFunctiegroep}/TimeColumnUtil.d.ts +1 -1
- package/dist/types/src/classes/BusinessLogicManager/Inhuurmateriaal/InhuurmateriaalFactorBusinessLogicRuleBase.d.ts +40 -0
- package/dist/types/src/classes/BusinessLogicManager/Inhuurmateriaal/InhuurmateriaalFactorCreateBusinessLogicRule.d.ts +17 -0
- package/dist/types/src/classes/BusinessLogicManager/Inhuurmateriaal/InhuurmateriaalFactorUpdateBusinessLogicRule.d.ts +16 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalCalculateDuurBusinessLogicRule.d.ts +29 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalCombinationChildrenBusinessLogicRuleBase.d.ts +31 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalCreatePeriodBusinessLogicRule.d.ts +28 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalEditTijdSchemaPlanningBusinessLogicRule.d.ts +16 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalEditTijdSchemaUsageBusinessLogicRule.d.ts +16 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalFactorUpdateBusinessLogicRule.d.ts +25 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalOptieBusinessLogicRule.d.ts +10 -19
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalParentSchemaBusinessLogicRule.d.ts +23 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/{PlanningmateriaalParentBusinessLogicRule.d.ts → PlanningmateriaalParentSetcontentBusinessLogicRule.d.ts} +6 -1
- package/dist/types/src/classes/BusinessLogicManager/Tijd/TijdCalculatePlanningmateriaalDuurBusinessLogicRule.d.ts +28 -0
- package/dist/types/src/classes/BusinessLogicManager/registeredBusinessLogicRules.d.ts +16 -8
- package/dist/types/src/classes/cache/AbstractCache.d.ts +1 -1
- package/dist/types/src/classes/cache/transaction/TransactionCache.d.ts +1 -1
- package/dist/types/src/index.d.ts +6 -1
- package/dist/types/src/internal.d.ts +1 -1
- package/dist/types/src/models/CollectionResource.d.ts +1 -1
- package/dist/types/src/services/rm-factor.service.d.ts +72 -0
- package/dist/types/src/services/rm-project-default-time.service.d.ts +72 -0
- package/package.json +4 -4
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemMateriaalCatBusinessLogicRule.d.ts +0 -24
- /package/dist/types/src/classes/BusinessLogicManager/{MateriaalCatFunctieFunctiegroep → FunctieFunctiegroep}/LinkedTimeItemBusinessLogicRuleBase.d.ts +0 -0
- /package/dist/types/src/classes/BusinessLogicManager/{MateriaalCatFunctieFunctiegroep → FunctieFunctiegroep}/LinkedTimeItemDurationBusinessLogicRule.d.ts +0 -0
- /package/dist/types/src/classes/BusinessLogicManager/{MateriaalCatFunctieFunctiegroep → FunctieFunctiegroep}/LinkedTimeItemTimeSchemeBusinessLogicRule.d.ts +0 -0
- /package/dist/types/src/classes/BusinessLogicManager/{MateriaalCatFunctieFunctiegroep → FunctieFunctiegroep}/LinkedTimeItemTimeSchemeStartBusinessLogicRule.d.ts +0 -0
- /package/dist/types/src/classes/BusinessLogicManager/{MateriaalCatFunctieFunctiegroep → FunctieFunctiegroep}/LinkedTimeItemTimeValueStartBusinessLogicRule.d.ts +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ItemResource } from '../models/ItemResource';
|
|
3
|
+
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
4
|
+
import { ChangesDeltaResult } from '../classes/ChildChangesDelta';
|
|
5
|
+
export declare const defaultTimeRequestColumns: readonly ["id", "displayname", "gebruiksperiode", "planperiode", "transport_pickup", "transport_return"];
|
|
6
|
+
export declare const defaultTimeResourceColumns: readonly ["id", "naam", "subproject", "van", "tot", "volgorde", "is_absolute_times_substitute"];
|
|
7
|
+
type DefaultTimeColumns = typeof defaultTimeRequestColumns;
|
|
8
|
+
export type RmProjectDefaultTimeColumnId = 'gebruiksperiode' | 'planperiode';
|
|
9
|
+
export type RmProjectDefaultTransportColumnId = 'transport_pickup' | 'transport_return';
|
|
10
|
+
export type RmProjectTimeTypeColumnId = RmProjectDefaultTimeColumnId | RmProjectDefaultTransportColumnId;
|
|
11
|
+
export type RmProjectDefaultTimeResources = {
|
|
12
|
+
project: ItemResource<'Project', DefaultTimeColumns>;
|
|
13
|
+
subproject: ItemResource<'Subproject', DefaultTimeColumns>;
|
|
14
|
+
usage: TimeResource | null;
|
|
15
|
+
plan: TimeResource | null;
|
|
16
|
+
};
|
|
17
|
+
export type RmDefaultTimeResourcesBySubprojectId = {
|
|
18
|
+
[subprojectId: number]: RmProjectDefaultTimeResources;
|
|
19
|
+
};
|
|
20
|
+
type TimeResource = ItemResource<'Tijd', typeof defaultTimeResourceColumns>;
|
|
21
|
+
/**
|
|
22
|
+
* @description Service containing methods to select a default usage or planning time given a project and subproject.
|
|
23
|
+
* Time resources are returned in this order of preference:
|
|
24
|
+
* 1. the subproject default time;
|
|
25
|
+
* 2. the project default time;
|
|
26
|
+
* 3. the last time in the given subproject;
|
|
27
|
+
* 4. the last in the given main project.
|
|
28
|
+
*/
|
|
29
|
+
export declare class RmProjectDefaultTimeService {
|
|
30
|
+
private static instance;
|
|
31
|
+
private constructor();
|
|
32
|
+
static construct(): RmProjectDefaultTimeService;
|
|
33
|
+
fetchDefaultTimeResourceByProjectId(transaction: TransactionCache, defaultTimeColumnId: RmProjectDefaultTimeColumnId, projectId: ItemId): Promise<TimeResource | null>;
|
|
34
|
+
fetchDefaultTimeResourceBySubprojectId(transaction: TransactionCache, defaultTimeColumnId: RmProjectDefaultTimeColumnId, subprojectId: ItemId): Promise<TimeResource | null>;
|
|
35
|
+
fetchDefaultTimeResourcesBySubprojectId(transaction: TransactionCache, subprojectId: ItemId): Promise<RmProjectDefaultTimeResources>;
|
|
36
|
+
fetchDefaultTimeResourcesBySubprojectIds(transaction: TransactionCache, subprojectIds: ItemId[]): Promise<RmDefaultTimeResourcesBySubprojectId>;
|
|
37
|
+
/**
|
|
38
|
+
* @internal Used in RmProjectTransactionValidatorTimeScheduleHelper
|
|
39
|
+
* @param columnId
|
|
40
|
+
* @param projectResource
|
|
41
|
+
* @param subprojectResource
|
|
42
|
+
*/
|
|
43
|
+
getDefaultTimeId(columnId: RmProjectTimeTypeColumnId, projectResource: ItemResource<'Project', DefaultTimeColumns>, subprojectResource: ItemResource<'Subproject', DefaultTimeColumns> | null): ItemId | null;
|
|
44
|
+
/**
|
|
45
|
+
* @description Warning: this function doesn't test for linked items! (Equipment groups etc.)
|
|
46
|
+
* Use `deleteTimes` in {@link RmTijdService RmTijdService}.
|
|
47
|
+
* In time, this function could be replaced by triggers.
|
|
48
|
+
*/
|
|
49
|
+
deleteTimesRespectingDefaultTimes(transaction: TransactionCache, projectId: ItemId, itemIds: ItemId[]): Promise<ChangesDeltaResult>;
|
|
50
|
+
/**
|
|
51
|
+
* @description Finds a default usage or planning time given a project and subproject, in this order of
|
|
52
|
+
* preference:
|
|
53
|
+
* 1. the subproject default time;
|
|
54
|
+
* 2. the project default time;
|
|
55
|
+
* 3. the last time in the given subproject;
|
|
56
|
+
* 4. the last time in the given main project.
|
|
57
|
+
* @returns A time item resource, or null if none is found.
|
|
58
|
+
* @param timeResources - All times in the current project.
|
|
59
|
+
*/
|
|
60
|
+
private getDefaultTimeResourceWithFallback;
|
|
61
|
+
/**
|
|
62
|
+
* @description Finds the last time (the time with the highest 'order' value) in the given sub- or main project.
|
|
63
|
+
* @param timeResources - All times in the current project.
|
|
64
|
+
*/
|
|
65
|
+
private getLastTimeWithSubprojectId;
|
|
66
|
+
private fetchTimeResources;
|
|
67
|
+
private fetchSubprojectResources;
|
|
68
|
+
private fetchProjectAndSubprojectResources;
|
|
69
|
+
private fetchSubprojectResource;
|
|
70
|
+
private fetchProjectResource;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rentman/rm-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "67.0.0-beta.0",
|
|
4
4
|
"description": "Rentman core functionalities",
|
|
5
5
|
"main": "./dist/rm-core.js",
|
|
6
6
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"url": "https://github.com/rentmanpublic/frontend-core"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@angular/core": "
|
|
19
|
+
"@angular/core": "22.0.7",
|
|
20
20
|
"@eslint/js": "^9.8.0",
|
|
21
|
-
"@rentman/backend-types": "4.
|
|
21
|
+
"@rentman/backend-types": "4.904.0-158-gd4b8809987",
|
|
22
22
|
"@stylistic/eslint-plugin-ts": "^2.7.2",
|
|
23
23
|
"@types/eslint__js": "^8.42.3",
|
|
24
24
|
"@vitest/coverage-v8": "^3.2.3",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@angular/core": "^22",
|
|
42
|
-
"@rentman/backend-types": "4.
|
|
42
|
+
"@rentman/backend-types": "4.892.0-51-g469b43c811",
|
|
43
43
|
"moment": "^2.30.1",
|
|
44
44
|
"rxjs": "^7"
|
|
45
45
|
},
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
import { TimeColumnUtil } from './TimeColumnUtil';
|
|
8
|
-
type ConditionResult = Map<ItemId<'MateriaalCat'>, (typeof TimeColumnUtil.valueColumnIds)[number][]>;
|
|
9
|
-
declare const materiaalCatColumns: readonly ["id", "gebruikvan", "planvan", "gebruiktot", "plantot", "schema_gv_begin", "schema_gt_begin", "schema_pv_begin", "schema_pt_begin", {
|
|
10
|
-
readonly schema_pv: readonly ["van", "tot", "is_absolute_times_substitute"];
|
|
11
|
-
}, {
|
|
12
|
-
readonly schema_pt: readonly ["van", "tot", "is_absolute_times_substitute"];
|
|
13
|
-
}, {
|
|
14
|
-
readonly schema_gv: readonly ["van", "tot", "is_absolute_times_substitute"];
|
|
15
|
-
}, {
|
|
16
|
-
readonly schema_gt: readonly ["van", "tot", "is_absolute_times_substitute"];
|
|
17
|
-
}];
|
|
18
|
-
type Dependency = ItemResource<'MateriaalCat', typeof materiaalCatColumns>[];
|
|
19
|
-
export declare class LinkedTimeItemMateriaalCatBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
20
|
-
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
21
|
-
dependency(transaction: TransactionCache, conditionResult: ConditionResult): Promise<Dependency>;
|
|
22
|
-
apply(context: BusinessLogicRuleApplyContext, dependency: Dependency, conditionResult: ConditionResult): void;
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|