< Summary

Information
Class: Services.ChannelTaskServices.ChannelTaskState
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ChannelTaskServices/ChannelTaskModels.cs
Line coverage
100%
Covered lines: 15
Uncovered lines: 0
Coverable lines: 15
Total lines: 68
Line coverage: 100%
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_TaskId()100%11100%
get_Type()100%11100%
get_Status()100%11100%
get_Stage()100%11100%
get_Message()100%11100%
get_Current()100%11100%
get_Total()100%11100%
get_Percent()100%11100%
get_FileName()100%11100%
get_Error()100%11100%
get_ResultKind()100%11100%
get_ReportId()100%11100%
get_CreatedAtUtc()100%11100%
get_StartedAtUtc()100%11100%
get_CompletedAtUtc()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ChannelTaskServices/ChannelTaskModels.cs

#LineLine coverage
 1using Services.BitrixStockServices;
 2
 3namespace Services.ChannelTaskServices;
 4
 5public static class ChannelTaskStages
 6{
 7    public const string Queued = "queued";
 8    public const string Loading = "loading";
 9    public const string Building = "building";
 10    public const string Saving = "saving";
 11    public const string Sending = "sending";
 12    public const string Completed = "completed";
 13    public const string Failed = "failed";
 14}
 15
 16public enum ChannelTaskType
 17{
 18    BitrixSyncReportExcel,
 19    BitrixSyncReportEmail,
 20    TransactionExcel
 21}
 22
 23public enum ChannelTaskResultKind
 24{
 25    None,
 26    File,
 27    Email
 28}
 29
 30public sealed class ChannelTaskState
 31{
 49432    public string TaskId { get; init; } = string.Empty;
 22533    public ChannelTaskType Type { get; init; }
 56634    public string? Status { get; set; } = ChannelTaskStages.Queued;
 54035    public string? Stage { get; set; } = ChannelTaskStages.Queued;
 49836    public string? Message { get; set; } = "Ожидание запуска…";
 3437    public int Current { get; set; }
 3438    public int Total { get; set; }
 26039    public int Percent { get; set; }
 2640    public string? FileName { get; set; }
 841    public string? Error { get; set; }
 3342    public ChannelTaskResultKind ResultKind { get; set; } = ChannelTaskResultKind.None;
 22643    public string? ReportId { get; set; }
 2033244    public DateTime CreatedAtUtc { get; init; } = DateTime.UtcNow;
 2045    public DateTime? StartedAtUtc { get; set; }
 2011546    public DateTime? CompletedAtUtc { get; set; }
 47}
 48
 49internal sealed class ChannelTaskWorkItem
 50{
 51    public required string TaskId { get; init; }
 52    public required ChannelTaskType Type { get; init; }
 53    public required string PayloadJson { get; init; }
 54}
 55
 56public sealed class BitrixSyncReportTaskPayload
 57{
 58    public string? ReportId { get; set; } = string.Empty;
 59    public BitrixStockSyncReportQuery? Query { get; set; }
 60}
 61
 62public sealed class TransactionExcelTaskPayload
 63{
 64    public int? TransactionId { get; set; }
 65    public int[] OrderIds { get; set; } = Array.Empty<int>();
 66    public int[] DeletedOrderIds { get; set; } = Array.Empty<int>();
 67    public bool TableMode { get; set; }
 68}