barkibu-kb 0.24.0 → 0.24.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29792b50e3dad51825c1fb0237155a3a6983a893173d00fafe3722e406f5f771
4
- data.tar.gz: 3390ea2cc76d6d6ac5489fda5e4dbacd4b1cc556ba773a1e12f3ca21645ef9ed
3
+ metadata.gz: 48debe3b5db09b2105b42d33a2af92efdd9fa32ba6678667b53d8ddd5cf128bb
4
+ data.tar.gz: 6d8d1fcce91207312f25be2caec25e11b8de1dc2b1dea770e79271d010717812
5
5
  SHA512:
6
- metadata.gz: d76b73f6fcc48fad7f3242f3278e340d258f902b9bf999a61c7fe482c50fe734f28edf2aa28a88bbe37e61dcc6b56862e4f2ef31666fe8a2398609a1a5504d56
7
- data.tar.gz: 3e83ee7c1e7c357661293f2bfa750ca29a9358afa7dc4dbf94216f7fd947b7a23616c964e87e31ab0dcd6c06dba04727881d4301d68ea6bd91482d8ed59a883e
6
+ metadata.gz: b3eaefc9de67484caeb842474809cb3d480b2d65d0e04394c6c400d2d294823e5328e36fd7da3c5e12dfea2bef63fcb6ea1ddcc55c1b20cb391ce86a15796a39
7
+ data.tar.gz: 0cbaa57bfed152f621af509ad2aef485a135d1e247d66ee89e2c7ec5191ab81c1cef27d83963c564e363e8c184beee404dcc19fe048f2eb92248e548c56ed6eb
data/CHANGELOG.md CHANGED
@@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [unreleased]
9
- - See diff: https://github.com/barkibu/kb-ruby/compare/v0.24.0...HEAD
9
+ - See diff: https://github.com/barkibu/kb-ruby/compare/v0.24.1...HEAD
10
+
11
+ # [0.24.1]
12
+ - Add support for `.referrers` method on `PetParent` in fake model
10
13
 
11
14
  # [0.24.0]
12
15
  - Add support for `.referrers` method on `PetParent`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- barkibu-kb (0.24.0)
4
+ barkibu-kb (0.24.1)
5
5
  activemodel (>= 4.0.2)
6
6
  activerecord
7
7
  activesupport (>= 3.0.0)
@@ -10,8 +10,8 @@ PATH
10
10
  faraday-http
11
11
  faraday_middleware
12
12
  i18n
13
- barkibu-kb-fake (0.24.0)
14
- barkibu-kb (= 0.24.0)
13
+ barkibu-kb-fake (0.24.1)
14
+ barkibu-kb (= 0.24.1)
15
15
  countries
16
16
  sinatra
17
17
  webmock
@@ -19,38 +19,29 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- activemodel (7.1.3.2)
23
- activesupport (= 7.1.3.2)
24
- activerecord (7.1.3.2)
25
- activemodel (= 7.1.3.2)
26
- activesupport (= 7.1.3.2)
27
- timeout (>= 0.4.0)
28
- activesupport (7.1.3.2)
29
- base64
30
- bigdecimal
22
+ activemodel (7.0.4.2)
23
+ activesupport (= 7.0.4.2)
24
+ activerecord (7.0.4.2)
25
+ activemodel (= 7.0.4.2)
26
+ activesupport (= 7.0.4.2)
27
+ activesupport (7.0.4.2)
31
28
  concurrent-ruby (~> 1.0, >= 1.0.2)
32
- connection_pool (>= 2.2.5)
33
- drb
34
29
  i18n (>= 1.6, < 2)
35
30
  minitest (>= 5.1)
36
- mutex_m
37
31
  tzinfo (~> 2.0)
38
32
  addressable (2.8.0)
39
33
  public_suffix (>= 2.0.2, < 5.0)
40
34
  ast (2.4.2)
41
- base64 (0.2.0)
42
- bigdecimal (3.1.6)
43
35
  byebug (11.1.3)
44
- concurrent-ruby (1.2.3)
45
- connection_pool (2.4.1)
46
- countries (5.7.2)
36
+ concurrent-ruby (1.2.2)
37
+ countries (5.3.1)
47
38
  unaccent (~> 0.3)
48
39
  crack (0.4.5)
49
40
  rexml
50
41
  diff-lcs (1.4.4)
51
42
  docile (1.4.0)
52
- domain_name (0.6.20240107)
53
- drb (2.2.1)
43
+ domain_name (0.5.20190701)
44
+ unf (>= 0.0.5, < 1.0.0)
54
45
  dry-configurable (0.16.1)
55
46
  dry-core (~> 0.6)
56
47
  zeitwerk (~> 2.6)
@@ -85,40 +76,35 @@ GEM
85
76
  faraday-retry (1.0.3)
86
77
  faraday_middleware (1.2.0)
