@rentman/rm-core 64.0.1 → 64.0.2-RM4-47618-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.
@@ -0,0 +1,30 @@
1
+ import { ItemId } from '@rentman/backend-types';
2
+ import { ItemResource } from '../../../models/ItemResource';
3
+ import { ApiRequestColumnArray } 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 CombinationChildrenConditionResult = ItemId[];
14
+ export type BaseChildResource = ItemResource<'Planningmateriaal', typeof baseChildColumns>;
15
+ export type BaseChangedResource = ItemResource<'Planningmateriaal', typeof baseChangedColumns>;
16
+ export type CombinationChildrenDependency = {
17
+ childPlanningmateriaalResourcesInCategories: BaseChildResource[];
18
+ changedPlanningmateriaalResources: BaseChangedResource[];
19
+ };
20
+ export declare abstract class PlanningmateriaalCombinationChildrenBusinessLogicRuleBase extends BusinessLogicRule<CombinationChildrenConditionResult, CombinationChildrenDependency> {
21
+ protected abstract readonly childColumns: ApiRequestColumnArray<'Planningmateriaal'>;
22
+ protected abstract readonly changedColumns: ApiRequestColumnArray<'Planningmateriaal'>;
23
+ protected abstract getConditionResult(context: BusinessLogicRuleConditionContext): CombinationChildrenConditionResult | typeof BLR_SKIP_RULE;
24
+ protected abstract applyChangesToChild(parentResource: BaseChangedResource, childResource: BaseChildResource, destinationChangesDelta: ChangesDelta): void;
25
+ protected shouldSkipChangedResource(changedResource: BaseChangedResource): boolean;
26
+ condition(context: BusinessLogicRuleConditionContext): CombinationChildrenConditionResult | typeof BLR_SKIP_RULE;
27
+ dependency(transaction: TransactionCache, changedPlanningmateriaalIds: CombinationChildrenConditionResult): Promise<CombinationChildrenDependency>;
28
+ apply(context: BusinessLogicRuleApplyContext, dependency: CombinationChildrenDependency): void;
29
+ private updateChildrenRecursively;
30
+ }
@@ -0,0 +1,26 @@
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 tijdColumns: readonly ["id", "naam"];
8
+ declare const planningmateriaalColumns: readonly [{
9
+ readonly categorie: readonly ["project"];
10
+ }];
11
+ type ConditionResult = Set<ItemId> | typeof BLR_SKIP_RULE;
12
+ type Dependency = {
13
+ gebruiksperiode: ItemResource<'Tijd', typeof tijdColumns> | null;
14
+ planperiode: ItemResource<'Tijd', typeof tijdColumns> | null;
15
+ planningmateriaalItems: ItemResource<'Planningmateriaal', typeof planningmateriaalColumns>[];
16
+ };
17
+ /**
18
+ * @description
19
+ * If the planningmateriaal is created, set the schema_pv and schema_gv to the project's planperiode and gebruiksperiode.'
20
+ */
21
+ export declare class PlanningmateriaalCreatePeriodBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
22
+ condition(context: BusinessLogicRuleConditionContext): ConditionResult;
23
+ dependency(transaction: TransactionCache, createdItems: Set<ItemId<'MateriaalCat'>>): Promise<Dependency>;
24
+ apply(context: BusinessLogicRuleApplyContext, dependency: Dependency): void;
25
+ }
26
+ export {};
@@ -0,0 +1,22 @@
1
+ import { ItemResource } from '../../../models/ItemResource';
2
+ import { ChangesDelta } from '../../ChangesDelta';
3
+ import { BLR_SKIP_RULE } from '../BusinessLogicRule';
4
+ import { BusinessLogicRuleConditionContext } from '../BusinessLogicRuleConditionContext';
5
+ import { CombinationChildrenConditionResult, PlanningmateriaalCombinationChildrenBusinessLogicRuleBase } from './PlanningmateriaalCombinationChildrenBusinessLogicRuleBase';
6
+ declare const childPlanningmateriaalColumns: readonly ["id", "parent", "naam", "schema_pv", "schema_pv_begin", "schema_pt", "schema_pt_begin", "schema_gv", "schema_gv_begin", "schema_gt", "schema_gt_begin"];
7
+ declare const changedPlanningmateriaalColumns: readonly ["id", "categorie", "parent", "naam", {
8
+ readonly materiaal: readonly ["is_combination", "is_physical"];
9
+ }, "schema_pv", "schema_pv_begin", "schema_pt", "schema_pt_begin", "schema_gv", "schema_gv_begin", "schema_gt", "schema_gt_begin"];
10
+ /**
11
+ * @description
12
+ * If planningmateriaal schema fields are edited, the same edits should be applied to the children of Planningmateriaal combinations.
13
+ */
14
+ export declare class PlanningmateriaalEditTijdSchemaBusinessLogicRule extends PlanningmateriaalCombinationChildrenBusinessLogicRuleBase {
15
+ protected readonly childColumns: readonly ["id", "parent", "naam", "schema_pv", "schema_pv_begin", "schema_pt", "schema_pt_begin", "schema_gv", "schema_gv_begin", "schema_gt", "schema_gt_begin"];
16
+ protected readonly changedColumns: readonly ["id", "categorie", "parent", "naam", {
17
+ readonly materiaal: readonly ["is_combination", "is_physical"];
18
+ }, "schema_pv", "schema_pv_begin", "schema_pt", "schema_pt_begin", "schema_gv", "schema_gv_begin", "schema_gt", "schema_gt_begin"];
19
+ protected getConditionResult(context: BusinessLogicRuleConditionContext): CombinationChildrenConditionResult | typeof BLR_SKIP_RULE;
20
+ protected applyChangesToChild(parentResource: ItemResource<'Planningmateriaal', typeof changedPlanningmateriaalColumns>, childResource: ItemResource<'Planningmateriaal', typeof childPlanningmateriaalColumns>, destinationChangesDelta: ChangesDelta): void;
21
+ }
22
+ export {};
@@ -1,26 +1,23 @@
1
- import { ItemId } from '@rentman/backend-types';
2
1
  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';
