rentvine 0.4.0 → 0.6.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 +15 -0
- data/Dockerfile +24 -0
- data/Gemfile +9 -9
- data/Gemfile.lock +47 -43
- data/README.md +41 -0
- data/docker-compose.yml +20 -0
- data/examples/balances.rb +1 -1
- data/examples/lease_statues.rb +26 -0
- data/examples/leases.rb +25 -6
- data/examples/owners.rb +1 -1
- data/examples/recurring_charges.rb +29 -0
- data/examples/tenants.rb +6 -0
- data/lib/rentvine/client/lease_statuses.rb +20 -0
- data/lib/rentvine/client/leases.rb +7 -0
- data/lib/rentvine/client/owners.rb +1 -1
- data/lib/rentvine/client/recurring_charges.rb +34 -0
- data/lib/rentvine/client/tenants.rb +7 -0
- data/lib/rentvine/client.rb +7 -0
- data/lib/rentvine/model/inspection.rb +1 -1
- data/lib/rentvine/model/lease_status.rb +7 -0
- data/lib/rentvine/model/occupant.rb +7 -0
- data/lib/rentvine/model/recurring_charge.rb +7 -0
- data/lib/rentvine/model/rentvine_model.rb +4 -0
- data/lib/rentvine/version.rb +1 -1
- metadata +12 -8
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 88c3bfbe007336c3002d81d1d93aa62e80246f6c1736010f19b7bf044f0e2155
|
|
4
|
+
data.tar.gz: 4c71e92c2826ea4dc4018aece64cc70da9dfbf51af6438f2adbd66060eada924
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53200ddee424de893a707968bac0aa2783dbecff25e15f1efe3c1b0ea9da833a06a75af7a2eb7a8d67b2f08c598b8c46a6a902f207c5643f00ca99d189ca420d
|
|
7
|
+
data.tar.gz: 47221e73d336a67f74ea0d9ccca2afe1d9340b87b3aebad2502ac147ce4631e3d401d824bc34cd8726e5a879add559dda072f06795b779ada467071f08568233
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.6.0] - 2026-08-17
|
|
4
|
+
|
|
5
|
+
- Added support to load an lease occupants
|
|
6
|
+
|
|
7
|
+
## [0.5.0] - 2026-05-28
|
|
8
|
+
|
|
9
|
+
- Added support to load an individual tenant by id.
|
|
10
|
+
- Update the endpoint used for fetching owners.
|
|
11
|
+
- Dockerized the project for easier development for those on Windows.
|
|
12
|
+
- Fixed spelling error in the lease model example.
|
|
13
|
+
- Added support to load recurrening charges for a lease.
|
|
14
|
+
- Updated gems to the latest versions.
|
|
15
|
+
- Added support to load the custom leases statuses.
|
|
16
|
+
- Added helper method on RentvineModel for checking if the response is an error using ".error?" which returns false.
|
|
17
|
+
|
|
3
18
|
## [0.4.0] - 2025-01-30
|
|
4
19
|
|
|
5
20
|
- Added support on the lease to load the tenants for the lease.
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
FROM ruby:3.3.5
|
|
2
|
+
|
|
3
|
+
RUN apt update -yqq
|
|
4
|
+
# RUN apt-get install libvips-dev -yqq
|
|
5
|
+
# RUN apt-get install build-essential libpq-dev postgresql-contrib vim -yqq
|
|
6
|
+
# RUN apt-get install imagemagick libmagickcore-dev libmagickwand-dev -yqq
|
|
7
|
+
RUN apt-get -q clean
|
|
8
|
+
RUN rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man
|
|
9
|
+
|
|
10
|
+
RUN mkdir -p /app
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
|
|
13
|
+
RUN gem update --system
|
|
14
|
+
RUN gem install bundler --version 2.4.6
|
|
15
|
+
RUN bundle config set specific_platform x86_64-linux
|
|
16
|
+
COPY . .
|
|
17
|
+
RUN bundle install
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# RUN bundle binstubs --all
|
|
21
|
+
|
|
22
|
+
# RUN chmod +x docker-entrypoint.sh
|
|
23
|
+
# ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
|
24
|
+
# CMD ["sleep", "100000"]
|
data/Gemfile
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
-
# Specify your gem's dependencies in
|
|
5
|
+
# Specify your gem's dependencies in rentvine.gemspec
|
|
6
6
|
gemspec
|
|
7
7
|
|
|
8
8
|
group :development do
|
|
9
|
-
gem 'pry-byebug', '~> 3.
|
|
10
|
-
gem 'dotenv', '~> 3.1'
|
|
11
|
-
gem 'rake', '~> 13.0'
|
|
12
|
-
gem 'rspec', '~> 3.13'
|
|
13
|
-
gem 'rubocop', '~> 1.
|
|
14
|
-
gem 'simplecov', '~> 0.22'
|
|
15
|
-
gem 'vcr', '~> 6.3'
|
|
16
|
-
gem 'webmock', '~> 3.
|
|
9
|
+
gem 'pry-byebug', '~> 3.11.0'
|
|
10
|
+
gem 'dotenv', '~> 3.1.8'
|
|
11
|
+
gem 'rake', '~> 13.3.0'
|
|
12
|
+
gem 'rspec', '~> 3.13.1'
|
|
13
|
+
gem 'rubocop', '~> 1.77.0'
|
|
14
|
+
gem 'simplecov', '~> 0.22.0'
|
|
15
|
+
gem 'vcr', '~> 6.3.1'
|
|
16
|
+
gem 'webmock', '~> 3.25.1'
|
|
17
17
|
end
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rentvine (0.
|
|
4
|
+
rentvine (0.5.0)
|
|
5
5
|
awrence (~> 3.0)
|
|
6
6
|
json (~> 2.7)
|
|
7
7
|
ostruct (~> 0.6.1)
|
|
@@ -16,55 +16,57 @@ GEM
|
|
|
16
16
|
ast (2.4.2)
|
|
17
17
|
awrence (3.0.0)
|
|
18
18
|
base64 (0.2.0)
|
|
19
|
-
bigdecimal (3.1.
|
|
20
|
-
byebug (
|
|
19
|
+
bigdecimal (3.1.9)
|
|
20
|
+
byebug (12.0.0)
|
|
21
21
|
coderay (1.1.3)
|
|
22
22
|
crack (1.0.0)
|
|
23
23
|
bigdecimal
|
|
24
24
|
rexml
|
|
25
|
-
diff-lcs (1.
|
|
25
|
+
diff-lcs (1.6.0)
|
|
26
26
|
docile (1.4.1)
|
|
27
|
-
dotenv (3.1.
|
|
27
|
+
dotenv (3.1.8)
|
|
28
28
|
ethon (0.16.0)
|
|
29
29
|
ffi (>= 1.15.0)
|
|
30
|
-
ffi (1.17.
|
|
31
|
-
ffi (1.17.
|
|
32
|
-
ffi (1.17.
|
|
33
|
-
ffi (1.17.
|
|
34
|
-
ffi (1.17.
|
|
35
|
-
ffi (1.17.
|
|
36
|
-
ffi (1.17.
|
|
37
|
-
ffi (1.17.
|
|
38
|
-
ffi (1.17.
|
|
39
|
-
ffi (1.17.
|
|
40
|
-
ffi (1.17.
|
|
30
|
+
ffi (1.17.1)
|
|
31
|
+
ffi (1.17.1-aarch64-linux-gnu)
|
|
32
|
+
ffi (1.17.1-aarch64-linux-musl)
|
|
33
|
+
ffi (1.17.1-arm-linux-gnu)
|
|
34
|
+
ffi (1.17.1-arm-linux-musl)
|
|
35
|
+
ffi (1.17.1-arm64-darwin)
|
|
36
|
+
ffi (1.17.1-x86-linux-gnu)
|
|
37
|
+
ffi (1.17.1-x86-linux-musl)
|
|
38
|
+
ffi (1.17.1-x86_64-darwin)
|
|
39
|
+
ffi (1.17.1-x86_64-linux-gnu)
|
|
40
|
+
ffi (1.17.1-x86_64-linux-musl)
|
|
41
41
|
hashdiff (1.1.2)
|
|
42
|
-
json (2.
|
|
43
|
-
language_server-protocol (3.17.0.
|
|
42
|
+
json (2.10.1)
|
|
43
|
+
language_server-protocol (3.17.0.4)
|
|
44
|
+
lint_roller (1.1.0)
|
|
44
45
|
method_source (1.1.0)
|
|
45
46
|
ostruct (0.6.1)
|
|
46
47
|
parallel (1.26.3)
|
|
47
|
-
parser (3.3.
|
|
48
|
+
parser (3.3.8.0)
|
|
48
49
|
ast (~> 2.4.1)
|
|
49
50
|
racc
|
|
50
51
|
plissken (3.0.0)
|
|
52
|
+
prism (1.4.0)
|
|
51
53
|
pry (0.14.2)
|
|
52
54
|
coderay (~> 1.1)
|
|
53
55
|
method_source (~> 1.0)
|
|
54
|
-
pry-byebug (3.
|
|
55
|
-
byebug (~>
|
|
56
|
-
pry (>= 0.13, < 0.
|
|
56
|
+
pry-byebug (3.11.0)
|
|
57
|
+
byebug (~> 12.0)
|
|
58
|
+
pry (>= 0.13, < 0.16)
|
|
57
59
|
public_suffix (6.0.1)
|
|
58
60
|
racc (1.8.1)
|
|
59
61
|
rainbow (3.1.1)
|
|
60
|
-
rake (13.
|
|
61
|
-
regexp_parser (2.
|
|
62
|
-
rexml (3.4.
|
|
63
|
-
rspec (3.13.
|
|
62
|
+
rake (13.3.0)
|
|
63
|
+
regexp_parser (2.10.0)
|
|
64
|
+
rexml (3.4.1)
|
|
65
|
+
rspec (3.13.1)
|
|
64
66
|
rspec-core (~> 3.13.0)
|
|
65
67
|
rspec-expectations (~> 3.13.0)
|
|
66
68
|
rspec-mocks (~> 3.13.0)
|
|
67
|
-
rspec-core (3.13.
|
|
69
|
+
rspec-core (3.13.3)
|
|
68
70
|
rspec-support (~> 3.13.0)
|
|
69
71
|
rspec-expectations (3.13.3)
|
|
70
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
@@ -73,18 +75,20 @@ GEM
|
|
|
73
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
74
76
|
rspec-support (~> 3.13.0)
|
|
75
77
|
rspec-support (3.13.2)
|
|
76
|
-
rubocop (1.
|
|
78
|
+
rubocop (1.77.0)
|
|
77
79
|
json (~> 2.3)
|
|
78
|
-
language_server-protocol (
|
|
80
|
+
language_server-protocol (~> 3.17.0.2)
|
|
81
|
+
lint_roller (~> 1.1.0)
|
|
79
82
|
parallel (~> 1.10)
|
|
80
83
|
parser (>= 3.3.0.2)
|
|
81
84
|
rainbow (>= 2.2.2, < 4.0)
|
|
82
85
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
83
|
-
rubocop-ast (>= 1.
|
|
86
|
+
rubocop-ast (>= 1.45.1, < 2.0)
|
|
84
87
|
ruby-progressbar (~> 1.7)
|
|
85
88
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
86
|
-
rubocop-ast (1.
|
|
87
|
-
parser (>= 3.3.
|
|
89
|
+
rubocop-ast (1.45.1)
|
|
90
|
+
parser (>= 3.3.7.2)
|
|
91
|
+
prism (~> 1.4)
|
|
88
92
|
ruby-progressbar (1.13.0)
|
|
89
93
|
simplecov (0.22.0)
|
|
90
94
|
docile (~> 1.1)
|
|
@@ -94,12 +98,12 @@ GEM
|
|
|
94
98
|
simplecov_json_formatter (0.1.4)
|
|
95
99
|
typhoeus (1.4.1)
|
|
96
100
|
ethon (>= 0.9.0)
|
|
97
|
-
unicode-display_width (3.1.
|
|
101
|
+
unicode-display_width (3.1.4)
|
|
98
102
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
99
103
|
unicode-emoji (4.0.4)
|
|
100
104
|
vcr (6.3.1)
|
|
101
105
|
base64
|
|
102
|
-
webmock (3.
|
|
106
|
+
webmock (3.25.1)
|
|
103
107
|
addressable (>= 2.8.0)
|
|
104
108
|
crack (>= 0.3.2)
|
|
105
109
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
@@ -118,15 +122,15 @@ PLATFORMS
|
|
|
118
122
|
x86_64-linux-musl
|
|
119
123
|
|
|
120
124
|
DEPENDENCIES
|
|
121
|
-
dotenv (~> 3.1)
|
|
122
|
-
pry-byebug (~> 3.
|
|
123
|
-
rake (~> 13.0)
|
|
125
|
+
dotenv (~> 3.1.8)
|
|
126
|
+
pry-byebug (~> 3.11.0)
|
|
127
|
+
rake (~> 13.3.0)
|
|
124
128
|
rentvine!
|
|
125
|
-
rspec (~> 3.13)
|
|
126
|
-
rubocop (~> 1.
|
|
127
|
-
simplecov (~> 0.22)
|
|
128
|
-
vcr (~> 6.3)
|
|
129
|
-
webmock (~> 3.
|
|
129
|
+
rspec (~> 3.13.1)
|
|
130
|
+
rubocop (~> 1.77.0)
|
|
131
|
+
simplecov (~> 0.22.0)
|
|
132
|
+
vcr (~> 6.3.1)
|
|
133
|
+
webmock (~> 3.25.1)
|
|
130
134
|
|
|
131
135
|
BUNDLED WITH
|
|
132
|
-
2.5
|
|
136
|
+
2.6.5
|
data/README.md
CHANGED
|
@@ -24,6 +24,8 @@ TODO: Write usage instructions here
|
|
|
24
24
|
|
|
25
25
|
## Development
|
|
26
26
|
|
|
27
|
+
### Local Development using RVM
|
|
28
|
+
|
|
27
29
|
You will need to add a .env file to the root of the project with the following variables:
|
|
28
30
|
|
|
29
31
|
```
|
|
@@ -36,6 +38,42 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
|
|
|
36
38
|
|
|
37
39
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
38
40
|
|
|
41
|
+
### Local Development using Docker
|
|
42
|
+
|
|
43
|
+
You can also use Docker to develop the gem. To do this, you will need to have Docker installed on your machine.
|
|
44
|
+
|
|
45
|
+
To get started, you will need to build the Docker image:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
docker compose build
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
After the image is built, you can run the following command to start the container. Note that
|
|
52
|
+
you will want to do this in its own terminal window so you can attach to the container.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
docker compose up
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
You will see "Attaching to rentvine" in the output. This means the container is running and you can now run the following command to attach to the container:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
docker exec -it rentvine bash
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
To stop the container, you can run the following command:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
docker compose down
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
# Rebuild Gemfile.lock
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
docker compose run rentvine bundle install
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
|
|
39
77
|
## Implemented Endpoints
|
|
40
78
|
|
|
41
79
|
- Export
|
|
@@ -96,6 +134,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
96
134
|
- Leases
|
|
97
135
|
- List `GET /leases`
|
|
98
136
|
- View `GET /leases/:lease_id`
|
|
137
|
+
- Leases Export `GET /leases/export`
|
|
138
|
+
- Lease Tenants `GET /leases/:lease_id/tenants`
|
|
139
|
+
- Lease Occupants `GET /leases/:lease_id/occupants`
|
|
99
140
|
|
|
100
141
|
- Maintenance
|
|
101
142
|
- Work Orders
|
data/docker-compose.yml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
services:
|
|
2
|
+
rentvine:
|
|
3
|
+
container_name: "rentvine"
|
|
4
|
+
platform: linux/x86_64
|
|
5
|
+
build: .
|
|
6
|
+
# command: bundle exec rails s -p 3000 -b '0.0.0.0'
|
|
7
|
+
environment:
|
|
8
|
+
LOG_LEVEL: DEBUG
|
|
9
|
+
volumes:
|
|
10
|
+
- .:/app
|
|
11
|
+
- rentvine_bundle:/usr/local/bundle
|
|
12
|
+
working_dir: /app
|
|
13
|
+
# Keeps the stdin open, so we can attach to our app container's process and
|
|
14
|
+
# do stuff such as `byebug` or `binding.pry`:
|
|
15
|
+
stdin_open: true
|
|
16
|
+
# Allows us to send signals (CTRL+C, CTRL+P + CTRL+Q) into the container
|
|
17
|
+
tty: true
|
|
18
|
+
|
|
19
|
+
volumes:
|
|
20
|
+
rentvine_bundle:
|
data/examples/balances.rb
CHANGED
|
@@ -15,6 +15,6 @@ rv_client = Rentvine::Client.new(auth)
|
|
|
15
15
|
# Assocation Examples
|
|
16
16
|
# =========================================
|
|
17
17
|
|
|
18
|
-
rv_client.
|
|
18
|
+
rv_client.export_leases.each do |lease_info|
|
|
19
19
|
puts lease_info.balance.past_due_total_amount
|
|
20
20
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'pry-byebug'
|
|
2
|
+
require 'dotenv'
|
|
3
|
+
require_relative '../lib/rentvine'
|
|
4
|
+
|
|
5
|
+
Dotenv.load('../.env')
|
|
6
|
+
|
|
7
|
+
auth = {
|
|
8
|
+
account_code: ENV['RENTVINE_ACCOUNT_CODE'],
|
|
9
|
+
api_key: ENV['RENTVINE_API_KEY'],
|
|
10
|
+
api_secret: ENV['RENTVINE_API_SECRET']
|
|
11
|
+
}
|
|
12
|
+
rv_client = Rentvine::Client.new(auth)
|
|
13
|
+
|
|
14
|
+
# =========================================
|
|
15
|
+
# Lease Examples
|
|
16
|
+
# =========================================
|
|
17
|
+
|
|
18
|
+
rv_client.lease_statuses.each do |lease_status|
|
|
19
|
+
puts lease_status.name
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# ===========================
|
|
23
|
+
|
|
24
|
+
lease_status_id = 10
|
|
25
|
+
rv_obj = rv_client.lease_status(lease_status_id)
|
|
26
|
+
puts rv_obj.name
|
data/examples/leases.rb
CHANGED
|
@@ -15,21 +15,26 @@ rv_client = Rentvine::Client.new(auth)
|
|
|
15
15
|
# Lease Examples
|
|
16
16
|
# =========================================
|
|
17
17
|
|
|
18
|
-
rv_client.leases.each do |lease|
|
|
19
|
-
|
|
20
|
-
end
|
|
18
|
+
# rv_client.leases.each do |lease|
|
|
19
|
+
# puts lease
|
|
20
|
+
# end
|
|
21
21
|
|
|
22
22
|
# ===========================
|
|
23
23
|
|
|
24
24
|
lease_id = 7
|
|
25
25
|
rv_obj = rv_client.lease(lease_id)
|
|
26
26
|
puts rv_obj.address
|
|
27
|
+
|
|
27
28
|
# ===========================
|
|
28
29
|
|
|
29
30
|
lease_id = 7
|
|
30
31
|
rv_obj = rv_client.lease_tenants(lease_id)
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
puts rv_obj.name
|
|
33
|
+
|
|
34
|
+
# ===========================
|
|
35
|
+
|
|
36
|
+
lease_id = 7
|
|
37
|
+
rv_obj = rv_client.lease_occupants(lease_id)
|
|
33
38
|
puts rv_obj.name
|
|
34
39
|
|
|
35
40
|
# ===========================
|
|
@@ -37,4 +42,18 @@ puts rv_obj.name
|
|
|
37
42
|
rv_client.export_leases.each do |lease|
|
|
38
43
|
binding.pry
|
|
39
44
|
adsf=3
|
|
40
|
-
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# ===========================
|
|
48
|
+
|
|
49
|
+
lease_id = 1
|
|
50
|
+
rv_client.export_leases(lease_ids: [lease_id]).each do |lease|
|
|
51
|
+
binding.pry
|
|
52
|
+
adsf=3
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# ===========================
|
|
56
|
+
|
|
57
|
+
# Filter by lease_ids
|
|
58
|
+
lease_ids = [1,2]
|
|
59
|
+
leases = rv_client.export_leases(leaseIDs: lease_ids)
|
data/examples/owners.rb
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'pry-byebug'
|
|
2
|
+
require 'dotenv'
|
|
3
|
+
require_relative '../lib/rentvine'
|
|
4
|
+
|
|
5
|
+
Dotenv.load('../.env')
|
|
6
|
+
|
|
7
|
+
auth = {
|
|
8
|
+
account_code: ENV['RENTVINE_ACCOUNT_CODE'],
|
|
9
|
+
api_key: ENV['RENTVINE_API_KEY'],
|
|
10
|
+
api_secret: ENV['RENTVINE_API_SECRET']
|
|
11
|
+
}
|
|
12
|
+
rv_client = Rentvine::Client.new(auth)
|
|
13
|
+
|
|
14
|
+
# =========================================
|
|
15
|
+
# Recurring Charges Examples
|
|
16
|
+
# =========================================
|
|
17
|
+
|
|
18
|
+
lease_id = 7
|
|
19
|
+
|
|
20
|
+
rv_client.recurring_charges(lease_id).each do |charge|
|
|
21
|
+
puts [charge.lease_recurring_charge_id, charge.description, charge.amount, charge.account.is_rent].join(' - ')
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# ===========================
|
|
25
|
+
|
|
26
|
+
lease_id = 7
|
|
27
|
+
lease_recurring_charge_id = 10
|
|
28
|
+
charge = rv_client.recurring_charge(lease_id, lease_recurring_charge_id)
|
|
29
|
+
puts [charge.lease_recurring_charge_id, charge.description, charge.amount, charge.previous_charge&.amount].join(' - ')
|
data/examples/tenants.rb
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Rentvine
|
|
2
|
+
class Client
|
|
3
|
+
module LeaseStatuses
|
|
4
|
+
def lease_statuses(args = {})
|
|
5
|
+
results = process_request(:get, 'leases/statuses', params: args)
|
|
6
|
+
return results if results.is_a?(RentvineError)
|
|
7
|
+
|
|
8
|
+
results.map { |result| Rentvine::LeaseStatus.new(result[:lease_status]) }
|
|
9
|
+
end
|
|
10
|
+
alias list_lease_statuses lease_statuses
|
|
11
|
+
|
|
12
|
+
def lease_status(lease_status_id)
|
|
13
|
+
result = process_request(:get, "leases/statuses/#{lease_status_id}")
|
|
14
|
+
return result if result.is_a?(RentvineError)
|
|
15
|
+
|
|
16
|
+
Rentvine::LeaseStatus.new(result[:lease_status])
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -39,6 +39,13 @@ module Rentvine
|
|
|
39
39
|
|
|
40
40
|
results.map { |result| Rentvine::Tenant.new(result) }
|
|
41
41
|
end
|
|
42
|
+
|
|
43
|
+
def lease_occupants(lease_id, args = {})
|
|
44
|
+
results = process_request(:get, "leases/#{lease_id}/occupants", params: args)
|
|
45
|
+
return results if results.is_a?(RentvineError)
|
|
46
|
+
|
|
47
|
+
results.map { |result| Rentvine::Occupant.new(result) }
|
|
48
|
+
end
|
|
42
49
|
end
|
|
43
50
|
end
|
|
44
51
|
end
|
|
@@ -2,7 +2,7 @@ module Rentvine
|
|
|
2
2
|
class Client
|
|
3
3
|
module Owners
|
|
4
4
|
def owners(args = {})
|
|
5
|
-
results = process_request(:get, 'owners
|
|
5
|
+
results = process_request(:get, 'owners', params: args)
|
|
6
6
|
return results if results.is_a?(RentvineError)
|
|
7
7
|
|
|
8
8
|
results.map { |result| Rentvine::Owner.new(result[:contact]) }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module Rentvine
|
|
2
|
+
class Client
|
|
3
|
+
module RecurringCharges
|
|
4
|
+
def recurring_charges(lease_id, args = {})
|
|
5
|
+
results = process_request(:get, "leases/#{lease_id}/recurring-charges", params: args)
|
|
6
|
+
return results if results.is_a?(RentvineError)
|
|
7
|
+
|
|
8
|
+
results.map { |result| Rentvine::RecurringCharge.new(result[:recurring_charge]) }
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
results.map do |result|
|
|
12
|
+
rvobj = Rentvine::RecurringCharge.new(result[:recurring_charge])
|
|
13
|
+
rvobj.account = Rentvine::Account.new(result[:account])
|
|
14
|
+
rvobj.meta = { appends: [:account] }
|
|
15
|
+
rvobj
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
alias list_recurring_charges recurring_charges
|
|
19
|
+
|
|
20
|
+
def recurring_charge(lease_id, recurring_charge_id)
|
|
21
|
+
result = process_request(:get, "leases/#{lease_id}/recurring-charges/#{recurring_charge_id}")
|
|
22
|
+
return result if result.is_a?(RentvineError)
|
|
23
|
+
|
|
24
|
+
retval = Rentvine::RecurringCharge.new(result[:recurring_charge])
|
|
25
|
+
retval.previous_charge = if result[:previous_charge].nil?
|
|
26
|
+
nil
|
|
27
|
+
else
|
|
28
|
+
Rentvine::RecurringCharge.new(result[:previous_charge])
|
|
29
|
+
end
|
|
30
|
+
retval
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -8,6 +8,13 @@ module Rentvine
|
|
|
8
8
|
results.map { |result| Rentvine::Tenant.new(result[:contact]) }
|
|
9
9
|
end
|
|
10
10
|
alias list_tenants tenants
|
|
11
|
+
|
|
12
|
+
def tenant(tenant_id)
|
|
13
|
+
result = process_request(:get, "tenants/#{tenant_id}")
|
|
14
|
+
return result if result.is_a?(RentvineError)
|
|
15
|
+
|
|
16
|
+
Rentvine::Property.new(result[:contact])
|
|
17
|
+
end
|
|
11
18
|
end
|
|
12
19
|
end
|
|
13
20
|
end
|
data/lib/rentvine/client.rb
CHANGED
|
@@ -6,10 +6,12 @@ require_relative 'client/diagnostics'
|
|
|
6
6
|
require_relative 'client/files'
|
|
7
7
|
require_relative 'client/inspections'
|
|
8
8
|
require_relative 'client/leases'
|
|
9
|
+
require_relative 'client/lease_statuses'
|
|
9
10
|
require_relative 'client/ledgers'
|
|
10
11
|
require_relative 'client/owners'
|
|
11
12
|
require_relative 'client/portfolios'
|
|
12
13
|
require_relative 'client/properties'
|
|
14
|
+
require_relative 'client/recurring_charges'
|
|
13
15
|
require_relative 'client/tenants'
|
|
14
16
|
require_relative 'client/transaction_entries'
|
|
15
17
|
require_relative 'client/transactions'
|
|
@@ -29,11 +31,14 @@ require_relative 'model/diagnostic'
|
|
|
29
31
|
require_relative 'model/file'
|
|
30
32
|
require_relative 'model/inspection'
|
|
31
33
|
require_relative 'model/lease'
|
|
34
|
+
require_relative 'model/lease_status'
|
|
32
35
|
require_relative 'model/ledger'
|
|
36
|
+
require_relative 'model/occupant'
|
|
33
37
|
require_relative 'model/owner'
|
|
34
38
|
require_relative 'model/owner_distribution'
|
|
35
39
|
require_relative 'model/portfolio'
|
|
36
40
|
require_relative 'model/property'
|
|
41
|
+
require_relative 'model/recurring_charge'
|
|
37
42
|
require_relative 'model/tenant'
|
|
38
43
|
require_relative 'model/transaction_entry'
|
|
39
44
|
require_relative 'model/transaction'
|
|
@@ -53,10 +58,12 @@ module Rentvine
|
|
|
53
58
|
include Rentvine::Client::Files
|
|
54
59
|
include Rentvine::Client::Inspections
|
|
55
60
|
include Rentvine::Client::Leases
|
|
61
|
+
include Rentvine::Client::LeaseStatuses
|
|
56
62
|
include Rentvine::Client::Ledgers
|
|
57
63
|
include Rentvine::Client::Owners
|
|
58
64
|
include Rentvine::Client::Portfolios
|
|
59
65
|
include Rentvine::Client::Properties
|
|
66
|
+
include Rentvine::Client::RecurringCharges
|
|
60
67
|
include Rentvine::Client::Tenants
|
|
61
68
|
include Rentvine::Client::TransactionEntries
|
|
62
69
|
include Rentvine::Client::Transactions
|
data/lib/rentvine/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rentvine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wes Hays
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: typhoeus
|
|
@@ -91,10 +90,9 @@ files:
|
|
|
91
90
|
- ".gitignore"
|
|
92
91
|
- ".rspec"
|
|
93
92
|
- ".rubocop.yml"
|
|
94
|
-
- ".ruby-gemset"
|
|
95
|
-
- ".ruby-version"
|
|
96
93
|
- CHANGELOG.md
|
|
97
94
|
- CODE_OF_CONDUCT.md
|
|
95
|
+
- Dockerfile
|
|
98
96
|
- Gemfile
|
|
99
97
|
- Gemfile.lock
|
|
100
98
|
- LICENSE.txt
|
|
@@ -102,6 +100,7 @@ files:
|
|
|
102
100
|
- Rakefile
|
|
103
101
|
- bin/console
|
|
104
102
|
- bin/setup
|
|
103
|
+
- docker-compose.yml
|
|
105
104
|
- examples/accounts.rb
|
|
106
105
|
- examples/applications.rb
|
|
107
106
|
- examples/associations.rb
|
|
@@ -110,12 +109,14 @@ files:
|
|
|
110
109
|
- examples/diagnostics.rb
|
|
111
110
|
- examples/files.rb
|
|
112
111
|
- examples/inspections.rb
|
|
112
|
+
- examples/lease_statues.rb
|
|
113
113
|
- examples/leases.rb
|
|
114
114
|
- examples/ledgers.rb
|
|
115
115
|
- examples/object_types.rb
|
|
116
116
|
- examples/owners.rb
|
|
117
117
|
- examples/portfolios.rb
|
|
118
118
|
- examples/properties.rb
|
|
119
|
+
- examples/recurring_charges.rb
|
|
119
120
|
- examples/tenants.rb
|
|
120
121
|
- examples/transaction_entries.rb
|
|
121
122
|
- examples/transactions.rb
|
|
@@ -133,11 +134,13 @@ files:
|
|
|
133
134
|
- lib/rentvine/client/diagnostics.rb
|
|
134
135
|
- lib/rentvine/client/files.rb
|
|
135
136
|
- lib/rentvine/client/inspections.rb
|
|
137
|
+
- lib/rentvine/client/lease_statuses.rb
|
|
136
138
|
- lib/rentvine/client/leases.rb
|
|
137
139
|
- lib/rentvine/client/ledgers.rb
|
|
138
140
|
- lib/rentvine/client/owners.rb
|
|
139
141
|
- lib/rentvine/client/portfolios.rb
|
|
140
142
|
- lib/rentvine/client/properties.rb
|
|
143
|
+
- lib/rentvine/client/recurring_charges.rb
|
|
141
144
|
- lib/rentvine/client/tenants.rb
|
|
142
145
|
- lib/rentvine/client/transaction_entries.rb
|
|
143
146
|
- lib/rentvine/client/transactions.rb
|
|
@@ -155,11 +158,14 @@ files:
|
|
|
155
158
|
- lib/rentvine/model/file.rb
|
|
156
159
|
- lib/rentvine/model/inspection.rb
|
|
157
160
|
- lib/rentvine/model/lease.rb
|
|
161
|
+
- lib/rentvine/model/lease_status.rb
|
|
158
162
|
- lib/rentvine/model/ledger.rb
|
|
163
|
+
- lib/rentvine/model/occupant.rb
|
|
159
164
|
- lib/rentvine/model/owner.rb
|
|
160
165
|
- lib/rentvine/model/owner_distribution.rb
|
|
161
166
|
- lib/rentvine/model/portfolio.rb
|
|
162
167
|
- lib/rentvine/model/property.rb
|
|
168
|
+
- lib/rentvine/model/recurring_charge.rb
|
|
163
169
|
- lib/rentvine/model/rentvine_model.rb
|
|
164
170
|
- lib/rentvine/model/tenant.rb
|
|
165
171
|
- lib/rentvine/model/transaction.rb
|
|
@@ -181,7 +187,6 @@ metadata:
|
|
|
181
187
|
bug_tracker_uri: https://github.com/Launch-Engine/rentvine/issues
|
|
182
188
|
changelog_uri: https://github.com/Launch-Engine/rentvine/blob/main/CHANGELOG.md
|
|
183
189
|
documentation_uri: https://docs.rentvine.com/
|
|
184
|
-
post_install_message:
|
|
185
190
|
rdoc_options: []
|
|
186
191
|
require_paths:
|
|
187
192
|
- lib
|
|
@@ -196,8 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
196
201
|
- !ruby/object:Gem::Version
|
|
197
202
|
version: '0'
|
|
198
203
|
requirements: []
|
|
199
|
-
rubygems_version:
|
|
200
|
-
signing_key:
|
|
204
|
+
rubygems_version: 4.0.3
|
|
201
205
|
specification_version: 4
|
|
202
206
|
summary: API wrapper for the Rentvine.com API
|
|
203
207
|
test_files: []
|
data/.ruby-gemset
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
rentvine
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.3.1
|