< Summary

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

Metrics

MethodLine coverage Branch coverage
.ctor(...)0%100%
get_DocumentNumber()0%100%
get_Seller()0%100%
get_Buyer()0%100%
get_BeginDate()0%100%
get_EndDate()0%100%
get_ConclusionDate()0%100%
get_PrepaimentPercent()0%100%
get_TradeRatio()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    {
 032        public SupplyContractDTO_GET(SupplyContract data)
 033        {
 034            Id = data.Id;
 035            DocumentNumber = data.DocumentNumber;
 036            Seller = new ContractsContractorDTO(data.Seller);
 037            Buyer = new ContractsContractorDTO(data.Buyer);
 038            BeginDate = data.BeginDate;
 039            EndDate = data.EndDate;
 040            ConclusionDate = data.SignOffDate;
 041            PrepaimentPercent = data.PrepaimentPercent;
 042            StateId = (int)data.RecState.Id;
 043            TradeRatio = data.TradeRatio;
 044        }
 45        [NotNullOrWhiteSpaceValidator]
 046        public string DocumentNumber { get; set; }
 47        [Required]
 048        public ContractsContractorDTO Seller { get; set; }
 49        [Required]
 050        public ContractsContractorDTO Buyer { get; set; }
 51        [Required]
 052        public DateTime BeginDate { get; set; }
 53        [Required]
 054        public DateTime EndDate { get; set; }
 55        [Required]
 056        public DateTime ConclusionDate { get; set; }
 57        [Required]
 058        public decimal PrepaimentPercent { get; set; }
 59        [Required]
 060        public decimal TradeRatio { get; set; }
 61    }
 62
 63    public class ContractsContractorDTO
 64    {
 65        public ContractsContractorDTO(Contragent data)
 66        {
 67            Id = data.Id;
 68            ShortName = data.ShortName;
 69            Inn = data.Inn;
 70        }
 71        [Required]
 72        public long Id { get; set; }
 73        [NotNullOrWhiteSpaceValidator]
 74        public string ShortName { get; set; }
 75        [NotNullOrWhiteSpaceValidator]
 76        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}