diff --git a/.travis.yml b/.travis.yml index 11a115a..222078e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: ruby rvm: - 1.9.3 + - 2.0.0 diff --git a/lib/mindbody-api/models.rb b/lib/mindbody-api/models.rb index 6bc0e2f..b29838f 100644 --- a/lib/mindbody-api/models.rb +++ b/lib/mindbody-api/models.rb @@ -9,6 +9,9 @@ class Base end require 'mindbody-api/models/location' +require 'mindbody-api/models/client_credit_card' +require 'mindbody-api/models/relationship' +require 'mindbody-api/models/client_relationship' require 'mindbody-api/models/client' require 'mindbody-api/models/schedule_type' require 'mindbody-api/models/program' diff --git a/lib/mindbody-api/models/client.rb b/lib/mindbody-api/models/client.rb index 96f6bf7..14a1088 100644 --- a/lib/mindbody-api/models/client.rb +++ b/lib/mindbody-api/models/client.rb @@ -18,11 +18,17 @@ class Client < Base attribute :is_prospect, Boolean attribute :is_company, Boolean attribute :notes, String + attribute :emergency_contact_info_phone, String + attribute :emergency_contact_info_name, String + attribute :emergency_contact_info_relationship, String + attribute :emergency_contact_info_email, String attribute :mobile_phone, String attribute :home_phone, String attribute :photo_url, String attribute :username, String attribute :first_appointment_date, DateTime + attribute :client_relationships, Array[ClientRelationship] + attribute :client_credit_card, ClientCreditCard def name "#{first_name} #{last_name}" diff --git a/lib/mindbody-api/models/client_credit_card.rb b/lib/mindbody-api/models/client_credit_card.rb new file mode 100644 index 0000000..6aea607 --- /dev/null +++ b/lib/mindbody-api/models/client_credit_card.rb @@ -0,0 +1,17 @@ +module MindBody + module Models + class ClientCreditCard < Base + attribute :card_number, String + attribute :card_holder, String + attribute :city, String + attribute :address, String + attribute :state, String + attribute :postal_code, String + attribute :exp_month, String + attribute :exp_year, Integer + + + end + end +end + diff --git a/lib/mindbody-api/models/client_relationship.rb b/lib/mindbody-api/models/client_relationship.rb new file mode 100644 index 0000000..0dfaa20 --- /dev/null +++ b/lib/mindbody-api/models/client_relationship.rb @@ -0,0 +1,11 @@ +module MindBody + module Models + class ClientRelationship < Base + attribute :related_client, Client + attribute :relationship, Relationship + attribute :relationship_name, String + + end + end +end + diff --git a/lib/mindbody-api/models/relationship.rb b/lib/mindbody-api/models/relationship.rb new file mode 100644 index 0000000..75971c4 --- /dev/null +++ b/lib/mindbody-api/models/relationship.rb @@ -0,0 +1,10 @@ +module MindBody + module Models + class Relationship < Base + attribute :id, Integer + attribute :relationship_name1, String + attribute :relationship_name2, String + end + end +end + diff --git a/spec/models/client_credit_card_spec.rb b/spec/models/client_credit_card_spec.rb new file mode 100644 index 0000000..d4d9de1 --- /dev/null +++ b/spec/models/client_credit_card_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe MindBody::Models::ClientCreditCard do + it {should respond_to(:card_number)} + it {should respond_to(:card_holder)} + it {should respond_to(:city)} + it {should respond_to(:address)} + it {should respond_to(:state)} + it {should respond_to(:postal_code)} + it {should respond_to(:exp_month)} + it {should respond_to(:exp_year)} +end diff --git a/spec/models/client_relationship_spec.rb b/spec/models/client_relationship_spec.rb new file mode 100644 index 0000000..d02bfc1 --- /dev/null +++ b/spec/models/client_relationship_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe MindBody::Models::ClientRelationship do + it {should respond_to(:related_client)} + it {should respond_to(:relationship)} + it {should respond_to(:relationship_name)} +end diff --git a/spec/models/client_spec.rb b/spec/models/client_spec.rb index c562eed..73a1db3 100644 --- a/spec/models/client_spec.rb +++ b/spec/models/client_spec.rb @@ -17,12 +17,19 @@ it {should respond_to(:home_location)} it {should respond_to(:is_prospect)} it {should respond_to(:is_company)} + it {should respond_to(:emergency_contact_info_phone)} + it {should respond_to(:emergency_contact_info_name)} + it {should respond_to(:emergency_contact_info_relationship)} + it {should respond_to(:emergency_contact_info_email)} it {should respond_to(:notes)} it {should respond_to(:mobile_phone)} it {should respond_to(:home_phone)} + it {should respond_to(:work_phone)} it {should respond_to(:photo_url)} it {should respond_to(:username)} it {should respond_to(:first_appointment_date)} + it {should respond_to(:client_relationships)} + it {should respond_to(:client_credit_card)} it {should respond_to(:name)} it 'should concatenate first_name and last_name to be name' do diff --git a/spec/models/relationship_spec.rb b/spec/models/relationship_spec.rb new file mode 100644 index 0000000..a54a476 --- /dev/null +++ b/spec/models/relationship_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe MindBody::Models::Relationship do + it {should respond_to(:id)} + it {should respond_to(:relationship_name1)} + it {should respond_to(:relationship_name2)} +end