architecture · Jun 2025 – Present

Owning Solar Billing & Time-of-Use Rate Optimization End to End

Own solar billing and time-of-use rate optimization end to end — API design, data modelling, release — turning seasonal and mid-cycle rate logic into accurate, repeatable costs.

Role
End-to-end owner — API design, data modelling, implementation, and release
Team
Backend engineering
Scope
Solar billing and TOU rate optimization for utility customers on Bidgely's B2B energy SaaS platform
Level
Software Engineer

Ownership

end to end

Method: Own the feature from API design and data modelling through implementation and release.
Window: during tenure

Rate logic covered

seasonal + TOU + mid-cycle

Method: Scope of rate logic the calculation handles: seasonal tariffs, time-of-use periods, and rate changes that land mid billing cycle.
Window: by design

Cost output

repeatable

Method: Design property: cost is computed deterministically from interval data, rate version, and billing period, so the same inputs always reproduce the same output.
Window: by design

Context

Bidgely sells to utilities. Two of the things utilities and their customers care about most are getting a solar bill right and finding the cheapest time-of-use rate plan for how a household actually uses energy. I own that area end to end — API design, data modelling, implementation, and release — on a high-volume B2B energy SaaS platform.

The hard part isn't arithmetic. It's that real tariffs are messy: rates vary by season and by time of day, they differ between utilities, and they change — sometimes in the middle of someone's billing cycle.

Rates are data, not code

The tempting first move is to code each utility's tariff directly. It's fast for the first one and painful for every one after: each rate change becomes a deploy, and mid-cycle changes become special cases scattered through the code.

Instead, rate plans are modelled as effective-dated data — seasons, TOU periods, and the dates each version applies. One calculation path looks up whichever rate version was in effect for each interval. A billing period that crosses a rate change simply resolves to two versions.

Same inputs, same answer

Billing output is something people act on, so it has to be repeatable. Cost is computed as a pure function of interval data, rate version, and billing period over large historical datasets — not as running totals mutated over time. Late or corrected data means a recompute, not a mystery. Any number can be reproduced and explained, and results can be tested against known historical bills.

Owning the contract

The outputs feed other product surfaces that serve utility customers, so I designed the APIs around the questions consumers need answered rather than around the internal model. That kept the contract stable while the internals evolved — and owning it through release meant the person who designed it was also accountable for it working in production.

What broke

My first take on a billing period that straddled a rate change prorated it across the two rate versions. That's wrong for TOU: usage isn't spread evenly across a cycle, so the split has to happen on the interval data at the effective boundary. Validation against historical bills surfaced it before release. Now I split on the data at the exact boundary, and I validate against real historical bills that include rate changes and season boundaries — not just clean single-tariff months.

Outcomes

Seasonal, time-of-use, and mid-cycle rate logic runs through one calculation path; cost output is accurate and repeatable; and new tariffs or rate changes are data changes, not code changes.

Decision Records

Where I Got It Wrong

Failure 1

Billing periods that straddled a rate change were first handled by prorating the period across the two rate versions, which is wrong for TOU plans — usage isn't spread evenly across a billing cycle, so the split has to happen on the interval data at the effective boundary

Cost: Rework of the period-splitting logic before release, and a fresh round of validation against historical bills

Lesson: In billing, split on the data at the exact effective boundary — never approximate with proration — and validate against real historical bills that include rate changes and season boundaries, not only clean single-tariff months

Long-Term Impact

A billing and rate-optimization backend where new tariffs and rate changes are data, and every number can be reproduced and explained to a utility.