< Summary

Information
Class: LifeChart.Infrastructure.Persistence.Configurations.DailyEntryConfiguration
Assembly: LifeChart.Infrastructure
File(s): /home/runner/work/lifechart/lifechart/src/LifeChart.Infrastructure/Persistence/Configurations/DailyEntryConfiguration.cs
Tag: 113_29159449707
Line coverage
0%
Covered lines: 0
Uncovered lines: 21
Coverable lines: 21
Total lines: 38
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Configure(...)100%210%

File(s)

/home/runner/work/lifechart/lifechart/src/LifeChart.Infrastructure/Persistence/Configurations/DailyEntryConfiguration.cs

#LineLine coverage
 1using LifeChart.Domain.Entries;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace LifeChart.Infrastructure.Persistence.Configurations;
 6
 7public class DailyEntryConfiguration : IEntityTypeConfiguration<DailyEntry>
 8{
 9    public void Configure(EntityTypeBuilder<DailyEntry> builder)
 10    {
 011        builder.HasKey(e => e.Id);
 12
 013        builder.HasIndex(e => e.Date).IsUnique();
 14
 015        builder.Property(e => e.Date)
 016            .HasConversion(
 017                v => v.ToDateTime(TimeOnly.MinValue),
 018                v => DateOnly.FromDateTime(v));
 19
 020        builder.Property(e => e.Mood)
 021            .HasConversion(
 022                v => v.Value,
 023                v => new MoodScore(v));
 24
 025        builder.Property(e => e.Functionality)
 026            .HasConversion(
 027                v => v.Value,
 028                v => new FunctionalityScore(v));
 29
 030        builder.Property(e => e.SleepHours)
 031            .HasConversion(
 032                v => v.Value,
 033                v => new SleepHours(v));
 34
 035        builder.Property(e => e.Symptoms).HasMaxLength(1000);
 036        builder.Property(e => e.Notes).HasMaxLength(2000);
 037    }
 38}