Denormalised inline calculations to property documents, needs to be referenced by UI still

This commit is contained in:
Stefan Zermatten
2021-01-29 12:29:01 +02:00
parent 9c799e3dc9
commit 1167538977
25 changed files with 360 additions and 118 deletions

View File

@@ -1,4 +1,5 @@
import SimpleSchema from 'simpl-schema';
import InlineComputationSchema from '/imports/api/properties/subSchemas/InlineComputationSchema.js';
let ContainerSchema = new SimpleSchema({
name: {
@@ -33,6 +34,11 @@ let ContainerSchema = new SimpleSchema({
});
const ComputedOnlyContainerSchema = new SimpleSchema({
descriptionCalculations: {
type: Array,
maxCount: 32,
},
'descriptionCalculations.$': InlineComputationSchema,
// Weight of all the contents, zero if `contentsWeightless` is true
contentsWeight:{
type: Number,
@@ -48,4 +54,4 @@ const ComputedContainerSchema = new SimpleSchema()
.extend(ComputedOnlyContainerSchema)
.extend(ContainerSchema);
export { ContainerSchema, ComputedContainerSchema };
export { ContainerSchema, ComputedOnlyContainerSchema, ComputedContainerSchema };