@rentman/rm-core 63.0.0 → 63.0.1-RM4-45253
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/Setinhoud/SetinhoudCreateFixedBusinessLogicRule.d.ts +4 -4
- package/dist/types/src/classes/BusinessLogicManager/Taak/TaakDeadlineOffsetBusinessLogicRule.d.ts +23 -0
- package/dist/types/src/classes/BusinessLogicManager/Taak/TaakDeadlineTypeBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/registeredBusinessLogicRules.d.ts +3 -1
- package/dist/types/src/classes/SocketMessageHandler.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ItemResource } from '../../../models/ItemResource';
|
|
2
1
|
import { TransactionCache } from '../../cache/transaction/TransactionCache';
|
|
3
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';
|
|
7
|
-
|
|
6
|
+
import { LatestItem } from '../BusinessLogicRuleContextBase';
|
|
7
|
+
declare const materiaalColumns: readonly ["id", "type", "is_combination", "is_physical"];
|
|
8
8
|
type ConditionResult = ChangesDeltaItemCreateDelta<'Setinhoud'>[];
|
|
9
|
-
type Dependency = Record<string,
|
|
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)
|
|
@@ -15,7 +15,7 @@ type Dependency = Record<string, ItemResource<'Materiaal', typeof materiaalColum
|
|
|
15
15
|
*/
|
|
16
16
|
export declare class SetinhoudCreateFixedBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
17
17
|
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
18
|
-
dependency(
|
|
18
|
+
dependency(_transaction: TransactionCache, conditionResult: ConditionResult, context: BusinessLogicRuleConditionContext): Promise<Dependency>;
|
|
19
19
|
apply(context: BusinessLogicRuleApplyContext, dependencyResult: Dependency, conditionResult: ConditionResult): void;
|
|
20
20
|
}
|
|
21
21
|
export {};
|
package/dist/types/src/classes/BusinessLogicManager/Taak/TaakDeadlineOffsetBusinessLogicRule.d.ts
ADDED
|
@@ -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
|
+
declare const taakColumns: readonly [{
|
|
8
|
+
readonly deadline_relative_time_period: readonly ["tot", "van"];
|
|
9
|
+
}, "deadline_type", "deadline_relative_offset_amount", "deadline_relative_offset_base", "deadline_relative_offset_direction", "deadline_relative_offset_unit"];
|
|
10
|
+
type ConditionResult = ItemId[];
|
|
11
|
+
type Dependency = ItemResource<'Taak', typeof taakColumns>[];
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* When the fields used to calculate relative deadline change,
|
|
15
|
+
* apply offsets to recalculate the deadline field
|
|
16
|
+
*/
|
|
17
|
+
export declare class TaakDeadlineOffsetBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
18
|
+
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
19
|
+
dependency(transaction: TransactionCache, taakIds: ConditionResult): Promise<Dependency>;
|
|
20
|
+
apply(context: BusinessLogicRuleApplyContext, taakResources: Dependency): void;
|
|
21
|
+
calculateTaskTimeWithOffset(context: BusinessLogicRuleApplyContext, selectedDateWithoutOffset: moment.Moment, taskResource: ItemResource<'Taak', any>): moment.Moment;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/dist/types/src/classes/BusinessLogicManager/Taak/TaakDeadlineTypeBusinessLogicRule.d.ts
ADDED
|
@@ -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, BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
|
+
import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
|
|
6
|
+
import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
|
|
7
|
+
declare const taakColumns: readonly ["deadline_type", "deadline_relative_time_period", "deadline_relative_offset_amount", "deadline_relative_offset_base", "deadline_relative_offset_direction", "deadline_relative_offset_unit"];
|
|
8
|
+
type ConditionResult = ItemId[];
|
|
9
|
+
type Dependency = ItemResource<'Taak', typeof taakColumns>[];
|
|
10
|
+
/**
|
|
11
|
+
* @description
|
|
12
|
+
* When the 'deadline_type' field changes to 'absolute', reset the relative deadline fields
|
|
13
|
+
* so that they do not contain stale values.
|
|
14
|
+
*/
|
|
15
|
+
export declare class TaakDeadlineTypeBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
16
|
+
condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
|
|
17
|
+
dependency(transaction: TransactionCache, taakIds: ConditionResult): Promise<Dependency>;
|
|
18
|
+
apply(context: BusinessLogicRuleApplyContext, taakResources: Dependency): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -61,6 +61,8 @@ import { SetinhoudUpdateFixedBusinessLogicRule } from './Setinhoud/SetinhoudUpda
|
|
|
61
61
|
import { SubprojectInPlanningBusinessLogicRule } from './Subproject/SubprojectInPlanningBusinessLogicRule';
|
|
62
62
|
import { SubprojectOneSubLocationAlignBusinessLogicRule } from './Subproject/SubprojectOneSubLocationAlignBusinessRule';
|
|
63
63
|
import { SubprojectOneSubNameAlignBusinessLogicRule } from './Subproject/SubprojectOneSubNameAlignBusinessRule';
|
|
64
|
+
import { TaakDeadlineTypeBusinessLogicRule } from './Taak/TaakDeadlineTypeBusinessLogicRule';
|
|
65
|
+
import { TaakDeadlineOffsetBusinessLogicRule } from './Taak/TaakDeadlineOffsetBusinessLogicRule';
|
|
64
66
|
import { TijdNameChangedBusinessLogicRule } from './Tijd/TijdNameChangedBusinessLogicRule';
|
|
65
67
|
import { TijdSubprojectChangedBusinessLogicRule } from './Tijd/TijdSubprojectChangedBusinessLogicRule';
|
|
66
|
-
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 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 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 TijdSubprojectChangedBusinessLogicRule, typeof TijdNameChangedBusinessLogicRule, typeof AfspraakRecureindBusinessLogicRule, typeof BeschikbaarheidRecureindBusinessLogicRule];
|
|
68
|
+
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 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 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];
|
|
@@ -12,6 +12,7 @@ export declare class SocketMessageHandler {
|
|
|
12
12
|
constructor(changesDeltaFactory: ChangesDeltaFactory, columnCache: ColumnCache, errorHandler: ErrorHandlerInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory, transactionCacheFactory: TransactionCacheFactory, apiRequestService: ApiRequestService, requestColumnsOperationsCacheFactory: RequestColumnsOperationsCacheFactory);
|
|
13
13
|
onMessagesReceived(messages: SocketMessage<any>[], flushTimeout?: number): Promise<ChangesDeltaResult>;
|
|
14
14
|
refreshItemsOfType(itemType: ApiItemType): Promise<void>;
|
|
15
|
+
private handleMassUpdate;
|
|
15
16
|
private handleDelete;
|
|
16
17
|
private logFetchedItems;
|
|
17
18
|
private processSocketMessageValues;
|