wolf_core 0.1.48 → 0.1.49

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: 535688e7b4d2713a3c0870c1ceaeebab05d8e4b244a8fe64e7adc9a62e4dbf80
4
- data.tar.gz: 7b72783c16feadf6933c5ffcd1a821bd0f7710b67d68137607b694ec7a40fd15
3
+ metadata.gz: d7fe8a03e62e03784dbec0eecb5c1b4e66dcddc1b83adf3ea8befbce293d0cb7
4
+ data.tar.gz: a5e16a273bdfc49d42210a46b07bfb9cf57746d4ba330188566dffbd32e3c762
5
5
  SHA512:
6
- metadata.gz: e3a66dd20fa45f5cfa93281dc38d4581f44725bda38f27f9e082f58fcad0a6844fd5663e059f56240ad35e68522c9ca12954cc1a14709314c9bbee7eb0e5e5e4
7
- data.tar.gz: 17862b2a58ab4641a2514ef68513f40859f01135006284fba4633d9573c3704da9ef6e6e56a927dd70473ca41f9fefa6173f84707e6bf5c170126691fb9b3a04
6
+ metadata.gz: 25e8463c4357a9699f613f21c8199e54d5bddb1d26b48fb80ea80d75c7050f613e79cfca6c5c33208fd9df58a0627faf4a5d5e863d740d0d864cea91a84aa9ac
7
+ data.tar.gz: afceb443287ce81f73bd2fb11dd49c773fb9e9df0efeb4f113934c2dbe057f098971c6aa5d17c71e12df4feb72743172d75bf9ab90d5d43dbe58269a7b643f63
@@ -28,6 +28,16 @@ module WolfCore
28
28
  'Closed' => 'pending',
29
29
  }
30
30
 
31
+ SUBMITTAL_STAGE_MAP = {
32
+ 'Pre-Submission' => 'wait',
33
+ 'Submittal' => 'wait',
34
+ 'Send Out' => 'wait',
35
+ 'On Hold' => 'wait',
36
+ 'Offer' => 'wait',
37
+ 'Withdraw' => 'declined',
38
+ 'Reject' => 'rejected',
39
+ }
40
+
31
41
  def map_provider_type_to_pricing_id(provider_type)
32
42
  pricing_id = PROVIDER_TYPE_MAPPING[provider_type]
33
43
  pricing_id || provider_type
@@ -55,6 +65,14 @@ module WolfCore
55
65
  def reverse_map_order_status(value)
56
66
  ORDER_STATUS_MAP.invert[value] || value
57
67
  end
68
+
69
+ def map_submittal_stage_to_order_application_status(value)
70
+ SUBMITTAL_STAGE_MAP[value] || value
71
+ end
72
+
73
+ def revert_map_submittal_stage_to_order_application_status(value)
74
+ SUBMITTAL_STAGE_MAP.invert[value] || value
75
+ end
58
76
  end
59
77
  end
60
78
  end
@@ -31,13 +31,11 @@ module WolfCore
31
31
  end
32
32
 
33
33
  def async_http_post(**args)
34
- puts "starting async_http_post"
35
- puts "async_http_post args are"
36
- log_object args
34
+ log_object "starting async_http_post"
35
+ log_object args, title: 'async_http_post args are'
37
36
  run_async do
38
37
  response = http_post(**args)
39
- puts "async_http_post response is"
40
- log_object parse_http_response(response).to_h
38
+ log_object parse_http_response(response), title: 'async_http_post response is'
41
39
  end
42
40
  end
43
41
 
@@ -63,8 +61,7 @@ module WolfCore
63
61
  log_object args, title: 'async_http_put args are'
64
62
  run_async do
65
63
  response = http_put(**args)
66
- puts "async_http_put response is"
67
- log_object parse_http_response(response).to_h
64
+ log_object parse_http_response(response), title: 'async_http_put response is'
68
65
  end
69
66
  end
70
67
 
@@ -1,11 +1,15 @@
1
+ require_relative 'result'
2
+
1
3
  module WolfCore
2
4
  module LoggingUtils
3
5
  def log_object(object, title: nil)
4
6
  puts '---------------------------------'
5
7
  puts title if title
6
8
  case object
7
- when Hash, Array, OpenStruct
8
- object = object.to_h if object.instance_of?(OpenStruct)
9
+ when Hash, Array, OpenStruct, Result
10
+ if object.instance_of?(OpenStruct) || object.instance_of?(Result)
11
+ object = object.to_h
12
+ end
9
13
  puts object.to_json
10
14
  when Object
11
15
  pp object
@@ -22,4 +22,12 @@ class Result
22
22
  def failure?
23
23
  !@success
24
24
  end
25
+
26
+ def to_h
27
+ {
28
+ success: @success,
29
+ data: @data,
30
+ error: @error,
31
+ }
32
+ end
25
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "0.1.48"
4
+ VERSION = "0.1.49"
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.48
4
+ version: 0.1.49
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-07-30 00:00:00.000000000 Z
11
+ date: 2024-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty