Changed models, added Application layer models

This commit is contained in:
2024-08-15 14:54:23 +03:00
parent 1d8405b4ec
commit c1a4acf414
50 changed files with 628 additions and 647 deletions

View File

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

View File

@@ -1,57 +1,56 @@
using Domains.LocationDomain;
using Domains.VisaApplicationDomain;
namespace Domains.ApplicantDomain
namespace Domains.ApplicantDomain;
/// Model of an applicant
public class Applicant : IEntity
{
/// Model of an applicant
public class Applicant : IEntity
{
/// Unique identifier of the <see cref="Applicant"/>
public Guid Id { get; set; }
/// Unique identifier of the <see cref="Applicant"/>
public Guid Id { get; set; }
/// Full name of the <see cref="Applicant"/>
public Name Name { get; set; } = null!;
/// Full name of the <see cref="Applicant"/>
public Name Name { get; set; } = null!;
/// Passport of <see cref="Applicant"/>
public Passport Passport { 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; }
/// Date of birth of the <see cref="Applicant"/>
public DateTime BirthDate { get; set; }
/// <see cref="Country"/> of birth of the <see cref="Applicant"/>
public Country CountryOfBirth { get; set; } = null!;
/// <see cref="Country"/> of birth of the <see cref="Applicant"/>
public Country CountryOfBirth { get; set; } = null!;
/// <see cref="City"/> of birth of the <see cref="Applicant"/>
public City CityOfBirth { get; set; } = null!;
/// <see cref="City"/> of birth of the <see cref="Applicant"/>
public City CityOfBirth { get; set; } = null!;
/// Citizenship of <see cref="Applicant"/>
public string Citizenship { 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!;
/// Citizenship by birth of <see cref="Applicant"/>
public string CitizenshipByBirth { get; set; } = null!;
/// Gender of <see cref="Applicant"/>
public Gender Gender { get; set; }
/// Gender of <see cref="Applicant"/>
public Gender Gender { get; set; }
/// Marital status of <see cref="Applicant"/>
public MaritalStatus MaritalStatus { 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 father
public Name FatherName { get; set; } = null!;
/// Full name of the <see cref="Applicant"/>'s mother
public Name MotherName { 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!;
/// Position of <see cref="Applicant"/>
public string JobTitle { get; set; } = null!;
/// Place of <see cref="Applicant"/>'s work
public PlaceOfWork PlaceOfWork { 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; }
/// Is <see cref="Applicant"/> a non-resident
public bool IsNonResident { get; set; }
/// List of <see cref="Applicant"/>'s applications
public List<VisaApplication> VisaApplications { get; set; } = null!;
}
}
/// List of <see cref="Applicant"/>'s applications
public List<VisaApplication> VisaApplications { get; set; } = null!;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,15 +1,14 @@
namespace Domains.LocationDomain
namespace Domains.LocationDomain;
/// Model of a city
public class City : IEntity
{
/// Model of a city
public class City : IEntity
{
/// Unique identifier of the <see cref="City"/>
public Guid Id { get; private set; } = Guid.NewGuid();
/// Unique identifier of the <see cref="City"/>
public Guid Id { get; private set; } = Guid.NewGuid();
/// Name of the city
public string Name { get; set; } = null!;
/// Name of the city
public string Name { get; set; } = null!;
/// <see cref="LocationDomain.Country"/> in which the city is located
public Country Country { get; set; } = null!;
}
}
/// <see cref="LocationDomain.Country"/> in which the city is located
public Country Country { get; set; } = null!;
}

View File

@@ -1,18 +1,17 @@
namespace Domains.LocationDomain
namespace Domains.LocationDomain;
/// Model of a country
public class Country : IEntity
{
/// Model of a country
public class Country : IEntity
{
/// Unique identifier of the <see cref="Country"/>
public Guid Id { get; private set; } = Guid.NewGuid();
/// Unique identifier of the <see cref="Country"/>
public Guid Id { get; private set; } = Guid.NewGuid();
/// Name of the country
public string Name { get; set; } = null!;
/// Name of the country
public string Name { get; set; } = null!;
/// Located in Schengen area
public bool IsSchengen { get; set; }
/// Located in Schengen area
public bool IsSchengen { get; set; }
/// List of <see cref="City"/> that country have
public List<City> Cities { get; set; } = null!;
}
}
/// List of <see cref="City"/> that country have
public List<City> Cities { get; set; } = null!;
}

View File

@@ -1,20 +1,17 @@
using Domains.ApplicantDomain;
namespace Domains.VisaApplicationDomain
namespace Domains.VisaApplicationDomain;
/// Visa that <see cref="Applicant"/> already had
/// <remarks>Owned</remarks>
public class PastVisa
{
/// Visa that <see cref="Applicant"/> already had
public class PastVisa : IEntity
{
/// Unique identifier of <see cref="PastVisa"/>
public Guid Id { get; private set; } = Guid.NewGuid();
/// Date of issue
public DateTime IssueDate { get; set; }
/// Date of issue
public DateTime IssueDate { get; set; }
/// Name of visa
public string Name { get; set; } = null!;
/// Name of visa
public string Name { get; set; } = null!;
/// Date when visa expires
public DateTime ExpirationDate { get; set; }
}
/// Date when visa expires
public DateTime ExpirationDate { get; set; }
}

View File

@@ -1,17 +1,14 @@
using Domains.ApplicantDomain;
namespace Domains.VisaApplicationDomain
namespace Domains.VisaApplicationDomain;
/// Visit in a Schengen country that <see cref="Applicant"/> already had
/// <remarks>Owned</remarks>
public class PastVisit
{
/// Visit in a Schengen country that <see cref="Applicant"/> already had
public class PastVisit : IEntity
{
/// Unique identifier of <see cref="PastVisit"/>
public Guid Id { get; private set; } = Guid.NewGuid();
/// First day of <see cref="PastVisit"/>
public DateTime StartDate { get; set; }
/// First day of <see cref="PastVisit"/>
public DateTime StartDate { get; set; }
/// Last day of <see cref="PastVisit"/>
public DateTime EndDate { get; set; }
}
/// Last day of <see cref="PastVisit"/>
public DateTime EndDate { get; set; }
}

View File

@@ -1,13 +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; }
namespace Domains.VisaApplicationDomain;
/// Issuing authority
public string Issuer { get; set; } = null!;
}
}
/// 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

@@ -1,13 +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!;
namespace Domains.VisaApplicationDomain;
/// Date when <see cref="ReentryPermit"/> expires
public DateTime ExpirationDate { get; set; }
}
}
/// 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

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

View File

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

View File

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