@rentman/rm-core 66.1.2-RM4-46977 → 66.1.2

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.
@@ -1,17 +1,26 @@
1
- import { ChangesDelta } from '../../ChangesDelta';
2
- import { BLR_SKIP_RULE } from '../BusinessLogicRule';
3
- import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
4
- import { ExtendedChangedResource, ExtendedChildResource, PlanningmateriaalCombinationChildrenBusinessLogicRuleBase } from './PlanningmateriaalCombinationChildrenBusinessLogicRuleBase';
5
1
  import { ItemId } from '@rentman/backend-types';
6
- declare const columnExtensions: readonly ["optie"];
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 childPlanningmateriaalColumns: readonly ["id", "optie", "parent"];
9
+ declare const changedPlanningMateriaalColumns: readonly ["id", "optie", "categorie", "parent", {
10
+ readonly materiaal: readonly ["is_combination", "is_physical"];
11
+ }];
12
+ type Dependency = {
13
+ childPlanningmateriaalResourcesInCategories: ItemResource<'Planningmateriaal', typeof childPlanningmateriaalColumns>[];
14
+ changedPlanningmateriaalResources: ItemResource<'Planningmateriaal', typeof changedPlanningMateriaalColumns>[];
15
+ };
7
16
  /**
8
17
  * @description
9
18
  * If the kit's 'optie' is changed then the children should follow
10
19
  */
11
- export declare class PlanningmateriaalOptieBusinessLogicRule extends PlanningmateriaalCombinationChildrenBusinessLogicRuleBase<typeof columnExtensions> {
12
- protected readonly columnExtensions: typeof columnExtensions;
13
- protected shouldSkipChangedResource(changedResource: ExtendedChangedResource<typeof columnExtensions>): boolean;
14
- protected getConditionResult(context: BusinessLogicRuleConditionContext): ItemId<'Planningmateriaal'>[] | typeof BLR_SKIP_RULE;
15
- protected applyChangesToChild(parentResource: ExtendedChangedResource<typeof columnExtensions>, childResource: ExtendedChildResource<typeof columnExtensions>, destinationChangesDelta: ChangesDelta): void;
20
+ export declare class PlanningmateriaalOptieBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
21
+ condition(context: BusinessLogicRuleConditionContext): ConditionResult | typeof BLR_SKIP_RULE;
22
+ dependency(transaction: TransactionCache, changedPlanningmateriaalIds: ConditionResult): Promise<Dependency>;
23
+ apply(context: BusinessLogicRuleApplyContext, dependency: Dependency): void;
24
+ private updatePlanningmateriaalByParent;
16
25
  }
17
26
  export {};
@@ -68,6 +68,4 @@ import { TaakDeadlineTypeBusinessLogicRule } from './Taak/TaakDeadlineTypeBusine
68
68
  import { TaakDeadlineOffsetBusinessLogicRule } from './Taak/TaakDeadlineOffsetBusinessLogicRule';
69
69
  import { TijdPropagateNameToFunctiegroepBusinessLogicRule } from './Tijd/TijdPropagateNameToFunctiegroepBusinessLogicRule';
70
70
  import { TijdSubprojectChangedBusinessLogicRule } from './Tijd/TijdSubprojectChangedBusinessLogicRule';
