Help needed: Advice on how to add an approval system to an existing app?

Hi,

I need to add an “approval system” to an existing app and I’m looking for general guidance/best practices.

The app writes data to about 15 tables and I’m not sure how to structure the approval system/workflow around it.

What I have: A CRUD app that lets all users add data to the app.

What I need: When a user that isn’t an approver adds a row that row should be visible in the app, but marked (lets say in red) until an approver approves it.

Thoughts: I could add a the following fields to all tables: “approval_state”, “approved_by” and then have a second app that approvers can use to approve those rows.

Issues: I’m simply not sure if there is an easier way to do this? A lot of the changes depend on another entity existing, so they’d need to be approved in the right order, which makes the approval process error prone. If a user adds a company and a bank account and during approval it is discovered, that the user entered the wrong company name and the right bank account the approver can’t approve the bank account without also approving the (incorrect) company.

And even if both changes are correct (correct new company and correct bank account) the order in which the changes are persisted to the database matter.

If you have any ideas/hints, please let me hear them! :slight_smile:

Thanks for posting it here, @dakes! Leaving the floor open for the community to chime in with their ideas. :raising_hands: