37 lines
1006 B
TypeScript
37 lines
1006 B
TypeScript
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
|
|
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema';
|
|
import { TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
|
|
|
|
const FeatureSchema = createPropertySchema({
|
|
name: {
|
|
type: String,
|
|
max: STORAGE_LIMITS.name,
|
|
optional: true,
|
|
},
|
|
summary: {
|
|
type: 'inlineCalculationFieldToCompute' as const,
|
|
optional: true,
|
|
},
|
|
description: {
|
|
type: 'inlineCalculationFieldToCompute' as const,
|
|
optional: true,
|
|
},
|
|
});
|
|
|
|
const ComputedOnlyFeatureSchema = createPropertySchema({
|
|
summary: {
|
|
type: 'computedOnlyInlineCalculationField' as const,
|
|
optional: true,
|
|
},
|
|
description: {
|
|
type: 'computedOnlyInlineCalculationField' as const,
|
|
optional: true,
|
|
},
|
|
});
|
|
|
|
const ComputedFeatureSchema = TypedSimpleSchema.from({})
|
|
.extend(FeatureSchema)
|
|
.extend(ComputedOnlyFeatureSchema);
|
|
|
|
export { FeatureSchema, ComputedFeatureSchema, ComputedOnlyFeatureSchema }
|