/** @module entities/profileSchema */ import { allModules } from '..' /** * profile schema object * uses the module system to use common fields * but sets fields with our validation types * @constructor */ const profileSchema = { type: 'object', properties: { /** _baseRecord fields */ createdAt: { type: 'string' }, _id: { type: 'string' }, lastUpdatedAt: { type: 'string' }, type: { type: 'string' }, /** our fields */ email: { type: 'string' }, /** tricky module system fields */ ...allModules.location({ street: { type: 'string' }, apt: { type: 'string' }, city: { type: 'string' }, state: { type: 'string' }, zip: { type: 'number' } }) }, /** fields required before saving */ required: [ 'email' ], additionalProperties: false } export { profileSchema }