cats_core 1.1.25 → 1.1.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3babdd4703726f7863d05d4b939af06ede31f1b6a0a5a715ad0f13286ea8343a
4
- data.tar.gz: 44ed3f59a6099ba17094b8d81232c9e8cf72c6ac95118da99e1e8a23286bebf7
3
+ metadata.gz: bb380491b61a7969316bce920572048d8654e059ea310880d6c7919ec3797dd9
4
+ data.tar.gz: 8650f299e8e221842a6c1c88b1e603e0b78acf709c8731b61743e82454d64e49
5
5
  SHA512:
6
- metadata.gz: 82195965fd9917d53ff286e1d2822302f87c9ecf836b292dc8d647eef5f307a9f84d692b4dd5ff4d6a16dc1c21e9c52109966c39d459052f918cd9ad73c6914b
7
- data.tar.gz: f7c58b63d4e6f66b9ba3011a7066175052b5e6aa92c13339d5d975cf3567108c405e5bfb571bd527c8d12f3b24b6d8ba8924f67134c2f28d5941958a9ba2fb89
6
+ metadata.gz: 1700fa7100a312a136579defe9782a1c4a919c488cb44c25d899f1cfc72ce6ac94a50e677aa521c2b600fa672b44fe89213db5e947fefe77c24861686f75db3b
7
+ data.tar.gz: '08df5a63ebfa01ad0f2c47094b81d9fa0e2546b37ab5704e8882c09aa6ac949cee80682cf50a3dac84e52dd149ea9a0fb10f0e1b3d346968f8f5641bb16abb48'
@@ -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
- class CommodityCategorySerializer < ActiveModel::Serializer
2
- attributes :id, :code, :name, :description, :parent_id
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,3 +1,7 @@
1
- class CurrencySerializer < ActiveModel::Serializer
2
- attributes :id, :code, :name
1
+ module Cats
2
+ module Core
3
+ class CurrencySerializer < ActiveModel::Serializer
4
+ attributes :id, :code, :name
5
+ end
6
+ end
3
7
  end
@@ -1,8 +1,12 @@
1
- class DispatchSerializer < ActiveModel::Serializer
2
- attributes :id, :reference_no, :allocation_item_id, :transporter_id, :transporter_name, :plate_no, :driver_name,
3
- :driver_phone, :quantity, :remark, :prepared_by_id, :prepared_by_email, :dispatch_status, :destination
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
- def destination
6
- object.allocation_item.destination.name
7
+ def destination
8
+ object.allocation_item.destination.name
9
+ end
10
+ end
7
11
  end
8
12
  end
@@ -1,4 +1,8 @@
1
- class DispatchTransactionSerializer < ActiveModel::Serializer
2
- attributes :id, :source_id, :source_code, :destination_id, :destination_reference_no, :quantity, :transaction_date,
3
- :status
1
+ module Cats
2
+ module Core
3
+ class DispatchTransactionSerializer < ActiveModel::Serializer
4
+ attributes :id, :source_id, :source_code, :destination_id, :destination_reference_no, :quantity, :transaction_date,
5
+ :status
6
+ end
7
+ end
4
8
  end
@@ -1,3 +1,7 @@
1
- class LocationSerializer < ActiveModel::Serializer
2
- attributes :id, :code, :name, :location_type, :description, :parent_id
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
- class ReceiptSerializer < ActiveModel::Serializer
2
- attributes :id, :dispatch_id, :dispatch_reference_no, :commodity_status, :quantity, :status, :remark,
3
- :prepared_by_id, :prepared_by_email
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
- class ReceiptTransactionSerializer < ActiveModel::Serializer
2
- attributes :id, :source_id, :dispatch_reference, :destination_id, :destination_code, :quantity, :transaction_date,
3
- :status
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
- def dispatch_reference
6
- object.source.dispatch.reference_no
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
- class RoleSerializer < ActiveModel::Serializer
2
- attributes :id, :name, :application_module_id
1
+ module Cats
2
+ module Core
3
+ class RoleSerializer < ActiveModel::Serializer
4
+ attributes :id, :name, :application_module_id
5
+ end
6
+ end
3
7
  end
@@ -1,3 +1,7 @@
1
- class UnitOfMeasureSerializer < ActiveModel::Serializer
2
- attributes :id, :abbreviation, :name, :unit_type
1
+ module Cats
2
+ module Core
3
+ class UnitOfMeasureSerializer < ActiveModel::Serializer
4
+ attributes :id, :abbreviation, :name, :unit_type
5
+ end
6
+ end
3
7
  end
@@ -1,3 +1,7 @@
1
- class UserSerializer < ActiveModel::Serializer
2
- attributes :id, :first_name, :last_name, :email, :phone_number, :active, :details, :application_module_id
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
- stacks = receipt.receipt_transactions.map(&:destination)
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
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.1.25'.freeze
3
+ VERSION = '1.1.29'.freeze
4
4
  end
5
5
  end
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.25
4
+ version: 1.1.29
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-06 00:00:00.000000000 Z
11
+ date: 2021-10-10 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.15
412
+ rubygems_version: 3.2.22
413
413
  signing_key:
414
414
  specification_version: 4
415
415
  summary: Core module for CATS applications