namespace MeterVault.Core.Domain; /// /// How a meter's raw readings become normalized consumption (SDD §5.2). /// Stored as text in the database via a value converter. /// public enum MeterMode { /// Monotonic register (electricity house/grid/EV, water). Consumption = Δ register, with swaps/resets. CumulativeCounter, /// Monotonic generation register (PV). Δ register → generation. GenerationCounter, /// Cumulative operating hours (burner). Δ hours × rate (fixed or empirical) → consumption. RuntimeCounter, /// Tank/bottle with deliveries + level. Deliveries add; usage from level-Δ and/or runtime×rate; forecast to empty. ConsumableBalance, /// Source already reports increments. The value is the increment. DirectDelta, /// Power/flow sensor. Consumption = rate integrated over time (trapezoidal). InstantRate, /// Computed from other meters via a user-defined expression. Virtual, } /// Whether a normalized amount is drawn (consumption) or produced (generation). public enum ConsumptionKind : short { Consumption = 0, Generation = 1, } /// Provenance/confidence of a reading or consumption row. public enum ReadingQuality : short { Measured = 0, Estimated = 1, Manual = 2, Imported = 3, Interpolated = 4, } /// Bitmask annotations on a reading/consumption delta. [Flags] public enum ReadingFlags { None = 0, CounterReset = 1, MeterSwap = 2, Anomaly = 4, } /// Discrete meter lifecycle/correction events (SDD meter_event.event_type). public enum MeterEventType { MeterSwap, CounterReset, Delivery, TankLevel, Correction, Note, } /// Where a meter_source pulls values from. public enum SourceType { Mqtt, Tasmota, HomeAssistant, Manual, Import, Virtual, } /// What kind of quantity a source reports (drives normalization). public enum SourceValueKind { Register, Delta, Rate, Level, Runtime, } /// Scope a tariff applies to. public enum TariffScope { Global, EnergyType, Meter, } /// Which price component a tariff row carries. public enum TariffComponent { UnitPrice, BasePrice, FeedIn, Bonus, Discount, Tax, } /// How a tank's runtime→consumption rate is derived. public enum TankRateMode { Fixed, Empirical, } /// Type of an ingestion endpoint (broker / HA connection). public enum EndpointType { MqttBroker, HomeAssistant, }