feat(sva): exports include SVA devision date

This commit is contained in:
Colin Darie 2023-06-22 12:06:38 +02:00
parent e74f4db8c8
commit 8c49dcf21e
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
3 changed files with 14 additions and 1 deletions

View file

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

View file

@ -20,6 +20,12 @@ class SVASVRConfiguration
UNIT_OPTIONS
end
def human_decision
return if decision == 'disabled'
decision.upcase
end
private
def enabled?

View file

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