zaikio-warehouse 0.5.0 → 0.5.1

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: b27e4cb1d7c29e1f7066607d0ab7e7a4048c68a1a01a98fac834ce98511869eb
4
- data.tar.gz: 1e9d184f6b06f1bc8f7e79a79223773892b750251209154b8e2738fe1ad31055
3
+ metadata.gz: 2c62c0970c1b081c6700f3314338a4ae3ee4f568924b8c7dc73617e05cad3507
4
+ data.tar.gz: bac0a0541969b5ecf8f57d25092c5a58937652e339ce8721734f2bb3caf4a160
5
5
  SHA512:
6
- metadata.gz: 5b774df07a6af007f3213ccc2593d7b8a7cff6fc7f8c4ed23cf900adc8dcc997ff167bc51058a28c37de2da32a3e6d2d189373af939e5a3d2f12045e20ce667f
7
- data.tar.gz: c6869a82225fb97df7d12736d8699519c2e3f979279e81f902441d8037ee56228dde49dcd01c53abc866b3329f5aabb3d012e45b47c1da2e2e889ef0fab66636
6
+ metadata.gz: 350f090f78a86b594365c69b1913cc9011aea013cb8ea89956caa76be6211a7e78001f19a70288b14b4dd6ed2f1a1b3d7466264db354d5fdb8b3bced37b6445d
7
+ data.tar.gz: 3a297ec8bfb7fd0e9f9168f63d5794697c822c00c2fde3c0ea06421ff4b2dfbd6ca83e2ea5e50855c7f04b8d62cd8753ae92f83f1b9a47ffbc1fa999eabaf68a
data/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.1] - 2023-11-09
11
+
12
+ - Improve workstep transitions to return updated workstep
13
+
10
14
  ## [0.5.0] - 2023-11-06
11
15
 
12
16
  - Add support for worksteps and material requirements API
@@ -55,7 +59,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55
59
  - Update and reuse `zaikio-client-helpers` logic to support `Zaikio::Client.with_token`
56
60
  - Initial release
57
61
 
58
- [Unreleased]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.5.0..HEAD
62
+ [Unreleased]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.5.1..HEAD
63
+ [0.5.1]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.5.0..v0.5.1
64
+ [0.5.0]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.4.0..v0.5.0
59
65
  [0.4.0]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.4.0..v0.5.0
60
66
  [0.4.0]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.3.0..v0.4.0
61
67
  [0.3.0]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.2.5..v0.3.0
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Zaikio
4
4
  module Warehouse
5
- VERSION = "0.5.0"
5
+ VERSION = "0.5.1"
6
6
  end
7
7
  end
@@ -17,24 +17,28 @@ module Zaikio
17
17
  has_many :material_requirements, uri: nil, class_name: "Zaikio::Warehouse::MaterialRequirement"
18
18
 
19
19
  def prepare(params = {})
20
- response = self.class.send(:send_request, :post, "worksteps/#{id}/prepare", params)
21
- puts "response prepare: #{response.inspect}"
22
-
23
- raise InvalidTransition, response.body if (200..201).exclude?(response.status)
20
+ transition("prepare", params)
24
21
  end
25
22
 
26
23
  def start(params = {})
27
- response = self.class.send(:send_request, :post, "worksteps/#{id}/start", params)
28
- puts "response start: #{response.inspect}"
29
-
30
- raise InvalidTransition, response.body if (200..201).exclude?(response.status)
24
+ transition("start", params)
31
25
  end
32
26
 
33
27
  def complete(params = {})
34
- response = self.class.send(:send_request, :post, "worksteps/#{id}/complete", params)
35
- puts "response complete: #{response.inspect}"
28
+ transition("complete", params)
29
+ end
30
+
31
+ private
32
+
33
+ def transition(transition, params = {})
34
+ response = self.class.send(:send_request, :post, "worksteps/#{id}/#{transition}", params)
36
35
 
37
36
  raise InvalidTransition, response.body if (200..201).exclude?(response.status)
37
+
38
+ result = Spyke::Result.new_from_response(response)
39
+ self.attributes = result.data["workstep"].merge(
40
+ "material_requirements" => result.data["material_requirements"]
41
+ )
38
42
  end
39
43
  end
40
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-warehouse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zaikio GmbH
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-11-06 00:00:00.000000000 Z
12
+ date: 2023-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport