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 +4 -4
- data/README.md +15 -14
- data/app/models/lockstep/connection.rb +10 -9
- data/app/models/lockstep/contact.rb +3 -3
- data/app/models/lockstep/status.rb +13 -0
- data/lib/lockstep_rails/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eab60f66a141c0dd8b3720267e9c19f2e857cab653f595ef0032c6b374d07ec2
|
4
|
+
data.tar.gz: e33abbe23d8f4cabf497970e7393073b8d489319ae5bdd5e94592f943ca0f878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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::
|
46
|
-
* Lockstep::
|
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::
|
52
|
+
* Lockstep::MagicLink
|
53
|
+
* Lockstep::Note
|
50
54
|
* Lockstep::Payments
|
51
55
|
* Lockstep::PaymentSummary
|
52
|
-
* Lockstep::
|
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::
|
63
|
-
* Lockstep::
|
64
|
-
* Lockstep::
|
65
|
-
* Lockstep::
|
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 =
|
3
|
-
self.id_ref =
|
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
|
6
|
+
enum company_type: %w[Customer Vendor Group Company]
|
7
7
|
|
8
|
-
has_many :contacts, class_name:
|
9
|
-
belongs_to :created_user, class_name:
|
10
|
-
belongs_to :modified_user, class_name:
|
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
|
14
|
+
default_scope { where(company_type: %w[Customer Vendor Group Company]).or(where(company_type: nil)) }
|
15
15
|
|
16
|
-
scope :customers, -> { where(company_type:
|
17
|
-
scope :vendors, -> { where(company_type:
|
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 =
|
3
|
-
self.id_ref =
|
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:
|
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
|
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.
|
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-
|
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
|