<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Adenugawilly on Medium]]></title>
        <description><![CDATA[Stories by Adenugawilly on Medium]]></description>
        <link>https://medium.com/@adenugawilly431?source=rss-a36848a56afe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xu6zxwZ-3BDDdZ3nuV85fg.jpeg</url>
            <title>Stories by Adenugawilly on Medium</title>
            <link>https://medium.com/@adenugawilly431?source=rss-a36848a56afe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:17:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adenugawilly431/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Business Analysis Can Solve Nigeria’s Fake Transfer Problem]]></title>
            <link>https://medium.com/@adenugawilly431/how-business-analysis-can-solve-nigerias-fake-transfer-problem-bfd94b23c86e?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfd94b23c86e</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[fraud-prevention]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[business-analytics]]></category>
            <category><![CDATA[banking]]></category>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 12:53:50 GMT</pubDate>
            <atom:updated>2026-09-29T12:53:50.565Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WvmpMVO-4RMCUcfJ4beS5A.jpeg" /></figure><h4><strong>The Problem</strong></h4><p>Fake transfer fraud is a growing problem in Nigeria where buyers use unauthorised third party apps to generate fake bank alert notifications. These apps flash a convincing payment notification to the merchant’s phone without any real money moving. The unsuspecting vendor sees the notification, assumes payment has been made and releases the goods.By the time they realise no money entered their account the buyer is long gone.</p><p>This problem is hitting hardest at the grassroots level. Market traders, small shop owners, roadside merchants and physical store vendors who handle high volumes of customers daily cannot afford to verify every transaction carefully. The financial losses are significant and in many cases devastating for small business owners.</p><p><strong>Why Merchants Fall For It</strong></p><p>The question most people ask is why do merchants fall for it? The answer lies in three things: trust, time pressure and opportunity.</p><p>In a busy Nigerian market or store, a vendor is managing multiple customers at once. The pressure to attend to everyone quickly and reduce queue frustration means there is simply no time to open a banking app and verify every incoming transfer. When an in-app credit notification flashes on the screen, the assumption is automatic. Money has arrived.</p><p>The fraud triangle explains the opportunity angle perfectly. When a buyer is a familiar face, a regular customer the vendor knows and trusts, the psychological barrier to questioning the payment drops completely. The buyer says “I have sent the money”, the vendor sees a notification, recognises the customer and releases the goods without a second thought. By the time the vendor checks their actual balance the buyer is gone.</p><p>Familiarity breeds trust. And in this case, trust is the vulnerability.</p><p><strong>Gap Analysis</strong></p><p>To solve any problem effectively a Business Analyst starts with understanding the gap between where things are today and where they need to be.</p><p><strong>Current State (As Is):</strong><br> Merchants, traders and vendors across Nigeria are experiencing an increasing rate of fake transfer fraud. The existing alert system relies on SMS, email and in-app notifications that cannot be independently verified at a glance. A fraudulent notification looks identical to a legitimate one. There is no visual or instant way for a merchant to distinguish between a real credit and a fake one without opening their banking app and manually checking their balance.</p><p><strong>Future State (To Be):</strong><br> A system where merchants can instantly identify a legitimate transfer from a fake one at the point of notification, without needing to open their app, refresh their balance or interrupt their customer flow.</p><p><strong>The Gap:</strong><br> The gap is verification speed. Merchants cannot spot a fake transfer in real time because the current notification system shows the same information whether the transfer is real or fake. SMS and email alerts are often delayed, leaving the in-app notification as the only reference, which fraudsters have learned to replicate perfectly.</p><p>Closing this gap requires both human and technology solutions applied in the right order.</p><p><strong>Proposed Solutions</strong></p><p>As a Business Analyst the goal is never to jump straight to technology. The best solutions start with what can be implemented immediately and build towards what requires more investment.</p><p><strong>Human Solution (Immediate):</strong><br> The simplest and most immediately actionable solution is process based. Merchants with multiple staff should assign one dedicated person responsible for verifying all incoming transfer notifications before goods are released. This person opens the banking app, confirms the balance has increased and gives a physical signal to the vendor before the transaction is completed. No technology change required. No cost. Implementable today.</p><p><strong>Technology Solution (Priority 1):</strong><br> Banks should redesign their alert notification to display both the previous balance and the current balance simultaneously. A fake alert cannot increase an actual account balance. If a merchant sees their previous balance of N50,000 and their current balance of N80,000 side by side in the same notification, verification is instant. No app refresh needed. No time wasted. The fraud is exposed at the point of notification.</p><p><strong>Technology Solution (Priority 2):</strong><br> Banks should integrate with NIBSS (Nigeria Inter-Bank Settlement System) to verify that every transfer notification originates from an authorised banking application. Any alert generated from an unauthorised third party app should be flagged immediately and blocked from displaying as a legitimate credit notification. This cuts the problem at the source.</p><p><strong>Technology Solution (Priority 3):</strong><br> A final layer of protection is real time account verification. Cross checking the sender’s account number, linked bank and account name against NIBSS records at the point of transfer. Any mismatch between the account number and the registered account name triggers an immediate flag before the notification reaches the recipient.</p><p>Applied together these three layers of solution make fake transfer fraud significantly harder to execute and significantly easier to detect.</p><p><strong>What Merchants and Banks Can Do Today</strong></p><p>While banks work towards implementing these technology solutions merchants cannot afford to wait. There are practical steps that can be taken today.</p><p>First, assign a dedicated staff member to verify every transfer notification before goods are released. This costs nothing and can be implemented immediately in any store regardless of size.</p><p>Second, train yourself and your staff to always open your banking app and confirm your balance has increased before releasing any goods. Make it a non-negotiable store policy. One extra minute of verification is worth more than a lost product.</p><p>Third, educate your customers. Put a visible sign in your store stating that all transfers are verified before goods are released. This alone deters opportunistic fraudsters who rely on merchants being too busy or too trusting to check.</p><p>On the technology side, the good news is that the majority of Nigerian bank users are on Android or iOS devices. This means once banks ship these updates the rollout reaches most of their customer base immediately. However shipping the update is only half the job. Banks must include deliberate in-app instruction guides that users are required to read before dismissing, not optional pop-ups that are swiped away. Users need to understand what the new verification features mean and how to use them. An update nobody understands is an update that does not work.</p><p><strong>Conclusion</strong></p><p>Fake transfer fraud is not just a technology problem. It is a business problem that requires business thinking first and technology solutions second. That is exactly what Business Analysis brings to the table, the ability to study how people behave, identify where the process breaks down and propose solutions that bridge the gap between human behaviour and technology capability.</p><p>The gap between where Nigerian merchants are today and where they need to be is not impossible to close. It requires banks to take responsibility for how their notification systems are designed, merchants to implement simple verification processes immediately and both parties to communicate clearly when changes are made.</p><p>Merchants, stay alert, verify every transfer and do not let time pressure become your vulnerability.</p><p>Banks, your notification system is your merchant’s first line of defence. Redesign it like one.</p><p>Business Analysis does not just solve problems. It prevents them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfd94b23c86e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Excel Through an Engineer’s Eyes: From VLOOKUP to Pivot Tables and Business Insights]]></title>
            <link>https://medium.com/@adenugawilly431/excel-through-an-engineers-eyes-from-vlookup-to-pivot-tables-and-business-insights-fd00f611243f?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd00f611243f</guid>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[business-analysis]]></category>
            <category><![CDATA[career-transitions]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Sun, 23 Aug 2026 10:09:20 GMT</pubDate>
            <atom:updated>2026-08-23T10:09:20.560Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LA3MYJyOlUZFs__OSkIPFA.avif" /></figure><p>After refreshing my accounting knowledge I realised something that textbooks never made clear. Accounting is not just about knowing debits and credits. At its core accounting is about data presentation , taking raw financial information and turning it into something that internal and external users can understand well enough to make informed decisions.</p><p>That realisation led me to a question. In the business world what tools exist to present, visualise, and analyse data? The answer kept pointing to one place , Microsoft Excel.</p><p>But here is what nobody tells you about Excel. It is not just a spreadsheet. It is a UI framework. Think of it this way , Excel is the frontend that stakeholders see. You, the analyst, are the backend engineer writing the logic behind every cell, every formula, every chart. The stakeholder sees a clean dashboard with insights. You built the engine underneath it.</p><p>That mental shift changed how I approached every formula I learned this week.</p><h3>VLOOKUP and XLOOKUP: The Database Query of Excel</h3><p>The first concept that clicked immediately was how Excel searches for relational data. There are two ways to do this , VLOOKUP and XLOOKUP , and the moment I understood them I stopped thinking of them as Excel formulas and started thinking of them as database queries.</p><p>Both work like a Mongoose query. You have a collection of data , say a sales table with salesperson names and figures. You want to find Chidi’s total sales without scrolling through hundreds of rows manually. You pass in the identifier, the query loops through the table, finds the matching row, and returns exactly what you asked for. No mistakes. No manual searching.</p><p>The difference between the two is flexibility.</p><p>VLOOKUP searches vertically from left to right only. The identifier must always be in the first column and you can only return values to the right of it. It is like a Mongoose query where the filter field must always be the first field in the document , rigid but reliable.</p><p>XLOOKUP removes that restriction entirely. You tell it exactly which column to search and exactly which column to return from , independently. It loops through the lookup column, finds the match, then jumps directly to the return column. Direction does not matter. It is the more flexible, modern version.</p><p>In my opinion XLOOKUP is always the better choice when available. It is cleaner, more readable, and has built in error handling , no need to wrap it in IFERROR separately.</p><h3>Pivot Tables: The Figma of Data Analysis</h3><p>If you have ever used Figma or WordPress you will immediately feel at home with Pivot Tables. The drag and drop interface, the instant visual feedback, the ability to rearrange everything without touching a single formula , it feels less like a spreadsheet tool and more like a design canvas for your data.</p><p>A Pivot Table takes your entire dataset , hundreds or thousands of rows , and summarises it in one place. You decide how it looks by dragging fields into four areas: Rows, Columns, Values, and Filters. Drag Salesperson to Rows and Total Sales to Values , instantly you see every salesperson’s performance. Drag Region to Filters and slice the data by North, South, or East with one click.</p><p>What impressed me most is how it handles multiple questions simultaneously. One dataset. Infinite views. Rearrange the fields and the entire summary rebuilds in seconds.</p><p>For engineers , think of it as a MongoDB aggregation pipeline with a visual interface. The GROUP BY, SUM, and FILTER operations are all happening under the hood. You are just dragging instead of typing.</p><p>Pivot Tables are best for quick exploration and management presentations. When a stakeholder asks “how did each region perform this quarter?” , a Pivot Table answers that in under a minute. No formulas. No code. Just drag, drop, and present.</p><h3>SUMIF: The Array Filter of Excel</h3><p>When I first encountered SUMIF I questioned why it existed. We already have VLOOKUP and XLOOKUP for finding data , why do we need another formula?</p><p>Then it clicked. VLOOKUP and XLOOKUP are search tools. They find one specific record and return one value. They are one to one , give me one identifier and I will return one result.</p><p>SUMIF is different. It is a one to many formula. It does not find one record , it scans the entire dataset, filters every row that meets a condition, and performs a mathematical operation on all matching rows simultaneously.</p><p>Think of it as an array filter combined with a reduce. In JavaScript:</p><pre>const total = salesData<br>  .filter(row =&gt; row.salesperson === &quot;Chidi&quot;)<br>  .reduce((sum, row) =&gt; sum + row.sales, 0)</pre><p>SUMIF does exactly that in one formula. It loops through the salesperson column, matches every row where the name is Chidi, then adds up all corresponding sales figures.</p><p>And just like SQL , SUMIF models a one to many relationship. One condition applied across many rows to produce one aggregated result. SUMIFS extends this further by adding multiple conditions , the equivalent of WHERE salesperson = “Chidi” AND region = “North” in a SQL query.</p><p>The moment I made that connection SUMIF stopped feeling like an Excel trick and started feeling like a query language built into a spreadsheet.</p><h3>Power Query: The Data Cleaning Function</h3><p>I was given a messy dataset. Names were inconsistent , some written in lowercase, some in uppercase, some mixed. There were extra spaces before numbers. Months were capitalised in some rows and lowercase in others. The kind of data that arrives in real organisations every day from different people typing into different systems.</p><p>My first instinct was to fix it manually , retype each inconsistent value one by one. Then I thought about how long that would take with 500 rows. Or 5,000 rows. Or 50,000 rows.</p><p>That is where Power Query came in.</p><p>Think of Power Query as writing a cleaning function instead of procedural corrections. Instead of fixing each problem manually , you define the rules once. Capitalise each word in this column. Trim extra spaces from this column. Standardise this date format. Power Query applies those rules to every row automatically and returns a clean transformed dataset.</p><p>In engineering terms it is a pure function , same input, same output, every time. And like any good function it is reusable. Next month when a new messy dataset arrives in the same format , you click Refresh. Power Query reruns every cleaning step automatically in seconds.</p><p>What used to take an analyst two hours every Monday now takes two minutes.</p><p>That is not just a productivity improvement. It is the difference between spending your time cleaning data and spending your time analysing it.</p><h3>The Dashboard: Speaking the Stakeholder’s Language</h3><p>After spending days learning formulas I had a moment of clarity. I am not trying to become an Excel analyst. I am trying to become a Business Analyst who uses Excel as a tool to communicate insights to stakeholders.</p><p>And here is what stakeholders do not care about , they do not care if you used SUMIF or SUMIFS or a Pivot Table or XLOOKUP. They do not care about your formula bar. They care about one thing , show me what is happening with my business in a way I can understand quickly and act on immediately.</p><p>That is where charts come in.</p><p>I built three charts from my sales dataset:</p><p>A Bar Chart to show the totality of individual performance , who sold the most, who sold the least, how far apart they are. One glance and you know Chidi is the top performer.</p><p>A Pie Chart for sectional analysis , what percentage of total sales came from each region. North at 51%, East at 37%, South at 12%. The story of regional imbalance told in three slices.</p><p>A Line Chart to observe trend behaviour , how sales moved across the four months. January to February growth, the sharp March dip, the April recovery. A trend you cannot see in a table of numbers but cannot miss on a line chart.</p><p>Together these three charts told a complete business story. And from that story I drew the following recommendations:</p><p><strong>Key Findings:</strong></p><p>Chidi drove 50.91% of total sales making him the strongest individual contributor. North region generated 50.91% of total revenue. April was the strongest month at 2,070,000 generating 32.78% of total sales. March was the weakest month at 940,000, a 50.3% drop from February. Laptop generated 73.68% of total product revenue despite low unit volume. Mouse moved the most units at 37 but contributed only 2.93% of revenue. Amaka contributed only 11.96% of total sales, significantly underperforming.</p><p><strong>Primary Recommendations:</strong></p><p>Increase Chidi’s sales target by 10% to 3,536,500 , he has proven capacity. Increase Bola’s target by 5% to 2,462,250 , strong consistent performer. Assign 2 additional sales promoters to the South region to support Amaka. Redirect 30% of North marketing budget to South for Q2. Bundle Mouse with Laptop and Monitor purchases to increase Mouse revenue contribution.</p><p><strong>Secondary Recommendations:</strong></p><p>Implement biweekly mystery shopper visits to monitor sales activity. Target school areas in South region with promotional campaigns. Host product shows in South region subject to budget approval.</p><p><strong>Watch List:</strong></p><p>Keyboard performance , monitor Q2 before taking action. March dip , investigate root cause before Q2 planning.</p><h3>The Road You Must Pass</h3><p>As I wrap up Week 2 with Excel fundamentals locked in my mind I want to be clear about one thing , this is just the beginning of the journey.</p><p>Excel is not the destination. It is the road you must pass through before you get to the real business concepts. Every formula I learned this week , SUMIF, XLOOKUP, Pivot Tables, Power Query , is a building block. Not the building itself.</p><p>For anyone transitioning from tech to business analysis the path is not as foreign as it looks. You already think in logic. You already think in systems. You already understand what it means to query data, filter results, and return a clean output. Excel is just a different interface for skills you already have.</p><p>What this week taught me is that the gap between a software engineer and a business analyst is smaller than most people think. The tools are different. The language is different. But the thinking , breaking a problem down, finding the data, drawing a conclusion, making a recommendation , that thinking is the same.</p><p>Start with the basics. Build your analysis muscle. Give recommendations from your data even when nobody asks. That habit alone will separate you from everyone who just knows the formulas.</p><p>SQL is next. The journey continues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd00f611243f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accounting Through an Engineer’s Eyes: Ledgers, Cashbooks and Trial Balance]]></title>
            <link>https://medium.com/@adenugawilly431/accounting-through-an-engineers-eyes-ledgers-cashbooks-and-trial-balance-447fdcfa7144?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/447fdcfa7144</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[accounting]]></category>
            <category><![CDATA[career-change]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[business]]></category>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 17:50:14 GMT</pubDate>
            <atom:updated>2026-08-17T17:50:14.642Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*im51BmUGjHncki8p8lpvIA.jpeg" /></figure><p>Recently I was laid off from the company where I worked as a full stack software engineer. I started from the backend and grew into the frontend but every beginning has an end, and sometimes that end is the beginning of a new journey.</p><p>So I sat with the question: what do I actually want?</p><p>The answer came after a lot of reflection. I kept coming back to one thought , how do I combine business, accounting, and my engineering skills into something that genuinely serves people? The roles that kept appearing in my research were Business Analyst, Finance Analyst, and Operations Analyst. All of them sit at the intersection of technology and business. All of them require something I already have , a B.Sc. in Accounting , but have not used in three years.</p><p>So I made a decision. I would refresh my accounting knowledge from scratch, connect it to what I know as an engineer, and document every step of the journey. This article is Day 3 of that journey and what I discovered is that accounting and software engineering speak the same language. You just have to know how to listen.</p><h3>Ledgers: The Accounting Book of Truth</h3><p>A ledger is an entry book , the accounting book of truth. Every financial transaction a business makes eventually lands in a ledger. Think of it like your phone contacts app.</p><p>Your <strong>General Ledger</strong> is your main contacts list. It contains every account the business has , assets, liabilities, capital, income, and expenses. It is the master book. The single source of truth for the entire business.</p><p>But just like your contacts app has groups, the General Ledger has supporting ledgers:</p><p>The <strong>Sales Ledger</strong> is your “Customers” group. It records every credit sale , situations where you delivered a product or service but the customer has not yet paid. Each customer gets their own account showing exactly what they owe.</p><p>The <strong>Purchases Ledger</strong> is your “Suppliers” group. It records every credit purchase , situations where a supplier delivered goods to you but you have not yet paid. Each supplier gets their own account showing exactly what you owe them.</p><p>The totals from both the Sales and Purchases Ledger feed back into the General Ledger as single figures , Accounts Receivable and Accounts Payable respectively. The groups feed the main list.</p><p>As an engineer I immediately saw this as a microservices architecture. The General Ledger is the API gateway. The Sales and Purchases Ledgers are individual services feeding data into the central system.</p><h3>The Cashbook: Where Cash Tells Its Story</h3><p>If the ledger is the book of truth, the cashbook is the book of life. Cash is the lifeblood of every business and the cashbook records every heartbeat.</p><p>A cashbook is a special accounting book that records all cash transactions on a daily basis. What makes it unique is that it serves as both a journal and a ledger simultaneously , recording transactions as they happen AND maintaining a running balance at all times.</p><p>The cashbook is divided into two sides:</p><p>The <strong>Debit side</strong> records all cash coming IN. Every sale, every payment received, every deposit. Money entering the business.</p><p>The <strong>Credit side</strong> records all cash going OUT. Every expense paid, every purchase, every withdrawal. Money leaving the business.</p><p>There are three types of cashbook:</p><p>The <strong>Single Column Cashbook</strong> records cash transactions only. Simple and straightforward , money in on the left, money out on the right.</p><p>The <strong>Double Column Cashbook</strong> adds a bank column alongside the cash column. Now you track both physical cash and bank transactions separately. This is where the Contra Entry comes in and as an engineer, this one made me smile.</p><p>A <strong>Contra Entry</strong> is when cash moves between your cashbox and your bank account. You deposit N100,000 cash into the bank , cash goes out of the cashbox, cash goes into the bank. Same money, different pocket. It appears on both sides of the cashbook marked with a C. No income, no expense , just an internal transfer.</p><p>If you have worked with atomic transactions in backend engineering, you already understand this. A contra entry is a single atomic event , it either happens completely on both sides or not at all. The books must reflect both movements or neither.</p><p>The <strong>Triple Column Cashbook</strong> extends the double column by adding a discount column on each side , Discount Allowed on the debit side and Discount Received on the credit side.</p><p>Discount Allowed is what you give customers who pay early , an expense, you are losing something. Discount Received is what suppliers give you for paying them early , income, you are gaining something.</p><h3>Trial Balance: The Court and The Dev Environment</h3><p>After all transactions have been recorded in the journal and posted to the ledger, the accountant prepares a Trial Balance. Its purpose is simple , to test the mathematical accuracy of the bookkeeping. Total debits must equal total credits. If they do, the books are balanced. If they do not, something went wrong somewhere.</p><p>But here is where it gets interesting. Let me give you two analogies that made this concept click instantly for me.</p><h3>The Court Analogy</h3><p>The Trial Balance is a court hearing. The books are the co-defendants. We are examining the evidence to determine if the recording is accurate.</p><p>The Journal is the witness statements , every transaction recorded exactly as it happened, in date order. The Ledger is the evidence files , every account organised and categorised for the court to examine. The Trial Balance is the hearing itself , all evidence presented, all numbers checked. Do they agree?</p><p>The Auditor is the judge , an independent reviewer who confirms whether everything is true and fair. The Financial Statements are the verdict , the final picture of the business’s financial health delivered to the world.</p><p>And just like a court, the Trial Balance can be fooled. Errors of omission, where a transaction was never recorded at all, escape the Trial Balance completely. Both sides are missing so the totals still agree. A guilty party can walk free on a technicality.</p><h3>The Dev Environment Analogy</h3><p>For engineers, this one hits differently.</p><p>The Trial Balance is your dev environment. The Financial Statements are production.</p><p>The Journal is writing the code , recording every line as you build. The Ledger is your codebase organised by module , each account is its own file. The Trial Balance is running your tests locally , do all debits equal all credits? Does the logic hold before you push?</p><p>Errors of omission are silent bugs , the kind that do not throw an error but quietly break functionality downstream. The tests pass but something is wrong. You only discover it in production.</p><p>The Auditor is your code reviewer , independent eyes checking what you missed before merging to main. The Financial Statements are production , what the end user sees, the final deployed version.</p><p>The Accountant is the developer. GAAP and IFRS accounting standards are the coding conventions and style guides the whole team follows.</p><p>Two completely different worlds. One identical system.</p><h3>Income Statement: The Scoreboard</h3><p>Every business exists to make money. The Income Statement is the scoreboard , it tells you whether the business is winning or losing financially during a specific period.</p><p>Formally it is called the Statement of Comprehensive Income. Informally most people call it the Profit and Loss Account or simply the P&amp;L. Whatever you call it , it answers one question:</p><p>Did the business make a profit or a loss?</p><p>The Income Statement has two levels:</p><p><strong>Gross Profit</strong> is the first checkpoint. You take your Net Sales , total sales minus any returns from customers , and subtract the Cost of Goods Sold. Cost of Goods Sold includes everything it took to get your product ready for sale. Opening stock brought forward from the previous period, new purchases made during the period, carriage inward which is the cost of bringing goods from the supplier to your warehouse, minus any purchase returns and closing stock still sitting unsold at the end of the period.</p><p>What remains after that calculation is Gross Profit. It tells you how profitable your core trading activity is before you even think about running costs.</p><p><strong>Net Profit</strong> is the bottom line. From Gross Profit you deduct all operating expenses , the day to day costs of running the business. Rent, salaries, electricity, carriage outward, marketing, stationery. Everything it costs to keep the doors open.</p><p>What remains is Net Profit. This is what the business actually earned. This is what the owner takes home.</p><p>As an engineer I see the Income Statement as a function:</p><pre>function getNetProfit(revenue, cogs, expenses) {<br>  const grossProfit = revenue - cogs;<br>  const netProfit = grossProfit - expenses;<br>  return netProfit;<br>}</pre><p>If the return value is positive , profit. If negative , loss. Clean, logical, deterministic.</p><h3>The Reunion</h3><p>Reconnecting with accounting after three years as a software engineer felt like an adult reuniting with a childhood friend. The foundation was always there , the double entry rules, the ledger logic, the balance sheet structure. Time had not erased it. Life experience had just added new layers on top.</p><p>But something is different now. We are no longer in a classroom preparing for an exam. We are in the real world where accounting is not just theory , it is the language every business speaks. Every startup pitch, every investor meeting, every board decision, every product pricing model , accounting is underneath all of it.</p><p>And technology has found its way into accounting permanently. Spreadsheets replaced manual ledgers. ERP systems replaced handwritten cashbooks. Power BI dashboards replaced printed reports. AI is now beginning to automate reconciliations and flag anomalies in real time. The tools have evolved but the concepts have not. Debits still equal credits. Assets still equal liabilities plus equity. The Income Statement still measures profit or loss.</p><p>If you are a software engineer thinking about transitioning into business analysis, finance, or operations , this is your call. You are not starting from zero. You are starting from an advantage. You understand systems, logic, data, and processes. Accounting is just another system. Learn the language and you become one of the rarest professionals in any organisation , someone who can build the technology AND understand the business it serves.</p><p>The reunion has just begun. Week 1 is not finished yet.</p><p>Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=447fdcfa7144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting Frontend to Backend: A Backend Engineer’s Reality Check]]></title>
            <link>https://medium.com/@adenugawilly431/connecting-frontend-to-backend-a-backend-engineers-reality-check-005a69fc394b?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/005a69fc394b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[backend-engineering]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 08:45:01 GMT</pubDate>
            <atom:updated>2026-06-29T08:45:01.689Z</atom:updated>
            <content:encoded><![CDATA[<p>So recently I picked up Next.js. While testing the waters, I found myself building a login and signup form for a dashboard. Then I thought why not connect this to a real backend? So I built an auth API with NestJS that matched the expected data shape. Simple enough, right? Wrong.<br>Here’s what actually happened.</p><h3>CORS Blocked Everything</h3><p>The moment my Next.js app on port 3000 tried to reach my NestJS server on port 5000, the browser shut it down immediately. CORS:Cross-Origin Resource Sharing is a browser security policy that blocks requests between different origins(your frontend in my case) unless the server explicitly allows them.<br>The fix was one method in main.ts:</p><pre>app.enableCors({<br>//In nestjs you can use configService to get the clientUrl from .envfilepath<br>  origin: process.env.CLIENT_URL, <br>  methods: [&#39;GET&#39;, &#39;POST&#39;, &#39;PUT&#39;, &#39;DELETE&#39;, &#39;PATCH&#39;],<br>  credentials: true,<br>});</pre><p>But the lesson was deeper: CORS can’t be fixed from the frontend. It has to come from the server. The browser enforces it, the server permits it. And the origin should always come from an environment variable not hardcoded so it works in every environment without touching the code.</p><h3>The Rate Limiter Blocked Me From My Own API</h3><p>I added rate limiting to protect the login endpoint from brute force attacks 3 requests per minute. Smart security decision. What I didn’t expect was blocking myself during testing. I kept hitting the endpoint while debugging and suddenly got a 429 Too Many Requests. My own protection locked me out. The lesson: test with fresh credentials and understand the limits you set, because they apply to everyone including you. Rate limiting doesn’t know the difference between an attacker and a developer.</p><h3>Helmet: Protecting the Headers</h3><p>After adding rate limiting to the login endpoint, I realized I was only protecting one door. What about the headers? One of the fastest ways to attack an API is through HTTP headers injecting scripts, clickjacking, bypassing content policies. That’s when I added Helmet. One import, one line in main.ts, and suddenly 14 security headers were added to every response automatically.</p><pre>app.use(helmet());</pre><h3>The AtLeastOneOf Problem: UX Meets Validation</h3><p>Jacob Nielsen’s usability principle says your product should behave like products people already use. Most apps people use daily offer either a password or a PIN to login not both at the same time, but either one. So I built exactly that a toggle between password and PIN on the login form. Simple UX decision. Nightmare validation problem. Every time I tested from the backend, PIN login with an email identifier failed. The backend was receiving an empty password string alongside the PIN because my frontend still had the password field registered even after switching to PIN mode. The DTO expected either password or PIN not an empty password AND a PIN. I had to build a custom class-validator decorator called AtLeastOneOf that enforced exactly one must be present:</p><pre>export function AtLeastOneOf(...fields: string[]) {<br>  return function (object: object, propertyName: string) {<br>    registerDecorator({<br>      name: &#39;atLeastOneOf&#39;,<br>      target: object.constructor,<br>      propertyName,<br>      validator: {<br>        validate(_: any, args: ValidationArguments) {<br>          return fields.some(<br>            (field) =&gt; (args.object as any)[field] !== undefined,<br>          );<br>        },<br>        defaultMessage() {<br>          return `At least one of ${fields.join(&#39;, &#39;)} must be provided`;<br>        },<br>      },<br>    });<br>  };<br>}</pre><p>And on the frontend, I had to unregister the unused field when toggling:</p><pre>const switchToPin = () =&gt; {<br>  unregister(&#39;password&#39;);<br>  setUsePin(true);<br>};</pre><p>One UX decision created a full-stack validation challenge I didn’t see coming.</p><h3>Expected Data vs Actual Data</h3><p>This was the most expensive lesson of all. What you think you’re sending and what you’re actually sending are often two different things. My backend DTO expected either a password or a PIN. My frontend was sending an empty password string alongside the PIN because React Hook Form still held the registered value even after I switched to PIN mode. The backend saw an empty password, failed validation, and threw a 400 Bad Request. The fix: always check the Network tab payload before debugging the backend. The answer is usually right there you’re just not looking at the right place.</p><h3>The Takeaway</h3><p>Connecting a frontend to a backend taught me more about backend engineering than building the backend alone ever did. You don’t truly understand CORS until the browser blocks you. You don’t truly understand rate limiting until it locks you out. You don’t truly understand validation until a UX decision breaks your API. Build the full stack. Break things. The errors are the education.</p><p><em>Next week the same project from the frontend view.<br>GitHub: github.com/Willy0la , Medium: medium.com/@adenugawilly431</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=005a69fc394b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Form Handling in React: From useState to useForm]]></title>
            <link>https://medium.com/@adenugawilly431/form-handling-in-react-from-usestate-to-useform-4e0e374985d2?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e0e374985d2</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-hook-usestate]]></category>
            <category><![CDATA[react-hook-form]]></category>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Wed, 10 Jun 2026 09:06:53 GMT</pubDate>
            <atom:updated>2026-06-10T09:06:53.173Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jnbi-FEBF4cwgBhFZjYlgw.jpeg" /></figure><p>When I first started building forms in React, I did what most developers do I reached for useState. One field, one state variable. Simple enough. But as forms grew more complex, that approach started to crack. <br>This article walks through my personal journey: from naive state management, to dynamic field mapping, to finally discovering the power of <strong>Zod</strong> and <strong>React Hook Form</strong>. If you’ve ever spent an afternoon chasing a form validation bug, this one’s for you.</p><h3>Stage 1: The useState Trap</h3><p>My first instinct was to create a separate state variable for every input field:</p><pre>const [fullName, setFullName] = useState(&#39;&#39;);<br>const [email, setEmail] = useState(&#39;&#39;);<br>const [password, setPassword] = useState(&#39;&#39;);</pre><p>This works fine for two or three fields. But the moment a form grows let say, a registration form with eight fields you’re managing eight state variables, eight change handlers, and eight validation checks buried inside an if-chain on submit. It gets messy fast.</p><h3>Stage 2: Dynamic Field Mapping</h3><p>The next step I took was collapsing all those variables into a single form state object and looping over the fields dynamically:</p><pre>const [formData, setFormData] = useState({<br>  fullName: &#39;&#39;,<br>  email: &#39;&#39;,<br>  password: &#39;&#39;,<br>  confirmPassword: &#39;&#39;,<br>});<br><br>const handleChange = (e: React.ChangeEvent&lt;HTMLInputElement&gt;) =&gt; {<br>  const { name, value, type, checked } = e.target;<br>  setFormData((prev) =&gt; ({<br>    ...prev,<br>    [name]: type === &#39;checkbox&#39; ? checked : value,<br>  }));<br>};</pre><p>This was cleaner. But it introduced a new problem: <strong>silent failures</strong>. If I added a new field and misspelled the name attribute in the JSX, nothing would error loudly. The state simply wouldn&#39;t update for that field, and I&#39;d spend an hour wondering why my submit handler was receiving an empty string. TypeScript helps here, but it only goes so far when your form state is a plain object with no schema behind it.</p><h3>Stage 3: Adding Zod for Schema Validation</h3><p>This is where things clicked for me. <strong>Zod</strong> is a TypeScript-first schema validation library. Instead of writing validation logic inside your submit handler, you define a <em>schema</em> that describes exactly what valid data looks like and Zod does the rest.</p><p>Here’s the schema I built for a registration form:</p><pre><br>import { z } from &quot;zod&quot;;<br><br>const formSchema = z.object({<br>    fullName: z<br>        .string()<br>        .min(1, &quot;Name is required&quot;)<br>        .max(256, &quot;Name must not exceed 256 characters&quot;)<br>        .trim(),<br>    email: z<br>        .string()<br>        .email(&quot;Invalid email address&quot;) <br>        .trim()<br>        .lowercase(),<br>    password: z<br>        .string()<br>        .min(8, &quot;Password must be at least 8 characters&quot;), <br>    confirmPassword: z<br>        .string()<br>        .min(8, &quot;Confirm password must be at least 8 characters&quot;),<br>    checkBox: z<br>        .boolean()<br>        .refine((val) =&gt; val === true, {<br>            message: &quot;You must accept the terms and conditions&quot;<br>        })<br>}) <br>.refine((data) =&gt; data.password === data.confirmPassword, {<br>    message: &quot;Passwords do not match&quot;, <br>    path: [&quot;confirmPassword&quot;]<br>});<br><br>type FormSchema = z.infer&lt;typeof formSchema&gt;;<br><br>const formDefaultValue: FormSchema = {<br>    fullName: &quot;&quot;,<br>    email: &quot;&quot;,<br>    password: &quot;&quot;,<br>    confirmPassword: &quot;&quot;,<br>    checkBox: false<br>};<br><br>export { formSchema, type FormSchema, formDefaultValue };</pre><p>One of Zod’s most useful features is <strong>type inference</strong>. Instead of defining your TypeScript type separately and risk it going out of sync with your schema, you infer it directly:</p><pre>type FormSchema = z.infer&lt;typeof formSchema&gt;;</pre><p>Now your form state type is always in sync with your validation rules. Add a field to the schema, and TypeScript immediately tells you everywhere that’s affected.</p><h3>Stage 4: The Better Way “React Hook Form + Zod”</h3><p>Once I understood Zod, the next upgrade was <strong>React Hook Form</strong> (react-hook-form). This library is built specifically for form management in React, and it solves the core problem with the useState approach: <strong>unnecessary re-renders</strong>. With useState, every keystroke triggers a re-render. With React Hook Form, the form inputs are <em>uncontrolled</em> by default the library tracks values via refs, and only re-renders when it needs to (like on validation errors or submission).</p><h3>Setting Up the Integration</h3><p>First, install the packages:</p><pre>npm install react-hook-form zod @hookform/resolvers</pre><p>Then, I like to keep my schema and default values in a separate file:</p><pre><br>import { z } from &quot;zod&quot;;<br><br>const formSchema = z.object({<br>    fullName: z<br>        .string()<br>        .min(1, &quot;Name is required&quot;)<br>        .max(256, &quot;Name must not exceed 256 characters&quot;)<br>        .trim(),<br>    email: z<br>        .string()<br>        .email(&quot;Invalid email address&quot;) <br>        .trim()<br>        .lowercase(),<br>    password: z<br>        .string()<br>        .min(8, &quot;Password must be at least 8 characters&quot;), <br>    confirmPassword: z<br>        .string()<br>        .min(8, &quot;Confirm password must be at least 8 characters&quot;),<br>    checkBox: z<br>        .boolean()<br>        .refine((val) =&gt; val === true, {<br>            message: &quot;You must accept the terms and conditions&quot;<br>        })<br>}) <br>.refine((data) =&gt; data.password === data.confirmPassword, {<br>    message: &quot;Passwords do not match&quot;, <br>    path: [&quot;confirmPassword&quot;]<br>});<br><br>type FormSchema = z.infer&lt;typeof formSchema&gt;;<br><br>const formDefaultValue: FormSchema = {<br>    fullName: &quot;&quot;,<br>    email: &quot;&quot;,<br>    password: &quot;&quot;,<br>    confirmPassword: &quot;&quot;,<br>    checkBox: false<br>};<br><br>export { formSchema, type FormSchema, formDefaultValue };</pre><p>Using the Form</p><pre>import { formDefaultValue, formSchema, type FormSchema } from &#39;./FormSchema&#39;<br>import {zodResolver} from &quot;@hookform/resolvers/zod&quot;<br>import {useForm, } from &quot;react-hook-form&quot;<br>function Form() {<br><br>    const {register, handleSubmit,watch, formState:{errors,isSubmitting }, reset } = useForm&lt;FormSchema&gt;({<br>        resolver:zodResolver(formSchema),<br>        defaultValues:formDefaultValue<br>    })<br><br>     const isChecked = watch(&quot;checkBox&quot;) as boolean<br>     const onSubmit = async (data:FormSchema)=&gt;{<br>       <br> await new Promise(resolve =&gt; setTimeout(resolve, 2000))<br>        console.log(&quot;Form submitted successfully...&quot;, data)<br>  reset()<br><br>        <br>    }<br>  return (<br>    &lt;&gt;<br>    &lt;form onSubmit={handleSubmit(onSubmit)}&gt;<br>        &lt;div className=&quot;fullName&quot;&gt;<br>             &lt;label htmlFor=&#39;fullName&#39;&gt; FullName&lt;/label&gt;<br>             &lt;input id=&#39;fullName&#39; {...register(&quot;fullName&quot;)} /&gt;<br>             {errors.fullName &amp;&amp;&lt;p className=&#39;error&#39;&gt;{errors.fullName.message}&lt;/p&gt;}<br>        &lt;/div&gt;<br>        &lt;div className=&quot;email&quot;&gt;<br>            &lt;label htmlFor=&#39;email&#39;&gt; Email&lt;/label&gt;<br>            &lt;input type=&quot;email&quot;id=&#39;email&#39;{...register(&quot;email&quot;)}/&gt;<br>            {errors.email &amp;&amp; &lt;p  className=&#39;error&#39;&gt;{errors.email.message}&lt;/p&gt; }<br>        &lt;/div&gt;<br><br>        &lt;div className=&quot;pass&quot;&gt;<br>            &lt;label htmlFor=&#39;password&#39; &gt;Password&lt;/label&gt;<br>            &lt;input type=&#39;password&#39; id=&#39;password&#39; {...register(&#39;password&#39;)} /&gt;<br>            {errors.password &amp;&amp; &lt;p className=&#39;error&#39;&gt; {errors.password.message}&lt;/p&gt;}<br>        &lt;/div&gt;<br>        &lt;div className=&quot;conpass&quot;&gt;<br>            &lt;label htmlFor=&#39;confirmPassword&#39;&gt;confirmPassword&lt;/label&gt;<br>            &lt;input type=&#39;password&#39; id=&#39;confirmPassword&#39;{...register(&#39;confirmPassword&#39;, )} /&gt;<br>            {errors.confirmPassword &amp;&amp; &lt;p className=&#39;error&#39;&gt; {errors.confirmPassword.message}&lt;/p&gt;} <br>        &lt;/div&gt;<br>               &lt;div className=&quot;terms&quot;&gt;<br>          {/* Using a label element here enables clicking the text to toggle the checkbox */}<br>          &lt;label htmlFor=&quot;checkBox&quot; style={{ cursor: &#39;pointer&#39; }}&gt;<br>            &lt;input {...register(&quot;checkBox&quot;)} type=&quot;checkbox&quot; id=&quot;checkBox&quot; /&gt;<br>            &lt;span&gt; Accept terms and conditions&lt;/span&gt;<br>          &lt;/label&gt;<br>          {errors.checkBox &amp;&amp; &lt;p className=&#39;error&#39;&gt;{errors.checkBox.message}&lt;/p&gt;}<br>        &lt;/div&gt;<br>  <br>              &lt;button disabled={isSubmitting || !isChecked} type=&#39;submit&#39;&gt;{isSubmitting ? &quot;submitting...&quot;:&quot;Submit&quot;}&lt;/button&gt;<br>    &lt;/form&gt;<br>    &lt;/&gt;<br>  )<br>}<br><br>export default Form</pre><h3>Breaking Down the Key Pieces</h3><ul><li><strong>register </strong>:connects each input to React Hook Form. It handles the name, ref, onChange, and onBlur attributes automatically. No more manually writing name=&quot;email&quot; and hoping it matches your state key.</li><li><strong>handleSubmit</strong> : wraps your submit function. It runs Zod validation first; your onSubmit only fires if everything passes.</li><li><strong>errors</strong>: an object containing field-level error messages, pulled directly from your Zod schema. No more writing if (!email.includes(&#39;@&#39;)).</li><li><strong>watch</strong>: subscribes to a field&#39;s value in real time. Useful for conditional UI for example, only showing a &quot;confirm password&quot; field once the password field has content.</li><li><strong>isSubmitting</strong>: a boolean that&#39;s true while your submit handler is running. Great for disabling the submit button and preventing double-submissions.</li><li><strong>reset</strong>: a utility provided by react-hook-form that returns the form to its initial state. It&#39;s particularly useful after a successful submission or when you want users to start over without manually clearing each field.</li></ul><h3>So When Should You Use useState for Forms?</h3><p>Honestly? Rarely. Here’s a simple rule of thumb:</p><p><strong>Scenario 1.<br></strong>Single input (e.g. a search bar)<br><strong>Recommendation: </strong>useState is fine</p><p><strong>Scenario 2.<br></strong>2–3 fields, no complex validation<br><strong>Recommendation: </strong>useState is fine</p><p><strong>Scenario 3.<br></strong> 4 fields, no complex validation<br><strong>Recommendation: </strong>Use useForm + Zod</p><p><strong>Scenario 4.<br></strong> Dynamic field arrays<br><strong>Recommendation: </strong>Use useForm with useFieldArray</p><h3>Conclusion</h3><p>The journey from useState to useForm isn&#39;t just about learning a new library it&#39;s about recognising that forms are a specific problem with purpose built solutions. Zod gives you a single source of truth for your data shape. React Hook Form gives you performance and developer experience that useState simply can&#39;t match at scale. If you’re still managing complex forms with a pile of state variables and if chains, I&#39;d encourage you to give this stack a try. Your future self chasing down a validation bug at midnight will thank you.</p><p><em>Thanks for reading. If this helped you, consider sharing it with a fellow developer still deep in the useState trenches.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e0e374985d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Retries Get Expensive: The Day I Realized My Backend Was Double-Charging Users]]></title>
            <link>https://medium.com/@adenugawilly431/when-retries-get-expensive-the-day-i-realized-my-backend-was-double-charging-users-381ce19f476a?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/381ce19f476a</guid>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 20:32:22 GMT</pubDate>
            <atom:updated>2026-04-06T20:32:22.702Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Situation Every Fintech System Must Expect</h4><p>In my previous article, I spoke about database transactions and how they help prevent “orphan documents” when creating dependent records, like a User and a Wallet. Transactions ensure that both documents are created together or not at all. While building the rest of the payment logic, I started thinking about another real-world problem, what happens after the transaction is completed?<strong> </strong>What if the server crashes before the client receives the response? Or what if poor network connectivity prevents the user from seeing whether the payment succeeded? Let’s walk through a scenario every fintech system must expect.</p><p>A user sends money to a vendor. The transaction is processed successfully on the server, but the server crashes before the response is returned. From the user’s perspective, the request looks like it failed. The user gets frustrated and tries again. Maybe they click the button twice; maybe they retry two more times. Later, when they reload their wallet, they realize something terrible happened, they were debited multiple times. Now they are angry. They contact customer support, and after several complaints and investigations, the issue is eventually resolved days later. By that time, the damage is done. The user has lost trust in the system and moves their money elsewhere. Honestly, you can’t blame them.<br>The important question here is, c<strong>ould this situation have been prevented?</strong> Yes, it could.</p><h4>The Real Problem, Duplicate Requests.</h4><p>In systems that handle financial transactions, duplicate requests are extremely dangerous. A user clicking the same button twice, retrying a request, or resending a payment due to network failure can lead to multiple executions of the same transaction. This is where a concept called <strong>Idempotency</strong> becomes critical. A request is idempotent when performing the same operation multiple times produces the same result as performing it once. In simple terms, multiple identical requests should not create multiple transactions, they should always return the same outcome. To achieve this, payment systems use an <strong>Idempotency Key</strong>.</p><h4>My First Implementation</h4><p>After understanding this concept, I created an Idempotency document that contained:</p><ul><li>A unique key</li><li>The response from the original transaction</li><li>A TTL (Time to Live) value</li></ul><p>This document would be attached to every deposit or transfer request to ensure duplicate actions could not occur. At first, I was very happy with the solution until I tested it. At this point the theory made sense, but the real question was, <strong>what does this actually look like in code?</strong></p><h4>Example Implementation in My NestJS Service</h4><p>To make the system idempotent, my wallet service first checks whether a request with the same idempotency key has already been processed. If it exists, the system simply returns the previous response instead of executing the transaction again. Here is a simplified example from my NestJS service:</p><pre>async sendMoney(userId: string, dto: SendMoneyDto): Promise&lt;TransferResponse&gt; {<br>  const { amount, receiverAccountNumber, idempotencyKey } = dto;<br><br>  // Check if this request already exists<br>  if (idempotencyKey) {<br>    const existing = await this.baseService.findIdempotencyKey(idempotencyKey);<br><br>    if (existing &amp;&amp; existing.status === TransactionStatus.success) {<br>      return existing.previousResponse;<br>    }<br>  }<br><br>  const session = await this.connection.startSession();<br><br>  try {<br>    await session.withTransaction(async () =&gt; {<br><br>      // debit sender<br>      await this.baseService.decrementWalletBalance(userId, amount, session);<br><br>      // credit receiver<br>      await this.baseService.incrementWalletBalance(<br>        receiverAccountNumber,<br>        amount,<br>        session,<br>      );<br><br>      // store idempotency record<br>      await this.baseService.createIdempotencyKey(<br>        {<br>          key: idempotencyKey,<br>          status: TransactionStatus.success,<br>          previousResponse: transferSanitizer(amount),<br>        },<br>        session,<br>      );<br>    });<br><br>    return transferSanitizer(amount);<br><br>  } finally {<br>    await session.endSession();<br>  }<br>}</pre><p>The important idea here is simple, every request carries an <strong>idempotency key</strong>. If the key already exists, the service simply returns the <strong>previous response</strong> instead of executing the transaction again.</p><h4>The Bug I Didn’t Expect</h4><p>While testing my endpoint, I noticed something strange, two transactions were successfully created with the same Idempotency key. I spent hours debugging the code, thinking I had made a mistake in my application logic.<br>Eventually, I realized this wasn’t a logic problem. It was a database protection problem. The fix was simple, the idempotency key must be unique at the database level. By enforcing a <strong>unique index</strong>, the database itself prevents two records from sharing the same key. That immediately solved the issue of one key producing multiple transactions.</p><h4>Where Should the Idempotency Key Be Stored?</h4><p>Initially, I stored the idempotency key inside my Wallet schema. I quickly realized this was not ideal. As the number of transactions increased, searching through wallet records to detect duplicate keys would eventually slow down the database.</p><p>I changed the design and created a separate Idempotency collection. The wallet service would reference it when processing payments. This separation improved:</p><ul><li>Database query performance</li><li>Data organization</li><li>System scalability</li></ul><h4>The Scaling Problem</h4><p>After solving the duplication issue, another question appeared, <strong>What happens when the system grows?</strong> Imagine 10,000 requests hitting the database just to check whether an idempotency key exists. If every retry hits the database, it can quickly overwhelm the system. This is when I remembered a fundamental rule of system design, databases should not handle every repeated read request. Instead, frequently accessed data should be stored in fast, in-memory storage.</p><h4>Introducing Redis</h4><p>To optimize performance, I introduced <strong>Redis</strong>. Redis acts as a high-speed memory layer between the server and the database. When an idempotency key is processed:</p><ol><li>The server first checks Redis.</li><li>If the key exists, the stored response is returned immediately.</li><li>If it does not exist, the request proceeds to the database.</li><li>The result is then cached in Redis with a TTL.</li></ol><h4>System Flow:</h4><pre><br>Client Request<br>   ↓<br>API Server<br>   ↓<br>Redis (Idempotency Cache)<br>   ↓<br>Database (Source of Truth)</pre><p>Redis acts as the <strong>first line of protection</strong>, preventing repeated requests from reaching the database.</p><h4>The UX Perspective</h4><p>Solving this backend issue also aligns with important UX principles:</p><ul><li><strong>Murphy’s Law:</strong> “Anything that can go wrong, will go wrong.” Network failures, double-clicks, and server crashes are inevitable. By preventing duplicate charges, the system reduces user anxiety and frustration.</li><li><strong>Tesler’s Law:</strong> Every system has a certain amount of complexity that cannot be removed, only shifted. The question is: who handles the complexity — the user or the system? Idempotency shifts that responsibility to the backend.</li></ul><p>Instead of forcing users to worry about whether a request succeeded, the system safely handles retries without creating duplicate actions. This builds trust and predictability, two critical qualities in any financial system.</p><h4>What Comes Next</h4><p>I hope this article helped explain why idempotency is essential in payment systems. But shortly after I figured this out, a friend asked me another interesting question:,<strong>“What happens if two services try to modify the same wallet balance at the exact same time?”</strong> That question leads into another important topic, <strong>Concurrency</strong>. I’m currently researching and designing solutions for that scenario, and I’ll share what I learn in my next article.</p><p>Until then, cheers</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=381ce19f476a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rookie Backend Mistake That Forced Me to Learn Database Transactions]]></title>
            <link>https://medium.com/@adenugawilly431/the-rookie-backend-mistake-that-forced-me-to-learn-database-transactions-450cddbb6864?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/450cddbb6864</guid>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Sun, 08 Mar 2026 11:16:12 GMT</pubDate>
            <atom:updated>2026-03-08T11:16:12.059Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="NestJs transaction image" src="https://cdn-images-1.medium.com/max/1024/1*x2kgVoxrhPZrC5QLLOX-3w.png" /></figure><p>Recently, I had some free time and decided to build something for myself. But I didn’t want to build another basic <strong>CRUD</strong> project like a todo list or a calculator. I wanted something that would push me into system thinking and force me to do deeper research.<br>So I decided to build a digital payment service<strong> </strong>something that allows users to send and receive money.</p><h3>Starting With the Basics</h3><p>Like most backend projects, I started with the fundamentals. I created User schema, User services,<strong> </strong>Implemented <strong>Authentication (AuthN) </strong>and <strong>Authorization (AuthZ). </strong>Once everything was wired together, I tested my signup endpoint. It worked, everything looked fine but something was missing.</p><h3>The Missing Piece</h3><p>A wallet<strong> </strong>account<strong>, </strong>I started thinking about the digital payment apps I use every day. Then it suddenly clicked every single one of them has something in common, when you create an account, a wallet is automatically created for you. Users never manually create a wallet, it just exists. That realization made me go back to my code.</p><h3>My First Solution</h3><p>My first idea was simple, I created a wallet schema, then updated my signup service to create both the <strong>user account</strong> and the <strong>wallet account</strong> at the same time using Promise.all().</p><pre>await Promise.all([<br>  this.userModel.create(userData),<br>  this.walletModel.create(walletData),<br>]);</pre><p>Did it work? Yes but then another problem appeared.</p><h3>The Orphan Data Problem</h3><p>What happens if something fails halfway? For example, the user account gets created but the wallet creation fails. Now the system has a user without a wallet. Or even worse, if deletion logic is not handled correctly, I could end up with wallets that don’t belong to any user. This breaks an important rule in a payment system which states that, “<em>If a user exists, their wallet must exist and if a wallet exists, its user must exist”. <br></em>In other words, these two pieces of data must always be created together. That was when I realized my Promise.all() approach wasn&#39;t enough.</p><h3>Discovering Transactions</h3><p>I reached out to a few developer friends to ask how they would solve this problem. They all gave the same answer, Use <strong>database transactions</strong>.<strong> </strong>Transactions allow multiple database operations to be treated as <strong>a single atomic unit</strong>. This means either everything succeeds or everything fails, there is no in-between, this is what flow looks like.</p><pre>Start Transaction<br>Create User<br>Create Wallet<br>Commit Transaction</pre><p>If something fails along the way:</p><pre>Rollback Transaction</pre><p>Both records disappear, leaving the database clean and consistent. After implementing this approach, the problem was solved. But what surprised me the most was something else.</p><h3><strong>The Real Solution: Database Transactions</strong></h3><p>To fix this, I had to introduce a <strong>Session</strong>. In MongoDB, a transaction must run inside a session so the database can track all the operations as one single task.Here is the updated code:</p><pre>...<br>const session = await mongoose.startSession(); // 1. Start the session<br>session.startTransaction(); // 2. Begin the transaction<br><br>try {<br>  // 3. Create the user within the session<br>  const [user] = await this.userModel.create([userData], { session });<br><br>  // 4. Create the wallet within the same session<br>  await this.walletModel.create([{ ...walletData, userId: user._id }], { session });<br><br>  // 5. If both succeed, save changes permanently<br>  await session.commitTransaction(); <br>  console.log(&quot;Success! User and Wallet created together.&quot;);<br>} catch (error) {<br>  // 6. If ANYTHING fails, undo everything (Rollback)<br>  await session.abortTransaction();<br>  console.log(&quot;Error occurred. No data was saved to the database.&quot;);<br>  throw error;<br>} finally {<br>  // 7. Always close the session to free up resources<br>  session.endSession();<br>}<br>...<br></pre><h3>This Wasn’t Just a Database Problem</h3><p>It was also a user experience problem. Two well-known<strong> UX principles</strong> helped me understand this better.</p><p><strong>Jakob’s Law: </strong>Jakob Nielsen, the originator of <strong>Jakob’s Law</strong> states, “<em>Users spend most of their time on other websites, so they expect your site to work the same way as the ones they already know”. </em>Most fintech apps automatically create a wallet during registration. If my application forced users to click a Create Wallet button after signing up, it would introduce a non-standard interaction. Users would have to learn a new step for something they already expect the system to handle. Transactions allowed me to keep wallet creation invisible to the user, matching the behaviour of most payment apps.</p><ol><li><strong>Hick–Hyman Law</strong>: It states that, <em>The time it takes to make a decision increases with the number and complexity of choices. </em>Adding a manual wallet setup step introduces an unnecessary decision for the user. More decisions mean more friction, and more friction can discourage users from continuing. By automatically creating the wallet during registration, the system becomes simpler and faster for the user.</li></ol><h3>The Result</h3><p>Using transactions solved several problems at once:</p><ul><li>It prevented inconsistent data</li><li>It avoided orphan records</li><li>It aligned my system with industry design patterns</li><li>It improved the user experience</li></ul><p>And once I implemented it, everything worked exactly as expected.</p><h3>What I’m Working On Next</h3><p>Now I’m designing the wallet system itself, which currently supports two services:</p><ul><li>Deposits</li><li>Receiving money</li></ul><p>While working through the logic, I started asking myself some deeper questions. What happens if two services try to read and write to the same wallet balance at the same time? What happens if a transfer succeeds but the server crashes before the user receives a response? What happens if a user accidentally performs the same transaction twice? These are real problems that payment systems must handle carefully.I’m currently researching and designing solutions for these scenarios, and once I have them implemented, I’ll share what I learnt in my next article.</p><p>Until then cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=450cddbb6864" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Interfaces to DTOs: Another Contract That Changed How I Write Backend Code.]]></title>
            <link>https://medium.com/@adenugawilly431/from-interfaces-to-dtos-another-contract-that-changed-how-i-write-backend-code-6bf918be2077?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bf918be2077</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 09:56:20 GMT</pubDate>
            <atom:updated>2026-03-03T09:56:20.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3J4vNxaoAxqJwmteFtFsQ.png" /></figure><p>Earlier, I talked about interfaces and how they act as a compile-time discipline tool helping your code stay consistent before it even runs. But backend engineering isn’t just about compile-time checks, it’s a world of contracts. From compile-time, to runtime, to your API request and API response cycles, contracts are everywhere. Today, I want to cover another contract which is one of the reasons I enjoy working with NestJS so much. DTOs (Data Transfer Objects).</p><h4>What is a DTO?</h4><p>If you look at the name, it already gives you a hint.</p><ul><li><strong>D (Data)</strong> — think of it as a container</li><li><strong>T (Transfer)</strong> — a bridge connecting two parties</li><li><strong>O (Object)</strong> — the receiver, who gets exactly what they expect</li></ul><p>Above is my definition of <strong>DTO</strong>, I like to think of it this way to keep the purpose clear. Essentially, it’s a contract that validates and structures data before it hits your logic, protecting the app from malformed requests.</p><h4>Why is DTO a Class and Not an Interface?</h4><p>I often ask myself, “Why does NestJS use a class for a DTO instead of an interface?” The reason is simple but important, <strong>interfaces disappear after compilation in TypeScript.</strong> This means they cannot be used for runtime validation.<br>DTOs are not just compile-time contracts; they are runtime contracts. Using a class allows NestJS (and class-validator) to inspect the structure of the object while the application is running, enforcing validation rules before your business logic executes. This is why NestJS DTOs are always implemented as classes.</p><h4>Why DTOs Matter?</h4><ul><li><strong>Input validation</strong>: Ensuring incoming data matches expectations</li><li><strong>Sanitization: P</strong>icking only the fields you want to allow</li><li><strong>Transformation:</strong> Converting raw request data into the shape your services understand</li></ul><p>DTOs are a runtime contract. They complement interfaces (compile-time) by safeguarding your application at runtime.</p><h4>Example: DTO in NestJS</h4><p>Below is a simple DTO using class-validator to enforce input contracts:</p><pre><br>import { IsString, IsNumber, Min, Max } from &#39;class-validator&#39;;<br><br>export class CreateUserDto {<br>  @IsString()<br>  name: string;<br><br>  @IsNumber()<br>  @Min(1)<br>  @Max(120)<br>  age: number;<br><br>}</pre><h4>Using the DTO in a Controller</h4><pre>import { Body, Controller, Post } from &#39;@nestjs/common&#39;;<br>import { CreateUserDto } from &#39;./create-user.dto&#39;;<br><br>@Controller(&#39;users&#39;)<br>export class UsersController {<br>  @Post()<br>  createUser(@Body() createUserDto: CreateUserDto) {<br>    return {<br>      message: &#39;User created successfully&#39;,<br>      user: createUserDto,<br>    };<br>  }<br>}</pre><p>The DTO ensures your endpoint only works with <strong>clean, predictable data</strong>. No guessing, no type mismatches, no surprises.</p><h4>Using the DTO in a Service</h4><p>DTOs aren’t limited to controllers. You can also pass them into your <strong>services</strong> to maintain consistency across layers:</p><pre>import { Injectable } from &#39;@nestjs/common&#39;;<br>import { CreateUserDto } from &#39;./create-user.dto&#39;;<br><br>@Injectable()<br>export class UsersService {<br>  create(createUserDto: CreateUserDto) {<br>    const user = {<br>      id: Date.now(),<br>      ...createUserDto,<br>    };<br>    return user;<br>  }<br>}</pre><h4><strong>The Discipline of Contracts</strong></h4><p>I remember the first time I skipped using a DTO. A client sent age: &quot;twenty&quot; instead of a number, and my endpoint crashed. After introducing a DTO, this problem disappeared. If interfaces keep me honest during development, DTOs keep the application honest in production. Backend engineering isn’t just writing code that works, it’s designing contracts for every layer from compile-time to runtime to API boundaries. That mindset changed how I write code and why I enjoy NestJS so much.</p><p>Next, I’ll share how DTOs combine with <strong>pipes and transformation</strong> in NestJS to make endpoints even more robust and how I structure them in real projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bf918be2077" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Error That Kept Humbling Me as a Backend Engineer (Until I Discovered Interfaces)]]></title>
            <link>https://medium.com/@adenugawilly431/the-error-that-kept-humbling-me-as-a-backend-engineer-until-i-discovered-interfaces-f58f295576fa?source=rss-a36848a56afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f58f295576fa</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Adenugawilly]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 09:24:54 GMT</pubDate>
            <atom:updated>2026-02-25T09:24:54.083Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*lZtoBUuCMKuyVSIPHDKggQ.png" /></figure><p>When I started my journey as a backend engineer, I thought my biggest problems would be architecture, performance, or complex business logic. I was wrong. My biggest enemy? Data type mismatch, and it humbled me… repeatedly.</p><h4>The Silent Bug</h4><p>I would write logic that looked perfectly fine. The server compiles, the endpoint runs, and the response returns. Everything looks okay until something subtle breaks. An API that should calculate a value suddenly behaves strangely. A number behaves like a string. A boolean behaves like “truthy” chaos, and then I see it, the error! Or worse… no error at all, just incorrect behaviour.</p><h4>The Pattern I Ignored</h4><p>At first, I blamed myself. Maybe my logic is wrong, or maybe MongoDB returned something weird, or maybe I forgot to cast a value. But after this happened multiple times, I noticed something the problem wasn’t always my logic, It was structure. I was passing objects around without clearly defining what they should look like. I assumed the shape of my data, and assumptions in backend systems are dangerous.</p><h4>The Turning Point</h4><p>Then I truly understood what an interface is, not just the syntax but the philosophy behind it. An interface is a contract. It says, “If you want to use this data here, it must follow this structure. No negotiation!”</p><p>For example:</p><pre>interface User {<br>  name: string;<br>  age: number;<br>}</pre><p>Now if I try this:</p><pre>const user: User = {<br>  name: 1,<br>  age: &#39;F3E&#39;, // TypeScript stops me immediately<br>};</pre><p>Boom, error, not in production, not in staging but in my editor. That was the moment everything changed.</p><p>But if i do this:</p><pre>const user: User = {<br>  name: &quot;F3Ewer&quot;,<br>  age:22, // This matches the contract <br>};</pre><h4>Interfaces Beyond Objects</h4><p>What made interfaces even more powerful for me was realising they weren’t just for defining objects, they could shape my functions, could define service responses and could even make asynchronous code predictable.<br>For example, instead of writing vague functions like this:</p><pre>function getUser(id: string) {<br>  // returns something…<br>}</pre><p>I started doing this:</p><pre>interface UserResponse {<br>  success: boolean;<br>  data?: User;<br>  error?: string;<br>}<br><br>async function getUser(id: string): Promise&lt;UserResponse&gt; {<br>  // implementation<br>}</pre><p>Now my function wasn’t just returning something, It was returning a contract and that changed how I designed my services.</p><h4>Why This Hit Different</h4><p>Before interfaces, I was writing backend code reactively. Fix error, patch bug, and move on. After interfaces, I started thinking in contracts. Instead of asking: Does this logic work? I started asking, What is the shape of this data supposed to be? This question alone improved my code quality more than any tutorial I watched.</p><h4>What Interfaces Actually Do</h4><p>Interfaces are compile-time data contracts in TypeScript, They:</p><ul><li>Define the expected structure of an object</li><li>Catch structural mistakes early</li><li>Improve readability for other developers</li><li>Make refactoring safer</li><li>Turn assumptions into guarantees</li></ul><h4>What Interfaces Don’t Do</h4><p>They don’t exist at runtime. They don’t validate user input. They don’t replace proper request validation. But they protect you from yourself. And sometimes, that’s exactly what you need.</p><h4>The Real Lesson</h4><p>The issue was never just “data type mismatch.” It was discipline. Interfaces forced me to stop being casual about data structure. They made me design first, implement second. And that mindset shift made me grow.</p><h3>What’s Next?</h3><p>Interfaces solved part of the problem. But then I discovered something even more powerful for handling incoming request data properly… DTOs. That’s a story for the next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f58f295576fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>