using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using Kreta.Core.Domain; using Kreta.Core.Enum; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace Kreta.Naplo.Dto.V3.Exception { public class NaploExceptionResponseDto { public NaploExceptionResponseDto(BlExceptionType exceptionType, string message) { ExceptionType = exceptionType; Message = message; } public NaploExceptionResponseDto(BlExceptionType exceptionType, string message, List errorList) { ExceptionType = exceptionType; Message = message; if (errorList != null && errorList.Count > 0) { ErrorList = errorList; } } [Required, Description("Hiba egyedi azonosítója")] public Guid ExceptionId => Guid.NewGuid(); [Required, Description("Az exception típusa; röviden az ok, ami kiváltotta"), JsonConverter(typeof(StringEnumConverter))] public BlExceptionType ExceptionType { get; set; } [Required, Description("Ember által olvasható hibaüzenet
kliens dönti el, hogy megjeleníti-e a felhasználó számára")] public string Message { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] ////DevKornel: Swagger miatt [Description("Ember által olvasható hibalista, null ha nincs plusz információ
kliens dönti el, hogy megjeleníti-e a felhasználó számára")] public List ErrorList { get; set; } } }