71
- import { PlanningmateriaalCreatePeriodBusinessLogicRule } from './Planningmateriaal/PlanningmateriaalCreatePeriodBusinessLogicRule';
72
- import { PlanningmateriaalEditTijdSchemaBusinessLogicRule } from './Planningmateriaal/PlanningmateriaalEditTijdSchemaBusinessLogicRule';
73
- 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 InhuurmateriaalAantalRoundUpBusinessLogicRule, 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 PlanningmateriaalAantalRoundUpBusinessLogicRule, typeof PlanningmateriaalAantaltotaalBusinessLogicRule, typeof PlanningmateriaalOptieBusinessLogicRule, typeof PlanningmateriaalParentBusinessLogicRule, typeof PlanningmateriaalStaysAtLocationBusinessLogicRule, typeof PlanningmateriaalCreatePeriodBusinessLogicRule, typeof PlanningmateriaalEditTijdSchemaBusinessLogicRule, typeof PlanningPersoneelTransportBusinessLogicRule, typeof ProjectClientChangedBusinessLogicRule, typeof ProjectContactProjectNoteBusinessLogicRule, typeof ProjectOneSubLocationAlignBusinessLogicRule, typeof ProjectSubprojectDefaultTimeBusinessLogicRule, typeof PurchaseOrderOwnerBusinessLogicRule, typeof PurchaseOrderApprovalStatusBusinessLogicRule, typeof RateDeactivateExistingOnCreateBusinessLogicRule, 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 TijdPropagateNameToFunctiegroepBusinessLogicRule, typeof AfspraakRecureindBusinessLogicRule, typeof BeschikbaarheidRecureindBusinessLogicRule];
71
+ 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 InhuurmateriaalAantalRoundUpBusinessLogicRule, 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 PlanningmateriaalAantalRoundUpBusinessLogicRule, typeof PlanningmateriaalAantaltotaalBusinessLogicRule, typeof PlanningmateriaalOptieBusinessLogicRule, typeof PlanningmateriaalParentBusinessLogicRule, typeof PlanningmateriaalStaysAtLocationBusinessLogicRule, typeof PlanningPersoneelTransportBusinessLogicRule, typeof ProjectClientChangedBusinessLogicRule, typeof ProjectContactProjectNoteBusinessLogicRule, typeof ProjectOneSubLocationAlignBusinessLogicRule, typeof ProjectSubprojectDefaultTimeBusinessLogicRule, typeof PurchaseOrderOwnerBusinessLogicRule, typeof PurchaseOrderApprovalStatusBusinessLogicRule, typeof RateDeactivateExistingOnCreateBusinessLogicRule, 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 TijdPropagateNameToFunctiegroepBusinessLogicRule, typeof AfspraakRecureindBusinessLogicRule, typeof BeschikbaarheidRecureindBusinessLogicRule];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rentman/rm-core",
3
- "version": "66.1.2-RM4-46977",
3
+ "version": "66.1.2",
4
4
  "description": "Rentman core functionalities",
5
5
  "main": "./dist/rm-core.js",
6
6
  "types": "./dist/types/src/index.d.ts",
