require 'virtus' class Roqua::CoreApi::Models::Person < Roqua::CoreApi::Models::ActiveVirtus attribute :id, String attribute :role, String attribute :firstname, String attribute :lastname, String attribute :initials, String attribute :email, String attribute :phone_home, String attribute :phone_work, String attribute :phone_cell, String attribute :birthdate, Date attribute :gender, String attribute :country_of_birth, String attribute :address_type, String attribute :street, String attribute :city, String attribute :zipcode, String attribute :country, String validates :role, inclusion: { in: %w( professional patient parent ) } def persisted? id.present? end end