package economics import ( "encoding/json" "strings" "testing" ) // TestManualBillMarshalsWithoutPulledAt: a SourceManual bill never sets // PulledAt, and encoding/json's omitempty does NOT treat a zero time.Time as // empty — omitzero does. A manual bill that marshalled a pulled_at key would // lie: "0001-01-01T00:00:00Z" reads as a real pull that never happened. func TestManualBillMarshalsWithoutPulledAt(t *testing.T) { b := Bill{ Schema: 1, Month: "2026-08", TotalUSD: 42.5, Services: map[string]float64{"AmazonEC2": 42.5}, Source: SourceManual, } raw, err := json.Marshal(b) if err != nil { t.Fatal(err) } if strings.Contains(string(raw), "pulled_at") { t.Fatalf("manual bill marshalled a pulled_at key: %s", raw) } }