@rentman/rm-core 10.0.0 → 10.0.1
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/changelog.md +4 -0
- package/dist/rm-core.js +787 -641
- package/dist/rm-core.min.js +1 -1
- package/dist/types/classes/BusinessLogicManager/BusinessLogicManager.d.ts +2 -0
- package/dist/types/classes/BusinessLogicManager/BusinessLogicRule.d.ts +3 -3
- package/dist/types/classes/BusinessLogicManager/Materiaal/MateriaalTelexemplarenBusinessLogicRule.d.ts +15 -0
- package/dist/types/classes/cache/AbstractCache.d.ts +2 -1
- package/dist/types/internal.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +2 -2
|
@@ -13,6 +13,7 @@ import { FactuurDatumBusinessLogicRule } from './Factuur/FactuurDatumBusinessLog
|
|
|
13
13
|
import { FactuurNumberseriesBusinessLogicRule } from './Factuur/FactuurNumberseriesBusinessLogicRule';
|
|
14
14
|
import { FunctieNaaminternBusinessLogicRule } from './Functie/FunctieNaaminternBusinessLogicRule';
|
|
15
15
|
import { FunctieTwowayBusinessLogicRule } from './Functie/FunctieTwowayBusinessLogicRule';
|
|
16
|
+
import { MateriaalTelexemplarenBusinessLogicRule } from './Materiaal/MateriaalTelexemplarenBusinessLogicRule';
|
|
16
17
|
import { MateriaalTypeBusinessLogicRule } from './Materiaal/MateriaalTypeBusinessLogicRule';
|
|
17
18
|
import { MateriaalVerhuurBusinessLogicRule } from './Materiaal/MateriaalVerhuurBusinessLogicRule';
|
|
18
19
|
import { SurfaceArticleSizeBusinessLogicRule } from './Materiaal/SurfaceArticleSizeBusinessLogicRule';
|
|
@@ -60,6 +61,7 @@ export declare class BusinessLogicManager {
|
|
|
60
61
|
MateriaalVerhuurBusinessLogicRule: MateriaalVerhuurBusinessLogicRule;
|
|
61
62
|
MateriaalTypeBusinessLogicRule: MateriaalTypeBusinessLogicRule;
|
|
62
63
|
SurfaceArticleSizeBusinessLogicRule: SurfaceArticleSizeBusinessLogicRule;
|
|
64
|
+
MateriaalTelexemplarenBusinessLogicRule: MateriaalTelexemplarenBusinessLogicRule;
|
|
63
65
|
PlanningPersoneelTransportBusinessLogicRule: PlanningPersoneelTransportBusinessLogicRule;
|
|
64
66
|
ProjectClientNoteBusinessLogicRule: ProjectClientNoteBusinessLogicRule;
|
|
65
67
|
FactuurNumberseriesBusinessLogicRule: FactuurNumberseriesBusinessLogicRule;
|
|
@@ -6,7 +6,7 @@ import { TransactionCache } from '../cache/transaction/TransactionCache';
|
|
|
6
6
|
import { TransactionItemHandler } from '../cache/transaction/TransactionItemHandler';
|
|
7
7
|
import { ChangesDelta } from '../ChangesDelta';
|
|
8
8
|
import { ChangesDeltaItemUpdateDelta } from '../ChangesDeltaBase';
|
|
9
|
-
export declare type BusinessLogicRuleConfirmFn<ConditionResult = any> = (conditionResult: ConditionResult) => Promise<boolean>;
|
|
9
|
+
export declare type BusinessLogicRuleConfirmFn<ConditionResult = any> = (conditionResult: ConditionResult, changesDelta: ChangesDelta) => Promise<boolean>;
|
|
10
10
|
export declare type BusinessLogicConditionResult<ItemTypeType extends ApiEnumItemType, ColumnId extends ItemTypeColumnId<ItemTypeType>> = {
|
|
11
11
|
itemEntry: ItemEntry<ItemTypeType>;
|
|
12
12
|
responseColumn: ResponseColumn<ItemTypeType, ColumnId>;
|
|
@@ -82,8 +82,8 @@ export declare abstract class BusinessLogicRule<ConditionResult extends any = an
|
|
|
82
82
|
protected getItemIdsWithUpdatedField<ItemTypeType extends ApiEnumItemType>(changesDelta: ChangesDelta, itemChanges: TransactionItemHandler['itemChanges'], itemType: ItemTypeType, columnId: keyof FieldMap<ItemTypeType>): ItemId[] | undefined;
|
|
83
83
|
/**
|
|
84
84
|
* @description
|
|
85
|
-
* This function will compare the stored changes with the given changes, and return
|
|
86
|
-
* If either the source or changed field is `undefined` it will always return `
|
|
85
|
+
* This function will compare the stored changes with the given changes, and return a {@link BusinessLogicConditionResult} if the fields have been changed, null otherwise.
|
|
86
|
+
* If either the source or changed field is `undefined` it will always return `null` (not changed)
|
|
87
87
|
*
|
|
88
88
|
* @param itemChanges The {@link TransactionItemHandler.itemChanges ItemChanges} of the transaction
|
|
89
89
|
* @param tuple The {@link ChangesDelta.updated update tuple} from a ChangesDelta
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ItemEntry, TransactionCache } from '../../..';
|
|
3
|
+
import { ChangesDelta } from '../../ChangesDelta';
|
|
4
|
+
import { BusinessLogicRule } from '../BusinessLogicRule';
|
|
5
|
+
export declare type ConditionResult = ItemId[];
|
|
6
|
+
declare type Dependency = {
|
|
7
|
+
local: ItemEntry<ApiEnumItemType.Voorraadmutatie>[];
|
|
8
|
+
remote: ItemEntry<ApiEnumItemType.Voorraadmutatie>[];
|
|
9
|
+
};
|
|
10
|
+
export declare class MateriaalTelexemplarenBusinessLogicRule extends BusinessLogicRule<ConditionResult, Dependency> {
|
|
11
|
+
protected condition(changesDelta: ChangesDelta): ConditionResult | undefined;
|
|
12
|
+
dependency(transaction: TransactionCache, conditionResult: ConditionResult): Promise<Dependency>;
|
|
13
|
+
apply(_changesDelta: ChangesDelta, destinationChangesDelta: ChangesDelta, dependencies: Dependency): Promise<any> | void;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -34,7 +34,8 @@ export declare abstract class AbstractCache {
|
|
|
34
34
|
* @description
|
|
35
35
|
* Returns this transaction and all parents
|
|
36
36
|
*/
|
|
37
|
-
getTransactionChain():
|
|
37
|
+
getTransactionChain(includeServerCache: false): TransactionCache[];
|
|
38
|
+
getTransactionChain(includeServerCache?: true): AbstractCache[];
|
|
38
39
|
/**
|
|
39
40
|
* @description
|
|
40
41
|
* Returns the {@link TransactionItemHandler.entries ItemCache} of the transaction
|
package/dist/types/internal.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ export * from './classes/BusinessLogicManager/Functie/FunctieTwowayBusinessLogic
|
|
|
89
89
|
export * from './classes/BusinessLogicManager/Materiaal/MateriaalTypeBusinessLogicRule';
|
|
90
90
|
export * from './classes/BusinessLogicManager/Materiaal/MateriaalVerhuurBusinessLogicRule';
|
|
91
91
|
export * from './classes/BusinessLogicManager/Materiaal/SurfaceArticleSizeBusinessLogicRule';
|
|
92
|
+
export * from './classes/BusinessLogicManager/Materiaal/MateriaalTelexemplarenBusinessLogicRule';
|
|
92
93
|
export * from './classes/BusinessLogicManager/OfferteContract/OfferteContractDatumBusinessLogicRule';
|
|
93
94
|
export * from './classes/BusinessLogicManager/PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule';
|
|
94
95
|
export * from './classes/BusinessLogicManager/Project/ProjectClientNoteBusinessLogicRule';
|
package/package.json
CHANGED
package/readme.md
CHANGED