-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[usager] Laisser un délai avant suppression des dossiers expirés #10488
Changes from all commits
c2abcea
8b88faf
9346020
2d66a67
1441855
0bf1790
954ab39
0dcdcb5
eb3b928
94e1f04
df13e53
5c26073
ae1a6e1
b820577
7da3e05
4b1e743
4f7b0c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class DossierProjectionService | ||
class DossierProjection < Struct.new(:dossier_id, :state, :archived, :hidden_by_user_at, :hidden_by_administration_at, :for_tiers, :prenom, :nom, :batch_operation_id, :sva_svr_decision_on, :corrections, :columns) do | ||
class DossierProjection < Struct.new(:dossier_id, :state, :archived, :hidden_by_user_at, :hidden_by_administration_at, :hidden_by_reason, :for_tiers, :prenom, :nom, :batch_operation_id, :sva_svr_decision_on, :corrections, :columns) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. je pense qu'il faut ajouter ici There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tu veux dire There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ca me va de conserver la |
||
def pending_correction? | ||
return false if corrections.blank? | ||
|
||
|
@@ -44,13 +44,14 @@ def self.project(dossiers_ids, fields) | |
batch_operation_field = { TABLE => 'self', COLUMN => 'batch_operation_id' } | ||
hidden_by_user_at_field = { TABLE => 'self', COLUMN => 'hidden_by_user_at' } | ||
hidden_by_administration_at_field = { TABLE => 'self', COLUMN => 'hidden_by_administration_at' } | ||
hidden_by_reason_field = { TABLE => 'self', COLUMN => 'hidden_by_reason' } | ||
for_tiers_field = { TABLE => 'self', COLUMN => 'for_tiers' } | ||
individual_first_name = { TABLE => 'individual', COLUMN => 'prenom' } | ||
individual_last_name = { TABLE => 'individual', COLUMN => 'nom' } | ||
sva_svr_decision_on_field = { TABLE => 'self', COLUMN => 'sva_svr_decision_on' } | ||
dossier_corrections = { TABLE => 'dossier_corrections', COLUMN => 'resolved_at' } | ||
champ_value = champ_value_formatter(dossiers_ids, fields) | ||
([state_field, archived_field, sva_svr_decision_on_field, hidden_by_user_at_field, hidden_by_administration_at_field, for_tiers_field, individual_first_name, individual_last_name, batch_operation_field, dossier_corrections] + fields) # the view needs state and archived dossier attributes | ||
([state_field, archived_field, sva_svr_decision_on_field, hidden_by_user_at_field, hidden_by_administration_at_field, hidden_by_reason_field, for_tiers_field, individual_first_name, individual_last_name, batch_operation_field, dossier_corrections] + fields) | ||
.each { |f| f[:id_value_h] = {} } | ||
.group_by { |f| f[TABLE] } # one query per table | ||
.each do |table, fields| | ||
|
@@ -73,7 +74,7 @@ def self.project(dossiers_ids, fields) | |
.pluck(:id, *fields.map { |f| f[COLUMN].to_sym }) | ||
.each do |id, *columns| | ||
fields.zip(columns).each do |field, value| | ||
if [state_field, archived_field, hidden_by_user_at_field, hidden_by_administration_at_field, for_tiers_field, batch_operation_field, sva_svr_decision_on_field].include?(field) | ||
if [state_field, archived_field, hidden_by_user_at_field, hidden_by_administration_at_field, hidden_by_reason_field, for_tiers_field, batch_operation_field, sva_svr_decision_on_field].include?(field) | ||
field[:id_value_h][id] = value | ||
else | ||
field[:id_value_h][id] = value&.strftime('%d/%m/%Y') # other fields are datetime | ||
|
@@ -150,6 +151,7 @@ def self.project(dossiers_ids, fields) | |
archived_field[:id_value_h][dossier_id], | ||
hidden_by_user_at_field[:id_value_h][dossier_id], | ||
hidden_by_administration_at_field[:id_value_h][dossier_id], | ||
hidden_by_reason_field[:id_value_h][dossier_id], | ||
for_tiers_field[:id_value_h][dossier_id], | ||
individual_first_name[:id_value_h][dossier_id], | ||
individual_last_name[:id_value_h][dossier_id], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merci d'avoir renommé !