lockstep_rails 0.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +216 -0
  4. data/Rakefile +31 -0
  5. data/app/assets/config/lockstep_rails_manifest.js +0 -0
  6. data/app/concepts/lockstep/active_records/association.rb +78 -0
  7. data/app/concepts/lockstep/api_record.rb +1118 -0
  8. data/app/concepts/lockstep/api_records/scopes.rb +20 -0
  9. data/app/concepts/lockstep/client.rb +162 -0
  10. data/app/concepts/lockstep/error.rb +50 -0
  11. data/app/concepts/lockstep/exceptions.rb +4 -0
  12. data/app/concepts/lockstep/query.rb +409 -0
  13. data/app/concepts/lockstep/query_methods.rb +75 -0
  14. data/app/concepts/lockstep/relation_array.rb +100 -0
  15. data/app/helpers/types.rb +3 -0
  16. data/app/models/lockstep/account.rb +15 -0
  17. data/app/models/lockstep/connection.rb +19 -0
  18. data/app/models/lockstep/contact.rb +9 -0
  19. data/app/models/lockstep/customer_summary.rb +6 -0
  20. data/app/models/lockstep/invoice.rb +7 -0
  21. data/app/models/lockstep/invoice_summary.rb +6 -0
  22. data/app/models/lockstep/invoices/address.rb +24 -0
  23. data/app/models/lockstep/note.rb +7 -0
  24. data/app/models/lockstep/payment.rb +7 -0
  25. data/app/models/lockstep/payment_summary.rb +6 -0
  26. data/app/models/lockstep/user.rb +10 -0
  27. data/app/platform_api/model_template.rb.erb +27 -0
  28. data/app/platform_api/schema/action_result.rb +15 -0
  29. data/app/platform_api/schema/activity.rb +141 -0
  30. data/app/platform_api/schema/activity_fetch_result.rb +26 -0
  31. data/app/platform_api/schema/activity_stream_item.rb +58 -0
  32. data/app/platform_api/schema/activity_x_ref.rb +37 -0
  33. data/app/platform_api/schema/aging.rb +24 -0
  34. data/app/platform_api/schema/api_key.rb +71 -0
  35. data/app/platform_api/schema/api_key_fetch_result.rb +26 -0
  36. data/app/platform_api/schema/app_enrollment.rb +88 -0
  37. data/app/platform_api/schema/app_enrollment_custom_field.rb +67 -0
  38. data/app/platform_api/schema/app_enrollment_custom_field_fetch_result.rb +26 -0
  39. data/app/platform_api/schema/app_enrollment_fetch_result.rb +26 -0
  40. data/app/platform_api/schema/application.rb +89 -0
  41. data/app/platform_api/schema/application_fetch_result.rb +26 -0
  42. data/app/platform_api/schema/ar_aging_header_info.rb +47 -0
  43. data/app/platform_api/schema/ar_header_info.rb +118 -0
  44. data/app/platform_api/schema/assembly.rb +68 -0
  45. data/app/platform_api/schema/at_risk_invoice_summary.rb +90 -0
  46. data/app/platform_api/schema/at_risk_invoice_summary_fetch_result.rb +26 -0
  47. data/app/platform_api/schema/attachment.rb +92 -0
  48. data/app/platform_api/schema/attachment_fetch_result.rb +26 -0
  49. data/app/platform_api/schema/attachment_header_info.rb +41 -0
  50. data/app/platform_api/schema/batch_sync.rb +18 -0
  51. data/app/platform_api/schema/bulk_currency_conversion.rb +19 -0
  52. data/app/platform_api/schema/cashflow_report.rb +35 -0
  53. data/app/platform_api/schema/code_definition.rb +58 -0
  54. data/app/platform_api/schema/code_definition_fetch_result.rb +26 -0
  55. data/app/platform_api/schema/company.rb +243 -0
  56. data/app/platform_api/schema/company_fetch_result.rb +26 -0
  57. data/app/platform_api/schema/company_sync.rb +142 -0
  58. data/app/platform_api/schema/connector_info.rb +27 -0
  59. data/app/platform_api/schema/constructor_info.rb +128 -0
  60. data/app/platform_api/schema/contact.rb +148 -0
  61. data/app/platform_api/schema/contact_fetch_result.rb +26 -0
  62. data/app/platform_api/schema/contact_sync.rb +109 -0
  63. data/app/platform_api/schema/country.rb +62 -0
  64. data/app/platform_api/schema/country_fetch_result.rb +26 -0
  65. data/app/platform_api/schema/credit_memo_applied.rb +104 -0
  66. data/app/platform_api/schema/credit_memo_applied_fetch_result.rb +26 -0
  67. data/app/platform_api/schema/credit_memo_applied_sync.rb +67 -0
  68. data/app/platform_api/schema/credit_memo_invoice.rb +77 -0
  69. data/app/platform_api/schema/currency.rb +31 -0
  70. data/app/platform_api/schema/currency_fetch_result.rb +26 -0
  71. data/app/platform_api/schema/currency_rate.rb +28 -0
  72. data/app/platform_api/schema/custom_attribute_data.rb +18 -0
  73. data/app/platform_api/schema/custom_attribute_named_argument.rb +24 -0
  74. data/app/platform_api/schema/custom_attribute_typed_argument.rb +16 -0
  75. data/app/platform_api/schema/custom_field_definition.rb +76 -0
  76. data/app/platform_api/schema/custom_field_definition_fetch_result.rb +26 -0
  77. data/app/platform_api/schema/custom_field_sync.rb +71 -0
  78. data/app/platform_api/schema/custom_field_value.rb +75 -0
  79. data/app/platform_api/schema/custom_field_value_fetch_result.rb +26 -0
  80. data/app/platform_api/schema/customer_details.rb +98 -0
  81. data/app/platform_api/schema/customer_details_payment.rb +60 -0
  82. data/app/platform_api/schema/customer_summary.rb +88 -0
  83. data/app/platform_api/schema/customer_summary_fetch_result.rb +26 -0
  84. data/app/platform_api/schema/daily_sales_outstanding_report.rb +25 -0
  85. data/app/platform_api/schema/developer_account_submit.rb +23 -0
  86. data/app/platform_api/schema/email.rb +160 -0
  87. data/app/platform_api/schema/email_fetch_result.rb +26 -0
  88. data/app/platform_api/schema/erp.rb +23 -0
  89. data/app/platform_api/schema/erp_fetch_result.rb +26 -0
  90. data/app/platform_api/schema/erp_info.rb +18 -0
  91. data/app/platform_api/schema/erp_info_data.rb +23 -0
  92. data/app/platform_api/schema/event_info.rb +59 -0
  93. data/app/platform_api/schema/exception.rb +41 -0
  94. data/app/platform_api/schema/field_info.rb +105 -0
  95. data/app/platform_api/schema/financial_account.rb +90 -0
  96. data/app/platform_api/schema/financial_account_balance_history.rb +90 -0
  97. data/app/platform_api/schema/financial_account_balance_history_fetch_result.rb +26 -0
  98. data/app/platform_api/schema/financial_account_fetch_result.rb +26 -0
  99. data/app/platform_api/schema/financial_year_setting.rb +74 -0
  100. data/app/platform_api/schema/financial_year_setting_fetch_result.rb +26 -0
  101. data/app/platform_api/schema/invite.rb +25 -0
  102. data/app/platform_api/schema/invite_data.rb +18 -0
  103. data/app/platform_api/schema/invite_submit.rb +15 -0
  104. data/app/platform_api/schema/invoice.rb +226 -0
  105. data/app/platform_api/schema/invoice_address.rb +97 -0
  106. data/app/platform_api/schema/invoice_fetch_result.rb +29 -0
  107. data/app/platform_api/schema/invoice_history.rb +188 -0
  108. data/app/platform_api/schema/invoice_history_fetch_result.rb +26 -0
  109. data/app/platform_api/schema/invoice_line.rb +142 -0
  110. data/app/platform_api/schema/invoice_line_sync.rb +208 -0
  111. data/app/platform_api/schema/invoice_payment_detail.rb +65 -0
  112. data/app/platform_api/schema/invoice_summary.rb +85 -0
  113. data/app/platform_api/schema/invoice_summary_fetch_result.rb +26 -0
  114. data/app/platform_api/schema/invoice_sync.rb +280 -0
  115. data/app/platform_api/schema/lead.rb +32 -0
  116. data/app/platform_api/schema/member_info.rb +36 -0
  117. data/app/platform_api/schema/method_base.rb +128 -0
  118. data/app/platform_api/schema/method_info.rb +137 -0
  119. data/app/platform_api/schema/module.rb +44 -0
  120. data/app/platform_api/schema/module_handle.rb +15 -0
  121. data/app/platform_api/schema/note.rb +72 -0
  122. data/app/platform_api/schema/note_fetch_result.rb +26 -0
  123. data/app/platform_api/schema/parameter_info.rb +64 -0
  124. data/app/platform_api/schema/payment.rb +147 -0
  125. data/app/platform_api/schema/payment_applied.rb +95 -0
  126. data/app/platform_api/schema/payment_applied_fetch_result.rb +26 -0
  127. data/app/platform_api/schema/payment_applied_sync.rb +74 -0
  128. data/app/platform_api/schema/payment_detail.rb +110 -0
  129. data/app/platform_api/schema/payment_detail_fetch_result.rb +26 -0
  130. data/app/platform_api/schema/payment_detail_header.rb +43 -0
  131. data/app/platform_api/schema/payment_fetch_result.rb +26 -0
  132. data/app/platform_api/schema/payment_summary.rb +79 -0
  133. data/app/platform_api/schema/payment_summary_fetch_result.rb +26 -0
  134. data/app/platform_api/schema/payment_sync.rb +112 -0
  135. data/app/platform_api/schema/problem_details.rb +31 -0
  136. data/app/platform_api/schema/property_info.rb +60 -0
  137. data/app/platform_api/schema/provisioning.rb +28 -0
  138. data/app/platform_api/schema/provisioning_finalize_request.rb +28 -0
  139. data/app/platform_api/schema/provisioning_response.rb +42 -0
  140. data/app/platform_api/schema/risk_rate.rb +57 -0
  141. data/app/platform_api/schema/runtime_field_handle.rb +13 -0
  142. data/app/platform_api/schema/runtime_method_handle.rb +13 -0
  143. data/app/platform_api/schema/runtime_type_handle.rb +13 -0
  144. data/app/platform_api/schema/state.rb +22 -0
  145. data/app/platform_api/schema/state_fetch_result.rb +26 -0
  146. data/app/platform_api/schema/status.rb +72 -0
  147. data/app/platform_api/schema/struct_layout_attribute.rb +16 -0
  148. data/app/platform_api/schema/sync_entity_result.rb +34 -0
  149. data/app/platform_api/schema/sync_request.rb +71 -0
  150. data/app/platform_api/schema/sync_request_fetch_result.rb +26 -0
  151. data/app/platform_api/schema/sync_submit.rb +15 -0
  152. data/app/platform_api/schema/test_argument_exception.rb +41 -0
  153. data/app/platform_api/schema/test_timeout_exception.rb +41 -0
  154. data/app/platform_api/schema/transfer_owner.rb +16 -0
  155. data/app/platform_api/schema/transfer_owner_submit.rb +15 -0
  156. data/app/platform_api/schema/type.rb +278 -0
  157. data/app/platform_api/schema/type_info.rb +287 -0
  158. data/app/platform_api/schema/uri.rb +15 -0
  159. data/app/platform_api/schema/user_account.rb +152 -0
  160. data/app/platform_api/schema/user_account_fetch_result.rb +26 -0
  161. data/app/platform_api/schema/user_role.rb +50 -0
  162. data/app/platform_api/schema/user_role_fetch_result.rb +26 -0
  163. data/app/platform_api/schema/webhook.rb +96 -0
  164. data/app/platform_api/schema/webhook_fetch_result.rb +26 -0
  165. data/app/platform_api/schema/webhook_history_table_storage.rb +64 -0
  166. data/app/platform_api/schema/webhook_history_table_storage_fetch_result.rb +26 -0
  167. data/app/platform_api/swagger.json +22056 -0
  168. data/config/routes.rb +2 -0
  169. data/lib/lockstep_rails/engine.rb +4 -0
  170. data/lib/lockstep_rails/version.rb +3 -0
  171. data/lib/lockstep_rails.rb +5 -0
  172. data/lib/tasks/lockstep_rails_tasks.rake +4 -0
  173. data/lib/tasks/update_api_schema.rake +159 -0
  174. metadata +230 -0
