init
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using Kreta.Ellenorzo.Domain.VN.Mulasztas;
|
||||
|
||||
namespace Kreta.Ellenorzo.Dto.VN.Mulasztas
|
||||
{
|
||||
public class MulasztasListRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Végdátum (ShortDateTime, UTC ISO 8601) is még a lekérdezés része (zárt intervallumon működik a szűrés)
|
||||
/// </summary>
|
||||
public DateTime? DatumIg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Kezdő dátum (ShortDateTime, UTC ISO 8601) is már a lekérdezés része (zárt intervallumon működik a szűrés)
|
||||
/// </summary>
|
||||
public DateTime? DatumTol { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Mulasztás Uid
|
||||
/// </summary>
|
||||
public string Uid { get; set; }
|
||||
|
||||
public static implicit operator MulasztasListRequest(MulasztasListRequestDto dto) => dto == null ? new MulasztasListRequestDto() : new MulasztasListRequest(dto.Uid)
|
||||
{
|
||||
DatumTol = dto.DatumTol,
|
||||
DatumIg = dto.DatumIg
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.Ellenorzo.Domain.VN.Mulasztas;
|
||||
using Kreta.Ellenorzo.Dto.VN.Adatszotar;
|
||||
using Kreta.Ellenorzo.Dto.VN.Documentation;
|
||||
using Kreta.Ellenorzo.Dto.VN.Interfaces;
|
||||
using Kreta.Ellenorzo.Dto.VN.Ora.TanitasiOra;
|
||||
using Kreta.Ellenorzo.Dto.VN.OsztalyCsoport;
|
||||
using Kreta.Ellenorzo.Dto.VN.Tantargy;
|
||||
using Kreta.Ellenorzo.Dto.VN.Utility;
|
||||
using Kreta.Ellenorzo.Enums.VN;
|
||||
using Kreta.Enums;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Kreta.Ellenorzo.Dto.VN.Mulasztas
|
||||
{
|
||||
public class MulasztasListResponseDto : IDtoListDocumentation, IDtoDocumentation
|
||||
{
|
||||
[Required, Description(DescriptionLookUp.ResponseModelEgyediAzonosito)]
|
||||
public string Uid { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.EntitashozRogzitettTantargy)]
|
||||
public TantargyResponseDto Tantargy { get; set; }
|
||||
|
||||
[Required, Description("Tanítási óra, amin a mulasztás keletkezett")]
|
||||
public TanitasiOraResponseDto Ora { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.EntitasNapjaShortDateTime)]
|
||||
public DateTime Datum { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.EntitastRogzitoTanarNeve)]
|
||||
public string RogzitoTanarNeve { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.EntitasTipusa)]
|
||||
public AdatszotarResponseDto<MulasztasTipusEnum> Tipus { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.EntitasModja)]
|
||||
public AdatszotarResponseDto<MulasztasMod> Mod { get; set; }
|
||||
|
||||
[Description(DescriptionLookUp.MulasztasKesesPercben)]
|
||||
public int? KesesPercben { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.EntitasLetrehozasanakDatuma)]
|
||||
public DateTime KeszitesDatuma { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.IgazolasAllapota), JsonConverter(typeof(StringEnumConverter))]
|
||||
public IgazolasAllapota IgazolasAllapota { get; set; }
|
||||
|
||||
[Description(DescriptionLookUp.IgazolasTipusa)]
|
||||
public AdatszotarResponseDto<IgazolasTipusEnum> IgazolasTipusa { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.EntitashozRogzitettOsztalyCsoport)]
|
||||
public OsztalyCsoportSimplifiedResponseDto OsztalyCsoport { get; set; }
|
||||
|
||||
public DocumentationExampleDto ListExample
|
||||
=> new DocumentationExampleDto(
|
||||
"ListMulasztas",
|
||||
new MulasztasListRequestDto
|
||||
{
|
||||
DatumTol = new DateTime(2021, 9, 1, 0, 0, 0),
|
||||
DatumIg = new DateTime(2021, 9, 18, 0, 0, 0)
|
||||
});
|
||||
|
||||
public DocumentationExampleDto Example => new DocumentationExampleDto("GetMulasztas", "32272324");
|
||||
|
||||
public static implicit operator MulasztasListResponseDto(MulasztasListResponse model) => new MulasztasListResponseDto
|
||||
{
|
||||
Uid = model.Uid.UidRaw,
|
||||
Tantargy = model.Tantargy,
|
||||
Ora = model.Ora,
|
||||
Datum = model.Datum.ToIso8601Utc(),
|
||||
RogzitoTanarNeve = model.RogzitoTanar.Nev,
|
||||
Tipus = AdatszotarResponseDto<MulasztasTipusEnum>.Create(model.Tipus),
|
||||
Mod = AdatszotarResponseDto<MulasztasMod>.Create(model.Mod),
|
||||
KesesPercben = model.KesesPercben,
|
||||
KeszitesDatuma = model.KeszitesDatuma.ToIso8601Utc(),
|
||||
IgazolasAllapota = model.IgazolasAllapota,
|
||||
IgazolasTipusa = AdatszotarResponseDto<IgazolasTipusEnum>.Create(model.IgazolasTipusa),
|
||||
OsztalyCsoport = model.OsztalyCsoport
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user