wolf_core 1.0.77 → 1.0.78

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: 78299938906476e29c333da5adb6b67feca648350340bdde8aa3934d03a7f744
4
- data.tar.gz: 49428fc05ee308e5b6e4f8421f9e98975f5648561182cc22b2987356b75b03c5
3
+ metadata.gz: 3cdf821478350d9768fad37e18e71dcfd64ffded145ead6b2a645ea76fadb35a
4
+ data.tar.gz: f177d7981e5a4408cee5050604502d8f96889a66bb139e035de3e9482e17297e
5
5
  SHA512:
6
- metadata.gz: 1a6db374f67ce4c6ed4847ebac8b333d6dc1d9e44b14d8c67980694beacdf9bdafe2f4b796f648ece803241195a09c5a723f870f6ad87917ddb97057a9da1e2f
7
- data.tar.gz: 1c81b0487da6230c39896c8eb6393ee817e3e9587e97c026056ec4afd804ec4e118a408dec3806d008f9d69f5e3db00a98ebb58b2f8ee5fa467956e681cb5134
6
+ metadata.gz: b45bf02cc38386e06bd132b02131328832cc0abad5d92ea24fe93de0f02d130964d94bf28b9edf3935b7dcec37cd5c12a31f16cf4f3c48602a82c8be8932ab1c
7
+ data.tar.gz: 391da00769556cf83144db1b53a139a6b9c5bd10ac8ba27ab24b4f8f6cbe47084e04501d8dac5f9ee2c98f5c538d159bceaa5e6a347b7bff8a00a2970c66b0e8
@@ -130,6 +130,40 @@ module WolfCore
130
130
  )
131
131
  end
132
132
  end
133
+
134
+ def upsert_custom_value(wolf_token:, tenant:, wolf_platform_url:, query:, custom_requirement_id:, custom_value:, error_message:, error_data: nil)
135
+ response = fetch_custom_values(
136
+ wolf_token: wolf_token,
137
+ tenant: tenant,
138
+ wolf_platform_url: wolf_platform_url,
139
+ query: query
140
+ )
141
+
142
+ return response unless response_success?(response)
143
+
144
+ custom_values = response.body.dig("data", "table", "custom_values")
145
+
146
+ if custom_values&.any?
147
+ custom_value_id = custom_values.first["id"]
148
+ update_response = update_custom_value(
149
+ wolf_platform_url: wolf_platform_url,
150
+ tenant: tenant,
151
+ wolf_token: wolf_token,
152
+ custom_value_id: custom_value_id,
153
+ custom_value: custom_value,
154
+ query: query
155
+ )
156
+ else
157
+ create_response = create_custom_value(
158
+ wolf_platform_url: wolf_platform_url,
159
+ tenant: tenant,
160
+ wolf_token: wolf_token,
161
+ custom_requirement_id: custom_requirement_id,
162
+ custom_value: custom_value,
163
+ query: query
164
+ )
165
+ end
166
+ end
133
167
  end
134
168
  end
135
169
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.77"
4
+ VERSION = "1.0.78"
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: 1.0.77
4
+ version: 1.0.78
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo