Show Entity-Change-History in Page for the user to review

Hello,  I’m building an App where the user fills a form to create an entity. The created entity has three different statuses: Cached, Sent, Approved. Once the form is filled, the entity is cached. Once it is internally reviewed, it is sent to the customer. Once it is reviewed by the customer, it is approved.  I want to add a button, which (on click) shows a page where the status-history is shown: It should show the username, the time and date, and the status of the associated entity. I have no idea how to implement this. Thank you in advance for your help!
1 answers

There’s multiple ways you can do this.

You could implement the audit trail module from the appstore:

But i think that you don’t need all of that just for your usecase.

Or you can keep a seperate logging/history entity in your domain model where whenever you commit a changed object of the type that you want to log. You create a new log/history object which you associate with the object which has changed. And you log which status was the old one, which is the new one, a datetime, and the name of the currently logged in user (as attributes on the log/history object)

On click of the button all you need to do is show a page which retrieves the log/history objects associated with your object sorted by datetime.

You basically already wrote the solution yourself.