Ideas for Approval Matrix in CI |
Hi,
Need help. Can't think on how I can handle this problem. I need an approval matrix system. Here's the plan: I have 4 users, "QA", "Team Lead", "Manager", "Human Resource"
My first idea was to use a JSON string instead of creating a separate columns for them. After the QA created a form, I will create an array of approval matrix then save as JSON. But I think this idea is bad. The next idea was to create a new table and create a column for the approval structure/matrix. I will name them descriptively (is that the right term?) Code: Table Name: tbl_approval_matrix And also the form should go back one step backward if rejected (ex: HR rejected the form, the form should return to Manager for review) Sorry for my bad English. I don't have any ideas right now and I only have 1 week to finish this approval matrix. And by the way, while I'm typing this, I'm on PANIC MODE. Thank you for the help. Hope you understand my bad English.
There's one problem with having matrix - these flows can change, and this is where more flexibility will pay off, god knows I've paid the price of having to re-write simple solutions quite few times.
It's probably slightly more work at first, but here's how I would do it. Have table with different phases / states: 1 - teamlead approval 2 - manager approval 3 - hr approval ... 10 - approved Then, I add current state ID to form table, it starts with 1, and you can easily query DB to get all "pending manager approval" rows. When user approves, you have approvals log table that keeps form ID, user ID who approved it, timestamp, and approval phase / state ID), and you move the form state ID to next state. You can eventually expand this system relatively easily, like keeping different options in DB too (if current state is 1, and you approve, it moves to state 2, if you reject, it'll move to state 10).
Based on your suggestion, I have to create multiple tables for the approval matrix? Correct me if I'm wrong.
You don't need the log table necessarily, but IMHO it's good idea to have record of who did what when.
I need that too. I'll try to work on this then I'll get back to you after my dev and testing. Hope your suggestion works.
If this forum can give a hundred reputation points, I'll give you twice of that. Thank you. +respect ![]()
Hi,
For some reason, I found your idea a little complex for me. Any new alternatives? Or maybe some examples? Thanks.
Maybe this is what your looking for.
How to design database request/approval tables What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-24-2018, 09:25 AM)InsiteFX Wrote: Maybe this is what your looking for. Yes, exactly. That question makes more sense. So.. how to design database request/approval tables?
This way you can have a form and add more users (personel).
table users id user_name approvel_name description table forms id appoved_by ie approved_name or the integer id from above table tl_nte_created agent_nte_responded nte_done_generated status make the forms table the way you want, but the first table users will allow you to add to it later if they decide they want a boss etc; Just a rough go at it you will need to decide how you want it. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |