501stLegionA3 / FiveOhFirstDataCore

A Web App designed to manage the 501st Legion StarSim Roster.
https://dc.501stlegion-a3.com/
MIT License
8 stars 12 forks source link

Edit History Service #400

Closed Soyvolon closed 2 years ago

Soyvolon commented 2 years ago

Summary

A service to record changes that are made on the website, and handle undoing/redoing the changes.

Details

This service would support a single base class that has methods to override for undo and redo. The service itself would only handle adding to the undo/redo stack and popping items from it when requested.

If the redo stack has items in it when a new item is added to the undo stack, clear the redo stack.

There will be no database storage for these edit stacks. Upon a page reload, all data is cleared.

Individual child classes handle making the proper calls to undo and redo changes. Some actions may need to change the database or call other services. A IServiceCollection (or one of its scopes) will be passed as the only parameter to the method. All other data should come from the class itself.