rentvine 0.3.3 → 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/.gitignore +2 -0
- data/CHANGELOG.md +20 -0
- data/Dockerfile +24 -0
- data/Gemfile +9 -9
- data/Gemfile.lock +49 -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 +31 -5
- 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 +14 -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
- data/rentvine.gemspec +1 -1
- metadata +26 -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/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
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
|
+
|
|
18
|
+
## [0.4.0] - 2025-01-30
|
|
19
|
+
|
|
20
|
+
- Added support on the lease to load the tenants for the lease.
|
|
21
|
+
- Added dependency for ostruct ~> 0.6.1.
|
|
22
|
+
|
|
3
23
|
## [0.3.3] - 2025-01-26
|
|
4
24
|
|
|
5
25
|
- Updated call to tenants to use "/tenants" instead of "/tenants/search".
|
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,9 +1,10 @@
|
|
|
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
|
+
ostruct (~> 0.6.1)
|
|
7
8
|
plissken (~> 3.0)
|
|
8
9
|
typhoeus (~> 1.4)
|
|
9
10
|
|
|
@@ -15,54 +16,57 @@ GEM
|
|
|
15
16
|
ast (2.4.2)
|
|
16
17
|
awrence (3.0.0)
|
|
17
18
|
base64 (0.2.0)
|
|
18
|
-
bigdecimal (3.1.
|
|
19
|
-
byebug (
|
|
19
|
+
bigdecimal (3.1.9)
|
|
20
|
+
byebug (12.0.0)
|
|
20
21
|
coderay (1.1.3)
|
|
21
22
|
crack (1.0.0)
|
|
22
23
|
bigdecimal
|
|
23
24
|
rexml
|
|
24
|
-
diff-lcs (1.
|
|
25
|
+
diff-lcs (1.6.0)
|
|
25
26
|
docile (1.4.1)
|
|
26
|
-
dotenv (3.1.
|
|
27
|
+
dotenv (3.1.8)
|
|
27
28
|
ethon (0.16.0)
|
|
28
29
|
ffi (>= 1.15.0)
|
|
29
|
-
ffi (1.17.
|
|
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.
|
|
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)
|
|
40
41
|
hashdiff (1.1.2)
|
|
41
|
-
json (2.
|
|
42
|
-
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)
|
|
43
45
|
method_source (1.1.0)
|
|
46
|
+
ostruct (0.6.1)
|
|
44
47
|
parallel (1.26.3)
|
|
45
|
-
parser (3.3.
|
|
48
|
+
parser (3.3.8.0)
|
|
46
49
|
ast (~> 2.4.1)
|
|
47
50
|
racc
|
|
48
51
|
plissken (3.0.0)
|
|
52
|
+
prism (1.4.0)
|
|
49
53
|
pry (0.14.2)
|
|
50
54
|
coderay (~> 1.1)
|
|
51
55
|
method_source (~> 1.0)
|
|
52
|
-
pry-byebug (3.
|
|
53
|
-
byebug (~>
|
|
54
|
-
pry (>= 0.13, < 0.
|
|
56
|
+
pry-byebug (3.11.0)
|
|
57
|
+
byebug (~> 12.0)
|
|
58
|
+
pry (>= 0.13, < 0.16)
|
|
55
59
|
public_suffix (6.0.1)
|
|
56
60
|
racc (1.8.1)
|
|
57
61
|
rainbow (3.1.1)
|
|
58
|
-
rake (13.
|
|
59
|
-
regexp_parser (2.
|
|
60
|
-
rexml (3.4.
|
|
61
|
-
rspec (3.13.
|
|
62
|
+
rake (13.3.0)
|
|
63
|
+
regexp_parser (2.10.0)
|
|
64
|
+
rexml (3.4.1)
|
|
65
|
+
rspec (3.13.1)
|
|
62
66
|
rspec-core (~> 3.13.0)
|
|
63
67
|
rspec-expectations (~> 3.13.0)
|
|
64
68
|
rspec-mocks (~> 3.13.0)
|
|
65
|
-
rspec-core (3.13.
|
|
69
|
+
rspec-core (3.13.3)
|
|
66
70
|
rspec-support (~> 3.13.0)
|
|
67
71
|
rspec-expectations (3.13.3)
|
|
68
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
@@ -71,18 +75,20 @@ GEM
|
|
|
71
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
72
76
|
rspec-support (~> 3.13.0)
|
|
73
77
|
rspec-support (3.13.2)
|
|
74
|
-
rubocop (1.
|
|
78
|
+
rubocop (1.77.0)
|
|
75
79
|
json (~> 2.3)
|
|
76
|
-
language_server-protocol (
|
|
80
|
+
language_server-protocol (~> 3.17.0.2)
|
|
81
|
+
lint_roller (~> 1.1.0)
|
|
77
82
|
parallel (~> 1.10)
|
|
78
83
|
parser (>= 3.3.0.2)
|
|
79
84
|
rainbow (>= 2.2.2, < 4.0)
|
|
80
85
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
81
|
-
rubocop-ast (>= 1.
|
|
86
|
+
rubocop-ast (>= 1.45.1, < 2.0)
|
|
82
87
|
ruby-progressbar (~> 1.7)
|
|
83
88
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
84
|
-
rubocop-ast (1.
|
|
85
|
-
parser (>= 3.3.
|
|
89
|
+
rubocop-ast (1.45.1)
|
|
90
|
+
parser (>= 3.3.7.2)
|
|
91
|
+
prism (~> 1.4)
|
|
86
92
|
ruby-progressbar (1.13.0)
|
|
87
93
|
simplecov (0.22.0)
|
|
88
94
|
docile (~> 1.1)
|
|
@@ -92,12 +98,12 @@ GEM
|
|
|
92
98
|
simplecov_json_formatter (0.1.4)
|
|
93
99
|
typhoeus (1.4.1)
|
|
94
100
|
ethon (>= 0.9.0)
|
|
95
|
-
unicode-display_width (3.1.
|
|
101
|
+
unicode-display_width (3.1.4)
|
|
96
102
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
97
103
|
unicode-emoji (4.0.4)
|
|
98
104
|
vcr (6.3.1)
|
|
99
105
|
base64
|
|
100
|
-
webmock (3.
|
|
106
|
+
webmock (3.25.1)
|
|
101
107
|
addressable (>= 2.8.0)
|
|
102
108
|
crack (>= 0.3.2)
|
|
103
109
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
@@ -116,15 +122,15 @@ PLATFORMS
|
|
|
116
122
|
x86_64-linux-musl
|
|
117
123
|
|
|
118
124
|
DEPENDENCIES
|
|
119
|
-
dotenv (~> 3.1)
|
|
120
|
-
pry-byebug (~> 3.
|
|
121
|
-
rake (~> 13.0)
|
|
125
|
+
dotenv (~> 3.1.8)
|
|
126
|
+
pry-byebug (~> 3.11.0)
|
|
127
|
+
rake (~> 13.3.0)
|
|
122
128
|
rentvine!
|
|
123
|
-
rspec (~> 3.13)
|
|
124
|
-
rubocop (~> 1.
|
|
125
|
-
simplecov (~> 0.22)
|
|
126
|
-
vcr (~> 6.3)
|
|
127
|
-
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)
|
|
128
134
|
|
|
129
135
|
BUNDLED WITH
|
|
130
|
-
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,9 +15,9 @@ 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
|
|
|
@@ -25,9 +25,35 @@ lease_id = 7
|
|
|
25
25
|
rv_obj = rv_client.lease(lease_id)
|
|
26
26
|
puts rv_obj.address
|
|
27
27
|
|
|
28
|
-
===========================
|
|
28
|
+
# ===========================
|
|
29
|
+
|
|
30
|
+
lease_id = 7
|
|
31
|
+
rv_obj = rv_client.lease_tenants(lease_id)
|
|
32
|
+
puts rv_obj.name
|
|
33
|
+
|
|
34
|
+
# ===========================
|
|
35
|
+
|
|
36
|
+
lease_id = 7
|
|
37
|
+
rv_obj = rv_client.lease_occupants(lease_id)
|
|
38
|
+
puts rv_obj.name
|
|
39
|
+
|
|
40
|
+
# ===========================
|
|
29
41
|
|
|
30
42
|
rv_client.export_leases.each do |lease|
|
|
31
43
|
binding.pry
|
|
32
44
|
adsf=3
|
|
33
|
-
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
|
|
@@ -32,6 +32,20 @@ module Rentvine
|
|
|
32
32
|
rvobj
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
+
|
|
36
|
+
def lease_tenants(lease_id, args = {})
|
|
37
|
+
results = process_request(:get, "leases/#{lease_id}/tenants", params: args)
|
|
38
|
+
return results if results.is_a?(RentvineError)
|
|
39
|
+
|
|
40
|
+
results.map { |result| Rentvine::Tenant.new(result) }
|
|
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
|
|
35
49
|
end
|
|
36
50
|
end
|
|
37
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
data/rentvine.gemspec
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
|
|
@@ -66,6 +65,20 @@ dependencies:
|
|
|
66
65
|
- - "~>"
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
67
|
version: '3.0'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: ostruct
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - "~>"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: 0.6.1
|
|
75
|
+
type: :runtime
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - "~>"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: 0.6.1
|
|
69
82
|
description: Rentvine is a web-based Property Management application that provides
|
|
70
83
|
a RESTful API for developers to interact with. This gem is a wrapper for that API.
|
|
71
84
|
email:
|
|
@@ -77,10 +90,9 @@ files:
|
|
|
77
90
|
- ".gitignore"
|
|
78
91
|
- ".rspec"
|
|
79
92
|
- ".rubocop.yml"
|
|
80
|
-
- ".ruby-gemset"
|
|
81
|
-
- ".ruby-version"
|
|
82
93
|
- CHANGELOG.md
|
|
83
94
|
- CODE_OF_CONDUCT.md
|
|
95
|
+
- Dockerfile
|
|
84
96
|
- Gemfile
|
|
85
97
|
- Gemfile.lock
|
|
86
98
|
- LICENSE.txt
|
|
@@ -88,6 +100,7 @@ files:
|
|
|
88
100
|
- Rakefile
|
|
89
101
|
- bin/console
|
|
90
102
|
- bin/setup
|
|
103
|
+
- docker-compose.yml
|
|
91
104
|
- examples/accounts.rb
|
|
92
105
|
- examples/applications.rb
|
|
93
106
|
- examples/associations.rb
|
|
@@ -96,12 +109,14 @@ files:
|
|
|
96
109
|
- examples/diagnostics.rb
|
|
97
110
|
- examples/files.rb
|
|
98
111
|
- examples/inspections.rb
|
|
112
|
+
- examples/lease_statues.rb
|
|
99
113
|
- examples/leases.rb
|
|
100
114
|
- examples/ledgers.rb
|
|
101
115
|
- examples/object_types.rb
|
|
102
116
|
- examples/owners.rb
|
|
103
117
|
- examples/portfolios.rb
|
|
104
118
|
- examples/properties.rb
|
|
119
|
+
- examples/recurring_charges.rb
|
|
105
120
|
- examples/tenants.rb
|
|
106
121
|
- examples/transaction_entries.rb
|
|
107
122
|
- examples/transactions.rb
|
|
@@ -119,11 +134,13 @@ files:
|
|
|
119
134
|
- lib/rentvine/client/diagnostics.rb
|
|
120
135
|
- lib/rentvine/client/files.rb
|
|
121
136
|
- lib/rentvine/client/inspections.rb
|
|
137
|
+
- lib/rentvine/client/lease_statuses.rb
|
|
122
138
|
- lib/rentvine/client/leases.rb
|
|
123
139
|
- lib/rentvine/client/ledgers.rb
|
|
124
140
|
- lib/rentvine/client/owners.rb
|
|
125
141
|
- lib/rentvine/client/portfolios.rb
|
|
126
142
|
- lib/rentvine/client/properties.rb
|
|
143
|
+
- lib/rentvine/client/recurring_charges.rb
|
|
127
144
|
- lib/rentvine/client/tenants.rb
|
|
128
145
|
- lib/rentvine/client/transaction_entries.rb
|
|
129
146
|
- lib/rentvine/client/transactions.rb
|
|
@@ -141,11 +158,14 @@ files:
|
|
|
141
158
|
- lib/rentvine/model/file.rb
|
|
142
159
|
- lib/rentvine/model/inspection.rb
|
|
143
160
|
- lib/rentvine/model/lease.rb
|
|
161
|
+
- lib/rentvine/model/lease_status.rb
|
|
144
162
|
- lib/rentvine/model/ledger.rb
|
|
163
|
+
- lib/rentvine/model/occupant.rb
|
|
145
164
|
- lib/rentvine/model/owner.rb
|
|
146
165
|
- lib/rentvine/model/owner_distribution.rb
|
|
147
166
|
- lib/rentvine/model/portfolio.rb
|
|
148
167
|
- lib/rentvine/model/property.rb
|
|
168
|
+
- lib/rentvine/model/recurring_charge.rb
|
|
149
169
|
- lib/rentvine/model/rentvine_model.rb
|
|
150
170
|
- lib/rentvine/model/tenant.rb
|
|
151
171
|
- lib/rentvine/model/transaction.rb
|
|
@@ -167,7 +187,6 @@ metadata:
|
|
|
167
187
|
bug_tracker_uri: https://github.com/Launch-Engine/rentvine/issues
|
|
168
188
|
changelog_uri: https://github.com/Launch-Engine/rentvine/blob/main/CHANGELOG.md
|
|
169
189
|
documentation_uri: https://docs.rentvine.com/
|
|
170
|
-
post_install_message:
|
|
171
190
|
rdoc_options: []
|
|
172
191
|
require_paths:
|
|
173
192
|
- lib
|
|
@@ -182,8 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
182
201
|
- !ruby/object:Gem::Version
|
|
183
202
|
version: '0'
|
|
184
203
|
requirements: []
|
|
185
|
-
rubygems_version:
|
|
186
|
-
signing_key:
|
|
204
|
+
rubygems_version: 4.0.3
|
|
187
205
|
specification_version: 4
|
|
188
206
|
summary: API wrapper for the Rentvine.com API
|
|
189
207
|
test_files: []
|
data/.ruby-gemset
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
rentvine
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ruby-3.3.1
|