using System; using _0_Framework.Domain.CustomizeCheckoutShared.Enums; namespace _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects; public record BreakTime { public BreakTime() { } public BreakTime(bool hasBreakTimeValue, TimeOnly breakTimeValue) { HasBreakTimeValue = hasBreakTimeValue; if (hasBreakTimeValue) { if (breakTimeValue == new TimeOnly()) { BreakTimeValue = breakTimeValue; BreakTimeType = BreakTimeType.WithoutTime; } else { BreakTimeType = BreakTimeType.WithTime; BreakTimeValue = breakTimeValue; } HasBreakTimeValue = true; } else { BreakTimeType = BreakTimeType.None; BreakTimeValue = new TimeOnly(); HasBreakTimeValue = false; } } public bool HasBreakTimeValue { get; set; } public BreakTimeType BreakTimeType { get; private set; } public TimeOnly BreakTimeValue { get; set; } }