Refactor code formatting and improve readability: standardize line breaks and indentation across various endpoint files, enhancing code clarity and maintainability. Update package version formatting in Directory.Packages.props for consistency.
This commit is contained in:
+13
-5
@@ -27,7 +27,11 @@ public sealed class CreateProgrammingOverrideCommandHandler(IAppDbContext dbCont
|
||||
)
|
||||
return Result.Failure<Guid>(ChannelErrors.InvalidOverrideWindow);
|
||||
}
|
||||
else if (command.StartsAtUtc is not { } start || command.EndsAtUtc is not { } end || end <= start)
|
||||
else if (
|
||||
command.StartsAtUtc is not { } start
|
||||
|| command.EndsAtUtc is not { } end
|
||||
|| end <= start
|
||||
)
|
||||
{
|
||||
return Result.Failure<Guid>(ChannelErrors.InvalidOverrideWindow);
|
||||
}
|
||||
@@ -35,9 +39,9 @@ public sealed class CreateProgrammingOverrideCommandHandler(IAppDbContext dbCont
|
||||
if (command.Shows.Count == 0)
|
||||
return Result.Failure<Guid>(ChannelErrors.OverrideNeedsShow);
|
||||
|
||||
var channel = await dbContext.Channels
|
||||
.Include(c => c.Overrides)
|
||||
.ThenInclude(o => o.Shows)
|
||||
var channel = await dbContext
|
||||
.Channels.Include(c => c.Overrides)
|
||||
.ThenInclude(o => o.Shows)
|
||||
.FirstOrDefaultAsync(c => c.Id == command.ChannelId, cancellationToken);
|
||||
if (channel is null)
|
||||
return Result.Failure<Guid>(ChannelErrors.NotFound);
|
||||
@@ -57,7 +61,11 @@ public sealed class CreateProgrammingOverrideCommandHandler(IAppDbContext dbCont
|
||||
command.StartMinute!.Value,
|
||||
command.EndMinute!.Value
|
||||
)
|
||||
: channel.AddOverride(command.Mode, command.StartsAtUtc!.Value, command.EndsAtUtc!.Value);
|
||||
: channel.AddOverride(
|
||||
command.Mode,
|
||||
command.StartsAtUtc!.Value,
|
||||
command.EndsAtUtc!.Value
|
||||
);
|
||||
foreach (var show in command.Shows)
|
||||
ovr.AddShow(show.ShowId, show.Weight);
|
||||
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@ public sealed class CreateProgrammingOverrideCommandValidator
|
||||
public CreateProgrammingOverrideCommandValidator()
|
||||
{
|
||||
RuleFor(x => x.Shows).NotEmpty();
|
||||
RuleForEach(x => x.Shows).ChildRules(s => s.RuleFor(i => i.Weight).InclusiveBetween(1, 1000));
|
||||
RuleForEach(x => x.Shows)
|
||||
.ChildRules(s => s.RuleFor(i => i.Weight).InclusiveBetween(1, 1000));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user