159 lines
7.9 KiB
C#
159 lines
7.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Kreta.Enums.ManualEnums;
|
|
using Kreta.Naplo.Domain.V3.Orarend;
|
|
using Kreta.Naplo.Domain.V3.Utility;
|
|
using Kreta.Naplo.Dto.V3.Attributes;
|
|
using Kreta.Naplo.Dto.V3.Converter;
|
|
using Kreta.Naplo.Dto.V3.Csatolmany;
|
|
using Kreta.Naplo.Dto.V3.Documentation;
|
|
using Kreta.Naplo.Dto.V3.Interfaces;
|
|
using Kreta.Naplo.Dto.V3.UniqueIdentifier;
|
|
using Newtonsoft.Json;
|
|
using static Kreta.Naplo.Dto.V3.Converter.ResponseModelConverter;
|
|
|
|
namespace Kreta.Naplo.Dto.V3.Orarend
|
|
{
|
|
public class OrarendElemResponseDto : IDtoListDocumentation, IDtoDocumentation
|
|
{
|
|
[Required, Description(DescriptionLookUp.ResponseModelEgyediAzonosito), JsonConverter(typeof(UidConverter<OrarendElemUidDto>)), SwaggerChangeType(typeof(string))]
|
|
public OrarendElemUidDto Uid { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.EntitashozRogzitettNev +
|
|
"<br>Ha ki van töltve a tantárgy rövid neve, akkor az kerül bele, egyébként a teljes neve;" +
|
|
"<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => tanév rendje neve")]
|
|
public string Nev { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.HasOrarendiOra)]
|
|
public bool HasOrarendiOra { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.EntitasTipusa)]
|
|
public int Tipus { get; set; }
|
|
|
|
[Description(DescriptionLookUp.EntitashozRogzitettOsztalyCsoportId + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public int OsztalyCsoportId { get; set; }
|
|
|
|
[Description(DescriptionLookUp.EntitashozRogzitettOsztalyCsoportNev + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public string OsztalyCsoportNev { get; set; }
|
|
|
|
[Description(DescriptionLookUp.EntitashozRogzitettTantargyId +
|
|
"<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public int TantargyId { get; set; }
|
|
|
|
[Description(DescriptionLookUp.EntitashozRogzitettTantargyNev +
|
|
"<br>Ha ki van töltve a tantárgy rövid neve, akkor az kerül bele, egyébként a teljes neve;" +
|
|
"<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public string TantargyNev { get; set; }
|
|
|
|
[Description(DescriptionLookUp.EntitashozRogzitettTeremNeve + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public string Terem { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.TanoraKezdetenekIdopontja + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => esemény kezdő dátum")]
|
|
public DateTime Kezdete { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.TanoraVegenekIdopontja + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => esemény végdátum")]
|
|
public DateTime Vege { get; set; }
|
|
|
|
[Description(DescriptionLookUp.EntitasTemaja +
|
|
"A tanárnak naplózás esetén kötelező megadnia;" +
|
|
"Nem naplózott óra esetén, tanévrendje esemény esetén vagy ha a testreszabásban le van tiltva a téma láthatósága => null")]
|
|
public string Tema { get; set; }
|
|
|
|
[Description(DescriptionLookUp.EntitasOraszamaAzAdottNapon + "; " +
|
|
DescriptionLookUp.NapirendiOraEsetenNull +
|
|
"<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public int? Oraszam { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.EntitasAllapota)]
|
|
public int Allapot { get; set; }
|
|
|
|
[Description(DescriptionLookUp.OratulajdonosTanarUid + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public Guid TanarUid { get; set; }
|
|
|
|
[Description(DescriptionLookUp.OratulajdonosTanarNev + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public string TanarNev { get; set; }
|
|
|
|
[Description(DescriptionLookUp.HelyettesTanarUid + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public Guid? HelyettesitoTanarUid { get; set; }
|
|
|
|
[Description(DescriptionLookUp.HelyettesTanarNev + "<br>Ha " + nameof(CalendarOraTypeEnum) + " == " + nameof(CalendarOraTypeEnum.TanevRendjeEsemeny) + " => null")]
|
|
public string HelyettesitoTanarNev { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.EvesOraSorszam)]
|
|
public int? EvesOraSorszam { get; set; }
|
|
|
|
[Description(DescriptionLookUp.HaziFeladatId)]
|
|
public int? HaziFeladatId { get; set; }
|
|
|
|
[Description(DescriptionLookUp.BejelentettSzamonkeresId)]
|
|
public int? BejelentettSzamonkeresId { get; set; }
|
|
|
|
[Description(DescriptionLookUp.BejelentettSzamonkeresMod)]
|
|
public string BejelentettSzamonkeresMod { get; set; }
|
|
|
|
[Description(DescriptionLookUp.BejelentettSzamonkeresTema)]
|
|
public string BejelentettSzamonkeresTema { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.CsatolmanyokOrahoz)]
|
|
public IEnumerable<CsatolmanyResponseDto> Csatolmanyok { get; set; }
|
|
|
|
[Description(DescriptionLookUp.ElozoNaplozottOraDatum)]
|
|
public DateTime? ElozoNaplozottOraDatum { get; set; }
|
|
|
|
[Description(DescriptionLookUp.ElozoNaplozottOraTema)]
|
|
public string ElozoNaplozottOraTema { get; set; }
|
|
|
|
[Required, Description(DescriptionLookUp.Naplozart)]
|
|
public bool Naplozart{ get; set; }
|
|
|
|
public DocumentationExampleDto ListExample
|
|
=> new DocumentationExampleDto(
|
|
"GetOrarend",
|
|
new OrarendRequestDto
|
|
{
|
|
DatumTol = new DateTime(2022, 2, 14, 0, 0, 0),
|
|
DatumIg = new DateTime(2022, 2, 20, 0, 0, 0)
|
|
});
|
|
|
|
public DocumentationExampleDto Example
|
|
=> new DocumentationExampleDto(
|
|
"GetOrarendElem",
|
|
new OrarendElemRequestDto
|
|
{
|
|
OrarendElemUid = "13279465,TanitasiOra,2022-02-22T23:00:00Z"
|
|
});
|
|
|
|
public static implicit operator OrarendElemResponseDto(OrarendElemResponse model) => new OrarendElemResponseDto
|
|
{
|
|
Uid = model.Uid,
|
|
Nev = model.Nev,
|
|
HasOrarendiOra = model.HasOrarendiOra,
|
|
Tipus = (int)model.Uid.Tipus,
|
|
OsztalyCsoportId = model.OsztalyCsoportId,
|
|
OsztalyCsoportNev = model.OsztalyCsoportNev,
|
|
TantargyId = model.TantargyId,
|
|
TantargyNev = model.TantargyNev,
|
|
Terem = model.Terem,
|
|
Kezdete = model.Kezdete.ToIso8601Utc(),
|
|
Vege = model.Vege.ToIso8601Utc(),
|
|
Tema = model.Tema,
|
|
Oraszam = model.Oraszam,
|
|
Allapot = model.Allapot,
|
|
TanarUid = model.TanarUid,
|
|
TanarNev = model.TanarNev,
|
|
HelyettesitoTanarUid = model.HelyettesitoTanarUid,
|
|
HelyettesitoTanarNev = model.HelyettesitoTanarNev,
|
|
EvesOraSorszam = model.EvesOraSorszam,
|
|
HaziFeladatId = model.HaziFeladatId,
|
|
BejelentettSzamonkeresId = model.BejelentettSzamonkeresId,
|
|
BejelentettSzamonkeresMod = model.BejelentettSzamonkeresMod,
|
|
BejelentettSzamonkeresTema = model.BejelentettSzamonkeresTema,
|
|
Csatolmanyok = ModelToDto(model.Csatolmanyok),
|
|
ElozoNaplozottOraDatum = model.ElozoNaplozottOraDatum?.ToIso8601Utc(),
|
|
ElozoNaplozottOraTema = model.ElozoNaplozottOraTema,
|
|
Naplozart = model.Naplozart
|
|
};
|
|
}
|
|
}
|