The task to be solved consisted of enforcing a 4-digit max size to Symitar core codes. It sounded easy enough, but a quick run through the domain revealed that core id fields were spread across eight different admin pages, each uniquely structured, implemented within their own context. Many forms had unique ‘core_id’ field names.
I had to extend existing jQuery Validation library functionality to accept custom messages and errors returned from Ajax requests to the back-end, instead of simply supplying cookie-cutter error strings on validation failure. The library claims to do this out of the box, but you have to dig a ways to figure out how to actually implement it.
It also needed to play nice with Knockout-enabled fields and dynamically editable multi-rows. A high test coverage using both PHPUnit and Jasmine was also required. My eventual Symitar core validation solution was done in a way that could be easily extendible to future core implementations.