cats_core 1.5.10 → 1.5.12

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: 9b4bc4794cd5e6b77b2db5b95b9164ad5a6d3cd031a7ca32716586b4e89ff6d9
4
- data.tar.gz: d26bae7c4c4a290c17aeec1c4bb059809ca0b5112f46991f9aaad660868dac0f
3
+ metadata.gz: 276a2fded748139110b7415ef828d512d5c589f9363fc5519619d7fe5a02ddf7
4
+ data.tar.gz: c10be63fba572250f567c947c3bd09c06592d8ae1e323d60a0f3464c9796ed2f
5
5
  SHA512:
6
- metadata.gz: 0b60c83380471fb433a0a2a5174a676a23d633a622a8edefcb391b9555fc132a6fed25695a8bcd7fff771e4ac8c86318666a85b896f6e6eb8da2a244c0546936
7
- data.tar.gz: 55d298f3113118d57864e4e67bdf5d9a8960061e2b1b24d7651b0ca8e63b2d8e619f52230c88181239ef9b4a010a7f1dc36dbe8650bcb2318ba8a736487d5faf
6
+ metadata.gz: cb500f43316387c327ec23d75c514b96e707b81b839fa690578261d9b1be74ddc4bed2d9fc1cb2796d7bb210b434ce4443cd17e37da0b946345d217289f6957c
7
+ data.tar.gz: a8bed5ed9018d105a24cd701ef904a11d067513901be84354df3619d2b02ab0a191f23fc59234aa656b44b5c81f06b53c22c18eea3df9df3701bff9b66590b30
@@ -24,6 +24,12 @@ module Cats
24
24
  service = StackService.new
25
25
  dispatch = Dispatch.find(params[:id])
26
26
  stacks = service.dispatch_stacks(dispatch)
27
+
28
+ # Filter for current user
29
+ if current_user.details.key?('stores')
30
+ stores = current_user.details['stores']
31
+ stacks = stacks.select { |stack| stores.include?(stack.store_id) }
32
+ end
27
33
  render json: { success: true, data: serialize(stacks) }
28
34
  end
29
35
 
@@ -9,6 +9,7 @@ module Cats
9
9
  validates :beneficiary_round_plan_item_id, uniqueness: { scope: :round_ration_id }
10
10
 
11
11
  delegate(:abbreviation, to: :unit, prefix: true)
12
+ delegate(:commodity_category_name, to: :round_ration, prefix: false)
12
13
  end
13
14
  end
14
15
  end
@@ -48,7 +48,7 @@ module Cats
48
48
  stores = Store.where(warehouse: warehouses)
49
49
 
50
50
  commodity = dispatch.dispatch_plan_item.commodity
51
- Stack.where(commodity: commodity, store: stores)
51
+ Stack.where(commodity: commodity, store: stores, stack_status: Stack::ALLOCATED)
52
52
  end
53
53
  end
54
54
  end
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.5.10'.freeze
3
+ VERSION = '1.5.12'.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.5.10
4
+ version: 1.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-06 00:00:00.000000000 Z
11
+ date: 2022-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers