< Summary

Class:SVETA.Api.Data.DTO.ContractsContractorDTO
Assembly:SVETA.Api
File(s):/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/SupplyContractDTO.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:88
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:0

Metrics

MethodLine coverage Branch coverage
.ctor(...)0%100%
get_Id()0%100%
get_ShortName()0%100%
get_Inn()0%100%

File(s)

/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/SupplyContractDTO.cs

#LineLine coverage
 1using System;
 2using System.ComponentModel.DataAnnotations;
 3using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 4using SVETA.Api.Validation;
 5
 6namespace SVETA.Api.Data.DTO
 7{
 8    public class SupplyContractRequestDTO
 9    {
 10        [DigitValidate(CanBeZero = false, CanBeNegative = true)]
 11        [Display(Name = "Покупатель")]
 12        public long Seller { get; set; }
 13        [DigitValidate(CanBeZero = false, CanBeNegative = true)]
 14        [Display(Name = "Продавец")]
 15        public long Buyer { get; set; }
 16        [Required]
 17        public DateTimeOffset BeginDate { get; set; }
 18        [Required]
 19        public DateTimeOffset EndDate { get; set; }
 20        [Required]
 21        public DateTimeOffset ConclusionDate { get; set; }
 22        [DigitValidate]
 23        [Display(Name = "Размер предоплаты")]
 24        public decimal PrepaimentPercent { get; set; }
 25        [DigitValidate]
 26        [Display(Name = "Торговый коэффициент")]
 27        public decimal TradeRatio { get; set; }
 28    }
 29
 30    public class SupplyContractDTO_GET : BaseDTO
 31    {
 32        public SupplyContractDTO_GET(SupplyContract data)
 33        {
 34            Id = data.Id;
 35            DocumentNumber = data.DocumentNumber;
 36            Seller = new ContractsContractorDTO(data.Seller);
 37            Buyer = new ContractsContractorDTO(data.Buyer);
 38            BeginDate = data.BeginDate;
 39            EndDate = data.EndDate;
 40            ConclusionDate = data.SignOffDate;
 41            PrepaimentPercent = data.PrepaimentPercent;
 42            StateId = (int)data.RecState.Id;
 43            TradeRatio = data.TradeRatio;
 44        }
 45        [NotNullOrWhiteSpaceValidator]
 46        public string DocumentNumber { get; set; }
 47        [Required]
 48        public ContractsContractorDTO Seller { get; set; }
 49        [Required]
 50        public ContractsContractorDTO Buyer { get; set; }
 51        [Required]
 52        public DateTime BeginDate { get; set; }
 53        [Required]
 54        public DateTime EndDate { get; set; }
 55        [Required]
 56        public DateTime ConclusionDate { get; set; }
 57        [Required]
 58        public decimal PrepaimentPercent { get; set; }
 59        [Required]
 60        public decimal TradeRatio { get; set; }
 61    }
 62
 63    public class ContractsContractorDTO
 64    {
 065        public ContractsContractorDTO(Contragent data)
 066        {
 067            Id = data.Id;
 068            ShortName = data.ShortName;
 069            Inn = data.Inn;
 070        }
 71        [Required]
 072        public long Id { get; set; }
 73        [NotNullOrWhiteSpaceValidator]
 074        public string ShortName { get; set; }
 75        [NotNullOrWhiteSpaceValidator]
 076        public string Inn { get; set; }
 77    }
 78
 79    public class ContragentPartners
 80    {
 81        public long ContragentId { get; set; }
 82        public string ShortName { get; set; }
 83
 84        public long SupplyContractId { get; set; }
 85
 86        public decimal TradeRatio { get; set; }
 87    }
 88}