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 NoteSchema = new SimpleSchema({
name: {
@@ -11,4 +12,24 @@ let NoteSchema = new SimpleSchema({
},
});
export { NoteSchema };
let ComputedOnlyNoteSchema = new SimpleSchema({
summaryCalculations: {
type: Array,
maxCount: 32,
},
'summaryCalculations.$': InlineComputationSchema,
descriptionCalculations: {
type: Array,
maxCount: 32,
},
'descriptionCalculations.$': InlineComputationSchema,
});
const ComputedNoteSchema = new SimpleSchema()
.extend(NoteSchema)
.extend(ComputedOnlyNoteSchema);
export { NoteSchema, ComputedNoteSchema, ComputedOnlyNoteSchema, };