import GenericFormObject from '../lib/GenericFormObject'
import EmailFormObject from './EmailFormObject'

export default class CityFormObject extends GenericFormObject {
  static get model() {
    return 'contact-person'
  }

  static get type() {
    return 'contact-people'
  }

  static get properties() {
    return [
      'area-code-1', 'local-number-1',
      'area-code-2', 'local-number-2',
      'email', 'organization', 'spoc'
    ]
  }

  static get formConfig() {
    return {
      'area-code-1': { type: 'number' },
      'local-number-1': { type: 'number' },
      'area-code-2': { type: 'number' },
      'local-number-2': { type: 'number' },
      // 'fax-area-code': { type: 'number' },
      // 'fax-number': { type: 'number' },
      // 'first-name': { type: 'string' },
      // 'last-name': { type: 'string' },
      // 'operational-name': { type: 'string' },
      // 'academic-title': { type: 'select', options: ['', 'dr', 'prof_dr'] },
      // gender: { type: 'select', options: ['', 'male', 'female'] },
      // responsibility: { type: 'string' },
      // position: {
      //   type: 'select', options: ['', 'superior', 'public_relations', 'other']
      // },
      // street: { type: 'string' },
      // 'zip-and-city': { type: 'string' },
      spoc: { type: 'checkbox' },
      organization: { type: 'filtering-select' },
      email: { type: 'creating-select' }
    }
  }

  static get submodels() {
    return ['email', 'organization']
  }

  static get submodelConfig() {
    return {
      email: { relationship: 'oneToOne', object: EmailFormObject },
      organization: { relationship: 'oneToOne' }
    }
  }

  // static get requiredFields() {
  //   return ['organization']
  // }

  validation() {
    // this.required('address').filled()
    // this.required('organization').filled()
  }
}

@@ -316,24 +316,44 @@
 turn %5B%0A     
+ 'operational-name',
  'area-code-
@@ -852,19 +852,16 @@
 %7D,%0A     
- //
  'operat

returned operational-name