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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f46b3c038f078ae2b3f258e6dbc823a83e1dadedf69abc468d5ac01c2efdaa0f
4
- data.tar.gz: 7eb3580fd56d9ec05aaabeb877b7e26fc100180701292682b662064bf46ae556
3
+ metadata.gz: 354e518eb2840dea95697c17f07a6c112d3206524f0f9a25cdad470778aefd11
4
+ data.tar.gz: dd66dbbb82a485ecc11b9dbba9beb0f829c8d6f382933b29c0838445561dcad7
5
5
  SHA512:
6
- metadata.gz: 0526fb377f7c87906394a044dafa1dc78c8e32b7899a64536f3415bb1bbc881469e49acac8c20872b395845c77b3e89499c6949e1a2722a3a6d98c0bf22380fe
7
- data.tar.gz: 981d03241bf3826b09fc7e83949d97f00ec3c2729ea8bd12f8a1e371548a3dad1646480571b68f5a7b96eb0685233fc2ed489fcb5f9628aa77d8d4afa3b43b16
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
@@ -15,3 +15,7 @@ rv_client = Rentvine::Client.new(auth)
15
15
  rv_client.owners.each do |owner|
16
16
  puts owner.name
17
17
  end
18
+
19
+ rv_client.owners(page: 1, page_size: 5).each do |owner|
20
+ puts owner.name
21
+ end
@@ -13,5 +13,5 @@ rv_client = Rentvine::Client.new(auth)
13
13
  # =========================================
14
14
 
15
15
  rv_client.portfolios.each do |portfolio|
16
- puts portfolio.name
16
+ puts [portfolio.portfolio_id, portfolio.name].join(' :: ')
17
17
  end
@@ -55,21 +55,27 @@ else
55
55
  puts new_property_saved_or_rentvine_error.address
56
56
  end
57
57
 
58
- puts '---------------------------------'
58
+ # ===========================
59
59
 
60
60
  property_id = 13
61
61
  rv_client.activate_property(13)
62
62
  puts 'Property 13 activated'
63
63
 
64
- puts '---------------------------------'
64
+ # ===========================
65
65
 
66
66
  property_id = 13
67
67
  rv_client.deactivate_property(13)
68
68
  puts 'Property 13 deactivated'
69
69
 
70
- puts '---------------------------------'
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
- puts '---------------------------------'
75
+ # ===========================
76
+
77
+ rv_client.export_properties.each do |property|
78
+ puts property.address
79
+ end
80
+
81
+ # ===========================
data/examples/units.rb CHANGED
@@ -27,3 +27,9 @@ rvu = rv_client.unit(property_id, unit_id)
27
27
  puts rvu.address
28
28
 
29
29
  # ===========================
30
+
31
+ rv_client.export_units.each do |unit|
32
+ puts unit.address
33
+ end
34
+
35
+ # ===========================
@@ -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
@@ -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'
@@ -0,0 +1,7 @@
1
+ module Rentvine
2
+ class Balance < RentvineModel
3
+ def initialize(data = {})
4
+ super(data)
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rentvine
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.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-10 00:00:00.000000000 Z
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