cats_core 1.4.28 → 1.4.31

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: f2cbd9de4f75e95103bf09a853e5d0098e925f6d63c058567657dca04c8e915e
4
- data.tar.gz: 39dc39668040493ad924ae291ea3f13b34b3644f113558274bbe8f15564d9f1b
3
+ metadata.gz: ee7760669a69dc6d1df8d3fe4cd79365ac759ab1ac8197e8d4e5020be437df17
4
+ data.tar.gz: 780bfaad187ab3c971cc1d073ff50e46702b2eaa46889fe3b2ea372f489751e4
5
5
  SHA512:
6
- metadata.gz: dca66c438930ac24dc216e3ef8f162bae9d0ef54442efaeb2139953379366e9fd93a3fd13ed08cc396f19b6383007f0cee5433ef69cdc863e39a96da92969f8c
7
- data.tar.gz: 22e99525720f4e34f0bae5fec105ebfaa80f28c73ce0b60c7323536e167bf54ef735969cafcd602124cfa148983207c9364707f62a4d74835d0fad597f85c793
6
+ metadata.gz: e02a405acb7159588c446fdfc5cfd396d539167fef0a7d41df8f2b8ced64894eb2a02f43e1d2e23fd7d84432c50b0d5cda0ab69c8cd051fe784ee8215ddd8364
7
+ data.tar.gz: ad68bf4257f469b9c4d5b5a2713d9dc13b908b02d0cfe7430e651332acea306868802250514679879ea432beb84f95c4148fb06b56c69d3ed0db954a42a2e0d2
@@ -9,7 +9,8 @@ module Cats
9
9
  validates :plan_item_id, uniqueness: { scope: :beneficiary_category_id }
10
10
 
11
11
  validates :rounds, presence: true, numericality: { greater_than: 0 }, if: :psnp?
12
- validates :rounds_served, presence: true, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true, if: :psnp?
12
+ validates :rounds_served, presence: true, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true,
13
+ if: :psnp?
13
14
  validates :rounds, :rounds_served, absence: true, unless: :psnp?
14
15
  validate :validate_rounds
15
16
 
@@ -80,6 +80,11 @@ module Cats
80
80
  end
81
81
 
82
82
  def stack
83
+ # check if all receipt transactions have been committed and change status
84
+ # of dispatch to stacked.
85
+ statuses = receipt_transactions.map(&:status).uniq
86
+ return unless statuses.length == 1 && statuses[0] == Transaction::COMMITTED
87
+
83
88
  self.dispatch_status = STACKED
84
89
  save!
85
90
  end
@@ -39,6 +39,7 @@ module Cats
39
39
  end
40
40
 
41
41
  authorization.transactions.each(&:commit)
42
+
42
43
  authorization.dispatch.stack
43
44
  authorization
44
45
  end
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.4.28'.freeze
3
+ VERSION = '1.4.31'.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.4.28
4
+ version: 1.4.31
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-05-30 00:00:00.000000000 Z
11
+ date: 2022-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers