Eikaiwa Admin Dev Diary #2 - Historical Billing Records

I've thrown myself into coding this last couple of weeks and have managed to implement both historical lesson records and billing records. These are completely unaffected by changes to course names, textbooks, pricing and other settings.

Historical Billing Billing records frozen, but not forgotten

A double dilemma

In theory, while keeping unbreakable past records is a good idea, it's not terribly easy to manage. Particularly for billing records; every invoice preview, billing statement or table of downloaded data has to run through a check: Is this for the current billing period or a past record?

How these records are stored differs. A current record relies on dynamic database lookups for its data. Historical records are self-contained. This means that features that look at both need to retrieve the data in different ways but format them to display the same. Needless to say, it's been quite a head scratcher.

Its all in the past

Fortunately, I've pulled through and completed this architectural shift, except for some lingering UI cleanup. I can breathe easy knowing that our school's data is locked away, safe and sound (so long as I run a backup!).

Back to the future

As a bonus, I added the ability to bill in advance or in arrears. While most schools prefer the former, others might prefer to collect fees owed at the end of the month. It's a bit tricky trying to keep the system flexible enough for how different eikaiwa schools operate. I'm satisfied, though, that Eikaiwa Admin can handle both billing periods.

Shadow planning on hold

I'm tempted to launch into the "shadow planning" feature - the ability to prep a new school year while the current one is still ongoing, but I have a laundry list of minor bug fixes, optimizations and language translations that I really need to clear out before inevitably adding more.