Вытащил солюшен на уровень выше, чтобы прощё было дотнетить
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-10-05 14:32:06 +03:00
parent fa87a56ad1
commit aae4b28089
242 changed files with 159 additions and 159 deletions

View File

@@ -0,0 +1,18 @@
namespace Domains.ApplicantDomain;
/// Model of address
/// <remarks>Owned</remarks>
public class Address
{
/// Country part of address
public string Country { get; set; } = null!;
/// City part of address
public string City { get; set; } = null!;
/// Street part of address
public string Street { get; set; } = null!;
/// Building part of address
public string Building { get; set; } = null!;
}

View File

@@ -0,0 +1,52 @@
namespace Domains.ApplicantDomain;
/// Model of an applicant
public class Applicant : IEntity
{
/// Unique identifier of the <see cref="Applicant"/>
public Guid Id { get; private set; } = Guid.NewGuid();
public Guid UserId { get; set; }
/// Full name of the <see cref="Applicant"/>
public Name Name { get; set; } = null!;
/// Passport of <see cref="Applicant"/>
public Passport Passport { get; set; } = null!;
/// Date of birth of the <see cref="Applicant"/>
public DateTime BirthDate { get; set; }
/// Country of birth of the <see cref="Applicant"/>
public string CountryOfBirth { get; set; } = null!;
/// City of birth of the <see cref="Applicant"/>
public string CityOfBirth { get; set; } = null!;
/// Citizenship of <see cref="Applicant"/>
public string Citizenship { get; set; } = null!;
/// Citizenship by birth of <see cref="Applicant"/>
public string CitizenshipByBirth { get; set; } = null!;
/// Gender of <see cref="Applicant"/>
public Gender Gender { get; set; }
/// Marital status of <see cref="Applicant"/>
public MaritalStatus MaritalStatus { get; set; }
/// Full name of the <see cref="Applicant"/>'s father
public Name FatherName { get; set; } = null!;
/// Full name of the <see cref="Applicant"/>'s mother
public Name MotherName { get; set; } = null!;
/// Position of <see cref="Applicant"/>
public string JobTitle { get; set; } = null!;
/// Place of <see cref="Applicant"/>'s work
public PlaceOfWork PlaceOfWork { get; set; } = null!;
/// Is <see cref="Applicant"/> a non-resident
public bool IsNonResident { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace Domains.ApplicantDomain;
public enum Gender
{
Unknown,
Male,
Female,
Turkish
}

View File

@@ -0,0 +1,10 @@
namespace Domains.ApplicantDomain;
public enum MaritalStatus
{
Other,
Married,
Unmarried,
Separated,
WidowOrWidower
}

View File

@@ -0,0 +1,12 @@
namespace Domains.ApplicantDomain;
/// Model of full name
/// <remarks>Owned</remarks>
public class Name
{
public string FirstName { get; set; } = null!;
public string Surname { get; set; } = null!;
public string? Patronymic { get; set; }
}

View File

@@ -0,0 +1,18 @@
namespace Domains.ApplicantDomain;
/// Model of passport
/// <remarks>Owned</remarks>
public class Passport
{
/// Number of <see cref="Passport"/>
public string Number { get; set; } = null!;
/// Issuing authority of <see cref="Passport"/>
public string Issuer { get; set; } = null!;
/// Date of issue
public DateTime IssueDate { get; set; }
/// Date when the <see cref="Passport"/> expires
public DateTime ExpirationDate { get; set; }
}

View File

@@ -0,0 +1,16 @@
namespace Domains.ApplicantDomain;
public class PlaceOfWork : IEntity
{
/// Unique identifier of <see cref="PlaceOfWork"/>
public Guid Id { get; private set; } = Guid.NewGuid();
/// Name of hirer
public string Name { get; set; } = null!;
/// <see cref="ApplicantDomain.Address"/> of hirer
public Address Address { get; set; } = null!;
/// Phone number of hirer
public string PhoneNum { get; set; } = null!;
}

View File

@@ -0,0 +1,23 @@
namespace Domains;
public static class ConfigurationConstraints
{
public const int CityNameLength = 70;
public const int CountryNameLength = 70;
public const int CitizenshipLength = 50;
public const int ReentryPermitNumberLength = 25;
public const int IssuerNameLength = 200;
public const int VisaNameLength = 70;
public const int StreetNameLength = 100;
public const int PlaceOfWorkNameLength = 200;
public const int NameLength = 50;
public const int BuildingNumberLength = 10;
public const int PassportNumberLength = 20;
public const int PhoneNumberLength = 13;
public const int PhoneNumberMinLength = 11;
public const int EmailLength = 254;
public const int PasswordLength = 50;
public const int ApplicantMinAge = 14;
public const int JobTitleLength = 50;
public const int MaxValidDays = 90;
}

13
Domains/Domains.csproj Normal file
View File

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
</ItemGroup>
</Project>

7
Domains/IEntity.cs Normal file
View File

@@ -0,0 +1,7 @@
namespace Domains;
/// Interface that every entity should inherit from
public interface IEntity
{
public Guid Id { get; }
}

12
Domains/Users/Role.cs Normal file
View File

@@ -0,0 +1,12 @@
namespace Domains.Users;
/// Role of <see cref="User"/>
public enum Role
{
/// Requests visa applications
Applicant,
/// Approves or declines applications
ApprovingAuthority,
/// Manages approving authorities
Admin
}

13
Domains/Users/User.cs Normal file
View File

@@ -0,0 +1,13 @@
namespace Domains.Users;
public class User : IEntity
{
/// Unique Identifier of <see cref="User"/>
public Guid Id { get; private set; } = Guid.NewGuid();
public Role Role { get; set; }
public string Email { get; set; } = null!;
public string Password { get; set; } = null!;
}

View File

@@ -0,0 +1,11 @@
namespace Domains.VisaApplicationDomain;
public enum ApplicationStatus
{
/// Waits for approve
Pending,
Approved,
Rejected,
/// Closed by applicant
Closed
}

View File

@@ -0,0 +1,17 @@
using Domains.ApplicantDomain;
namespace Domains.VisaApplicationDomain;
/// Visa that <see cref="Applicant"/> already had
/// <remarks>Owned</remarks>
public class PastVisa
{
/// Date of issue
public DateTime IssueDate { get; set; }
/// Name of visa
public string Name { get; set; } = null!;
/// Date when visa expires
public DateTime ExpirationDate { get; set; }
}

View File

@@ -0,0 +1,17 @@
using Domains.ApplicantDomain;
namespace Domains.VisaApplicationDomain;
/// Visit in a Schengen country that <see cref="Applicant"/> already had
/// <remarks>Owned</remarks>
public class PastVisit
{
/// First day of <see cref="PastVisit"/>
public DateTime StartDate { get; set; }
/// Last day of <see cref="PastVisit"/>
public DateTime EndDate { get; set; }
/// Destination country of <see cref="PastVisit"/>
public string DestinationCountry { get; set; } = null!;
}

View File

@@ -0,0 +1,12 @@
namespace Domains.VisaApplicationDomain;
/// Permission to enter the destination country
/// <remarks>Owned</remarks>
public class PermissionToDestCountry
{
/// Date when <see cref="PermissionToDestCountry"/> expires
public DateTime ExpirationDate { get; set; }
/// Issuing authority
public string Issuer { get; set; } = null!;
}

View File

@@ -0,0 +1,12 @@
namespace Domains.VisaApplicationDomain;
/// Permission to enter a country the issuer wants to come from
/// <remarks>Owned</remarks>
public class ReentryPermit
{
/// Number of <see cref="ReentryPermit"/>
public string Number { get; set; } = null!;
/// Date when <see cref="ReentryPermit"/> expires
public DateTime ExpirationDate { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace Domains.VisaApplicationDomain;
/// Requested number of entries
public enum RequestedNumberOfEntries
{
Many,
One,
Two
}

View File

@@ -0,0 +1,47 @@
using Domains.ApplicantDomain;
namespace Domains.VisaApplicationDomain;
/// Model of visit request
public class VisaApplication : IEntity
{
/// Unique identifier of <see cref="VisaApplication"/>
public Guid Id { get; private set; } = Guid.NewGuid();
/// Identifier of the <see cref="Applicant"/>
public Guid ApplicantId { get; set; }
/// Status of application
public ApplicationStatus Status { get; set; }
/// <inheritdoc cref="Domains.VisaApplicationDomain.ReentryPermit"/>
/// <remarks>always null if <see cref="Applicant"/> is not a non-resident</remarks>
public ReentryPermit? ReentryPermit { get; set; }
/// Country that <see cref="Applicant"/> wants to visit
public string DestinationCountry { get; set; } = null!;
/// List of <see cref="PastVisa"/> that applicant had before
public List<PastVisa> PastVisas { get; set; } = null!;
/// Permission to enter the destination country of <see cref="Applicant"/>
/// <remarks>always null if <see cref="DestinationCountry"/> is Schengen</remarks>
public PermissionToDestCountry? PermissionToDestCountry { get; set; }
public List<PastVisit> PastVisits { get; set; } = null!;
/// <see cref="Domains.VisaApplicationDomain.VisaCategory"/>
public VisaCategory VisaCategory { get; set; }
/// Is for group
public bool ForGroup { get; set; }
/// <see cref="Domains.VisaApplicationDomain.RequestedNumberOfEntries"/>
public RequestedNumberOfEntries RequestedNumberOfEntries { get; set; }
/// When application was created
public DateTime RequestDate { get; set; }
/// Valid days requested
public int ValidDaysRequested { get; set; }
}

View File

@@ -0,0 +1,8 @@
namespace Domains.VisaApplicationDomain;
/// Category of visa
public enum VisaCategory
{
Transit,
ShortDated
}