feat(sva): exports include SVA devision date
This commit is contained in:
parent
e74f4db8c8
commit
8c49dcf21e
3 changed files with 14 additions and 1 deletions
|
@ -1183,10 +1183,11 @@ class Dossier < ApplicationRecord
|
|||
['Dernière mise à jour le', :updated_at],
|
||||
['Déposé le', :depose_at],
|
||||
['Passé en instruction le', :en_instruction_at],
|
||||
procedure.sva_svr_enabled? ? ["Date #{procedure.sva_svr_configuration.human_decision}", :sva_svr_decision_on] : nil,
|
||||
['Traité le', :processed_at],
|
||||
['Motivation de la décision', :motivation],
|
||||
['Instructeurs', followers_instructeurs.map(&:email).join(' ')]
|
||||
]
|
||||
].compact
|
||||
|
||||
if procedure.routing_enabled?
|
||||
columns << ['Groupe instructeur', groupe_instructeur.label]
|
||||
|
|
|
@ -20,6 +20,12 @@ class SVASVRConfiguration
|
|||
UNIT_OPTIONS
|
||||
end
|
||||
|
||||
def human_decision
|
||||
return if decision == 'disabled'
|
||||
|
||||
decision.upcase
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def enabled?
|
||||
|
|
|
@ -1871,6 +1871,12 @@ describe Dossier, type: :model do
|
|||
let(:dossier) { create(:dossier) }
|
||||
|
||||
it { expect(dossier.spreadsheet_columns(types_de_champ: [])).to include(["État du dossier", "Brouillon"]) }
|
||||
|
||||
context 'procedure sva' do
|
||||
let(:dossier) { create(:dossier, :en_instruction, procedure: create(:procedure, :sva)) }
|
||||
|
||||
it { expect(dossier.spreadsheet_columns(types_de_champ: [])).to include(["Date SVA", :sva_svr_decision_on]) }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#processed_in_month' do
|
||||
|
|
Loading…
Reference in a new issue