rentvine 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/examples/balances.rb +17 -0
- data/examples/owners.rb +4 -0
- data/examples/portfolios.rb +1 -1
- data/examples/properties.rb +10 -4
- data/examples/units.rb +6 -0
- data/lib/rentvine/client/leases.rb +17 -0
- data/lib/rentvine/client/properties.rb +12 -0
- data/lib/rentvine/client/units.rb +12 -0
- data/lib/rentvine/client.rb +1 -0
- data/lib/rentvine/model/balance.rb +7 -0
- data/lib/rentvine/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 354e518eb2840dea95697c17f07a6c112d3206524f0f9a25cdad470778aefd11
|
4
|
+
data.tar.gz: dd66dbbb82a485ecc11b9dbba9beb0f829c8d6f382933b29c0838445561dcad7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93bd5bb57d7d7a0721c55e237b92ea5a787325c80e883caff2c8b27e4c9d8ae749c1e835b3baf6e9c41a00821d8c2cf3ff75116be7d208488241dd021e915eae
|
7
|
+
data.tar.gz: ab41575a244d7d568b98966f31079dde002dd3c9af41a869062c58efa40396cbdddc9cd006a59563ca54386a3b4e373d2ee35ea05e19c204b93405537ab98926
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.0] - 2024-09-15
|
4
|
+
|
5
|
+
- Added export endpoints for properties, units, and leases.
|
6
|
+
- Updated examples to show export usage for properties, units, and leases.
|
7
|
+
- Added model for lease balances.
|
8
|
+
- Added example for lease balances.
|
9
|
+
|
3
10
|
## [0.1.0] - 2024-09-01
|
4
11
|
|
5
12
|
- Initial release
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'pry-byebug'
|
2
|
+
require_relative '../lib/rentvine'
|
3
|
+
|
4
|
+
auth = {
|
5
|
+
account_code: ENV['RENTVINE_ACCOUNT_CODE'],
|
6
|
+
api_key: ENV['RENTVINE_API_KEY'],
|
7
|
+
api_secret: ENV['RENTVINE_API_SECRET']
|
8
|
+
}
|
9
|
+
rv_client = Rentvine::Client.new(auth)
|
10
|
+
|
11
|
+
# =========================================
|
12
|
+
# Assocation Examples
|
13
|
+
# =========================================
|
14
|
+
|
15
|
+
rv_client.export_leaeses.each do |lease_info|
|
16
|
+
puts lease_info.balance.past_due_total_amount
|
17
|
+
end
|
data/examples/owners.rb
CHANGED
data/examples/portfolios.rb
CHANGED
data/examples/properties.rb
CHANGED
@@ -55,21 +55,27 @@ else
|
|
55
55
|
puts new_property_saved_or_rentvine_error.address
|
56
56
|
end
|
57
57
|
|
58
|
-
|
58
|
+
# ===========================
|
59
59
|
|
60
60
|
property_id = 13
|
61
61
|
rv_client.activate_property(13)
|
62
62
|
puts 'Property 13 activated'
|
63
63
|
|
64
|
-
|
64
|
+
# ===========================
|
65
65
|
|
66
66
|
property_id = 13
|
67
67
|
rv_client.deactivate_property(13)
|
68
68
|
puts 'Property 13 deactivated'
|
69
69
|
|
70
|
-
|
70
|
+
# ===========================
|
71
71
|
|
72
72
|
property_id = new_property_saved_or_rentvine_error.property_id
|
73
73
|
rv_client.delete_property(property_id)
|
74
74
|
|
75
|
-
|
75
|
+
# ===========================
|
76
|
+
|
77
|
+
rv_client.export_properties.each do |property|
|
78
|
+
puts property.address
|
79
|
+
end
|
80
|
+
|
81
|
+
# ===========================
|
data/examples/units.rb
CHANGED
@@ -15,6 +15,23 @@ module Rentvine
|
|
15
15
|
|
16
16
|
Rentvine::Lease.new(result[:lease])
|
17
17
|
end
|
18
|
+
|
19
|
+
def export_leaeses(args = {})
|
20
|
+
results = process_request(:get, 'leases/export', params: args)
|
21
|
+
return results if results.is_a?(RentvineError)
|
22
|
+
|
23
|
+
results.map do |result|
|
24
|
+
rvobj = Rentvine::Lease.new(result[:lease])
|
25
|
+
rvobj.balance = Rentvine::Balance.new(result[:balances])
|
26
|
+
rvobj.balances = rvobj.balance
|
27
|
+
rvobj.tenants = result[:lease][:tenants].map { |tenant| Rentvine::Tenant.new(tenant) }
|
28
|
+
rvobj.property = Rentvine::Property.new(result[:property])
|
29
|
+
rvobj.unit = Rentvine::Unit.new(result[:unit])
|
30
|
+
rvobj.portfolio = Rentvine::Unit.new(result[:portfolio])
|
31
|
+
rvobj.meta = { appends: [:balances, :balance, :tenants, :property, :unit, :portfolio] }
|
32
|
+
rvobj
|
33
|
+
end
|
34
|
+
end
|
18
35
|
end
|
19
36
|
end
|
20
37
|
end
|
@@ -44,6 +44,18 @@ module Rentvine
|
|
44
44
|
|
45
45
|
true
|
46
46
|
end
|
47
|
+
|
48
|
+
def export_properties(args = {})
|
49
|
+
results = process_request(:get, 'properties/export', params: args)
|
50
|
+
return results if results.is_a?(RentvineError)
|
51
|
+
|
52
|
+
results.map do |result|
|
53
|
+
rvobj = Rentvine::Property.new(result[:property])
|
54
|
+
rvobj.portfolio = Rentvine::Portfolio.new(result[:portfolio])
|
55
|
+
rvobj.meta = { appends: [:portfolio] }
|
56
|
+
rvobj
|
57
|
+
end
|
58
|
+
end
|
47
59
|
end
|
48
60
|
end
|
49
61
|
end
|
@@ -15,6 +15,18 @@ module Rentvine
|
|
15
15
|
|
16
16
|
Rentvine::Unit.new(result[:unit])
|
17
17
|
end
|
18
|
+
|
19
|
+
def export_units(args = {})
|
20
|
+
results = process_request(:get, 'properties/units/export', params: args)
|
21
|
+
return results if results.is_a?(RentvineError)
|
22
|
+
|
23
|
+
results.map do |result|
|
24
|
+
rvobj = Rentvine::Unit.new(result[:unit])
|
25
|
+
rvobj.property = Rentvine::Property.new(result[:property])
|
26
|
+
rvobj.meta = { appends: [:property] }
|
27
|
+
rvobj
|
28
|
+
end
|
29
|
+
end
|
18
30
|
end
|
19
31
|
end
|
20
32
|
end
|
data/lib/rentvine/client.rb
CHANGED
@@ -23,6 +23,7 @@ require_relative 'model/rentvine_model'
|
|
23
23
|
require_relative 'model/account'
|
24
24
|
require_relative 'model/application'
|
25
25
|
require_relative 'model/association'
|
26
|
+
require_relative 'model/balance'
|
26
27
|
require_relative 'model/bill'
|
27
28
|
require_relative 'model/diagnostic'
|
28
29
|
require_relative 'model/file'
|
data/lib/rentvine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rentvine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wes Hays
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- examples/accounts.rb
|
91
91
|
- examples/applications.rb
|
92
92
|
- examples/associations.rb
|
93
|
+
- examples/balances.rb
|
93
94
|
- examples/bills.rb
|
94
95
|
- examples/diagnostics.rb
|
95
96
|
- examples/files.rb
|
@@ -133,6 +134,7 @@ files:
|
|
133
134
|
- lib/rentvine/model/account.rb
|
134
135
|
- lib/rentvine/model/application.rb
|
135
136
|
- lib/rentvine/model/association.rb
|
137
|
+
- lib/rentvine/model/balance.rb
|
136
138
|
- lib/rentvine/model/bill.rb
|
137
139
|
- lib/rentvine/model/diagnostic.rb
|
138
140
|
- lib/rentvine/model/file.rb
|