< Summary - Syki

Information
Class: Syki.Back.Commands.Domain.Commands.CommandBatch
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Domain/Commands/CommandBatch.cs
Tag: 97_27801654829
Line coverage
0%
Covered lines: 0
Uncovered lines: 21
Coverable lines: 21
Total lines: 46
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
get_Id()100%210%
get_InstitutionId()100%210%
get_Type()100%210%
get_Status()100%210%
get_CreatedAt()100%210%
get_ProcessedAt()100%210%
get_SourceCommandId()100%210%
get_NextCommandId()100%210%
get_Size()100%210%
.ctor()100%210%
New(...)100%210%
ContinueWith(...)100%210%

File(s)

/home/runner/work/syki/syki/Back/Domain/Commands/CommandBatch.cs

#LineLine coverage
 1namespace Syki.Back.Commands.Domain.Commands;
 2
 3public class CommandBatch
 4{
 05    public int Id { get; set; }
 06    public int InstitutionId { get; set; }
 07    public CommandBatchType Type { get; set; }
 08    public CommandBatchStatus Status { get; set; }
 09    public DateTime CreatedAt { get; set; }
 010    public DateTime? ProcessedAt { get; set; }
 11
 12    /// <summary>
 13    /// Id do comando que gerou o lote
 14    /// </summary>
 015    public int? SourceCommandId { get; set; }
 16
 17    /// <summary>
 18    /// Id do comando que será executado quando o lote for processado com sucesso
 19    /// </summary>
 020    public int? NextCommandId { get; set; }
 21
 022    public int Size { get; set; }
 23
 024    private CommandBatch() { }
 25
 26    public static CommandBatch New(
 27        int institutionId,
 28        CommandBatchType type,
 29        int? sourceCommandId = null)
 30    {
 031        return new()
 032        {
 033            Type = type,
 034            CreatedAt = DateTime.UtcNow,
 035            InstitutionId = institutionId,
 036            Status = CommandBatchStatus.Pending,
 037            SourceCommandId = sourceCommandId,
 038        };
 39    }
 40
 41    public void ContinueWith(Command command)
 42    {
 043        NextCommandId = command.Id;
 044        command.SetAwaiting();
 045    }
 46}