48a7f5a825
Five-project Clean Architecture solution (Core/Infrastructure/App + Core.Tests/ Integration.Tests) on .NET 10 with central package management, snake_case EF mapping, and shared build/style config. - Full domain entity set + EF DbContext for the SDD §5.3 schema (singular table names). - InitialSchema migration (relational) + TimescaleHypertables migration (raw SQL: create_hypertable + compression on reading, hypertable on consumption). - App wiring: Serilog (actually wired, unlike MQTTower), DbContext, migrate-on-startup, /healthz. Serves plain HTTP behind a reverse proxy (no HTTPS redirect). - deploy/Dockerfile (2-stage, ICU-capable) + docker-compose (app + timescaledb). - Integration.Tests: shared TimescaleFixture (Testcontainers) — migrations, hypertables, compression policy, and /healthz all verified green (4/4). Claude-Session: https://claude.ai/code/session_01WujdMtMJPbxDpDnMeK22rr
25 lines
747 B
C#
25 lines
747 B
C#
namespace MeterVault.Core.Domain;
|
|
|
|
/// <summary>
|
|
/// A raw, immutable, timestamped meter value — the audit truth (SDD §5.3 <c>reading</c>).
|
|
/// Backed by a TimescaleDB hypertable with composite key (meter_id, time).
|
|
/// The value is a register / level / hours / rate in the meter's own unit.
|
|
/// </summary>
|
|
public sealed class Reading
|
|
{
|
|
public DateTimeOffset Time { get; set; }
|
|
|
|
public int MeterId { get; set; }
|
|
|
|
public double Value { get; set; }
|
|
|
|
public int? SourceId { get; set; }
|
|
|
|
public ReadingQuality Quality { get; set; }
|
|
|
|
public ReadingFlags Flags { get; set; }
|
|
|
|
/// <summary>Provenance batch when this row came from a CSV/bulk import (revert support).</summary>
|
|
public int? ImportBatchId { get; set; }
|
|
}
|