Zum Hauptinhalt springen
LaufendHervorgehoben

Purchase Approval Program

A web app I built for Novin Abzian that turns purchase and payment approvals from phone calls into one traceable workflow: request, manager decision and the accounting outcome, with full history and Excel reports. Built with ASP.NET Core and PostgreSQL; tested locally, not yet deployed.

Aktueller Stand

The request, decision, payment-recording, closure, history and reporting flows are implemented and tested locally (129 unit, 24 PostgreSQL integration and 9 browser tests passed in the last recorded run). It is not deployed yet: the Windows Server/IIS rehearsal, a backup policy and testing on the company network are still open, and it does not handle real payments.

Technologie-Stack

  • C#
  • ASP.NET Core Razor Pages
  • .NET 10
  • Entity Framework Core
  • PostgreSQL
  • ASP.NET Core Identity
  • Bootstrap (RTL)
  • ClosedXML
  • xUnit
  • Playwright
  • Docker Compose

The problem

At Novin Abzian, approving a purchase or payment often meant a phone call or a verbal "go ahead". That works until someone asks who approved what, when, and whether the money was actually sent. I wanted to give employees, managers and the accounting side one place where a request keeps its whole story: what was asked for, who decided, and what happened afterwards.

This project is separate from my 2020 internship at Novin Abzian Setareh Asia. I built it in 2026, years later, for a current internal need.

Who it is for

  • Employees submit requests and follow their own history.
  • Administrators review requests, approve or reject them, manage employee access and search the company-wide history.
  • Accountants record what happened to an approved payment.

My role

I designed and built the application myself: the data model, the workflow rules, the authentication and permissions, the interface and the tests. It is also a learning project — I used it to get much more comfortable with C#, backend development, database design, authentication and testing on a real business problem. AI coding assistants helped along the way; reviewing and testing what they produced was a large part of the work.

What it does

  • Request submission: a justification, a payee, expense lines and optional supporting files (PDF or images, with size and count limits). Submissions are idempotent, so a double click doesn't create two requests, and daily and burst quotas protect against flooding.
  • Decisions: an administrator approves or rejects with a reason. Administrators can submit their own requests too, and if they approve one themselves, that self-approval is recorded and shown openly instead of hidden.
  • Payment outcome: after an approved payment is attempted outside the app, an accountant or administrator records it as transferred or unsuccessful, with the method (cash, bank transfer, cheque or other). The app only records outcomes — it never moves money or connects to a bank.
  • Closure: outcome and closure are separate. A transferred item closes automatically after 24 hours, an unsuccessful one after 48 hours, so mistakes can still be noticed before an item leaves the open queue. Closing never deletes history.
  • History and reports: employees see their own requests; administrators can search and filter the company history. Excel exports cover single decisions and consolidated approved requests, with Gregorian or Persian calendar dates.
  • Languages: Persian (right-to-left) by default, with an English interface.

The status flow, simplified:

text
Request:  Pending ──approve──▶ Approved ──▶ payment item created
                 └──reject───▶ Rejected

Payment:  AwaitingTransfer ──▶ Transferred    (closes after 24 h)
                           └─▶ Unsuccessful   (reason required, closes after 48 h)

How I built it

  • C# and ASP.NET Core Razor Pages on .NET 10. I kept it server-rendered instead of adding a separate front-end app — fewer moving parts for an internal tool.
  • PostgreSQL with Entity Framework Core, with concurrency tokens so two people deciding on the same request at the same time can't overwrite each other.
  • Two sign-in paths: administrators and accountants use ASP.NET Core Identity with lockout and throttling; employees sign in with an access key issued by an administrator, stored only as a salted hash and revocable at any time.
  • Role-based policies on every page: only administrators decide and manage employees; administrators and accountants record payments.
  • An audit trail for account, access, approval and payment events, with the actor's name and role copied into each entry.

Challenges and what I learned

  • Concurrency is a real requirement, not an edge case. Quotas and decisions had to stay correct when requests arrive at the same moment, which pushed me toward database-level guarantees instead of checks in memory.
  • Browser tests find bugs unit tests can't. End-to-end tests caught a history pager that never paged (it used a reserved query parameter) and a language switch that failed for signed-in employees because of how anti-forgery tokens interacted with the second sign-in scheme.
  • Local setup is part of the product. A mismatch between the database password in Docker and the app's configuration taught me to write clear setup and troubleshooting guides — and to treat a Docker volume as something that remembers.

Where it stands

Status
ImplementedRequest, decision, payment-recording, closure, history and Excel reporting flows
Verified locallyIn the last recorded run: 129 unit tests, 24 PostgreSQL integration tests and 9 browser tests passed
DeployedNot yet. It has not been rehearsed on the intended Windows Server/IIS setup, and it does not handle real company payments

Next steps

  • Rehearse the deployment on the intended Windows Server with IIS.
  • Agree on a backup policy and test it on that server.
  • Test on real devices over the company network and get the Persian wording approved.
  • Decide the deliberately postponed policies: withdrawing, reversing and correcting requests.

Links

Screenshots are not shown here because the application was built for an internal company process.

  • #asp-net-core
  • #postgresql
  • #workflow