zaikio-warehouse 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/zaikio/warehouse/consumption_request.rb +3 -0
- data/lib/zaikio/warehouse/consumption_request_cancelation.rb +1 -0
- data/lib/zaikio/warehouse/material_requirement.rb +31 -0
- data/lib/zaikio/warehouse/transfer_request.rb +25 -0
- data/lib/zaikio/warehouse/transfer_request_cancelation.rb +24 -0
- data/lib/zaikio/warehouse/version.rb +1 -1
- data/lib/zaikio/warehouse/workstep.rb +41 -0
- data/lib/zaikio/warehouse.rb +4 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b27e4cb1d7c29e1f7066607d0ab7e7a4048c68a1a01a98fac834ce98511869eb
|
4
|
+
data.tar.gz: 1e9d184f6b06f1bc8f7e79a79223773892b750251209154b8e2738fe1ad31055
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b774df07a6af007f3213ccc2593d7b8a7cff6fc7f8c4ed23cf900adc8dcc997ff167bc51058a28c37de2da32a3e6d2d189373af939e5a3d2f12045e20ce667f
|
7
|
+
data.tar.gz: c6869a82225fb97df7d12736d8699519c2e3f979279e81f902441d8037ee56228dde49dcd01c53abc866b3329f5aabb3d012e45b47c1da2e2e889ef0fab66636
|
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.0] - 2023-11-06
|
11
|
+
|
12
|
+
- Add support for worksteps and material requirements API
|
13
|
+
|
10
14
|
## [0.4.0] - 2023-07-06
|
11
15
|
|
12
16
|
- Add `ConsumptionRequestTransfer` for new API
|
@@ -51,7 +55,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
51
55
|
- Update and reuse `zaikio-client-helpers` logic to support `Zaikio::Client.with_token`
|
52
56
|
- Initial release
|
53
57
|
|
54
|
-
[Unreleased]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.
|
58
|
+
[Unreleased]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.5.0..HEAD
|
59
|
+
[0.4.0]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.4.0..v0.5.0
|
55
60
|
[0.4.0]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.3.0..v0.4.0
|
56
61
|
[0.3.0]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.2.5..v0.3.0
|
57
62
|
[0.2.5]: https://github.com/zaikio/zaikio-warehouse-ruby/compare/v0.2.4..v0.2.5
|
@@ -16,6 +16,9 @@ module Zaikio
|
|
16
16
|
has_one :storage_area, uri: nil, class_name: "Zaikio::Warehouse::StorageArea"
|
17
17
|
has_one :person, uri: nil, class_name: "Zaikio::Warehouse::Person"
|
18
18
|
has_one :consumption_request_cancelation, uri: nil, class_name: "Zaikio::Warehouse::ConsumptionRequestCancelation"
|
19
|
+
has_one :consumption, uri: nil, class_name: "Zaikio::Warehouse::Consumption"
|
20
|
+
has_one :operator, uri: nil, class_name: "Zaikio::Warehouse::Organization"
|
21
|
+
has_one :material_requirement, uri: nil, class_name: "Zaikio::Warehouse::MaterialRequirement"
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
@@ -17,6 +17,7 @@ module Zaikio
|
|
17
17
|
has_one :storage_area, uri: nil, class_name: "Zaikio::Warehouse::StorageArea"
|
18
18
|
has_one :person, uri: nil, class_name: "Zaikio::Warehouse::Person"
|
19
19
|
has_one :consumption_request, uri: nil, class_name: "Zaikio::Warehouse::ConsumptionRequest"
|
20
|
+
has_one :material_requirement, uri: nil, class_name: "Zaikio::Warehouse::MaterialRequirement"
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Zaikio
|
4
|
+
module Warehouse
|
5
|
+
class MaterialRequirement < Base
|
6
|
+
include_root_in_json :material_requirement
|
7
|
+
|
8
|
+
uri "material_requirements(/:id)"
|
9
|
+
|
10
|
+
attributes :created_at, :updated_at, :reference, :reference_link,
|
11
|
+
:estimated_amount_in_base_unit, :planned_amount_in_base_unit,
|
12
|
+
:actual_amount_in_base_unit, :allocation_mode, :allocated_at,
|
13
|
+
:completed_at
|
14
|
+
|
15
|
+
has_one :operator, uri: nil, class_name: "Zaikio::Warehouse::Organization"
|
16
|
+
has_one :warehouse, uri: nil, class_name: "Zaikio::Warehouse::Warehouse"
|
17
|
+
has_one :workstep, uri: nil, class_name: "Zaikio::Warehouse::Workstep"
|
18
|
+
has_one :material, uri: nil, class_name: "Zaikio::Warehouse::Material"
|
19
|
+
has_many :open_consumption_requests, uri: nil, class_name: "Zaikio::Warehouse::ConsumptionRequest"
|
20
|
+
has_many :open_transfer_requests, uri: nil, class_name: "Zaikio::Warehouse::TransferRequest"
|
21
|
+
has_many :consumptions, uri: nil, class_name: "Zaikio::Warehouse::Consumption"
|
22
|
+
has_many :transfers, uri: nil, class_name: "Zaikio::Warehouse::Transfer"
|
23
|
+
has_many :deposits, uri: "material_requirements/:material_requirement_id/deposits",
|
24
|
+
class_name: "Zaikio::Warehouse::Deposit"
|
25
|
+
|
26
|
+
def deposit(params)
|
27
|
+
deposits.create(params)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Zaikio
|
4
|
+
module Warehouse
|
5
|
+
class TransferRequest < Base
|
6
|
+
disable_http_methods :patch, :put
|
7
|
+
include_root_in_json :transfer_request
|
8
|
+
|
9
|
+
uri "transfer_requests(/:id)"
|
10
|
+
|
11
|
+
attributes :transfer_reference, :transfer_reference_link, :transfer_client, :transfer_subject, :amount,
|
12
|
+
:amount_in_base_unit, :completed, :canceled, :executed, :created_at, :updated_at
|
13
|
+
|
14
|
+
has_one :material, uri: nil, class_name: "Zaikio::Warehouse::Material"
|
15
|
+
has_one :sku, uri: nil, class_name: "Zaikio::Warehouse::SKU"
|
16
|
+
has_one :source, uri: nil, class_name: "Zaikio::Warehouse::StorageArea"
|
17
|
+
has_one :target, uri: nil, class_name: "Zaikio::Warehouse::StorageArea"
|
18
|
+
has_one :person, uri: nil, class_name: "Zaikio::Warehouse::Person"
|
19
|
+
has_one :transfer, uri: nil, class_name: "Zaikio::Warehouse::Transfer"
|
20
|
+
has_one :transfer_request_cancelation, uri: nil, class_name: "Zaikio::Warehouse::TransferRequestCancelation"
|
21
|
+
has_one :operator, uri: nil, class_name: "Zaikio::Warehouse::Organization"
|
22
|
+
has_one :material_requirement, uri: nil, class_name: "Zaikio::Warehouse::MaterialRequirement"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Zaikio
|
4
|
+
module Warehouse
|
5
|
+
class TransferRequestCancelation < Base
|
6
|
+
disable_http_methods :patch, :put, :delete
|
7
|
+
include_root_in_json :transfer_request_cancelation
|
8
|
+
|
9
|
+
uri "transfer_request_cancelations(/:id)"
|
10
|
+
|
11
|
+
attributes :cancelation_reference, :cancelation_reference_link, :cancelation_client,
|
12
|
+
:cancelation_subject, :amount, :amount_in_base_unit, :created_at, :updated_at
|
13
|
+
|
14
|
+
has_one :material, uri: nil, class_name: "Zaikio::Warehouse::Material"
|
15
|
+
has_one :sku, uri: nil, class_name: "Zaikio::Warehouse::SKU"
|
16
|
+
has_one :source_storage_area, uri: nil, class_name: "Zaikio::Warehouse::StorageArea"
|
17
|
+
has_one :target_storage_area, uri: nil, class_name: "Zaikio::Warehouse::StorageArea"
|
18
|
+
has_one :person, uri: nil, class_name: "Zaikio::Warehouse::Person"
|
19
|
+
has_one :transfer, uri: nil, class_name: "Zaikio::Warehouse::Transfer"
|
20
|
+
has_one :transfer_request, uri: nil, class_name: "Zaikio::Warehouse::TransferRequest"
|
21
|
+
has_one :material_requirement, uri: nil, class_name: "Zaikio::Warehouse::MaterialRequirement"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Zaikio
|
4
|
+
module Warehouse
|
5
|
+
class Workstep < Base
|
6
|
+
class InvalidTransition < StandardError; end
|
7
|
+
include_root_in_json :workstep
|
8
|
+
|
9
|
+
uri "worksteps(/:id)"
|
10
|
+
|
11
|
+
attributes :created_at, :updated_at, :name, :phase, :reference,
|
12
|
+
:reference_link, :job_title, :job_reference, :job_reference_link,
|
13
|
+
:starting_at, :due_at, :allocated_at, :completed_at
|
14
|
+
|
15
|
+
has_one :operator, uri: nil, class_name: "Zaikio::Warehouse::Organization"
|
16
|
+
has_one :warehouse, uri: nil, class_name: "Zaikio::Warehouse::Warehouse"
|
17
|
+
has_many :material_requirements, uri: nil, class_name: "Zaikio::Warehouse::MaterialRequirement"
|
18
|
+
|
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)
|
24
|
+
end
|
25
|
+
|
26
|
+
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)
|
31
|
+
end
|
32
|
+
|
33
|
+
def complete(params = {})
|
34
|
+
response = self.class.send(:send_request, :post, "worksteps/#{id}/complete", params)
|
35
|
+
puts "response complete: #{response.inspect}"
|
36
|
+
|
37
|
+
raise InvalidTransition, response.body if (200..201).exclude?(response.status)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/zaikio/warehouse.rb
CHANGED
@@ -35,6 +35,10 @@ require "zaikio/warehouse/transfer"
|
|
35
35
|
require "zaikio/warehouse/warehouse"
|
36
36
|
require "zaikio/warehouse/withdrawal"
|
37
37
|
require "zaikio/warehouse/withdrawal_request"
|
38
|
+
require "zaikio/warehouse/workstep"
|
39
|
+
require "zaikio/warehouse/material_requirement"
|
40
|
+
require "zaikio/warehouse/transfer_request"
|
41
|
+
require "zaikio/warehouse/transfer_request_cancelation"
|
38
42
|
|
39
43
|
require "zaikio/warehouse/version"
|
40
44
|
|
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.
|
4
|
+
version: 0.5.0
|
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-
|
12
|
+
date: 2023-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- lib/zaikio/warehouse/manifest_entry.rb
|
235
235
|
- lib/zaikio/warehouse/material.rb
|
236
236
|
- lib/zaikio/warehouse/material_manifest_entry.rb
|
237
|
+
- lib/zaikio/warehouse/material_requirement.rb
|
237
238
|
- lib/zaikio/warehouse/material_reservation.rb
|
238
239
|
- lib/zaikio/warehouse/material_reservation_cancelation.rb
|
239
240
|
- lib/zaikio/warehouse/material_reservation_fulfillment.rb
|
@@ -244,10 +245,13 @@ files:
|
|
244
245
|
- lib/zaikio/warehouse/sku.rb
|
245
246
|
- lib/zaikio/warehouse/storage_area.rb
|
246
247
|
- lib/zaikio/warehouse/transfer.rb
|
248
|
+
- lib/zaikio/warehouse/transfer_request.rb
|
249
|
+
- lib/zaikio/warehouse/transfer_request_cancelation.rb
|
247
250
|
- lib/zaikio/warehouse/version.rb
|
248
251
|
- lib/zaikio/warehouse/warehouse.rb
|
249
252
|
- lib/zaikio/warehouse/withdrawal.rb
|
250
253
|
- lib/zaikio/warehouse/withdrawal_request.rb
|
254
|
+
- lib/zaikio/warehouse/workstep.rb
|
251
255
|
homepage: https://docs.zaikio.com/api/warehouse/warehouse.html
|
252
256
|
licenses:
|
253
257
|
- MIT
|