Menu

Building an RFQ Approval Matrix in Laravel Without Hardcoded Thresholds
📰

Building an RFQ Approval Matrix in Laravel Without Hardcoded Thresholds

DEV Community: laravel·Tuğrul Yıldırım·2 days ago
#FTjI8ZRh
#devtolaravel#devto#dev#table#approval
Reading 0:00
15s threshold

Every procurement tool starts with a simple rule: "purchases over 10,000 need a manager's approval." Six months later the rule looks like this: over 10,000 needs the department head, over 50,000 also needs finance, IT hardware always needs the IT lead, and anything in a foreign currency is compared after conversion. If those rules live in if statements inside a controller, every policy change becomes a deploy.

This post walks through how I model an approval matrix for RFQs (requests for quotation) in Laravel so the rules live in data, the workflow lives in one service, and two people clicking "Approve" at the same second cannot corrupt the state.

The problem

An RFQ in a typical business app goes through a few stages: a requester drafts it, suppliers send quotes, the requester picks a winning quote, and then the selection has to be approved before it turns into a purchase order.

The approval part is where things usually break:

Thresholds are hardcoded.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.