< Summary

Class:WinSolutions.Sveta.Server.Data.DataModel.Entities.Cluster
Assembly:WinSolutions.Sveta.Server
File(s):/opt/dev/sveta_api_build/WinSolutions.Sveta.Server/Data/DataModel/Entities/Cluster.cs
Covered lines:7
Uncovered lines:1
Coverable lines:8
Total lines:57
Line coverage:87.5% (7 of 8)
Covered branches:0
Total branches:0

Metrics

MethodLine coverage Branch coverage
get_Name()100%100%
get_TradeRatio()100%100%
get_RatioForCalculations()100%100%
get_Departments()100%100%
get_MinOrderSum()100%100%
get_WarehouseId()0%100%
get_Warehouse()100%100%
get_ClusterDeliveryTypes()100%100%

File(s)

/opt/dev/sveta_api_build/WinSolutions.Sveta.Server/Data/DataModel/Entities/Cluster.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel.DataAnnotations;
 4using System.ComponentModel.DataAnnotations.Schema;
 5using System.Text;
 6
 7namespace WinSolutions.Sveta.Server.Data.DataModel.Entities
 8{
 9    public class Cluster : ExternalRecord, ITrackableRecord
 10    {
 11        /// <summary>
 12        /// Наименование
 13        /// </summary>
 14        [Required]
 75115        public string Name { get; set; }
 16
 17        /// <summary>
 18        /// Торговый коэффициент
 19        /// </summary>
 20        [Required]
 21        [Column(TypeName = "decimal(18,2)")]
 53022        public decimal TradeRatio { get; set; }
 23
 24        /// <summary>
 25        /// Переводит проценты из TradeRation в коэффициент, на который можно умножить. Для упрощения вычислений.
 26        /// </summary>
 27        [NotMapped]
 1028        public decimal RatioForCalculations => TradeRatio / 100;
 29
 30        /// <summary>
 31        /// Подразделения
 32        /// </summary>
 119633        public List<Department> Departments { get; set; } = new List<Department>();
 34
 35        /// <summary>
 36        /// Минимальная сумма заказа
 37        /// </summary>
 38        [Required]
 39        [Column(TypeName = "decimal(18,2)")]
 58540        public decimal MinOrderSum { get; set; }
 41
 42        /// <summary>
 43        /// Id склада-владелеца
 44        /// </summary>
 045        public long WarehouseId { get; set; }
 46
 47        /// <summary>
 48        /// Склад-владелец
 49        /// </summary>
 101950        public Department Warehouse { get; set; }
 51
 52        /// <summary>
 53        /// Типы доставки
 54        /// </summary>
 115755        public List<ClusterDeliveryType> ClusterDeliveryTypes { get; set; } = new List<ClusterDeliveryType>();
 56    }
 57}