mercredi 16 novembre 2022

Database design for request / approval process and logging any changes to request ( Vue / Laravel / Oracle )

Sup.

I'm tasked with making an ER Diagram in UML notation for my job. I've hit a problem that I can't find the best way to implement. I'd like some advice from people that are way smarter than me haha.

I'm going to simplify the architecture obviously to not give away exact information and the schema, but I'll try my best.

Let's say you have Users that can request services. A service can have 0, 1, or Many fees attached to it. Before the changes are committed to the database, it needs to be approved. (simplified structure so far). OK so that's easy enough, but here's where it gets weird...

On a request, we're allowing it to be editable. So before the validation process is complete, another user can EDIT the request. This is also logged. To give some working environment background, I'm using Laravel 9, Vue and Oracle Database.

I'm using this Audit Plugin. So I do have an audits table.

I guess what I'm asking is how would you implement this? How does the table structure look? Should I create custom audits? but if I create a custom audit of a request in the audit table, wouldn't that mean I'd have to create an audit of an audit if I want to edit it? I'm open to completely scrapping the auditing and making a custom auditing procedure for this functionality alone... I just need to know the best way to accomplish this.

Thanks! If you need any more info, I'll try to answer it as best I can without breaking confidentiality rules lol.

What I've tried

So, I like how the Auditing plugin allows for Old/New values to be in JSON strings. That takes up a lot less space. The problem is that the new values can be changed as a request should be able to be changed per the requirements. This is also logged. That means if I do this, I have to log the changes of a JSON string if I just add the auditing plugin to the request and fee models? I know it's DOABLE but I just want best practices.

Sorry if that doesn't make sense or I explained badly. Trying my best.

Aucun commentaire:

Enregistrer un commentaire