This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,34 @@
using System.Collections.Generic;
namespace Kreta.Client.CoreApi.Response
{
public class CoreApiResponse
{
public CoreApiExceptionItem Exception { get; set; }
public CoreApiValidationResult ValidationResult { get; set; }
public string CorrelationId { get; set; }
}
public class CoreApiValidationResult
{
public List<CoreApiValidationItem> Errors { get; set; } = new List<CoreApiValidationItem>();
public List<CoreApiValidationItem> Warnings { get; set; } = new List<CoreApiValidationItem>();
public List<CoreApiValidationItem> Successes { get; set; } = new List<CoreApiValidationItem>();
}
public class CoreApiExceptionItem
{
public string Type { get; set; }
public string Message { get; set; }
public string StackTrace { get; set; }
}
public class CoreApiValidationItem
{
public string Message { get; set; }
public string PropertyName { get; set; }
public string Value { get; set; }
public string TextValue { get; set; }
}
}

View file

@ -0,0 +1,7 @@
namespace Kreta.Client.CoreApi.Response
{
public class DKTFeladatInsertResponse : DKTFeladatResponse
{
public int NewHazifeladatId { get; set; }
}
}

View file

@ -0,0 +1,35 @@
using System.Collections.Generic;
namespace Kreta.Client.CoreApi.Response
{
public class DKTFeladatResponse
{
public string CorrelationId { get; set; }
public DKTExceptionItem Exception { get; set; }
public DKTValidationResult ValidationResult { get; set; }
public int Status { get; set; }
public Dictionary<string, string[]> Errors { get; set; }
public string Instance { get; set; }
}
public class DKTValidationResult
{
public List<DKTValidationItem> Tiltasok { get; set; } = new List<DKTValidationItem>();
public List<DKTValidationItem> Figyelmeztetesek { get; set; } = new List<DKTValidationItem>();
public List<DKTValidationItem> Engedelyezettek { get; set; } = new List<DKTValidationItem>();
}
public class DKTExceptionItem
{
public string Type { get; set; }
public string Message { get; set; }
public string StackTrace { get; set; }
}
public class DKTValidationItem
{
public string Id { get; set; }
public string Nev { get; set; }
public string Uzenet { get; set; }
}
}

View file

@ -0,0 +1,19 @@
using System;
namespace Kreta.Client.CoreApi.Response
{
public class EszkozIgenylesCreateDto
{
public int? AlkalmazottId { get; set; }
public int? TanuloId { get; set; }
public int? GondviseloId { get; set; }
public bool EszkozKiosztva { get; set; }
public bool ElfogadottAszf { get; set; }
public DateTime? AszfElfogadasIdeje { get; set; }
}
}

View file

@ -0,0 +1,7 @@
namespace Kreta.Client.CoreApi.Response
{
public class EszkozIgenylesCreateResponse : CoreApiResponse
{
public int NewId { get; set; }
}
}

View file

@ -0,0 +1,19 @@
using System;
namespace Kreta.Client.CoreApi.Response
{
public class EszkozIgenylesDto
{
public int? AlkalmazottId { get; set; }
public int? TanuloId { get; set; }
public int? GondviseloId { get; set; }
public bool EszkozKiosztva { get; set; }
public bool ElfogadottAszf { get; set; }
public DateTime? AszfElfogadasIdeje { get; set; }
}
}

View file

@ -0,0 +1,21 @@
using System;
namespace Kreta.Client.CoreApi.Response
{
public class EszkozIgenylesUpdateDto
{
public int Id { get; set; }
public int? AlkalmazottId { get; set; }
public int? TanuloId { get; set; }
public int? GondviseloId { get; set; }
public bool EszkozKiosztva { get; set; }
public bool ElfogadottAszf { get; set; }
public DateTime? AszfElfogadasIdeje { get; set; }
}
}

View file

@ -0,0 +1,10 @@
using Newtonsoft.Json;
namespace Kreta.Client.CoreApi.Response
{
internal class GetTokenFailureResponse
{
[JsonProperty("error")]
public string Error { get; set; }
}
}

View file

@ -0,0 +1,46 @@
using System;
namespace Kreta.Client.CoreApi.Response
{
public class GetTokenResponse : IResponse
{
public GetTokenResponse() { }
public GetTokenResponse(string error)
{
if (string.IsNullOrWhiteSpace(error))
{
throw new ArgumentNullException(nameof(error));
}
Error = error;
}
public GetTokenResponse(string accessToken, int expiresIn)
{
if (string.IsNullOrWhiteSpace(accessToken))
{
throw new ArgumentNullException(nameof(accessToken));
}
if (expiresIn < 1)
{
throw new ArgumentOutOfRangeException(nameof(expiresIn));
}
IsSuccess = true;
AccessToken = accessToken;
ExpiresIn = expiresIn;
}
public bool IsSuccess { get; }
public string AccessToken { get; }
public int ExpiresIn { get; }
public string Error { get; }
public bool TryAgain { get; }
}
}

View file

@ -0,0 +1,16 @@
using Newtonsoft.Json;
namespace Kreta.Client.CoreApi.Response
{
internal class GetTokenSuccessResponse
{
[JsonProperty(PropertyName = "access_token")]
public string AccessToken { get; set; }
[JsonProperty(PropertyName = "expires_in")]
public int ExpiresIn { get; set; }
[JsonProperty(PropertyName = "token_type")]
public string TokenType { get; set; }
}
}

View file

@ -0,0 +1,9 @@
namespace Kreta.Client.CoreApi.Response
{
internal interface IResponse
{
bool IsSuccess { get; }
string Error { get; }
}
}