wolf_core 0.1.97 → 0.1.99

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: b4cc996a7b18eea5664773996e709afcce3f5f1645e7f8feb57e659d0a72b063
4
- data.tar.gz: cdb96b24ac5894141469a7de98122bb80c6addd171c25f85586d3c5a24e5ae4e
3
+ metadata.gz: 8d2f944616b25d134e6589f0dbfcb8fd909a27dfb881cfd78eb9b76e264f900c
4
+ data.tar.gz: d6644bfec1886500d96906243f1429e6d28145fc19dd3e419826309122b243c5
5
5
  SHA512:
6
- metadata.gz: 329e6f0352682c6b2ff6c9bc4d0fd4fcded60341de35a63fc582afd04c27f02e018b07c499ce6784999e712e834007f80ff504b719a9931182e361f9fee9acb3
7
- data.tar.gz: 0152cd4ccb41678178a65c78ccfcab6b0d2cd08869d8d33469cbda9c41c92bb335ea55b4db9a2984d7d02633c102b33d759791346ce6760bae2f1d1dfdd10deb
6
+ metadata.gz: afef89f59ffb52ca6dee4b5a9a5a8baf1d281ac609702c472f7e048de8d57472439b4c82fe5800aec86f1e7790b6ad9fa0c800adfb507482aad1bc49cbefd447
7
+ data.tar.gz: f0f4f40b589361933bf7a7f2f5df41f7bc4e6f1ade3f3872d10b6fa10bf508b8d0fc989e2892bd1454f6345c8dc04b4e5bf40fb6fbba8d3e4ed63d39db4456d4
@@ -0,0 +1,32 @@
1
+ module WolfCore
2
+ module Integrations
3
+ module JobseekerApiOperations
4
+ include WolfCore::HttpOperations
5
+
6
+ def fetch_jobseeker(wolf_token:, jobseeker_id:, tenant:)
7
+ response = safe_http_get(
8
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
9
+ url: "#{ENV['WOLF_PLATFORM_URL']}/api/v2/jobseekers/#{jobseeker_id}",
10
+ query: { tenant: tenant },
11
+ error_message: 'Failed to fetch jobseeker',
12
+ )
13
+ response_body = response.body
14
+ response_body.dig('data', 'table', 'jobseeker')
15
+ end
16
+
17
+ def create_jobseeker(wolf_token:, jobseeker:, tenant:)
18
+ response = http_post(
19
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
20
+ query: { tenant: tenant },
21
+ url: "#{ENV['WOLF_PLATFORM_URL']}/api/v2/jobseekers",
22
+ body: jobseeker
23
+ )
24
+ log_object response, title: 'create jobseeker response is'
25
+ validate_http_response(
26
+ response: response,
27
+ message: 'Can not create jobseeker'
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
@@ -4,7 +4,7 @@ module WolfCore
4
4
  def get_payload(event_type:, params:)
5
5
  return if event_type == 'SubscriptionConfirmation'
6
6
  params = JSON.parse(params['Message'] || '{}')
7
- params['payload'] = JSON.parse(params['payload'] || '{}')
7
+ JSON.parse(params['payload'] || '{}')
8
8
  end
9
9
 
10
10
  def get_event_type(params:)
@@ -46,9 +46,15 @@ module WolfCore
46
46
  end
47
47
 
48
48
  def build_body_from_params(params:, id_key:)
49
- params.slice(
50
- 'event_name', 'payload'
51
- ).merge({ id_key => params['object_id'] })
49
+ {
50
+ event_name: get_event_name(params: params),
51
+ id_key => get_object_id(params: params)
52
+ }
53
+ end
54
+
55
+ def get_object_id(params:)
56
+ params = JSON.parse(params['Message'] || '{}')
57
+ params['object_id']
52
58
  end
53
59
  end
54
60
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "0.1.97"
4
+ VERSION = "0.1.99"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.97
4
+ version: 0.1.99
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
@@ -95,6 +95,7 @@ files:
95
95
  - lib/wolf_core/application/burnett/auth/auth_operations.rb
96
96
  - lib/wolf_core/application/exception_operations.rb
97
97
  - lib/wolf_core/application/integrations/change_detection.rb
98
+ - lib/wolf_core/application/integrations/jobseeker_api_operations.rb
98
99
  - lib/wolf_core/application/integrations/routing_operations.rb
99
100
  - lib/wolf_core/application/integrations/webhooks_operations.rb
100
101
  - lib/wolf_core/application/salesforce_oauth_service.rb