cats_core 1.1.26 → 1.1.30
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/app/models/cats/core/receipt_transaction.rb +10 -0
- data/app/serializers/cats/core/commodity_category_serializer.rb +6 -2
- data/app/serializers/cats/core/currency_serializer.rb +6 -2
- data/app/serializers/cats/core/dispatch_serializer.rb +9 -5
- data/app/serializers/cats/core/dispatch_transaction_serializer.rb +7 -3
- data/app/serializers/cats/core/location_serializer.rb +6 -2
- data/app/serializers/cats/core/receipt_serializer.rb +7 -3
- data/app/serializers/cats/core/receipt_transaction_serializer.rb +9 -5
- data/app/serializers/cats/core/role_serializer.rb +6 -2
- data/app/serializers/cats/core/unit_of_measure_serializer.rb +6 -2
- data/app/serializers/cats/core/user_serializer.rb +6 -2
- data/app/services/cats/core/receipt_service.rb +1 -8
- data/lib/cats/core/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13f0bbe36a351142a7de75a500557cc117ab5bbbefda056ed4d18e5e66daf5f4
|
4
|
+
data.tar.gz: 0a4e5382aaa43a8485b7db31121f1e0b5b524616e1404ed3ce9327d815e459fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c09413b96216242e58a76a65e923d9a32a244df5ec558123350a6b7e445fc378b8a8f1ea997f1998a145be4bb57571205d48232bf78c849d27ac3ac8b87ba50b
|
7
|
+
data.tar.gz: b026966a9a06fba9e3f37308528957d6011d89bbf4f403a93e31e7586c1fa78514da27515c1ba4a9a92ded6a2c08eec9a43e0a563b90f11dd1a912537dcba151
|
@@ -5,6 +5,16 @@ module Cats
|
|
5
5
|
belongs_to :destination, class_name: 'Cats::Core::Stack'
|
6
6
|
|
7
7
|
delegate(:code, to: :destination, prefix: true)
|
8
|
+
|
9
|
+
def commit
|
10
|
+
ReceiptTransaction.transaction do
|
11
|
+
destination.quantity += quantity
|
12
|
+
destination.stack_status = Cats::Core::Stack::ALLOCATED
|
13
|
+
destination.save
|
14
|
+
self.status = COMMITTED
|
15
|
+
save!
|
16
|
+
end
|
17
|
+
end
|
8
18
|
end
|
9
19
|
end
|
10
20
|
end
|
@@ -1,3 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class CommodityCategorySerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :code, :name, :description, :parent_id
|
5
|
+
end
|
6
|
+
end
|
3
7
|
end
|
@@ -1,8 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class DispatchSerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :reference_no, :allocation_item_id, :transporter_id, :transporter_name, :plate_no, :driver_name,
|
5
|
+
:driver_phone, :quantity, :remark, :prepared_by_id, :prepared_by_email, :dispatch_status, :destination
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
+
def destination
|
8
|
+
object.allocation_item.destination.name
|
9
|
+
end
|
10
|
+
end
|
7
11
|
end
|
8
12
|
end
|
@@ -1,4 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class DispatchTransactionSerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :source_id, :source_code, :destination_id, :destination_reference_no, :quantity,
|
5
|
+
:transaction_date, :status
|
6
|
+
end
|
7
|
+
end
|
4
8
|
end
|
@@ -1,3 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class LocationSerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :code, :name, :location_type, :description, :parent_id
|
5
|
+
end
|
6
|
+
end
|
3
7
|
end
|
@@ -1,4 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class ReceiptSerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :dispatch_id, :dispatch_reference_no, :commodity_status, :quantity, :status, :remark,
|
5
|
+
:prepared_by_id, :prepared_by_email
|
6
|
+
end
|
7
|
+
end
|
4
8
|
end
|
@@ -1,8 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class ReceiptTransactionSerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :source_id, :dispatch_reference, :destination_id, :destination_code, :quantity, :transaction_date,
|
5
|
+
:status
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
+
def dispatch_reference
|
8
|
+
object.source.dispatch.reference_no
|
9
|
+
end
|
10
|
+
end
|
7
11
|
end
|
8
12
|
end
|
@@ -1,3 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class UserSerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :first_name, :last_name, :email, :phone_number, :active, :details, :application_module_id
|
5
|
+
end
|
6
|
+
end
|
3
7
|
end
|
@@ -17,14 +17,7 @@ module Cats
|
|
17
17
|
end
|
18
18
|
|
19
19
|
receipt.status = Cats::Core::Receipt::STACKED
|
20
|
-
|
21
|
-
stacks.each { |stack| stack.stack_status = Cats::Core::Stack::ALLOCATED }
|
22
|
-
|
23
|
-
Cats::Core::Receipt.transaction do
|
24
|
-
receipt.receipt_transactions.each(&:commit)
|
25
|
-
stacks.each(&:save!)
|
26
|
-
receipt.save!
|
27
|
-
end
|
20
|
+
receipt.receipt_transactions.each(&:commit)
|
28
21
|
receipt
|
29
22
|
end
|
30
23
|
end
|
data/lib/cats/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cats_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -409,7 +409,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
409
409
|
- !ruby/object:Gem::Version
|
410
410
|
version: '0'
|
411
411
|
requirements: []
|
412
|
-
rubygems_version: 3.2.
|
412
|
+
rubygems_version: 3.2.22
|
413
413
|
signing_key:
|
414
414
|
specification_version: 4
|
415
415
|
summary: Core module for CATS applications
|