@@ -1,31 +0,0 @@
1
- import { ItemId } from '@rentman/backend-types';
2
- import { ItemResource } from '../../../models/ItemResource';
3
- import { ApiRequestColumnArray, ItemTypeColumnIds } from '../../../types/ItemTypesCollection';
4
- import { TransactionCache } from '../../cache/transaction/TransactionCache';
5
- import { ChangesDelta } from '../../ChangesDelta';
6
- import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
7
- import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
8
- import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
9
- export declare const baseChildColumns: readonly ["id", "parent", "naam"];
10
- export declare const baseChangedColumns: readonly ["id", "categorie", "parent", "naam", {
11
- readonly materiaal: readonly ["is_combination", "is_physical"];
12
- }];
13
- export type ExtendedChildResource<T extends ItemTypeColumnIds<'Planningmateriaal'>> = ItemResource<'Planningmateriaal', typeof baseChildColumns> & ItemResource<'Planningmateriaal', T>;
14
- export type ExtendedChangedResource<T extends ItemTypeColumnIds<'Planningmateriaal'>> = ItemResource<'Planningmateriaal', typeof baseChangedColumns> & ItemResource<'Planningmateriaal', T>;
15
- type CombinationChildrenDependency<T extends ItemTypeColumnIds<'Planningmateriaal'>> = {
16
- childResources: ExtendedChildResource<T>[];
17
- changedResources: ExtendedChangedResource<T>[];
18
- };
19
- export declare abstract class PlanningmateriaalCombinationChildrenBusinessLogicRuleBase<T extends ItemTypeColumnIds<'Planningmateriaal'>> extends BusinessLogicRule<ItemId<'Planningmateriaal'>[], CombinationChildrenDependency<T>> {
20
- protected childColumns: ApiRequestColumnArray<'Planningmateriaal'>;
21
- protected changedColumns: ApiRequestColumnArray<'Planningmateriaal'>;
22
- protected abstract columnExtensions: T;
23
- protected abstract getConditionResult(context: BusinessLogicRuleConditionContext): ItemId<'Planningmateriaal'>[] | typeof BLR_SKIP_RULE;
24
- protected abstract applyChangesToChild(parentResource: ExtendedChangedResource<T>, childResource: ExtendedChildResource<T>, destinationChangesDelta: ChangesDelta): void;
25
- protected shouldSkipChangedResource(changedResource: ExtendedChangedResource<T>): boolean;
26
- condition(context: BusinessLogicRuleConditionContext): ItemId<'Planningmateriaal'>[] | typeof BLR_SKIP_RULE;
27
- dependency(transaction: TransactionCache, changedPlanningmateriaalIds: ItemId<'Planningmateriaal'>[]): Promise<CombinationChildrenDependency<T>>;
28
- apply(context: BusinessLogicRuleApplyContext, dependency: CombinationChildrenDependency<T>): void;
29
- private updateChildrenRecursively;
30
- }
31
- export {};
@@ -1,26 +0,0 @@
1
- import { BLR_SKIP_RULE, BusinessLogicRule } from '../BusinessLogicRule';
2
- import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
3
- import { ItemId } from '@rentman/backend-types';
4
- import { TransactionCache } from '../../cache/transaction/TransactionCache';
5
- import { ItemResource } from '../../../models/ItemResource';
6
- import { BusinessLogicRuleApplyContext } from '../BusinessLogicRuleApplyContext';
7
- declare const planningmateriaalColumns: readonly [{
8
- readonly categorie: readonly [{
9
- readonly project: readonly ["gebruiksperiode", "planperiode"];
10
- }, {
11
- readonly subproject: readonly ["gebruiksperiode", "planperiode"];
12
- }];
13
- }];
14
- type ConditionResult = Set<ItemId> | typeof BLR_SKIP_RULE;
15
- type Dependency = ItemResource<'Planningmateriaal', typeof planningmateriaalColumns>[];
16
- /**
17
- * @description
18
- * If the planningmateriaal is created, set the schema fields to the project's planperiode and gebruiksperiode.'
19
- */
20
- export declare class PlanningmateriaalCreatePeriodBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
21
- condition(context: BusinessLogicRuleConditionContext): ConditionResult;
22
- dependency(transaction: TransactionCache, createdItems: Set<ItemId<'MateriaalCat'>>): Promise<Dependency>;
23
- apply(context: BusinessLogicRuleApplyContext, dependency: Dependency): void;
24
- private getRelevantPeriod;
25
- }
26
- export {};
@@ -1,16 +0,0 @@
1
- import { ChangesDelta } from '../../ChangesDelta';
2
- import { BLR_SKIP_RULE } from '../BusinessLogicRule';
3
- import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
4
- import { ExtendedChangedResource, ExtendedChildResource, PlanningmateriaalCombinationChildrenBusinessLogicRuleBase } from './PlanningmateriaalCombinationChildrenBusinessLogicRuleBase';
5
- import { ItemId } from '@rentman/backend-types';
6
- declare const columnExtensions: readonly ["schema_pv", "schema_pv_begin", "schema_pt", "schema_pt_begin", "schema_gv", "schema_gv_begin", "schema_gt", "schema_gt_begin"];
7
- /**
8
- * @description
9
- * If planningmateriaal schema fields are edited, the same edits should be applied to the children of Planningmateriaal combinations.
10
- */
11
- export declare class PlanningmateriaalEditTijdSchemaBusinessLogicRule extends PlanningmateriaalCombinationChildrenBusinessLogicRuleBase<typeof columnExtensions> {
12
- protected readonly columnExtensions: typeof columnExtensions;
13
- protected getConditionResult(context: BusinessLogicRuleConditionContext): ItemId<'Planningmateriaal'>[] | typeof BLR_SKIP_RULE;
14
- protected applyChangesToChild(parentResource: ExtendedChangedResource<typeof columnExtensions>, childResource: ExtendedChildResource<typeof columnExtensions>, destinationChangesDelta: ChangesDelta): void;
15
- }
16
- export {};