tramway-event 1.8.1.1 → 1.8.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5574ae2ac3d78c3ff39aa5c25dae378d511a219e6b568ed69cd8a02fc50913be
4
- data.tar.gz: 2d0fcd012e31b8a0968df194d630908ab97f529c6a5adaa5259323fdad59f8cd
3
+ metadata.gz: d91a1dc4a7e517bffc4a29b0a7785406e853a253e7994b9f84b3612aaf174184
4
+ data.tar.gz: ac9725effcbcce5644cf1dbb19835052071345d9a23a069f64da3f49b8ee3e39
5
5
  SHA512:
6
- metadata.gz: d19722a1145d77d7c98ad8c0b6b19dfbf9a65973ba6ecf4a7ea2f96e2086ea5cefa8eb6f54927290a4b0886071bcdb75b4ca5faecc606b3a49a0b2cb70882e69
7
- data.tar.gz: 74cbd149d2151dff70f7b9221db9d4b9697165e639821841ed9c8b2ac2b716acf9470ca194d9189eefcf6d6512c68e7f7607c8b23bf4911068fd3aa87664a7eb
6
+ metadata.gz: 73cb708fad65283d4add750f5876492b09bb6dba4244a64ba322ef8dbfcbf77ca82315a3d419bbece16fa4eb5f34188e0c184a7ad712c0b49420573b5fc434b1
7
+ data.tar.gz: 3ded032babbcd3f735c6b021436911c5bfdd70545fc58baa81b993a1003d2ca9659b0e1e3a33b66eda0f412416c4da695817253571f954f88f507ada51c6c6db
@@ -1,7 +1,7 @@
1
1
  class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorator
2
2
  class << self
3
3
  def collections
4
- [ :requested, :waiting, :prev_approved, :without_answer, :approved, :rejected, :all ]
4
+ [ :requested, :waiting, :prev_approved, :without_answer, :approved, :rejected, :reserved, :all ]
5
5
  end
6
6
 
7
7
  def list_attributes
@@ -69,6 +69,8 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
69
69
  :warning
70
70
  when :reject
71
71
  :danger
72
+ when :reserve
73
+ :warning
72
74
  end
73
75
  end
74
76
  end
@@ -8,6 +8,7 @@ class Tramway::Event::Participant < ::Tramway::Event::ApplicationRecord
8
8
  state :rejected
9
9
  state :approved
10
10
  state :without_answer
11
+ state :reserved
11
12
 
12
13
  event :previous_approve do
13
14
  transition [ :requested, :without_answer, :waiting ] => :prev_approved
@@ -22,12 +23,16 @@ class Tramway::Event::Participant < ::Tramway::Event::ApplicationRecord
22
23
  end
23
24
 
24
25
  event :approve do
25
- transition prev_approved: :approved
26
+ transition [ :prev_approved, :reserved ] => :approved
26
27
  end
27
28
 
28
29
  event :not_got_answer do
29
30
  transition requested: :without_answer
30
31
  end
32
+
33
+ event :reserve do
34
+ transition [ :requested, :without_answer, :waiting ] => :reserved
35
+ end
31
36
  end
32
37
 
33
38
  scope :requested, -> { where participation_state: :requested }
@@ -36,4 +41,5 @@ class Tramway::Event::Participant < ::Tramway::Event::ApplicationRecord
36
41
  scope :rejected, -> { where participation_state: :rejected }
37
42
  scope :approved, -> { where participation_state: :approved }
38
43
  scope :without_answer, -> { where participation_state: :without_answer }
44
+ scope :reserved, -> { where participation_state: :reserved }
39
45
  end
@@ -54,4 +54,5 @@ ru:
54
54
  rejected: Отклонены
55
55
  approved: Окончательно подтверждены
56
56
  without_answer: Не ответили
57
+ reserved: В резерве
57
58
 
@@ -14,9 +14,11 @@ ru:
14
14
  rejected: Заявка отклонена
15
15
  approved: Окончательное подтверждение
16
16
  without_answer: Без ответа
17
+ reserved: В резерве
17
18
  events:
18
19
  previous_approve: Предварительно подтвердить
19
20
  wait_for_decision: Ожидать ответа
20
21
  reject: Отклонить
21
22
  approve: Окончательно подтвердить
22
23
  not_got_answer: Связаться не удалось
24
+ reserve: Отправить в резерв
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.8.1.1'
3
+ VERSION = '1.8.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov