lockstep_rails 0.3.42 → 0.3.44

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c1e7f7f9fa871a4fee690f2b4e0a704f6b18e1730c5cbe4fad9d8769d19673f
4
- data.tar.gz: f110b33a97400fbc9e631a6ba65f8dfb31fcd6ade37dbff0c50b02867ed3c0f1
3
+ metadata.gz: eab60f66a141c0dd8b3720267e9c19f2e857cab653f595ef0032c6b374d07ec2
4
+ data.tar.gz: e33abbe23d8f4cabf497970e7393073b8d489319ae5bdd5e94592f943ca0f878
5
5
  SHA512:
6
- metadata.gz: cc11b8b450b104042b760ca8ec55cd95d3ab49451b92df24e6519c931868689eeb18d3f29c2bc919888adbc6ff0dc940b61a69ab6e46bdc3bd97926ceb250cb6
7
- data.tar.gz: 3fbd8e7d507bafe4b9f04f4db08e17e23a1e05bfa25a609cf6fab41ce95a1c57e4183177b2fa248dba5e1532b43203367e0155c30872dc3044d56ea3fc030776
6
+ metadata.gz: e37ab2c9b875e119ba2e0b9780926caacca6a3c0c4e6577f82f45d2f2024cdf2696a149d671153d973e1b80086c940ed0892e1bd40078beb0270179764a7bfd6
7
+ data.tar.gz: c4a1db170ab68d503cfb085571d2f585f94833be44985d64da17875e0320a7d495cd7e33b05e0c8721b5998e5902606821c46891de21369ca8b5ac18fc729cb4
data/README.md CHANGED
@@ -39,30 +39,31 @@ The gem is available as open source under the terms of the [MIT License](https:/
39
39
  # Usage
40
40
 
41
41
  ### Available Records
42
- * Lockstep::Contact
43
- * Lockstep::Connection
44
42
  * Lockstep::Account
45
- * Lockstep::User
46
- * Lockstep::Note
43
+ * Lockstep::ApiKey
44
+ * Lockstep::AppEnrollment
45
+ * Lockstep::Connection
46
+ * Lockstep::Contact
47
+ * Lockstep::CustomerSummary
48
+ * Lockstep::FeatureFlag
47
49
  * Lockstep::Invoice
50
+ * Lockstep::InvoiceAtRiskSummary
48
51
  * Lockstep::InvoiceSummary
49
- * Lockstep::CustomerSummary
52
+ * Lockstep::MagicLink
53
+ * Lockstep::Note
50
54
  * Lockstep::Payments
51
55
  * Lockstep::PaymentSummary
52
- * Lockstep::AppEnrollment
56
+ * Lockstep::ReportApAgingHeader
53
57
  * Lockstep::ReportArAgingHeader
54
58
  * Lockstep::ReportCashflow
55
- * Lockstep::ReportDailySalesOutstanding
56
- * Lockstep::ReportRiskRate
57
- * Lockstep::ReportApAgingHeader
58
59
  * Lockstep::ReportDailyPayableOutstanding
60
+ * Lockstep::ReportDailySalesOutstanding
59
61
  * Lockstep::ReportPayableComingDue
60
- * Lockstep::ReportPayableSummary
61
62
  * Lockstep::ReportPayablesComingDueSummary
62
- * Lockstep::ApiKey
63
- * Lockstep::InvoiceAtRiskSummary
64
- * Lockstep::MagicLink
65
- * Lockstep::FeatureFlag
63
+ * Lockstep::ReportPayableSummary
64
+ * Lockstep::ReportRiskRate
65
+ * Lockstep::Status
66
+ * Lockstep::User
66
67
 
67
68
  ## ActiveModel Interfaces
68
69
 
@@ -1,19 +1,20 @@
1
1
  class Lockstep::Connection < Lockstep::ApiRecord
2
- self.model_name_uri = "v1/Companies"
3
- self.id_ref = "company_id"
2
+ self.model_name_uri = 'v1/Companies'
3
+ self.id_ref = 'company_id'
4
4
  load_schema(Schema::Company)
5
5
 
6
- enum company_type: %w(Customer Vendor Group)
6
+ enum company_type: %w[Customer Vendor Group Company]
7
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
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
11
 
12
12
  validates :company_name, presence: true
13
13
 
14
- default_scope { where(company_type: %w(Customer Vendor Group)).or(where(company_type: nil)) }
14
+ default_scope { where(company_type: %w[Customer Vendor Group Company]).or(where(company_type: nil)) }
15
15
 
16
- scope :customers, -> { where(company_type: "Customer") }
17
- scope :vendors, -> { where(company_type: "Vendor") }
16
+ scope :customers, -> { where(company_type: 'Customer') }
17
+ scope :vendors, -> { where(company_type: 'Vendor') }
18
+ scope :internal_connections, -> { where(company_type: 'Company') }
18
19
  scope :company_type_null, -> { where(company_type: nil) }
19
20
  end
@@ -1,9 +1,9 @@
1
1
  class Lockstep::Contact < Lockstep::ApiRecord
2
- self.model_name_uri = "v1/Contacts"
3
- self.id_ref = "contact_id"
2
+ self.model_name_uri = 'v1/Contacts'
3
+ self.id_ref = 'contact_id'
4
4
  load_schema(Schema::Contact)
5
5
 
6
6
  validates :email_address, presence: true
7
7
 
8
- belongs_to :connection, class_name: "Lockstep::Connection", included: false
8
+ belongs_to :connection, class_name: 'Lockstep::Connection', included: true
9
9
  end
@@ -0,0 +1,13 @@
1
+ class Lockstep::Status
2
+ Lockstep::ApiRecord.model_name_uri = 'v1/Status'
3
+
4
+ def self.ping
5
+ resp = Lockstep::ApiRecord.resource.get('')
6
+ raise Lockstep::Exceptions::BadRequestError, 'Endpoint not found' if resp.code == '404'
7
+
8
+ status = JSON.parse(resp.body)
9
+ raise Lockstep::Exceptions::UnauthorizedError, status['errorMessage'] unless status['loggedIn']
10
+
11
+ status.deep_transform_keys!(&:underscore).deep_symbolize_keys!
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module LockstepRails
2
- VERSION = "0.3.42"
2
+ VERSION = '0.3.44'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockstep_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.42
4
+ version: 0.3.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-09 00:00:00.000000000 Z
11
+ date: 2022-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -69,6 +69,7 @@ files:
69
69
  - app/models/lockstep/report_payable_coming_due_summary.rb
70
70
  - app/models/lockstep/report_payable_summary.rb
71
71
  - app/models/lockstep/report_risk_rate.rb
72
+ - app/models/lockstep/status.rb
72
73
  - app/models/lockstep/user.rb
73
74
  - app/models/lockstep/vendor_summary.rb
74
75
  - app/models/lockstep/webhook.rb