2
+ import { ChangesDelta } from '../../ChangesDelta';
3
+ import { BLR_SKIP_RULE } from '../BusinessLogicRule';
6
4
  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", {
5
+ import { BaseChangedResource, CombinationChildrenConditionResult, PlanningmateriaalCombinationChildrenBusinessLogicRuleBase } from './PlanningmateriaalCombinationChildrenBusinessLogicRuleBase';
6
+ declare const childPlanningmateriaalColumns: readonly ["id", "parent", "naam", "optie"];
7
+ declare const changedPlanningMateriaalColumns: readonly ["id", "categorie", "parent", "naam", {
10
8
  readonly materiaal: readonly ["is_combination", "is_physical"];
11
- }];
12
- type Dependency = {
13
- childPlanningmateriaalResourcesInCategories: ItemResource<'Planningmateriaal', typeof childPlanningmateriaalColumns>[];
14
- changedPlanningmateriaalResources: ItemResource<'Planningmateriaal', typeof changedPlanningMateriaalColumns>[];
15
- };
9
+ }, "optie"];
16
10
  /**
17
11
  * @description
18
12
  * If the kit's 'optie' is changed then the children should follow
19
13
  */
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;
14
+ export declare class PlanningmateriaalOptieBusinessLogicRule extends PlanningmateriaalCombinationChildrenBusinessLogicRuleBase {
15
+ protected readonly childColumns: readonly ["id", "parent", "naam", "optie"];
16
+ protected readonly changedColumns: readonly ["id", "categorie", "parent", "naam", {
17
+ readonly materiaal: readonly ["is_combination", "is_physical"];
18
+ }, "optie"];
19
+ protected shouldSkipChangedResource(changedResource: BaseChangedResource): boolean;
20
+ protected getConditionResult(context: BusinessLogicRuleConditionContext): CombinationChildrenConditionResult | typeof BLR_SKIP_RULE;
21
+ protected applyChangesToChild(parentResource: ItemResource<'Planningmateriaal', typeof changedPlanningMateriaalColumns>, childResource: ItemResource<'Planningmateriaal', typeof childPlanningmateriaalColumns>, destinationChangesDelta: ChangesDelta): void;
25
22
  }
26
23
  export {};
@@ -68,4 +68,6 @@ 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
- 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];
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];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rentman/rm-core",
3
- "version": "64.0.1",
3
+ "version": "64.0.2-RM4-47618-2",
4
4
  "description": "Rentman core functionalities",
5
5
  "main": "./dist/rm-core.js",
6
6
  "types": "./dist/types/src/index.d.ts",