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

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using Kreta.Naplo.Domain.V3.Enum;
namespace Kreta.Naplo.Domain.V3.Common
{
public class MobileUser
{
private const int MinimumIdentifierValue = 1;
public MobileUser(string instituteCode, int userId, string userName, IEnumerable<FelhasznaloSzerepkor> roles, int schoolYearId, Guid userIdpUniqueId, Guid instituteUniqueId)
{
if (string.IsNullOrWhiteSpace(instituteCode))
{
throw new ArgumentException($"{nameof(instituteCode)} cannot be null or whitespace");
}
InstituteCode = instituteCode;
if (userId < MinimumIdentifierValue)
{
throw new ArgumentException($"{nameof(userId)} must be greater or equal to {MinimumIdentifierValue}");
}
UserId = userId;
if (string.IsNullOrWhiteSpace(userName))
{
throw new ArgumentException($"{nameof(userName)} cannot be null or whitespace");
}
UserName = userName;
if (roles == null)
{
throw new ArgumentNullException(nameof(roles));
}
Roles = roles;
if (schoolYearId < MinimumIdentifierValue)
{
throw new ArgumentException($"{nameof(schoolYearId)} must be greater or equal to {MinimumIdentifierValue}");
}
SchoolYearId = schoolYearId;
UserIdpUniqueId = userIdpUniqueId;
InstituteUniqueId = instituteUniqueId;
}
public string InstituteCode { get; }
public int SchoolYearId { get; }
public IEnumerable<FelhasznaloSzerepkor> Roles { get; }
public int UserId { get; }
public string UserName { get; }
public Guid UserIdpUniqueId { get; }
public Guid InstituteUniqueId { get; }
}
}