@@ -0,0 +1,75 @@
1
+ #require 'parse_resource'
2
+ require "lockstep/query"
3
+
4
+ module Lockstep
5
+ module QueryMethods
6
+ module ClassMethods
7
+ def query_builder
8
+ @query_builder = Query.new(self)
9
+ unless scopes[:default_scope].nil?
10
+ @query_builder.criteria.deep_merge!(Lockstep::ApiRecord.instance_exec(&scopes[:default_scope]).criteria)
11
+ end
12
+
13
+ @query_builder
14
+ end
15
+
16
+ def unscoped
17
+ Query.new(self)
18
+ end
19
+
20
+ def none
21
+ query_builder.none
22
+ end
23
+
24
+ # Include the attributes of a parent ojbect in the results
25
+ # Similar to ActiveRecord eager loading
26
+ #
27
+ def include_object(*associations)
28
+ query_builder.include_object(*associations)
29
+ end
30
+
31
+ # Add this at the end of a method chain to get the count of objects, instead of an Array of objects
32
+ def count
33
+ #https://www.parse.com/docs/rest#queries-counting
34
+ query_builder.count
35
+ end
36
+
37
+ # Find all Lockstep::ApiRecord objects for that model.
38
+ #
39
+ # @return [Array] an `Array` of objects that subclass `Lockstep::ApiRecord`.
40
+ def all
41
+ query_builder.all
42
+ end
43
+
44
+ # Find the first object. Fairly random, not based on any specific condition.
45
+ #
46
+ def first
47
+ query_builder.limit(1).first
48
+ end
49
+
50
+ # Limits the number of objects returned
51
+ #
52
+ def limit(n)
53
+ query_builder.limit(n)
54
+ end
55
+
56
+ # Skip the number of objects
57
+ #
58
+ def page(n)
59
+ query_builder.page(n)
60
+ end
61
+
62
+ def order(*attr)
63
+ query_builder.order(*attr)
64
+ end
65
+
66
+ def reorder(*attr)
67
+ query_builder.reorder(*attr)
68
+ end
69
+ end
70
+
71
+ def self.included(base)
72
+ base.extend(ClassMethods)
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,100 @@
1
+ class Lockstep::RelationArray < Array
2
+ attr_accessor :delegate, :key, :class_name
3
+
4
+ def initialize(delegate, items, key, class_name)
5
+ super(items)
6
+ self.delegate = delegate
7
+ self.key = key
8
+ self.class_name = class_name
9
+
10
+ class_eval do
11
+ define_method("#{key}_ids") do
12
+ each.map { |item| item.id }
13
+ end
14
+ end
15
+ end
16
+
17
+ def create(attributes_hash = {})
18
+ object = new(attributes_hash)
19
+ return false unless object.save
20
+
21
+ object
22
+ end
23
+
24
+ def new(attributes_hash = {})
25
+ # Assign the parent records primary_key to the foreign_key of the association
26
+ relation_config = delegate.class.lockstep_has_many_relations[key]
27
+ foreign_key = relation_config[:foreign_key]
28
+ primary_key = relation_config[:primary_key]
29
+ attributes_hash[foreign_key] = delegate.send(primary_key)
30
+ if relation_config[:polymorphic]
31
+ polymorphic_config = Lockstep::RelationArray.has_many_polymorphic_attributes(self, relation_config[:polymorphic])
32
+ attributes_hash.merge!(polymorphic_config) if polymorphic_config.is_a?(Hash)
33
+ end
34
+ object = self.class_name.constantize.new(attributes_hash)
35
+ self.push object
36
+
37
+ object
38
+ end
39
+
40
+ # @has_many_associations polymorphic properties builder.
41
+ # Polymorphic properties is used to further scope down the has_many association while querying or creating
42
+ #
43
+ def self.has_many_polymorphic_attributes(record, polymorphic_config)
44
+ return polymorphic_config if polymorphic_config.is_a?(Hash)
45
+ return record.instance_eval record, &polymorphic_config if polymorphic_config.is_a?(Proc)
46
+
47
+ nil
48
+ end
49
+
50
+ def <<(object)
51
+ if object.is_a? Hash
52
+ create(object)
53
+ return object
54
+ end
55
+
56
+ raise Exception.new("This relation only stores objects of type #{class_name.to_s.constantize}") if !object.is_a? class_name.to_s.constantize
57
+
58
+ super(object)
59
+ object
60
+ end
61
+
62
+ def push(object)
63
+ self << object
64
+ end
65
+
66
+ def delete(object)
67
+ if object.is_a? Hash
68
+ object_id = object["objectId"]
69
+ elsif object.is_a? String
70
+ object_id = object
71
+ else
72
+ object_id = object.id
73
+ end
74
+
75
+ self.each { |item| super(item) if item.id == object_id }
76
+ end
77
+
78
+ def contains?(object)
79
+ self.each { |item| return true if item.attributes == object.attributes }
80
+ false
81
+ end
82
+
83
+ def exists?(query)
84
+ each do |item|
85
+ conditions_met = true
86
+ item.attributes.each do |key, value|
87
+ conditions_met = false if query.has_key?(key) and query[key] != value
88
+ break
89
+ end
90
+ return true if conditions_met
91
+ end
92
+ false
93
+ end
94
+
95
+ def find(id_to_find)
96
+ each do |item|
97
+ return item if id_to_find == item.id
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,3 @@
1
+ module Types
2
+ include Dry.Types()
3
+ end
@@ -0,0 +1,15 @@
1
+ class Lockstep::Account < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Companies"
3
+ self.id_ref = "company_id"
4
+ load_schema(Schema::Company)
5
+
6
+ enum company_type: %w(Group)
7
+
8
+ has_many :connections, class_name: "Lockstep::Connection", included: false, loader: ->(account) { Lockstep::Connection.all }
9
+ has_many :contacts, class_name: "Lockstep::Contact", included: false, loader: ->(account) { Lockstep::Contact.all }
10
+ has_many :users, class_name: "Lockstep::User", included: false
11
+
12
+ validates :company_name, presence: true
13
+
14
+ default_scope { where(company_type: %w(Group)) }
15
+ end
@@ -0,0 +1,19 @@
1
+ class Lockstep::Connection < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Companies"
3
+ self.id_ref = "company_id"
4
+ load_schema(Schema::Company)
5
+
6
+ enum company_type: %w(Customer Vendor)
7
+
8
+ has_many :contacts, class_name: "Lockstep::Contact", included: true
9
+ belongs_to :created_user, class_name: "Lockstep::User", foreign_key: :created_user_id, primary_key: :user_id
10
+ belongs_to :modified_user, class_name: "Lockstep::User", foreign_key: :modified_user_id, primary_key: :user_id
11
+
12
+ validates :company_name, presence: true
13
+
14
+ default_scope { where(company_type: %w(Customer Vendor)).or(where(company_type: nil)) }
15
+
16
+ scope :customers, -> { where(company_type: "Customer") }
17
+ scope :vendors, -> { where(company_type: "Vendor") }
18
+ scope :company_type_null, -> { where(company_type: nil) }
19
+ end
@@ -0,0 +1,9 @@
1
+ class Lockstep::Contact < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Contacts"
3
+ self.id_ref = "contact_id"
4
+ load_schema(Schema::Contact)
5
+
6
+ validates :email_address, presence: true
7
+
8
+ belongs_to :connection, class_name: "Lockstep::Connection", included: false
9
+ end
@@ -0,0 +1,6 @@
1
+ class Lockstep::CustomerSummary < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Companies/views/customer-summary"
3
+ self.id_ref = "company_id"
4
+ self.query_path = ""
5
+ load_schema(Schema::CustomerSummary)
6
+ end
@@ -0,0 +1,7 @@
1
+ class Lockstep::Invoice < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Invoices"
3
+ self.id_ref = "invoice_id"
4
+ load_schema(Schema::Invoice)
5
+
6
+ belongs_to :connection, class_name: "Lockstep::Connection", foreign_key: :customer_id
7
+ end
@@ -0,0 +1,6 @@
1
+ class Lockstep::InvoiceSummary < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Invoices/views/summary"
3
+ self.id_ref = "invoice_id"
4
+ self.query_path = ""
5
+ load_schema(Schema::InvoiceSummary)
6
+ end
@@ -0,0 +1,24 @@
1
+ class Lockstep::Invoices::Address < Lockstep::ApiRecord
2
+ self.id_ref = "invoice_address_id"
3
+
4
+ field :invoice_address_id
5
+ field :group_key
6
+ field :invoice_id
7
+ field :line1
8
+ field :line2
9
+ field :line3
10
+ field :city
11
+ field :region
12
+ field :postal_code
13
+ field :country
14
+ field :latitude
15
+ field :longitude
16
+ field :created, Types::Params::DateTime
17
+ field :created_user_id
18
+ field :modified, Types::Params::DateTime
19
+ field :modified_user_id
20
+ field :app_enrollment_id
21
+
22
+ belongs_to :created_user, class_name: "Lockstep::User", foreign_key: :created_user_id, primary_key: :user_id
23
+ belongs_to :modified_user, class_name: "Lockstep::User", foreign_key: :modified_user_id, primary_key: :user_id
24
+ end
@@ -0,0 +1,7 @@
1
+ class Lockstep::Note < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Notes"
3
+ self.id_ref = "note_id"
4
+ load_schema(Schema::Note)
5
+
6
+ belongs_to :created_user, class_name: "Lockstep::User", foreign_key: :created_user_id, primary_key: :user_id
7
+ end
@@ -0,0 +1,7 @@
1
+ class Lockstep::Payment < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Payments"
3
+ self.id_ref = "payment_id"
4
+ load_schema(Schema::Payment)
5
+
6
+ belongs_to :connection, class_name: "Lockstep::Connection", foreign_key: :company_id
7
+ end
@@ -0,0 +1,6 @@
1
+ class Lockstep::PaymentSummary < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/Payments/views/summary"
3
+ self.id_ref = "payment_id"
4
+ self.query_path = ""
5
+ load_schema(Schema::PaymentSummary)
6
+ end
@@ -0,0 +1,10 @@
1
+ class Lockstep::User < Lockstep::ApiRecord
2
+ self.model_name_uri = "v1/UserAccounts"
3
+ self.id_ref = "user_id"
4
+ load_schema(Schema::UserAccount)
5
+
6
+ # # Load the first account
7
+ belongs_to :account, class_name: "Lockstep::Account", loader: ->(user) { Lockstep::Account.first }
8
+
9
+ alias_attribute :last_logged_in, :b2_c_last_logged_in
10
+ end
@@ -0,0 +1,27 @@
1
+ class Schema::<%= class_name %> < Lockstep::ApiRecord
2
+
3
+ # ApiRecord will crash unless `id_ref` is defined
4
+ def self.id_ref
5
+ nil
6
+ end
7
+
8
+ <% fields.each do |field_name, config| -%>
9
+ <%= config["description"].nil? ? nil : "# #{config['description'].gsub("\n", "\n # ")}"%>
10
+ <% if !config["type"].nil? -%>
11
+ # @type: <%= config["type"] %>
12
+ <%end -%>
13
+ <% if !config["format"].nil? -%>
14
+ # @format: <%= config["format"] %>
15
+ <%end -%>
16
+ field :<%= field_name %><%= config["value_type"].nil? ? nil : ", #{config["value_type"]}" %>
17
+
18
+ <%end -%>
19
+ <% belongs_to_relations.each do |relation, config| -%>
20
+ belongs_to :<%= relation %>, <%= config %>
21
+ <%end -%>
22
+
23
+ <% has_many_relations.each do |relation, config| -%>
24
+ has_many :<%= relation %>, <%= config %>
25
+ <%end -%>
26
+
27
+ end
@@ -0,0 +1,15 @@
1
+ class Schema::ActionResult < Lockstep::ApiRecord
2
+
3
+ # ApiRecord will crash unless `id_ref` is defined
4
+ def self.id_ref
5
+ nil
6
+ end
7
+
8
+ # If the API call produced messages, this element will contain a list of user-visible
9
+ # text strings that contain information about what work occurred in the API.
10
+ # @type: array
11
+ field :messages
12
+
13
+
14
+
15
+ end
@@ -0,0 +1,141 @@
1
+ class Schema::Activity < Lockstep::ApiRecord
2
+
3
+ # ApiRecord will crash unless `id_ref` is defined
4
+ def self.id_ref
5
+ nil
6
+ end
7
+
8
+ # The unique ID of this record, automatically assigned by Lockstep when this record is
9
+ # added to the Lockstep platform.
10
+ # @type: string
11
+ # @format: uuid
12
+ field :activity_id
13
+
14
+ # The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
15
+ # account will share the same GroupKey value. GroupKey values cannot be changed once created.
16
+ #
17
+ # For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
18
+ # @type: string
19
+ # @format: uuid
20
+ field :group_key
21
+
22
+ # The ID of the company to which this activity belongs.
23
+ # @type: string
24
+ # @format: uuid
25
+ field :company_id
26
+
27
+ # The type code of the activity
28
+ # @type: string
29
+ field :activity_type_code
30
+
31
+ # The name of the activity. The name is a short name provided by the
32
+ # person who created the activity that can be displayed in a list.
33
+ # @type: string
34
+ field :activity_name
35
+
36
+ # A description of the activity. This field contains more detailed text about the
37
+ # activity and can be lengthy.
38
+ # @type: string
39
+ field :activity_description
40
+
41
+ # The status of the activity.
42
+ # @type: string
43
+ field :activity_status
44
+
45
+ # True if this activity is currently "open", which indicates that the activity is
46
+ # currently in progress.
47
+ # @type: boolean
48
+ field :is_open
49
+
50
+ # The priority of the activity.
51
+ # @type: string
52
+ field :priority
53
+
54
+ # The ID of the user the activity is assigned to.
55
+ # @type: string
56
+ # @format: uuid
57
+ field :user_assigned_to
58
+
59
+ # The date the activity was assigned.
60
+ # @type: string
61
+ # @format: date-time
62
+ field :date_assigned, Types::Params::DateTime
63
+
64
+ # The date the activity was closed.
65
+ # @type: string
66
+ # @format: date-time
67
+ field :date_closed, Types::Params::DateTime
68
+
69
+ # If this activity has been "snoozed", this field will be non-null and will contain
70
+ # the date when the activity will be displayed. Until that date arrives, the activity
71
+ # will remain hidden.
72
+ # @type: string
73
+ # @format: date-time
74
+ field :snooze_until_date, Types::Params::DateTime
75
+
76
+ # The date on which this activity was created.
77
+ # @type: string
78
+ # @format: date-time
79
+ field :created, Types::Params::DateTime
80
+
81
+ # The ID of the user who created this activity.
82
+ # @type: string
83
+ # @format: uuid
84
+ field :created_user_id
85
+
86
+ # The date on which this activity was last modified.
87
+ # @type: string
88
+ # @format: date-time
89
+ field :modified, Types::Params::DateTime
90
+
91
+ # The ID of the user who last modified this activity.
92
+ # @type: string
93
+ # @format: uuid
94
+ field :modified_user_id
95
+
96
+ # Amount collected (if any) for the activity.
97
+ # @type: number
98
+ # @format: double
99
+ field :amount_collected
100
+
101
+ # Amount paid (if any) for the activity.
102
+ # @type: number
103
+ # @format: double
104
+ field :amount_paid
105
+
106
+ # Credit given (if any) for the activity.
107
+ # @type: number
108
+ # @format: double
109
+ field :credit_given
110
+
111
+ # True if this activity is to be shown in an "unread" state. When an activity
112
+ # is read by a person it is assigned to, this flag is set to false.
113
+ # @type: boolean
114
+ field :is_unread
115
+
116
+ # Activities may be archived when they should be hidden from the user. When
117
+ # this flag is true, this activity should be hidden.
118
+ # @type: boolean
119
+ field :is_archived
120
+
121
+ # The company associated with the activity
122
+ #
123
+ # To retrieve this collection, specify `Company` in the "Include" parameter for your query.
124
+ field :company
125
+
126
+ # The name of the user the activity is assigned to
127
+ # @type: string
128
+ field :user_assigned_to_name
129
+
130
+ belongs_to :company, {:class_name=>"Lockstep::Account", :primary_key=>:company_id, :foreign_key=>"company_id"}
131
+ belongs_to :account, {:class_name=>"Lockstep::Account", :primary_key=>:company_id, :foreign_key=>"company_id"}
132
+ belongs_to :created_user, {:class_name=>"Lockstep::User", :primary_key=>:user_id, :foreign_key=>"created_user_id"}
133
+ belongs_to :modified_user, {:class_name=>"Lockstep::User", :primary_key=>:user_id, :foreign_key=>"modified_user_id"}
134
+
135
+ has_many :attachments, {:class_name=>"Schema::Attachment", :included=>true}
136
+ has_many :notes, {:class_name=>"Lockstep::Note", :included=>true, :foreign_key=>:object_key, :polymorphic=>{:table_key=>"Activity"}}
137
+ has_many :custom_field_definitions, {:class_name=>"Schema::CustomFieldDefinition", :included=>true}
138
+ has_many :custom_field_values, {:class_name=>"Schema::CustomFieldValue", :included=>true}
139
+ has_many :references, {:class_name=>"Schema::ActivityXRef", :included=>true}
140
+
141
+ end
@@ -0,0 +1,26 @@
1
+ class Schema::ActivityFetchResult < Lockstep::ApiRecord
2
+
3
+ # ApiRecord will crash unless `id_ref` is defined
4
+ def self.id_ref
5
+ nil
6
+ end
7
+
8
+
9
+ # @type: integer
10
+ # @format: int32
11
+ field :total_count
12
+
13
+
14
+ # @type: integer
15
+ # @format: int32
16
+ field :page_size
17
+
18
+
19
+ # @type: integer
20
+ # @format: int32
21
+ field :page_number
22
+
23
+
24
+ has_many :records, {:class_name=>"Schema::Activity", :included=>true}
25
+
26
+ end
@@ -0,0 +1,58 @@
1
+ class Schema::ActivityStreamItem < Lockstep::ApiRecord
2
+
3
+ # ApiRecord will crash unless `id_ref` is defined
4
+ def self.id_ref
5
+ nil
6
+ end
7
+
8
+ # The object key of the activity stream item.
9
+ # @type: string
10
+ # @format: uuid
11
+ field :object_key
12
+
13
+ # The type code of the activity stream item.
14
+ # @type: string
15
+ field :activity_stream_type
16
+
17
+ # The text body description for this Activity Stream Item.
18
+ # @type: string
19
+ field :text_value
20
+
21
+ # The date on which this activity stream item was created.
22
+ # @type: string
23
+ # @format: date-time
24
+ field :created, Types::Params::DateTime
25
+
26
+ # The ID of the user who created this activity.
27
+ # @type: string
28
+ # @format: uuid
29
+ field :created_user_id
30
+
31
+ # The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
32
+ # account will share the same GroupKey value. GroupKey values cannot be changed once created.
33
+ #
34
+ # For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
35
+ # @type: string
36
+ # @format: uuid
37
+ field :group_key
38
+
39
+ # The sender's email address if activity stream item is an Email.
40
+ # @type: string
41
+ field :from_email_address
42
+
43
+ # The recipient's email address if activity stream item is an Email.
44
+ # @type: string
45
+ field :to_email_address
46
+
47
+ # The name of the contact sending the activity otherwise null.
48
+ # @type: string
49
+ field :from_contact_name
50
+
51
+ # The name of the contact sending the activity otherwise null.
52
+ # @type: string
53
+ field :to_contact_name
54
+
55
+ belongs_to :created_user, {:class_name=>"Lockstep::User", :primary_key=>:user_id, :foreign_key=>"created_user_id"}
56
+
57
+
58
+ end
@@ -0,0 +1,37 @@
1
+ class Schema::ActivityXRef < Lockstep::ApiRecord
2
+
3
+ # ApiRecord will crash unless `id_ref` is defined
4
+ def self.id_ref
5
+ nil
6
+ end
7
+
8
+ # The unique ID of this record, automatically assigned by Lockstep when this is
9
+ # added to the Lockstep platform.
10
+ # @type: string
11
+ # @format: uuid
12
+ field :activity_x_ref_id
13
+
14
+ # The ID of the activity to which this reference belongs.
15
+ # @type: string
16
+ # @format: uuid
17
+ field :activity_id
18
+
19
+ # The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
20
+ # account will share the same GroupKey value. GroupKey values cannot be changed once created.
21
+ #
22
+ # For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
23
+ # @type: string
24
+ # @format: uuid
25
+ field :group_key
26
+
27
+ # The name of the table the activity reference is associated with
28
+ # @type: string
29
+ field :table_key
30
+
31
+ # The ID of the object the activity reference is associated with
32
+ # @type: string
33
+ field :object_key
34
+
35
+
36
+
37
+ end
@@ -0,0 +1,24 @@
1
+ class Schema::Aging < Lockstep::ApiRecord
2
+
3
+ # ApiRecord will crash unless `id_ref` is defined
4
+ def self.id_ref
5
+ nil
6
+ end
7
+
8
+ # Aging bucket of outstanding balance data (days past due date of invoice)
9
+ # @type: integer
10
+ # @format: int32
11
+ field :bucket
12
+
13
+ # Currency code of aging bucket
14
+ # @type: string
15
+ field :currency_code
16
+
17
+ # Outstanding balance for the given aging bucket
18
+ # @type: number
19
+ # @format: double
20
+ field :outstanding_balance
21
+
22
+
23
+
24
+ end