mintsoft 0.1.5 → 0.1.7
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/mintsoft/resources/returns.rb +2 -15
- data/lib/mintsoft/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2a17bbdcac6407c2e35b8c88255eca2aa11c885925050fa52b5c77ee56cdf17
|
4
|
+
data.tar.gz: b8bf5662fb94f4b854aca4790e0420fce462dd5915ef75f2ef6ecde8eb10ff7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb81292cb1375785a2f553848ca8312cf42e45d70c05b5bc2c79a8c63ad4c9e35145927decf712bef768392637baea29735d54aa98fad8e474bbfe4d7c897c9f
|
7
|
+
data.tar.gz: 691e669052b7de1ab710aff5d03061ab5040b9871b3593978cfc5eda0f91aec766c7fc0e1e8aea7e4c8a0cb44aa346801f35c5b41a4145eb8b321c6aaa3f7864
|
@@ -42,7 +42,7 @@ module Mintsoft
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def validate_item_attributes!(attrs)
|
45
|
-
required = [:product_id, :quantity
|
45
|
+
required = [:product_id, :quantity]
|
46
46
|
required.each do |field|
|
47
47
|
raise ValidationError, "#{field} required" unless attrs[field]
|
48
48
|
end
|
@@ -55,21 +55,8 @@ module Mintsoft
|
|
55
55
|
data.map { |reason_data| Objects::ReturnReason.new(reason_data) }
|
56
56
|
end
|
57
57
|
|
58
|
-
def extract_return_id(toolkit_result)
|
59
|
-
# Parse ToolkitResult to extract return ID - handles various response formats
|
60
|
-
toolkit_result.dig("result", "return_id") ||
|
61
|
-
toolkit_result.dig("data", "id") ||
|
62
|
-
toolkit_result["id"]
|
63
|
-
end
|
64
|
-
|
65
58
|
def format_item_payload(attrs)
|
66
|
-
{
|
67
|
-
"ProductId" => attrs[:product_id],
|
68
|
-
"Quantity" => attrs[:quantity],
|
69
|
-
"ReasonId" => attrs[:reason_id],
|
70
|
-
"UnitValue" => attrs[:unit_value],
|
71
|
-
"Notes" => attrs[:notes]
|
72
|
-
}.compact
|
59
|
+
attrs.transform_keys { |x| x.to_s.camelcase }
|
73
60
|
end
|
74
61
|
end
|
75
62
|
end
|
data/lib/mintsoft/version.rb
CHANGED