text: from typing import List
  from pydantic import BaseModel, validator
  from mongomapper import Schema
  from datetime import date
  from dateutil.relativedelta import relativedelta
  
  from .utils import Name, Country, Timestamp, Password, PrivacyLevel, privacy_levels, country_codes
  
  class Settings(BaseModel):
    email_privacy:    PrivacyLevel  = privacy_levels.PRIVATE
    birthday_privacy: PrivacyLevel  = privacy_levels.PRIVATE
  
  class Profile(BaseModel):
    display_name:     str
    photo_url:        str           = ""
    about:            str           = ""
  
  class User(Schema, Timestamp):
    __collection_name__ = 'users'
    
    name:             Name
    birthday:         date
    emails:           List[str]
    primary_email:    int           = 0
    country:          Country       = country_codes.Chile
    password:         Password
    settings:         Settings      = Settings()
    profile:          Profile
  
    @validator('birthday')
    def not_underage(cls, v: date):
      d = v + relativedelta(years=18)
  
      if d > date.today():
        # raise UnderageUserError(v)
        ...
      
      return v
    
    @classmethod
    def create(cls, **data):
      pwd = data['password']
  
      data['password']  = Password.hash(pwd)
      data['emails']    = [data['email']]
  
      display_name = ' '.join([v for (_, v) in data['name'].items()])
      
      return super().create(**data, profile=Profile(display_name=display_name))