mohd-faraz

_blogs

// blogs / 20260612.md

Dev Log: June 12 Wrap-up

2026-06-12
#refactoring#java#angular#ux#crm

Overview

Today was all about consistency and cleaning up 'manual' work. I spent a good chunk of time moving more modules over to our shared grid component and finally killed off some redundant mapping logic in the backend that was becoming a maintenance headache.

What I Worked On

Cleaning up the Decorator mess

I noticed my CRM decorators were becoming a wall of manual setters. Every time I wanted to pass data from a customer record to a deal, I was manually mapping twenty different fields. It was tedious and error-prone. I refactored this to use a generic map conversion, which cut down about 30 lines of boilerplate per file.

I also implemented a more elegant way to handle dynamic data—like record counts—using transient keys. Instead of trying to keep a hardcoded count in sync in the database (which is always a bad idea), the decorator now fetches it on the fly when the resource is requested.

// Much cleaner than manual mapping
newResource.convertMapToResource(sourceResource.convertResourceToMap());
newResource.unSetId(); // Keep the original ID out of the new record
newResource.setLink(sourceResource.getId());

Refining the Filter Logic

I had to circle back to the filtering system. We have this is_not operator for our data grids, and the logic for multi-select was behaving a bit weirdly with how it joined values. I simplified the string builder so the backend can parse the negation more reliably.

I also brought back the multi-select dropdown with a much better UI. Users can now pick multiple options from a list, and it renders them as nice little chips/tags. It's a small thing, but it makes the 'Partner' and 'Leads' views feel a lot more modern and usable.

UI Polish and Consistency

I finally migrated the Leads module to use our centralized data-card-grid. Having a single source of truth for how lists and filters work across the app is making my life so much easier. While I was at it, I fixed a minor but annoying UX issue: our delete confirmation popups were showing internal database IDs. I swapped those out to show the actual human-readable record codes. It’s much less intimidating for the user to see “Delete Lead: LD-101” instead of a random UUID.

Wrapping Up

Everything feels a bit more “locked in” now that the main modules are using the same grid logic. Tomorrow, I’ll probably dive deeper into some performance tweaks for the reporting engine, but for now, I'm happy with the cleanup. Catch you later.