< Summary

Class:SVETA.Api.Data.DTO.DepartmentDTO.GoodSettingsSourceGoodsResponseDTO
Assembly:SVETA.Api
File(s):/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/DepartmentDTO/GoodSettingResponseDTO.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:52
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:0

Metrics

MethodLine coverage Branch coverage
get_Id()0%100%
get_VendorCode()0%100%
get_Name()0%100%
get_IsInSetting()0%100%
get_SettingId()0%100%
get_Photo()0%100%
get_UniqueCode()0%100%

File(s)

/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/DepartmentDTO/GoodSettingResponseDTO.cs

#LineLine coverage
 1using DocumentFormat.OpenXml.Vml.Spreadsheet;
 2using System;
 3using System.Collections.Generic;
 4using System.Linq;
 5using System.Threading.Tasks;
 6using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 7using WinSolutions.Sveta.Server.Data.DataModel.Extensions;
 8
 9namespace SVETA.Api.Data.DTO.DepartmentDTO
 10{
 11    public class GoodSettingResponseDTO
 12    {
 13        public GoodSettingResponseDTO() { }
 14        public GoodSettingResponseDTO(DepartmentGoodSetting data)
 15        {
 16            Id = data.Id;
 17            GoodId = data.Good.Id;
 18            Name = data.Good.Name;
 19            VendorCode = data.GetActualVendorCode();
 20            MinQuantity = data.MinQuantity;
 21            PickingQuantum = data.PickingQuantum;
 22            Photo = (PhotoPrevDto) data.Good.Photos.FirstOrDefault();
 23            UniqueCode = data.Good.UniqueCode;
 24            Labels = new List<GoodLabelResponseDTO>();
 25            if (data.GoodSettingsLabels?.Count > 0)
 26                Labels.AddRange(data.GoodSettingsLabels.Select(x => new GoodLabelResponseDTO(x.GoodLabel)));
 27            ShowcaseVisible = data.ShowcaseVisible;
 28        }
 29        public long Id { get; set; }
 30        public long GoodId { get; set; }
 31        public string Name { get; set; }
 32        public string VendorCode { get; set; }
 33        public decimal MinQuantity { get; set; }
 34        public decimal PickingQuantum { get; set; }
 35        public PhotoPrevDto Photo { get; set; }
 36        public string UniqueCode { get; set; }
 37        public List<GoodLabelResponseDTO> Labels { get; set; }
 38        public bool ShowcaseVisible { get; set; }
 39    }
 40
 41    public class GoodSettingsSourceGoodsResponseDTO
 42    {
 043        public long Id { get; set; }
 044        public string VendorCode { get; set; }
 045        public string Name { get; set; }
 046        public bool IsInSetting { get; set; }
 047        public long? SettingId { get; set; }
 048        public PhotoPrevDto Photo { get; set; }
 49
 050        public string UniqueCode { get; set; }
 51    }
 52}