ash-project / ash_paper_trail

The extension for keeping an audit log of changes to your Ash resources.
https://hexdocs.pm/ash_paper_trail
MIT License
32 stars 15 forks source link

feat: support atomic bulk actions #52

Open frankdugan3 opened 5 months ago

frankdugan3 commented 5 months ago

Is your feature request related to a problem? Please describe.

I have a number of bulk actions that require auditing and atomic actions w/ rollback. For example, a packing list form which updates the ownership of a number of scanned items.

The trouble is that AshPaperTrail currently interferes with atomicity. :full_diff tracking mode may not be possible currently, but :changes_only should be possible to support atomically.

Describe the solution you'd like

The change for create_new_version should be refactored for support of bulk/atomic operations where possible. Currently, this would probably exclude :full_diff tracking mode, supporting only :snapshot and :changes_only.

Describe alternatives you've considered