ecoportal-api 0.10.12 → 0.10.14
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/.rubocop.yml +1 -1
- data/CHANGELOG.md +13 -3
- data/lib/ecoportal/api/v1/person.rb +25 -0
- data/lib/ecoportal/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42c60da1fe6f9c6176e85d65b5283b75b54af11f5e977788eddd7fde57bba953
|
4
|
+
data.tar.gz: d5bf03e2eaec6dad5778f8a0ce693b9a29d9786331e5517facab0e28941abccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5d0dfc99e97e97b857a1f424b80e4211811ed7ef6250300a9cd8614a39d5281fef6661519d915a29980a8347368b50bcf7961cfb5a676b6b6d196f16a48cafb
|
7
|
+
data.tar.gz: 1ca5a7a3ffc81adc74679524ad715d4833e665867041e7c2c25eace44e98d9612a330dad433e0db4c9e85d95e5fbc5209fc5c46705c1510e91280a011a122c11
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,16 +2,26 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
## [0.10.
|
5
|
+
## [0.10.15] - 2025-08-xx
|
6
6
|
|
7
7
|
### Added
|
8
8
|
|
9
|
-
- `Client#post` **added** named argument `params` (for the **url** arguments)
|
10
|
-
|
11
9
|
### Changed
|
12
10
|
|
13
11
|
### Fixed
|
14
12
|
|
13
|
+
## [0.10.14] - 2025-08-15
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
- `Person#phone_number`
|
18
|
+
|
19
|
+
## [0.10.12] - 2025-05-30
|
20
|
+
|
21
|
+
### Added
|
22
|
+
|
23
|
+
- `Client#post` **added** named argument `params` (for the **url** arguments)
|
24
|
+
|
15
25
|
## [0.10.11] - 2025-05-15
|
16
26
|
|
17
27
|
### Changed
|
@@ -13,6 +13,8 @@ module Ecoportal
|
|
13
13
|
alias_method :archived?, :archived
|
14
14
|
|
15
15
|
passthrough :supervisor_id, :contractor_organization_id
|
16
|
+
|
17
|
+
passthrough :phone_number
|
16
18
|
passthrough :brand_id
|
17
19
|
passthrough :freemium
|
18
20
|
|
@@ -22,6 +24,7 @@ module Ecoportal
|
|
22
24
|
|
23
25
|
VALID_TAG_REGEX = /^[A-Za-z0-9 &_'\/.-]+$/
|
24
26
|
VALID_EMAIL_REGEX = /^[^@\s]+@[^@\s]+\.[^@\s]+$/
|
27
|
+
NON_PHONE_REGEX = /[^+0-9]/
|
25
28
|
|
26
29
|
def unarchive!
|
27
30
|
self.archived = false
|
@@ -65,6 +68,15 @@ module Ecoportal
|
|
65
68
|
doc['email'] = value&.downcase
|
66
69
|
end
|
67
70
|
|
71
|
+
# @note this property is read-only in the APIv0.
|
72
|
+
# Sets the **primary** phone number of a person.
|
73
|
+
# @param value [String, nil] the phone number of this person.
|
74
|
+
def phone_number=(value)
|
75
|
+
return
|
76
|
+
|
77
|
+
doc['phone_number'] = parse_number(value)
|
78
|
+
end
|
79
|
+
|
68
80
|
# Validates the string tags of the array, and sets the `filter_tags` property of the account.
|
69
81
|
# @note all is set in upper case and preserves the original order.
|
70
82
|
# @raise [Exception] if there was any invalid string tag.
|
@@ -146,6 +158,19 @@ module Ecoportal
|
|
146
158
|
}
|
147
159
|
end
|
148
160
|
end
|
161
|
+
|
162
|
+
private
|
163
|
+
|
164
|
+
def parse_number(value)
|
165
|
+
value = value.to_s.strip
|
166
|
+
return if value.empty?
|
167
|
+
|
168
|
+
value.gsub(NON_PHONE_REGEX, '').then do |str|
|
169
|
+
next str if str.start_with?('+')
|
170
|
+
|
171
|
+
"+#{str}"
|
172
|
+
end
|
173
|
+
end
|
149
174
|
end
|
150
175
|
end
|
151
176
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecoportal-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tapio Saarinen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|