Refactored AgeGroup namespace and services, added RegistrationKey functionality.
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
using API.Models.Internal.Altersgruppen;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace API.Models.Ingoing.Altersgruppen
|
||||
{
|
||||
public class AltersGruppeIngoing
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public int StartingAge { get; set; }
|
||||
[Required]
|
||||
public int EndingAge { get; set; }
|
||||
}
|
||||
|
||||
public static class AltersgruppeMapper
|
||||
{
|
||||
public static AltersGruppe ToInternalFromIngoing(this AltersGruppeIngoing group)
|
||||
{
|
||||
return new AltersGruppe
|
||||
{
|
||||
Name = group.Name,
|
||||
StartingAge = group.StartingAge,
|
||||
EndingAge = group.EndingAge,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,4 +9,27 @@ namespace API.Models.Internal.Altersgruppen
|
||||
public int StartingAge { get; set; }
|
||||
public int EndingAge { get; set; }
|
||||
}
|
||||
|
||||
public class AltersGruppeIngoing
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public int StartingAge { get; set; }
|
||||
[Required]
|
||||
public int EndingAge { get; set; }
|
||||
}
|
||||
|
||||
public static class AltersgruppeMapper
|
||||
{
|
||||
public static AltersGruppe ToInternalFromIngoing(this AltersGruppeIngoing group)
|
||||
{
|
||||
return new AltersGruppe
|
||||
{
|
||||
Name = group.Name,
|
||||
StartingAge = group.StartingAge,
|
||||
EndingAge = group.EndingAge,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
API/Models/Internal/User/RegistrationKey.cs
Normal file
24
API/Models/Internal/User/RegistrationKey.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace API.Models.Internal.User;
|
||||
|
||||
public class RegistrationKey
|
||||
{
|
||||
public string Id { get; set; } = Ulid.NewUlid().ToString();
|
||||
public string? LinkedRole { get; set; }
|
||||
public DateTime Created { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class RegistrationKeyIngoing
|
||||
{
|
||||
public string? LinkedRole { get; set; }
|
||||
}
|
||||
|
||||
public static class RegistrationKeyMapper
|
||||
{
|
||||
public static RegistrationKey ToInternalFromIngoing(this RegistrationKeyIngoing key)
|
||||
{
|
||||
return new RegistrationKey
|
||||
{
|
||||
LinkedRole = key.LinkedRole,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user