lockstep_rails 0.3.34 → 0.3.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/models/lockstep/ap_header.rb +32 -0
- data/app/models/lockstep/ar_header.rb +32 -0
- data/app/models/lockstep/invoice_at_risk_summary.rb +6 -0
- data/app/platform_api/schema/ap_header_info.rb +148 -0
- data/app/platform_api/schema/ar_header_info.rb +9 -4
- data/app/platform_api/schema/invoice_at_risk_summary.rb +90 -0
- data/lib/lockstep_rails/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05bd7ba3de1568889d934bc0160f923ecf173f1fe5f357856a9fc221d07fe039
|
4
|
+
data.tar.gz: 4a1458573f08c1b33aa11da01487df04ca403e9bff7f9e8039f723284e47f62b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 887d60f6868d2d525de634193da364ff24a86447d3b1e5616421d7c4ccefcb3c5b55d55c64ff3be0c7ec6f9ad94e794e3951ada7e0e9ffb3eef3834c4da6824f
|
7
|
+
data.tar.gz: 7adadb32cc6a971a5c9e4c816cd2e12f15aa85c845a73dab446f645cb1061d9f0f38d82da34b9d30cc3c0c84c161de4170d0cb5336b7e34c1309e981a37205da
|
data/README.md
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
class Lockstep::ApHeader < Lockstep::ApiRecord
|
2
|
+
self.model_name_uri = "v1/Reports/ap-header"
|
3
|
+
self.id_ref = "group_key"
|
4
|
+
self.query_path= ""
|
5
|
+
load_schema(Schema::ApHeaderInfo)
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
class Lockstep::Query
|
10
|
+
# Overriding the build_params method to just add attributes in params without filter option
|
11
|
+
def build_params
|
12
|
+
params = {}
|
13
|
+
criteria[:conditions].first.each do |key|
|
14
|
+
params.merge!({ :"#{key[0].to_s.camelize(:lower)}" => key[1] })
|
15
|
+
end
|
16
|
+
return params
|
17
|
+
end
|
18
|
+
|
19
|
+
# Overrinding the get_results method to parse the single object coming from v1.
|
20
|
+
def get_results(params = {})
|
21
|
+
resp = @klass.resource.get(@klass.query_path, :params => params)
|
22
|
+
|
23
|
+
return [] if %w(404).include?(resp.code.to_s)
|
24
|
+
# TODO handle non 200 response code. Throwing an exception for now
|
25
|
+
raise StandardError.new("#{resp.code} error while fetching: #{resp.body}") unless %w(201 200).include?(resp.code.to_s)
|
26
|
+
|
27
|
+
parsed_response = JSON.parse(resp.body)
|
28
|
+
|
29
|
+
r = parsed_response.transform_keys { |key| key.underscore }
|
30
|
+
@klass.model_name.to_s.constantize.new(r, false)
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class Lockstep::ArHeader < Lockstep::ApiRecord
|
2
|
+
self.model_name_uri = "v1/Reports/ar-header"
|
3
|
+
self.id_ref = "group_key"
|
4
|
+
self.query_path= ""
|
5
|
+
load_schema(Schema::ArHeaderInfo)
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
class Lockstep::Query
|
10
|
+
# Overriding the build_params method to just add attributes in params without filter option
|
11
|
+
def build_params
|
12
|
+
params = {}
|
13
|
+
criteria[:conditions].first.each do |key|
|
14
|
+
params.merge!({ :"#{key[0].to_s.camelize(:lower)}" => key[1] })
|
15
|
+
end
|
16
|
+
return params
|
17
|
+
end
|
18
|
+
|
19
|
+
# Overrinding the get_results method to parse the single object coming from v1.
|
20
|
+
def get_results(params = {})
|
21
|
+
resp = @klass.resource.get(@klass.query_path, :params => params)
|
22
|
+
|
23
|
+
return [] if %w(404).include?(resp.code.to_s)
|
24
|
+
# TODO handle non 200 response code. Throwing an exception for now
|
25
|
+
raise StandardError.new("#{resp.code} error while fetching: #{resp.body}") unless %w(201 200).include?(resp.code.to_s)
|
26
|
+
|
27
|
+
parsed_response = JSON.parse(resp.body)
|
28
|
+
|
29
|
+
r = parsed_response.transform_keys { |key| key.underscore }
|
30
|
+
@klass.model_name.to_s.constantize.new(r, false)
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
class Schema::ApHeaderInfo < Lockstep::ApiRecord
|
2
|
+
|
3
|
+
# ApiRecord will crash unless `id_ref` is defined
|
4
|
+
def self.id_ref
|
5
|
+
nil
|
6
|
+
end
|
7
|
+
|
8
|
+
# The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
|
9
|
+
# account will share the same GroupKey value. GroupKey values cannot be changed once created.
|
10
|
+
#
|
11
|
+
# For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
|
12
|
+
# @type: string
|
13
|
+
# @format: uuid
|
14
|
+
field :group_key
|
15
|
+
|
16
|
+
# The date of the report
|
17
|
+
# @type: string
|
18
|
+
# @format: date
|
19
|
+
field :report_date
|
20
|
+
|
21
|
+
# The date of the report
|
22
|
+
# @type: string
|
23
|
+
# @format: uuid
|
24
|
+
field :company_id
|
25
|
+
|
26
|
+
# The total number of vendors..
|
27
|
+
# @type: integer
|
28
|
+
# @format: int32
|
29
|
+
field :total_vendors
|
30
|
+
|
31
|
+
# The total number of bills.
|
32
|
+
# @type: integer
|
33
|
+
# @format: int32
|
34
|
+
field :total_bills
|
35
|
+
|
36
|
+
# The total amount billed.
|
37
|
+
# @type: number
|
38
|
+
# @format: double
|
39
|
+
field :total_billed_amount
|
40
|
+
|
41
|
+
# The total number of advance payments.
|
42
|
+
# @type: number
|
43
|
+
# @format: double
|
44
|
+
field :total_advance_payments
|
45
|
+
|
46
|
+
# The total amount paid.
|
47
|
+
# @type: number
|
48
|
+
# @format: double
|
49
|
+
field :total_paid
|
50
|
+
|
51
|
+
# The total accounts payable amount.
|
52
|
+
# @type: number
|
53
|
+
# @format: double
|
54
|
+
field :total_ap_amount
|
55
|
+
|
56
|
+
# The number of paid bills.
|
57
|
+
# @type: integer
|
58
|
+
# @format: int32
|
59
|
+
field :total_bills_paid
|
60
|
+
|
61
|
+
# The number of past due bills.
|
62
|
+
# @type: integer
|
63
|
+
# @format: int32
|
64
|
+
field :total_bills_past_due
|
65
|
+
|
66
|
+
# The number of bills 90+ days past due.
|
67
|
+
# @type: integer
|
68
|
+
# @format: int32
|
69
|
+
field :total_bills90_days_past_due
|
70
|
+
|
71
|
+
# The total amount past due.
|
72
|
+
# @type: number
|
73
|
+
# @format: double
|
74
|
+
field :total_past_due_amount
|
75
|
+
|
76
|
+
# The total amount for bills 90+ days past due.
|
77
|
+
# @type: number
|
78
|
+
# @format: double
|
79
|
+
field :total_past_due_amount90_days
|
80
|
+
|
81
|
+
# Portion of Total AP that is Past due.
|
82
|
+
# @type: number
|
83
|
+
# @format: double
|
84
|
+
field :percentage_of_total_ap
|
85
|
+
|
86
|
+
# The total amount billed, due this year.
|
87
|
+
# @type: number
|
88
|
+
# @format: double
|
89
|
+
field :total_billed_amount_current_year
|
90
|
+
|
91
|
+
# The total amount billed, due last year.
|
92
|
+
# @type: number
|
93
|
+
# @format: double
|
94
|
+
field :total_billed_amount_previous_year
|
95
|
+
|
96
|
+
# The total of all payments made this year.
|
97
|
+
# @type: number
|
98
|
+
# @format: double
|
99
|
+
field :total_paid_amount_current_year
|
100
|
+
|
101
|
+
# Portion of Total AP that is 90+ days Past due.
|
102
|
+
# @type: number
|
103
|
+
# @format: double
|
104
|
+
field :percentage_of_total_ap90_days_past_due
|
105
|
+
|
106
|
+
# The number of vendors who were paid within the past thirty days.
|
107
|
+
# @type: integer
|
108
|
+
# @format: int32
|
109
|
+
field :vendors_paid_past_thirty_days
|
110
|
+
|
111
|
+
# The total amount paid over the past thirty days.
|
112
|
+
# @type: number
|
113
|
+
# @format: double
|
114
|
+
field :amount_paid_past_thirty_days
|
115
|
+
|
116
|
+
# The amount in advance from the payments made over the past thirty days.
|
117
|
+
# @type: number
|
118
|
+
# @format: double
|
119
|
+
field :advance_payment_amount_past_thirty_days
|
120
|
+
|
121
|
+
# The number of bills paid over the past thirty days.
|
122
|
+
# @type: integer
|
123
|
+
# @format: int32
|
124
|
+
field :bills_paid_past_thirty_days
|
125
|
+
|
126
|
+
# The number of vendors that sent bills over the the past thirty days.
|
127
|
+
# @type: integer
|
128
|
+
# @format: int32
|
129
|
+
field :billing_vendors_past_thirty_days
|
130
|
+
|
131
|
+
# The total amount billed over the past thirty days.
|
132
|
+
# @type: number
|
133
|
+
# @format: double
|
134
|
+
field :amount_billed_past_thirty_days
|
135
|
+
|
136
|
+
# The amount outstanding on the bills received over the past thirty days.
|
137
|
+
# @type: number
|
138
|
+
# @format: double
|
139
|
+
field :amount_due_past_thirty_days
|
140
|
+
|
141
|
+
# The number of bills received over the past thirty days.
|
142
|
+
# @type: integer
|
143
|
+
# @format: int32
|
144
|
+
field :bills_past_thirty_days
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
end
|
@@ -5,9 +5,9 @@ def self.id_ref
|
|
5
5
|
nil
|
6
6
|
end
|
7
7
|
|
8
|
-
# The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
|
9
|
-
# account will share the same GroupKey value. GroupKey values cannot be changed once created.
|
10
|
-
#
|
8
|
+
# The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
|
9
|
+
# account will share the same GroupKey value. GroupKey values cannot be changed once created.
|
10
|
+
#
|
11
11
|
# For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
|
12
12
|
# @type: string
|
13
13
|
# @format: uuid
|
@@ -16,7 +16,12 @@ end
|
|
16
16
|
# The date of the report
|
17
17
|
# @type: string
|
18
18
|
# @format: date
|
19
|
-
field :
|
19
|
+
field :report_date
|
20
|
+
|
21
|
+
# The date of the report
|
22
|
+
# @type: string
|
23
|
+
# @format: uuid
|
24
|
+
field :company_id
|
20
25
|
|
21
26
|
# The total number of customers.
|
22
27
|
# @type: integer
|
@@ -0,0 +1,90 @@
|
|
1
|
+
class Schema::InvoiceAtRiskSummary < Lockstep::ApiRecord
|
2
|
+
|
3
|
+
# ApiRecord will crash unless `id_ref` is defined
|
4
|
+
def self.id_ref
|
5
|
+
nil
|
6
|
+
end
|
7
|
+
|
8
|
+
# The date of the report.
|
9
|
+
# @type: string
|
10
|
+
# @format: date
|
11
|
+
field :report_date
|
12
|
+
|
13
|
+
# The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
|
14
|
+
# account will share the same GroupKey value. GroupKey values cannot be changed once created.
|
15
|
+
#
|
16
|
+
# For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
|
17
|
+
# @type: string
|
18
|
+
# @format: uuid
|
19
|
+
field :group_key
|
20
|
+
|
21
|
+
# The ID number of the counterparty for the invoice, for example, a customer or vendor.
|
22
|
+
# @type: string
|
23
|
+
# @format: uuid
|
24
|
+
field :customer_id
|
25
|
+
|
26
|
+
# The unique ID number of this invoice.
|
27
|
+
# @type: string
|
28
|
+
# @format: uuid
|
29
|
+
field :invoice_id
|
30
|
+
|
31
|
+
# A reference code that is used to identify this invoice.
|
32
|
+
# The meaning of this field is specific to the ERP or accounting system used by the user.
|
33
|
+
# @type: string
|
34
|
+
field :invoice_number
|
35
|
+
|
36
|
+
# The reporting date for this invoice.
|
37
|
+
# @type: string
|
38
|
+
# @format: date
|
39
|
+
field :invoice_date
|
40
|
+
|
41
|
+
# The name of the counterparty for the invoice, for example, a customer or vendor.
|
42
|
+
# @type: string
|
43
|
+
field :customer_name
|
44
|
+
|
45
|
+
# The status of the invoice.
|
46
|
+
# @type: string
|
47
|
+
field :status
|
48
|
+
|
49
|
+
# The due date of the invoice.
|
50
|
+
# @type: string
|
51
|
+
# @format: date
|
52
|
+
field :payment_due_date
|
53
|
+
|
54
|
+
# The total amount of the Invoice.
|
55
|
+
# @type: number
|
56
|
+
# @format: double
|
57
|
+
field :invoice_amount
|
58
|
+
|
59
|
+
# The remaining balance value of this invoice.
|
60
|
+
# @type: number
|
61
|
+
# @format: double
|
62
|
+
field :outstanding_balance
|
63
|
+
|
64
|
+
# A code identifying the type of this Invoice.
|
65
|
+
# @type: string
|
66
|
+
field :invoice_type_code
|
67
|
+
|
68
|
+
# The date stamp for the newest Activity on this Invoice.
|
69
|
+
# @type: string
|
70
|
+
# @format: date
|
71
|
+
field :newest_activity
|
72
|
+
|
73
|
+
# The number of days this Invoice is past due.
|
74
|
+
# @type: integer
|
75
|
+
# @format: int32
|
76
|
+
field :days_past_due
|
77
|
+
|
78
|
+
# The memo text of the payments associated to this invoice.
|
79
|
+
# @type: array
|
80
|
+
field :payment_numbers
|
81
|
+
|
82
|
+
# The ids of the payments associated to this invoice.
|
83
|
+
# @type: array
|
84
|
+
field :payment_ids
|
85
|
+
|
86
|
+
belongs_to :customer, {:class_name=>"Lockstep::Connection", :primary_key=>:company_id, :foreign_key=>"customer_id"}
|
87
|
+
belongs_to :connection, {:class_name=>"Lockstep::Connection", :primary_key=>:company_id, :foreign_key=>"customer_id"}
|
88
|
+
|
89
|
+
|
90
|
+
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.36
|
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-
|
11
|
+
date: 2022-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -46,12 +46,15 @@ files:
|
|
46
46
|
- app/concepts/lockstep/relation_array.rb
|
47
47
|
- app/helpers/types.rb
|
48
48
|
- app/models/lockstep/account.rb
|
49
|
+
- app/models/lockstep/ap_header.rb
|
49
50
|
- app/models/lockstep/api_key.rb
|
50
51
|
- app/models/lockstep/app_enrollment.rb
|
52
|
+
- app/models/lockstep/ar_header.rb
|
51
53
|
- app/models/lockstep/connection.rb
|
52
54
|
- app/models/lockstep/contact.rb
|
53
55
|
- app/models/lockstep/customer_summary.rb
|
54
56
|
- app/models/lockstep/invoice.rb
|
57
|
+
- app/models/lockstep/invoice_at_risk_summary.rb
|
55
58
|
- app/models/lockstep/invoice_summary.rb
|
56
59
|
- app/models/lockstep/invoices/address.rb
|
57
60
|
- app/models/lockstep/note.rb
|
@@ -77,6 +80,7 @@ files:
|
|
77
80
|
- app/platform_api/schema/activity_x_ref.rb
|
78
81
|
- app/platform_api/schema/aging.rb
|
79
82
|
- app/platform_api/schema/ap_aging_header_info.rb
|
83
|
+
- app/platform_api/schema/ap_header_info.rb
|
80
84
|
- app/platform_api/schema/api_key.rb
|
81
85
|
- app/platform_api/schema/api_key_fetch_result.rb
|
82
86
|
- app/platform_api/schema/app_enrollment.rb
|
@@ -150,6 +154,7 @@ files:
|
|
150
154
|
- app/platform_api/schema/invite_submit.rb
|
151
155
|
- app/platform_api/schema/invoice.rb
|
152
156
|
- app/platform_api/schema/invoice_address.rb
|
157
|
+
- app/platform_api/schema/invoice_at_risk_summary.rb
|
153
158
|
- app/platform_api/schema/invoice_fetch_result.rb
|
154
159
|
- app/platform_api/schema/invoice_history.rb
|
155
160
|
- app/platform_api/schema/invoice_history_fetch_result.rb
|