42 lines
1010 B
JavaScript
42 lines
1010 B
JavaScript
import SimpleSchema from 'simpl-schema';
|
|
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
|
|
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema';
|
|
|
|
let NoteSchema = createPropertySchema({
|
|
name: {
|
|
type: String,
|
|
optional: true,
|
|
max: STORAGE_LIMITS.name,
|
|
},
|
|
summary: {
|
|
type: 'inlineCalculationFieldToCompute',
|
|
optional: true,
|
|
},
|
|
description: {
|
|
type: 'inlineCalculationFieldToCompute',
|
|
optional: true,
|
|
},
|
|
// Prevent the property from showing up in the log
|
|
silent: {
|
|
type: Boolean,
|
|
optional: true,
|
|
},
|
|
});
|
|
|
|
let ComputedOnlyNoteSchema = createPropertySchema({
|
|
summary: {
|
|
type: 'computedOnlyInlineCalculationField',
|
|
optional: true,
|
|
},
|
|
description: {
|
|
type: 'computedOnlyInlineCalculationField',
|
|
optional: true,
|
|
},
|
|
});
|
|
|
|
const ComputedNoteSchema = new SimpleSchema()
|
|
.extend(NoteSchema)
|
|
.extend(ComputedOnlyNoteSchema);
|
|
|
|
export { NoteSchema, ComputedNoteSchema, ComputedOnlyNoteSchema, };
|