implement first step - accepte without motivation and PJ

This commit is contained in:
Lisa Durand 2022-12-15 17:35:50 +01:00
parent 378f3c5fb0
commit d7ebb67889
15 changed files with 217 additions and 39 deletions

View file

@ -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