# Building Secure Approval Workflows for Your Business: A Merchant Onboarding Case Study

---

Every growing business eventually hits the same wall: a process that used to run on a spreadsheet, a shared inbox and a few WhatsApp messages starts breaking.

A customer application gets lost in someone's inbox. Two people edit the same row in the spreadsheet. A bank account number gets pasted into an email thread that ten people can read. Nobody can say who approved what, or when.

I recently built a **merchant onboarding portal** that solves exactly this kind of problem. In this post I'll walk through what it does, the business problems behind each feature, and how the same approach can work for your team, whether you're onboarding merchants, vendors, clients, students or employees.

---

## The Problem: Approval Workflows Built on Spreadsheets and Email

Most onboarding and approval processes look something like this:

1. Someone collects details from a customer (form, email or a phone call)
2. The details go into a spreadsheet or shared document
3. A manager decides who should review it
4. A reviewer checks it and approves, rejects or asks for more information
5. Everyone emails back and forth until it's done

That works with 10 applications a month. At 100 or 1,000, it causes real problems:

- **No access control.** Everyone who can open the spreadsheet can see and change everything.
- **Sensitive data everywhere.** Bank details, tax IDs and identity numbers end up in emails, chats and downloads.
- **Lost work.** Someone fills in half a form, the browser closes, and they start again.
- **No audit trail.** When something goes wrong, nobody can say who saw or changed what.
- **No visibility.** Managers can't see what's pending, what's stuck or who is overloaded.

---

## What I Built: A Role-Based Merchant Onboarding Portal

The portal handles the full journey of a merchant application for a payments business, with three roles:

| Role | What they can do |
| --- | --- |
| **Sales** | Create applications, fill in business and banking details, submit them for review, and fix them if the reviewer asks for more information |
| **Admin** | See every application and assign each one to the right reviewer |
| **Reviewer** | Review the applications assigned to them, then approve, reject or request more information |

Each application moves through clear stages:

**Draft → Submitted → In Review → Approved / Rejected** (or back to **Info Requested** if something is missing)

Everyone sees only what they need to see, and every important action is recorded.

---

## The Business Problems It Solves

### 1\. People only see what they're supposed to see

A salesperson sees only the applications they created. A reviewer sees only the applications assigned to them. Admins see everything.

This isn't just hiding buttons on the screen. The server checks every request against the same rules, so even someone who knows how to tinker with a web page can't reach data they shouldn't.

If someone tries to open an application they don't have access to, even with a direct link, the system says **"Not found"**. It doesn't even confirm that the application exists.

**What this means for you:** fewer data leaks, cleaner accountability, and an easier time with compliance questions.

### 2\. Sensitive data stays protected

Bank account numbers and tax IDs are **masked by default** and show as `•••• 1234`, even to people with full access.

To see the full value, an authorised person has to click **Reveal**. That action:

- checks their permission again on the server
- records who viewed it and when, in the application's history
- hides the value again automatically after 30 seconds

The real values are stored separately from the rest of the application data, so they can't leak through a report, an export or a log by accident.

**What this means for you:** sensitive customer data stops spreading through emails and spreadsheets, and you can always answer "who looked at this?"

### 3\. Nobody loses their work

The application form **saves automatically** as people type. If the internet drops or the browser closes, the work is still there.

If a save fails because of a network problem, the system retries quietly in the background. If it still can't save, it tells the user clearly and keeps everything they typed on screen. It never wipes the form.

If someone tries to leave the page with unsaved changes, they get a warning first.

**What this means for you:** fewer frustrated staff, fewer half-finished applications, and no "I have to fill this in again" moments.

### 4\. Mistakes get caught before they reach a reviewer

The form checks information as it's entered:

- required fields and correct formats (email, phone, website)
- rules that depend on each other, such as postal code formats that depend on the country
- duplicate checks, such as whether this business registration number has already been submitted

Errors appear right next to the field that needs fixing, in plain language.

**What this means for you:** reviewers spend their time on real decisions, not on chasing missing or badly formatted details.

### 5\. It keeps working when the network doesn't

Real-world internet isn't perfect, especially on mobile or in busy offices. The portal is built to handle that:

- If a page fails to load, users see a clear message and a **Retry** button, and their filters and search are kept.
- Users don't get logged out at random when their session renews in the background, even if several things are loading at once.
- Searching and filtering stay fast and never show outdated results.

**What this means for you:** fewer support tickets and fewer "the system logged me out again" complaints.

### 6\. A complete history of every application

Every application keeps a timeline: when it was created, submitted, assigned, reviewed and approved or rejected, and every time someone viewed sensitive data.

**What this means for you:** clear answers for audits, disputes and internal reviews.

### 7\. Shareable, bookmarkable views

Managers can filter the dashboard (for example, *"all applications waiting for review"*) and share the link with a colleague. The colleague sees exactly the same view, and the page remembers the filters after a refresh.

---

## Under the Hood (For CTOs and Tech Leads)

If you're evaluating the engineering side, here's a short summary of how it's built:

- **Frontend:** Angular with signals, standalone components and RxJS. The same architecture works equally well in **Next.js / React**, which is my primary stack.
- **One permission model, enforced twice:** a single set of permission rules is used both by the interface (what to show) and by the API (what to allow).
- **Secure session handling:** the access token is kept in memory only. Token refresh is *single-flight*, meaning simultaneous expired requests trigger exactly one refresh and are then replayed, which avoids random logouts with rotating refresh tokens.
- **Sensitive data endpoints:** read endpoints never return raw values. Reveal is a separate, permission-checked, audited call.
- **Auto-save pipeline:** debounced, saves in order, retries only on temporary errors, and is never destructive on failure.
- **Layered validation:** field rules, cross-field rules, async duplicate checks and server error mapping.
- **Security hardening:** Content Security Policy, and "404 instead of 403" for unauthorized records to prevent ID enumeration.
- **Testing:** 60 automated tests focused on the risky parts: session refresh, permissions, validation and auto-save under failure.

In production, this pairs with a Node.js / PostgreSQL backend on AWS, httpOnly cookies for session storage, end-to-end tests in CI, and error monitoring.

---

## Who This Is For

The project was a merchant onboarding portal, but the pattern (**collect → assign → review → decide → record**) fits almost any business process:

- **Fintech and payments:** merchant, agent or customer onboarding (KYC/KYB)
- **Lending and microfinance:** loan applications and approvals
- **Insurance:** claims intake and review
- **HR:** employee onboarding, leave and expense approvals
- **Procurement:** vendor registration and purchase approvals
- **Education:** student admissions and scholarship applications
- **Real estate:** tenant applications and document verification
- **Agencies and service businesses:** client onboarding and project sign-offs

If your team is approving things over email or in spreadsheets, this kind of system will probably save you time and reduce risk.

---

## Work With Me

I'm **Aakib Shah Sayed**, a full-stack developer based in Kathmandu with 3+ years of experience building production web applications in **Next.js, React, Angular, Node.js, PostgreSQL and AWS**. I'm also an AWS Certified Solutions Architect.

I can help you with:

- **Custom approval and onboarding portals** built around how your team actually works
- **Internal tools and dashboards** that replace spreadsheets and email chains
- **Secure handling of sensitive data**, including role-based access, masking and audit logs
- **Upgrading existing systems** that are slow, fragile or hard to maintain
- **Architecture reviews** for teams that want a second opinion before they build

**Got a process that's outgrowing spreadsheets?** Let's talk about what it would look like as a proper system.

👉 **Get in touch:** [aakibshah.com.np](https://aakibshah.com.np) or send me a message on LinkedIn.
