| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace WinSolutions.Sveta.Server.Data.DataModel.Entities |
| | | 5 | | { |
| | | 6 | | public class DepartmentCategoryRatio : ExternalRecord, ITrackableRecord |
| | | 7 | | { |
| | 14 | 8 | | public long CategoryId { get; set; } |
| | | 9 | | |
| | | 10 | | // <summary> |
| | | 11 | | /// Категория товара |
| | | 12 | | /// </summary> |
| | | 13 | | [Required] |
| | 17 | 14 | | public Category Category { get; set; } |
| | | 15 | | |
| | 14 | 16 | | public long DepartmentId { get; set; } |
| | | 17 | | |
| | | 18 | | // <summary> |
| | | 19 | | /// Подразделение |
| | | 20 | | /// </summary> |
| | | 21 | | [Required] |
| | 0 | 22 | | public Department Department { get; set; } |
| | | 23 | | |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Торговый коэффициент |
| | | 27 | | /// </summary> |
| | | 28 | | [Required] |
| | | 29 | | [Column(TypeName = "decimal(18,2)")] |
| | 24 | 30 | | public decimal TradeRatio { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Переводит проценты из TradeRation в коэффициент, на который можно умножить. Для упрощения вычислений. |
| | | 34 | | /// </summary> |
| | | 35 | | [NotMapped] |
| | 0 | 36 | | public decimal RatioForCalculations => TradeRatio / 100; |
| | | 37 | | } |
| | | 38 | | } |