Files
MeterVault/src/Core/Domain/Tariff.cs
T
schmidt.florian 48a7f5a825 M0: scaffold solution, EF+Timescale schema, /healthz
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
2026-07-13 11:02:21 +02:00

31 lines
874 B
C#

namespace MeterVault.Core.Domain;
/// <summary>
/// A price component with a validity range (price history), scoped globally, per energy
/// type, or per meter (SDD §5.3 <c>tariff</c>, FR-9). <see cref="ValidTo"/> null = open-ended.
/// </summary>
public sealed class Tariff
{
public int Id { get; set; }
public TariffScope ScopeType { get; set; }
/// <summary>energy_type.id or meter.id; null for global scope.</summary>
public int? ScopeId { get; set; }
public TariffComponent Component { get; set; }
public double Value { get; set; }
/// <summary>e.g. 'EUR/kWh', 'EUR/m3', 'EUR/100L', 'EUR/month'.</summary>
public required string Unit { get; set; }
public string Currency { get; set; } = "EUR";
public DateOnly ValidFrom { get; set; }
public DateOnly? ValidTo { get; set; }
public string? Notes { get; set; }
}