Back
Sometimes the Right Answer is to Split the Problem
From a branch-pricing idea to a discount code builder

Where It All Started
Imagine selling the same product at price X in "Branch A" and at price Y in "Branch B." Managing this at a small scale isn't complicated. But once you're dealing with more than 20 services and hundreds of variable items, traditional pricing formulas break down, and moving the work forward becomes challenging for both the user and the technical team.
Our business was expanding its branches and needed to manage service pricing separately for each branch. At the same time, there was the challenge of managing organizational contracts and discounts.
The Knot That Needed Untangling
Our goal was to create a structure based on the Rule Engine pattern, so that whenever a new branch was added or prices changed, we wouldn't need to manually update the entire pricing table. Instead, by simply defining a new rule and a list of base prices, all the prices for a branch could be managed at once.

Finding the Way Through
After talking with the CEO to understand the business vision, and consulting with the CTO to lay out the technical structure (this was actually the first time I heard the term "Rule Engine," from him), I started sketching flowcharts and wireframes to make the design process clear across different scenarios.

Turning point: rethinking the design path
Once I finished the branch pricing flow, I reviewed it with my colleague, Mohammad Ali. He agreed with the general idea, but when I tried to explain the organizational contracts section, the real spark happened. Mohammad Ali said: "Isn't this basically just a discount code?"
That feedback freed my mind from the framework I'd been stuck in. He continued:
"These are companies that have a contract with us for a specific period. Organizational discounts can be applied in different forms; if we bring this complex logic into the branch pricing section, instead of simplifying things, we'll make the rest of the teams' work harder."
Putting his perspective next to the CEO's goals, I realized separating these two paths made complete sense. As a result, I decided to add a dedicated "discount code builder" section to the CRM system.
Reviewing the design in the next step
I made the wireframe for the discount code builder page, and after that, I checked it with the technical director.
To build a discount code, the user has to filter three key fields hierarchically:
Service: the main categories (such as implant, veneer, composite).
Item: the subcategories within each service (for example, under implants: the implant brand, bone powder, and so on).
Details: the precise options for each item (for example, choosing a specific brand or specifying the amount of bone powder).

Discount Code Conditions
Based on the business requirements, at this stage the condition logic was designed to work only on an OR basis, and there was no need to complicate the system with AND conditions.

Interface Design
The main goal in the design was maximum simplicity and minimizing the learning curve. Even though I drew initial inspiration from the Expression component in the Lightning design system, and…

I removed all the secondary, complex parts that the business didn't need at this phase, so the system could be born in its most minimal and functional form.

What We Got Back
Fortunately, the idea was well received, and the CTO said:
"This design completely solves our problem. It's simple to use, and it lets discounts be defined with full detail. Given how you've designed it, we could even use this system as a temporary solution for branch pricing in the first phase, since organizational discounts are a more urgent priority right now, and we're pushing the full branch pricing system to the second half of the year."
What Stayed With Me
I got familiar with the concept of a Rule Engine, something I hadn't known before this project.
I also learned that in the process of designing a feature, shortening the gap between feedback loops reduces the time cost of the work, and helps prevent rework as well as the kind of mental bias that builds up when you stay stuck inside your own framing for too long. If that conversation with Mohammad Ali had happened later, I would probably have had to rewrite a large part of the design from scratch.
And I learned that having a single solution for every problem isn't necessarily the right approach. Sometimes the right move is to separate the problems from each other, so you can see more clearly how each one actually needs to be solved, whether one solution is enough, or whether you need several separate ones.