87
78
  faraday (~> 1.0)
88
- ffi (1.16.3)
79
+ ffi (1.15.5)
89
80
  ffi-compiler (1.0.1)
90
81
  ffi (>= 1.0.0)
91
82
  rake
92
83
  hashdiff (1.0.1)
93
- http (5.2.0)
84
+ http (5.1.1)
94
85
  addressable (~> 2.8)
95
- base64 (~> 0.1)
96
86
  http-cookie (~> 1.0)
97
87
  http-form_data (~> 2.2)
98
- llhttp-ffi (~> 0.5.0)
88
+ llhttp-ffi (~> 0.4.0)
99
89
  http-cookie (1.0.5)
100
90
  domain_name (~> 0.5)
101
91
  http-form_data (2.3.0)
102
- i18n (1.14.1)
92
+ i18n (1.12.0)
103
93
  concurrent-ruby (~> 1.0)
104
- llhttp-ffi (0.5.0)
94
+ llhttp-ffi (0.4.0)
105
95
  ffi-compiler (~> 1.0)
106
96
  rake (~> 13.0)
107
- minitest (5.22.2)
108
- multipart-post (2.4.0)
97
+ minitest (5.18.0)
98
+ multipart-post (2.3.0)
109
99
  mustermann (3.0.0)
110
100
  ruby2_keywords (~> 0.0.1)
111
- mutex_m (0.2.0)
112
101
  parallel (1.21.0)
113
102
  parser (3.0.2.0)
114
103
  ast (~> 2.4.1)
115
104
  public_suffix (4.0.7)
116
- rack (3.0.9.1)
117
- rack-protection (4.0.0)
118
- base64 (>= 0.1.0)
119
- rack (>= 3.0.0, < 4)
120
- rack-session (2.0.0)
121
- rack (>= 3.0.0)
105
+ rack (2.2.6.3)
106
+ rack-protection (3.0.5)
107
+ rack
122
108
  rainbow (3.0.0)
123
109
  rake (13.0.6)
124
110
  regexp_parser (2.1.1)
@@ -157,23 +143,24 @@ GEM
157
143
  simplecov_json_formatter (~> 0.1)
158
144
  simplecov-html (0.12.3)
159
145
  simplecov_json_formatter (0.1.3)
160
- sinatra (4.0.0)
146
+ sinatra (3.0.5)
161
147
  mustermann (~> 3.0)
162
- rack (>= 3.0.0, < 4)
163
- rack-protection (= 4.0.0)
164
- rack-session (>= 2.0.0, < 3)
148
+ rack (~> 2.2, >= 2.2.4)
149
+ rack-protection (= 3.0.5)
165
150
  tilt (~> 2.0)
166
- tilt (2.3.0)
167
- timeout (0.4.1)
151
+ tilt (2.1.0)
168
152
  tzinfo (2.0.6)
169
153
  concurrent-ruby (~> 1.0)
170
154
  unaccent (0.4.0)
155
+ unf (0.1.4)
156
+ unf_ext
157
+ unf_ext (0.0.8.2)
171
158
  unicode-display_width (2.1.0)
172
159
  webmock (3.14.0)
173
160
  addressable (>= 2.8.0)
174
161
  crack (>= 0.3.2)
175
162
  hashdiff (>= 0.4.0, < 2.0.0)
176
- zeitwerk (2.6.13)
163
+ zeitwerk (2.6.7)
177
164
 
178
165
  PLATFORMS
179
166
  ruby
@@ -30,6 +30,10 @@ module BoundedContext
30
30
  json_response 200, referrals_by_pet_parent_key(params['key'])
31
31
  end
32
32
 
33
+ get '/v1/petparents/:key/referrers' do
34
+ json_response 200, referrers_by_pet_parent_key(params['key'])
35
+ end
36
+
33
37
  post '/v1/petparents/:key/referrals' do
34
38
  resource = JSON.parse(request.body.read)
35
39
  resource = resource.merge 'key' => SecureRandom.uuid
@@ -94,6 +98,11 @@ module BoundedContext
94
98
  resource_state(:referrals).select { |resource| resource['referralKey'] == key }
95
99
  end
96
100
 
101
+ def referrers_by_pet_parent_key(key)
102
+ pet_keys = resource_state(:pets).select { |pet| pet['petParentKey'] == key }.map { |pet| pet['key'] }
103
+ resource_state(:referrals).select { |referral| pet_keys.include? referral['referredKey'] }
104
+ end
105
+
97
106
  def same_email_but_different_phone_number?(previous, new)
98
107
  (previous['email'] == new['email']) &&
99
108
  ((previous['phoneNumber'] != new['phoneNumber']) ||
data/lib/kb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KB
2
- VERSION = '0.24.0'.freeze
2
+ VERSION = '0.24.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barkibu-kb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Léo Figea
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-01 00:00:00.000000000 Z
11
+ date: 2024-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable