import DS from 'ember-data'; import { validator, buildValidations } from 'ember-cp-validations'; const Validations = buildValidations({ // 'addressType' : { // validators: [ // validator('presence', { // presence: true, // dependentKeys: ['model.addressType.id'] // }) // ], // }, // 'alamat1' : validator('presence', true), // 'country' : { // validators: [ // validator('presence', { // presence: true, // dependentKeys: ['model.country.id'] // }) // ], // }, // 'province' : { // validators: [ // validator('presence', { // presence: true, // dependentKeys: ['model.province.id'] // }) // ], // }, // 'governmentIdValue' : validator('presence', true), // 'namaDepan' : validator('presence', true), }); export default DS.Model.extend(Validations, { favorite: DS.attr('boolean'), nama: DS.attr('string'), account: DS.attr('string'), namaDepan: DS.attr('string'), namaBelakang: DS.attr('string'), tittle: DS.belongsTo('tittle',{inverse :null}), jobTittle : DS.attr('string'), owner: DS.attr('string'), gender: DS.belongsTo('gender', {inverse: null}), tanggalLahir: DS.attr('date'), mobilePhone: DS.attr('string'), validEmailAddress: DS.attr('string'), hobi: DS.attr('string'), religion: DS.belongsTo('religion', {inverse: null}), addressType: DS.belongsTo('address-type', {inverse: null}), country: DS.belongsTo('country', {inverse: null}), alamat1: DS.attr('string'), alamat2: DS.attr('string'), alamat3: DS.attr('string'), village: DS.belongsTo('village', {inverse: null}), province: DS.belongsTo('province', {inverse: null}), municipality: DS.belongsTo('municipality', {inverse: null}), subDistrict: DS.belongsTo('sub-district', {inverse: null}), kodePos: DS.attr('string'), governmentIdValue: DS.attr('string'), accountPartyNumber: DS.attr('string'), isPrimary: DS.attr('string'), chosee:DS.attr('boolean'), createdBy: DS.attr('string'), updatedBy: DS.attr('string'), isAllowedNamaBelakang: DS.attr('string'), isAllowedHoby:DS.attr('string'), isAllowedGender:DS.attr('string'), isAllowedTanggalLahir:DS.attr('string'), isAllowedMobilePhone:DS.attr('string'), isAllowedValidEmailAddress:DS.attr('string'), isAllowedTittle:DS.attr('string'), isAllowedReligion:DS.attr('string'), });