app/representers/openstax/accounts/api/v1/account_representer.rb in openstax_accounts-7.1.0 vs app/representers/openstax/accounts/api/v1/account_representer.rb in openstax_accounts-7.2.0

- old
+ new

@@ -1,20 +1,20 @@ # A representer for Accounts -# -# This representer can be used directly or subclassed for an object that -# delegates openstax_uid, username, first_name, last_name, full_name and -# title to an account module OpenStax module Accounts module Api module V1 class AccountRepresenter < Roar::Decorator # This representer is used to communicate with Accounts # and so must allow read/write on all properties + # Do not use it in create/update APIs! + # Otherwise, this representer can be used directly or subclassed + # for an object that delegates openstax_uid, username, first_name, last_name, full_name, # title, faculty_status and salesforce_contact_id to an account + include Roar::JSON property :openstax_uid, as: :id, type: Integer, @@ -50,9 +50,23 @@ property :title, type: String, schema_info: { description: "The user's title" + } + + property :salesforce_contact_id, + type: String, + schema_info: { + description: "The user's salesforce contact id" + } + + property :faculty_status, + type: String, + schema_info: { + description: "One of #{ + OpenStax::Accounts::Account.faculty_statuses.keys.map(&:to_s).inspect + }" } end end end