Refactored the Closed Deal Code

Dark Magic Demand

Today I spent a good chunk of the day refactoring the clojure code with regards to the Closed Deals out of Salesforce. Specifically, after I got all the original work done, I realized that as it stood, I didn't have a change of working. Why? Because the deals would change over time. The moment a deal popped up, it's have a fill count of zero and then over time, it'd increase to some final value.

This means we'd have to have mutable database records, and that's totally against the immutable concept that my co-worker had for the entire clojure-based project. So to make it mutable would make it impossible to re-run the code for any point in time - and that's no good. So it meant that I needed to re-do the code and get it to work with closed deal sets and then compare the sets I load in from Salesforce to the sets available in the database.

It wasn't horrific, but it wasn't trivial. I'm getting better at clojure, and that's nice, but it's also the korma library and all the other supporting tools that I need to get up to speed on to really be productive. In the end, there were a few issues, and yet I was able to get them resolved pretty easily.

In the end, I was able to get the imports running again in UAT and that was a great feeling. It was (albeit tiny) progress for the day.