Skip to content

feat: expose the champs changed in a correction via a traitement checkpoint#13235

Merged
tchak merged 2 commits into
mainfrom
push-nxrnqluquupo
Jun 17, 2026
Merged

feat: expose the champs changed in a correction via a traitement checkpoint#13235
tchak merged 2 commits into
mainfrom
push-nxrnqluquupo

Conversation

@tchak

@tchak tchak commented Jun 3, 2026

Copy link
Copy Markdown
Member

When a dossier is corrected (by the usager or an instructeur), the champs moved out of the buffer stream are now tagged with the history stream id as a "checkpoint", and that same id is stored on the resulting traitement. This links each correction traitement to the exact set of champs it changed.

  • Add a checkpoint column to champs and traitements.
  • merge_user/instructeur_buffer_stream! returns the history stream id and stamps the moved champs with it; submit helpers thread it onto the traitement.
  • Introduce ChangedColumn, which diffs the checkpointed champs against their reference values and yields displayable columns with their new values (handling repetitions).
  • Traitement#changed_columns / #has_changes? surface a correction's changes, and Dossier#user_changed_columns / #instructeur_changed_columns expose pending buffer changes.
  • Expose changedColumns on the GraphQL Traitement type.

@tchak
tchak force-pushed the push-nxrnqluquupo branch 2 times, most recently from 4614f85 to 2606662 Compare June 3, 2026 12:45

@mfo mfo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pas de bug, mais des proposition de refactoring. a prendre ou a laisser

Comment thread app/graphql/types/traitement_type.rb Outdated
Comment thread app/models/concerns/dossier_state_concern.rb Outdated
Comment thread app/controllers/users/dossiers_controller.rb Outdated
Comment thread app/controllers/users/dossiers_controller.rb
Comment thread app/models/concerns/dossier_state_concern.rb Outdated
Comment thread app/models/changed_column.rb
@tchak
tchak force-pushed the push-nxrnqluquupo branch 11 times, most recently from a57a78f to 0149996 Compare June 16, 2026 11:30
Comment thread app/components/dossiers/changes_component/changes_component.html.erb Outdated
Comment thread app/components/dossiers/changes_component.rb
Comment thread app/components/dossiers/changes_component.rb
Comment thread app/components/dossiers/changes_component.rb Outdated
lines << diff_line(t('.removed_values'), removed) if removed.present?
return tag.em(t('.changed')) if lines.empty?

safe_join(lines, tag.br)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrggsshhhhh le br

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oui, mais je ne sais pas trop comment s'en sortir ici. Nous sommes déjà à l'intérieur d'un dd

@tchak
tchak force-pushed the push-nxrnqluquupo branch from 0149996 to 9b4153f Compare June 16, 2026 13:05
Comment thread app/models/types_de_champ/type_de_champ_base.rb
Comment thread app/models/types_de_champ/repetition_type_de_champ.rb
Comment thread app/models/types_de_champ/piece_justificative_type_de_champ.rb
Comment thread app/models/types_de_champ/linked_drop_down_list_type_de_champ.rb
Comment thread app/models/types_de_champ/carte_type_de_champ.rb
@tchak
tchak force-pushed the push-nxrnqluquupo branch 2 times, most recently from 7414874 to 39275c9 Compare June 16, 2026 13:43
tchak and others added 2 commits June 17, 2026 14:36
…kpoint

When a dossier is corrected (by the usager or an instructeur), the champs
moved out of the buffer stream are now tagged with the history stream id as a
"checkpoint", and that same id is stored on the resulting traitement. This
links each correction traitement to the exact set of champs it changed.

- Add a `checkpoint` column to `champs` and `traitements`.
- `merge_user/instructeur_buffer_stream!` returns the history stream id and
  stamps the moved champs with it; submit helpers thread it onto the traitement.
- Introduce `ChangedColumn`, which diffs the checkpointed champs against their
  reference values and yields displayable columns with their new values
  (handling repetitions).
- `Traitement#changed_columns` / `#has_changes?` surface a correction's changes,
  and `Dossier#user_changed_columns` / `#instructeur_changed_columns` expose
  pending buffer changes.
- Expose `changedColumns` on the GraphQL `Traitement` type.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tchak
tchak force-pushed the push-nxrnqluquupo branch from 39275c9 to 116f8c4 Compare June 17, 2026 12:36
@tchak
tchak enabled auto-merge June 17, 2026 12:37
@tchak
tchak added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit 4cd0bdb Jun 17, 2026
20 checks passed
@tchak
tchak deleted the push-nxrnqluquupo branch June 17, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants