[#1946] Check if a dossier’s retention period has expired
This commit is contained in:
parent
b672377f5b
commit
43d8db88d9
2 changed files with 36 additions and 0 deletions
|
@ -183,6 +183,16 @@ class Dossier < ApplicationRecord
|
|||
brouillon? || en_construction?
|
||||
end
|
||||
|
||||
def retention_end_date
|
||||
if instruction_commencee?
|
||||
en_instruction_at + procedure.duree_conservation_dossiers_dans_ds.months
|
||||
end
|
||||
end
|
||||
|
||||
def retention_expired?
|
||||
instruction_commencee? && retention_end_date <= DateTime.now
|
||||
end
|
||||
|
||||
def text_summary
|
||||
if brouillon?
|
||||
parts = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue