Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

profile.schema.js 930B

123456789101112131415161718192021222324252627282930313233343536
  1. /** @module entities/profileSchema */
  2. import { allModules } from '..'
  3. /**
  4. * profile schema object
  5. * uses the module system to use common fields
  6. * but sets fields with our validation types
  7. * @constructor
  8. */
  9. const profileSchema = {
  10. type: 'object',
  11. properties: {
  12. /** _baseRecord fields */
  13. createdAt: { type: 'string' },
  14. _id: { type: 'string' },
  15. lastUpdatedAt: { type: 'string' },
  16. type: { type: 'string' },
  17. /** our fields */
  18. email: { type: 'string' },
  19. /** tricky module system fields */
  20. ...allModules.location({
  21. street: { type: 'string' },
  22. apt: { type: 'string' },
  23. city: { type: 'string' },
  24. state: { type: 'string' },
  25. zip: { type: 'number' }
  26. })
  27. },
  28. /** fields required before saving */
  29. required: [ 'email' ],
  30. additionalProperties: false
  31. }
  32. export { profileSchema }