< Summary

Information
Class: OzonDomains.Models.WarehouseStockSyncRun
Assembly: OzonDomains
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/WarehouseStockSyncRun.cs
Line coverage
58%
Covered lines: 7
Uncovered lines: 5
Coverable lines: 12
Total lines: 59
Line coverage: 58.3%
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%11100%
get_SourceType()100%11100%
get_Status()100%11100%
get_StartedAtUtc()100%11100%
get_CompletedAtUtc()100%210%
get_RowsRead()100%210%
get_RowsSaved()100%210%
get_TriggeredBy()100%210%
get_SourceFileName()100%210%
get_ErrorMessage()100%11100%
get_CreatedAtUtc()100%11100%
get_SnapshotRows()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/WarehouseStockSyncRun.cs

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using System.ComponentModel.DataAnnotations.Schema;
 3
 4namespace OzonDomains.Models;
 5
 6[Table("WarehouseStockSyncRuns")]
 7public class WarehouseStockSyncRun
 8{
 9    [Key]
 10    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 2511    public long Id { get; set; }
 12
 13    [Required]
 14    [MaxLength(32)]
 2515    public string SourceType { get; set; } = WarehouseStockSyncSourceType.GoogleSheets;
 16
 17    [Required]
 18    [MaxLength(32)]
 3019    public string Status { get; set; } = WarehouseStockSyncRunStatus.Running;
 20
 1621    public DateTime StartedAtUtc { get; set; } = DateTime.UtcNow;
 22
 023    public DateTime? CompletedAtUtc { get; set; }
 24
 025    public int RowsRead { get; set; }
 26
 027    public int RowsSaved { get; set; }
 28
 29    [MaxLength(255)]
 030    public string? TriggeredBy { get; set; }
 31
 32    [MaxLength(255)]
 033    public string? SourceFileName { get; set; }
 34
 235    public string? ErrorMessage { get; set; }
 36
 1437    public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
 38
 1439    public virtual ICollection<WarehouseStockSnapshot> SnapshotRows { get; set; } = new List<WarehouseStockSnapshot>();
 40}
 41
 42public static class WarehouseStockSyncRunStatus
 43{
 44    public const string Running = "Running";
 45    public const string Success = "Success";
 46    public const string Failed = "Failed";
 47}
 48
 49public static class WarehouseStockSyncSourceType
 50{
 51    public const string GoogleSheets = "GoogleSheets";
 52    public const string ExcelManual = "ExcelManual";
 53
 54    /// <summary>
 55    /// Нулевая строка-«надгробие» для артикула, исчезнувшего из источника: без неё отчёт этапа 1
 56    /// не видит артикул и не обнуляет его остаток на маркетплейсе.
 57    /// </summary>
 58    public const string Tombstone = "Tombstone";
 59}