Added conditions to action resources

This commit is contained in:
Stefan Zermatten
2023-08-24 14:51:09 +02:00
parent 7fa993de47
commit 75ea462e64
10 changed files with 205 additions and 5 deletions

View File

@@ -77,6 +77,7 @@ let ActionSchema = createPropertySchema({
'resources.itemsConsumed': {
type: Array,
defaultValue: [],
max: 32,
},
'resources.itemsConsumed.$': {
type: Object,
@@ -104,6 +105,7 @@ let ActionSchema = createPropertySchema({
'resources.attributesConsumed': {
type: Array,
defaultValue: [],
max: 32,
},
'resources.attributesConsumed.$': {
type: Object,
@@ -124,6 +126,30 @@ let ActionSchema = createPropertySchema({
type: 'fieldToCompute',
optional: true,
},
'resources.conditions': {
type: Array,
defaultValue: [],
max: 32,
},
'resources.conditions.$': {
type: Object,
},
'resources.conditions.$._id': {
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue() {
if (!this.isSet) return Random.id();
}
},
'resources.conditions.$.condition': {
type: 'fieldToCompute',
optional: true,
},
'resources.conditions.$.conditionNote': {
type: String,
optional: true,
max: STORAGE_LIMITS.calculation,
},
// Prevent the property from showing up in the log
silent: {
type: Boolean,