< Summary

Information
Class: OzonDomains.Models.BitrixStockAutoSchedule
Assembly: OzonDomains
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/BitrixStockAutoSchedule.cs
Line coverage
78%
Covered lines: 11
Uncovered lines: 3
Coverable lines: 14
Total lines: 61
Line coverage: 78.5%
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_Name()100%11100%
get_ActionType()100%11100%
get_FilterJson()100%11100%
get_OzonClientId()100%210%
get_CronExpression()100%11100%
get_IsActive()100%11100%
get_MaxItemsPerRun()100%11100%
get_LastRunAt()100%210%
get_NextRunAt()100%11100%
get_CreatedAt()100%11100%
get_UpdatedAt()100%11100%
get_OzonClient()100%210%
get_Runs()100%11100%

File(s)

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

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using System.ComponentModel.DataAnnotations.Schema;
 3
 4namespace OzonDomains.Models;
 5
 6[Table("BitrixStockAutoSchedules")]
 7public class BitrixStockAutoSchedule
 8{
 9    [Key]
 310    public int Id { get; set; }
 11
 12    [Required]
 13    [MaxLength(256)]
 614    public string Name { get; set; } = string.Empty;
 15
 16    /// <summary>Clear — обнуление; Push — накат по связанным складам.</summary>
 17    [Required]
 18    [MaxLength(50)]
 319    public string ActionType { get; set; } = BitrixStockAutoActionTypes.Clear;
 20
 21    [Required]
 322    public string FilterJson { get; set; } = "{}";
 23
 024    public int OzonClientId { get; set; }
 25
 26    [Required]
 27    [MaxLength(100)]
 328    public string CronExpression { get; set; } = "0 3 * * *";
 29
 630    public bool IsActive { get; set; } = true;
 31
 332    public int MaxItemsPerRun { get; set; } = 500;
 33
 034    public DateTime? LastRunAt { get; set; }
 35
 336    public DateTime? NextRunAt { get; set; }
 37
 338    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
 39
 340    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
 41
 42    [ForeignKey(nameof(OzonClientId))]
 043    public virtual OzonClient? OzonClient { get; set; }
 44
 345    public virtual ICollection<BitrixStockAutoScheduleRun> Runs { get; set; } = new List<BitrixStockAutoScheduleRun>();
 46}
 47
 48public static class BitrixStockAutoActionTypes
 49{
 50    public const string Clear = "Clear";
 51    public const string Push = "Push";
 52}
 53
 54public static class BitrixStockAutoScheduleRunStatus
 55{
 56    public const string Running = "Running";
 57    public const string Success = "Success";
 58    public const string Failed = "Failed";
 59    public const string Skipped = "Skipped";
 60    public const string PartialSuccess = "PartialSuccess";
 61}