implement first step - accepte without motivation and PJ
This commit is contained in:
parent
378f3c5fb0
commit
d7ebb67889
15 changed files with 217 additions and 39 deletions
|
@ -18,7 +18,8 @@
|
|||
class BatchOperation < ApplicationRecord
|
||||
enum operation: {
|
||||
archiver: 'archiver',
|
||||
passer_en_instruction: 'passer_en_instruction'
|
||||
passer_en_instruction: 'passer_en_instruction',
|
||||
accepter: 'accepter'
|
||||
}
|
||||
|
||||
has_many :dossiers, dependent: :nullify
|
||||
|
@ -53,6 +54,8 @@ class BatchOperation < ApplicationRecord
|
|||
query.not_archived.state_termine
|
||||
when BatchOperation.operations.fetch(:passer_en_instruction) then
|
||||
query.state_en_construction
|
||||
when BatchOperation.operations.fetch(:accepter) then
|
||||
query.state_en_instruction
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -67,6 +70,8 @@ class BatchOperation < ApplicationRecord
|
|||
dossier.archiver!(instructeur)
|
||||
when BatchOperation.operations.fetch(:passer_en_instruction)
|
||||
dossier.passer_en_instruction(instructeur: instructeur)
|
||||
when BatchOperation.operations.fetch(:accepter)
|
||||
dossier.accepter(instructeur: instructeur)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue