wolf_core 0.1.98 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e3d081c4b356d9b3bee8084b26251a3540c6884dba594cedc404d5a346dff22
4
- data.tar.gz: 8b9e86ead216520b002ebaaea42b621a188569e8a05c717ec3ad2e7df205290c
3
+ metadata.gz: 72dc3ed5c7b6520f4baa43f27e45a304ac21b7b68d5167beeed386fd088ee2e9
4
+ data.tar.gz: 87fa7ece4f89b46d81f7ca97c0e1470fa7f3ceff03de7725d5e3bc31b7b09d2e
5
5
  SHA512:
6
- metadata.gz: 613f563fdceb49519c12ce40d68e0a38f099d96f121ef63f71e305d8bce4b2f1bdab8057978dc8f2bbb305b13fb17c90b81d026971477bfb3517d8288763e8ba
7
- data.tar.gz: e1e40740f03748298dcc6430237bae7c7d4e6d73e8acf32cd521aefd2e9e3e8fdf5c3418e1169c35fc45993afdf7ce93291b81782ae15c85d87224ab6067fee8
6
+ metadata.gz: 570ad8e75a0c36bab766171acc847ecf0cf73e668890c425da83ed89bda51ca2890df07a9fb3a97dab425ded238287abfd239c4e510726ad44826bdd3be7b102
7
+ data.tar.gz: ae521dc9bc683c8cbc960abaf0b23037b5a804e2bcbeabb18b088b6fd7d36b345a679d81158152173a4d739effcbc45f4cae1f5ef0571996a1916fa3bebf9b06
@@ -0,0 +1,27 @@
1
+ module WolfCore
2
+ module Burnett
3
+ module Mappings
4
+ JOB_TYPE_MAPPING = {
5
+ '144' => '26',
6
+ '145' => '30',
7
+ '153' => '24',
8
+ '152' => '28',
9
+ '155' => '12',
10
+ '156' => '22',
11
+ '150' => '27',
12
+ '148' => '31',
13
+ '158' => '25',
14
+ '151' => '29',
15
+ '163' => '23',
16
+ }
17
+
18
+ def map_job_type(value)
19
+ JOB_TYPE_MAPPING[value] || value
20
+ end
21
+
22
+ def revert_map_job_type(value)
23
+ JOB_TYPE_MAPPING.invert[value] || value
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,48 @@
1
+ module WolfCore
2
+ module Integrations
3
+ module JobseekerApiOperations
4
+ include WolfCore::HttpOperations
5
+
6
+ def fetch_jobseeker!(wolf_token:, jobseeker_id:, tenant:, wolf_platform_url:, error_message:)
7
+ response = safe_http_get(
8
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
9
+ url: "#{wolf_platform_url}/api/v2/jobseekers/#{jobseeker_id}",
10
+ query: { tenant: tenant },
11
+ error_message: error_message,
12
+ )
13
+ response_body = response.body
14
+ response_body.dig('data', 'table', 'jobseeker')
15
+ end
16
+
17
+ def fetch_jobseeker(wolf_token:, jobseeker_id:, tenant:, wolf_platform_url:)
18
+ response = http_get(
19
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
20
+ url: "#{wolf_platform_url}/api/v2/jobseekers/#{jobseeker_id}",
21
+ query: { tenant: tenant },
22
+ )
23
+ response_body = response.body
24
+ return unless response_body.instance_of?(Hash)
25
+ response_body.dig('data', 'table', 'jobseeker')
26
+ end
27
+
28
+ def create_jobseeker!(wolf_token:, jobseeker:, tenant:, wolf_platform_url:, error_message:)
29
+ safe_http_post(
30
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
31
+ query: { tenant: tenant },
32
+ url: "#{wolf_platform_url}/api/v2/jobseekers",
33
+ body: jobseeker,
34
+ error_message: error_message,
35
+ )
36
+ end
37
+
38
+ def create_jobseeker(wolf_token:, jobseeker:, tenant:, wolf_platform_url:)
39
+ http_post(
40
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
41
+ query: { tenant: tenant },
42
+ url: "#{wolf_platform_url}/api/v2/jobseekers",
43
+ body: jobseeker
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,48 @@
1
+ module WolfCore
2
+ module Integrations
3
+ module OrdersApiOperations
4
+ include WolfCore::HttpOperations
5
+
6
+ def fetch_order!(wolf_token:, order_id:, tenant:, wolf_platform_url:, error_message:)
7
+ response = safe_http_get(
8
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
9
+ url: "#{wolf_platform_url}/api/v2/orders/#{order_id}",
10
+ query: { tenant: tenant },
11
+ error_message: error_message,
12
+ )
13
+ response_body = response.body
14
+ response_body.dig('data', 'table', 'order')
15
+ end
16
+
17
+ def fetch_order(wolf_token:, order_id:, tenant:, wolf_platform_url:)
18
+ response = http_get(
19
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
20
+ url: "#{wolf_platform_url}/api/v2/orders/#{order_id}",
21
+ query: { tenant: tenant },
22
+ )
23
+ response_body = response.body
24
+ return unless response_body.instance_of?(Hash)
25
+ response_body.dig('data', 'table', 'order')
26
+ end
27
+
28
+ def create_order!(wolf_token:, order:, tenant:, wolf_platform_url:, error_message:)
29
+ safe_http_post(
30
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
31
+ url: "#{wolf_platform_url}/api/v2/orders",
32
+ query: { tenant: tenant },
33
+ body: order,
34
+ error_message: error_message,
35
+ )
36
+ end
37
+
38
+ def create_order(wolf_token:, order:, tenant:, wolf_platform_url:)
39
+ http_post(
40
+ headers: { 'Authorization' => "Bearer #{wolf_token}" },
41
+ url: "#{wolf_platform_url}/api/v2/orders",
42
+ query: { tenant: tenant },
43
+ body: order
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "0.1.98"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.98
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-08 00:00:00.000000000 Z
11
+ date: 2024-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -93,8 +93,11 @@ files:
93
93
  - lib/wolf_core/application/barton/parsing.rb
94
94
  - lib/wolf_core/application/barton/routing.rb
95
95
  - lib/wolf_core/application/burnett/auth/auth_operations.rb
96
+ - lib/wolf_core/application/burnett/data_transformation/mappings.rb
96
97
  - lib/wolf_core/application/exception_operations.rb
97
98
  - lib/wolf_core/application/integrations/change_detection.rb
99
+ - lib/wolf_core/application/integrations/jobseeker_api_operations.rb
100
+ - lib/wolf_core/application/integrations/orders_api_operations.rb
98
101
  - lib/wolf_core/application/integrations/routing_operations.rb
99
102
  - lib/wolf_core/application/integrations/webhooks_operations.rb
100
103
  - lib/wolf_core/application/salesforce_oauth_service.rb