wolf_core 0.1.99 → 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 +4 -4
- data/lib/wolf_core/application/burnett/data_transformation/mappings.rb +27 -0
- data/lib/wolf_core/application/integrations/jobseeker_api_operations.rb +27 -11
- data/lib/wolf_core/application/integrations/orders_api_operations.rb +48 -0
- data/lib/wolf_core/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72dc3ed5c7b6520f4baa43f27e45a304ac21b7b68d5167beeed386fd088ee2e9
|
4
|
+
data.tar.gz: 87fa7ece4f89b46d81f7ca97c0e1470fa7f3ceff03de7725d5e3bc31b7b09d2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -3,28 +3,44 @@ module WolfCore
|
|
3
3
|
module JobseekerApiOperations
|
4
4
|
include WolfCore::HttpOperations
|
5
5
|
|
6
|
-
def fetch_jobseeker(wolf_token:, jobseeker_id:, tenant:)
|
6
|
+
def fetch_jobseeker!(wolf_token:, jobseeker_id:, tenant:, wolf_platform_url:, error_message:)
|
7
7
|
response = safe_http_get(
|
8
8
|
headers: { 'Authorization' => "Bearer #{wolf_token}" },
|
9
|
-
url: "#{
|
9
|
+
url: "#{wolf_platform_url}/api/v2/jobseekers/#{jobseeker_id}",
|
10
10
|
query: { tenant: tenant },
|
11
|
-
error_message:
|
11
|
+
error_message: error_message,
|
12
12
|
)
|
13
13
|
response_body = response.body
|
14
14
|
response_body.dig('data', 'table', 'jobseeker')
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
response =
|
17
|
+
def fetch_jobseeker(wolf_token:, jobseeker_id:, tenant:, wolf_platform_url:)
|
18
|
+
response = http_get(
|
19
19
|
headers: { 'Authorization' => "Bearer #{wolf_token}" },
|
20
|
+
url: "#{wolf_platform_url}/api/v2/jobseekers/#{jobseeker_id}",
|
20
21
|
query: { tenant: tenant },
|
21
|
-
url: "#{ENV['WOLF_PLATFORM_URL']}/api/v2/jobseekers",
|
22
|
-
body: jobseeker
|
23
22
|
)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
28
44
|
)
|
29
45
|
end
|
30
46
|
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
|
data/lib/wolf_core/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -93,9 +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
|
98
99
|
- lib/wolf_core/application/integrations/jobseeker_api_operations.rb
|
100
|
+
- lib/wolf_core/application/integrations/orders_api_operations.rb
|
99
101
|
- lib/wolf_core/application/integrations/routing_operations.rb
|
100
102
|
- lib/wolf_core/application/integrations/webhooks_operations.rb
|
101
103
|
- lib/wolf_core/application/salesforce_oauth_service.rb
|