mohd-faraz

_blogs

// blogs / 20260703.md

Dev Log: July 03 Wrap-up

2026-07-03
#bug-fixing#ui-ux#angular#logic-cleanup#automation

Overview

Today was one of those days where I felt like I was playing whack-a-mole with small, pesky bugs. Nothing groundbreaking, but the kind of 'death by a thousand cuts' issues that make a system feel clunky if you don't stay on top of them. I spent most of my time refining order calculations, fixing UI edge cases, and automating some boring status updates.

What I Worked On

Squashing Floating-Point Weirdness

I spent a good chunk of the afternoon in our order decorator logic. We were seeing some tiny but annoying discrepancies in how totals were being calculated—classic floating-point math issues. I ended up adding some helpers to ensure we're rounding amounts and percentages to two decimal places consistently.

I also ran into a fun little recursive loop where updating the form was triggering the decorator, which then tried to update the form again. I fixed that with a simple isUpdating flag to guard the logic. It’s a classic pattern, but it always feels satisfying when the UI stops flickering and just works.

// Simple guard to prevent the decorator from triggering itself
if (this.isUpdating) return;
this.isUpdating = true;
try {
    this.calculateTotals(form);
    // Ensure we handle decimal steps in the UI
    this.applyRounding(form);
} finally {
    this.isUpdating = false;
}

To make this work properly for the users, I also had to update the JSON configurations for our numeric inputs. Adding step: "any" across our value fields means the browser won't complain when someone enters a decimal. It’s a tiny change, but it removes a huge point of friction.

Automating Invoice Statuses

I noticed we were making users manually update invoice statuses even after they’d already entered payment details. That felt like unnecessary busywork. I added a hook to the invoice decorator so that whenever a payment reference and mode are present, the system automatically marks the invoice as paid. If the data is there, the system should be smart enough to know what it means.

UI Polish and CRM Plumbing

There were a few spots in the partner portal that needed some love:

  • Revenue Formatting: The partner detail view was breaking when revenue data wasn't available. I added a quick check to return a placeholder instead of crashing the formatter.
  • Lead Conversion: Fixed a routing bug where converting a lead was occasionally pointing to the wrong resource type. I had to pass down the specific customer resource through the route data to keep things consistent.
  • Auto-population: For our distributor-partner forms, I made sure the distributor ID is auto-selected and locked. It saves a few clicks and prevents data entry errors.

Wrapping Up

Most of today was about making the system more predictable. Whether it's rounding decimals correctly or automating a status change, these small wins add up to a much smoother experience. Tomorrow, I'm hoping to dive back into some heavier feature work, but it feels good to have cleared the deck of these smaller tickets. Catch you later.