Models
This commit is contained in:
47
SchengenVisaApi/Domains/ApplicantDomain/Applicant.cs
Normal file
47
SchengenVisaApi/Domains/ApplicantDomain/Applicant.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Domains.Common;
|
||||
|
||||
namespace Domains.ApplicantDomain
|
||||
{
|
||||
/// Model of an applicant
|
||||
public class Applicant : IEntity
|
||||
{
|
||||
/// 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!;
|
||||
|
||||
/// Date of birth of the <see cref="Applicant"/>
|
||||
public DateOnly BirthDate { get; set; }
|
||||
|
||||
/// <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!;
|
||||
|
||||
/// 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!;
|
||||
|
||||
/// 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; }
|
||||
}
|
||||
}
|
||||
10
SchengenVisaApi/Domains/ApplicantDomain/Gender.cs
Normal file
10
SchengenVisaApi/Domains/ApplicantDomain/Gender.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Domains.ApplicantDomain
|
||||
{
|
||||
public enum Gender
|
||||
{
|
||||
Unknown,
|
||||
Male,
|
||||
Female,
|
||||
Turkish
|
||||
}
|
||||
}
|
||||
11
SchengenVisaApi/Domains/ApplicantDomain/MaritalStatus.cs
Normal file
11
SchengenVisaApi/Domains/ApplicantDomain/MaritalStatus.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Domains.ApplicantDomain
|
||||
{
|
||||
public enum MaritalStatus
|
||||
{
|
||||
Other,
|
||||
Married,
|
||||
Unmarried,
|
||||
Separated,
|
||||
WidowOrWidower
|
||||
}
|
||||
}
|
||||
13
SchengenVisaApi/Domains/ApplicantDomain/Name.cs
Normal file
13
SchengenVisaApi/Domains/ApplicantDomain/Name.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
21
SchengenVisaApi/Domains/ApplicantDomain/Passport.cs
Normal file
21
SchengenVisaApi/Domains/ApplicantDomain/Passport.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace Domains.ApplicantDomain
|
||||
{
|
||||
/// Model of passport
|
||||
public class Passport : IEntity
|
||||
{
|
||||
/// Unique identifier of <see cref="Passport"/>
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
/// Number of <see cref="Passport"/>
|
||||
public string Number { get; set; }
|
||||
|
||||
/// Issuing authority of <see cref="Passport"/>
|
||||
public string Issuer { get; set; }
|
||||
|
||||
/// Date of issue
|
||||
public DateOnly IssueDate { get; set; }
|
||||
|
||||
/// Date when the <see cref="Passport"/> expires
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
}
|
||||
}
|
||||
19
SchengenVisaApi/Domains/ApplicantDomain/PlaceOfWork.cs
Normal file
19
SchengenVisaApi/Domains/ApplicantDomain/PlaceOfWork.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Domains.Common;
|
||||
|
||||
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="Domains.Common.Address"/> of hirer
|
||||
public Address Address { get; set; } = null!;
|
||||
|
||||
/// Phone number of hirer
|
||||
public string PhoneNum { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
19
SchengenVisaApi/Domains/Common/Address.cs
Normal file
19
SchengenVisaApi/Domains/Common/Address.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Domains.Common
|
||||
{
|
||||
/// Model of address
|
||||
/// <remarks>Owned</remarks>
|
||||
public class Address
|
||||
{
|
||||
/// Country part of address
|
||||
public Country Country { get; set; } = null!;
|
||||
|
||||
/// City part of address
|
||||
public City City { get; set; } = null!;
|
||||
|
||||
/// Street part of address
|
||||
public string Street { get; set; } = null!;
|
||||
|
||||
/// Building part of address
|
||||
public string Building { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
15
SchengenVisaApi/Domains/Common/City.cs
Normal file
15
SchengenVisaApi/Domains/Common/City.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Domains.Common
|
||||
{
|
||||
/// Model of a city
|
||||
public class City : IEntity
|
||||
{
|
||||
/// Unique identifier of the city
|
||||
public Guid Id { get; private set; } = Guid.NewGuid();
|
||||
|
||||
/// Name of the city
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
/// <see cref="Domains.Common.Country"/> in which the city is located
|
||||
public Country Country { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
15
SchengenVisaApi/Domains/Common/Country.cs
Normal file
15
SchengenVisaApi/Domains/Common/Country.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Domains.Common
|
||||
{
|
||||
/// Model of a country
|
||||
public class Country : IEntity
|
||||
{
|
||||
/// Name of the country
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
/// Located in Schengen area
|
||||
public bool IsSchengen { get; set; }
|
||||
|
||||
/// List of <see cref="City"/> that country have
|
||||
public List<City> Cities { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
9
SchengenVisaApi/Domains/Domains.csproj
Normal file
9
SchengenVisaApi/Domains/Domains.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
5
SchengenVisaApi/Domains/IEntity.cs
Normal file
5
SchengenVisaApi/Domains/IEntity.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Domains
|
||||
{
|
||||
/// Interface that every entity should inherit from
|
||||
public interface IEntity { }
|
||||
}
|
||||
20
SchengenVisaApi/Domains/VisaApplicationDomain/PastVisa.cs
Normal file
20
SchengenVisaApi/Domains/VisaApplicationDomain/PastVisa.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Domains.ApplicantDomain;
|
||||
|
||||
namespace Domains.VisaApplicationDomain
|
||||
{
|
||||
/// 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 DateOnly IssueDate { get; set; }
|
||||
|
||||
/// Name of visa
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
/// Date when visa expires
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
}
|
||||
}
|
||||
17
SchengenVisaApi/Domains/VisaApplicationDomain/PastVisit.cs
Normal file
17
SchengenVisaApi/Domains/VisaApplicationDomain/PastVisit.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Domains.ApplicantDomain;
|
||||
|
||||
namespace Domains.VisaApplicationDomain
|
||||
{
|
||||
/// 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 DateOnly StartDate { get; set; }
|
||||
|
||||
/// Last day of <see cref="PastVisit"/>
|
||||
public DateOnly EndDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Domains.VisaApplicationDomain
|
||||
{
|
||||
/// Permission to enter the destination country
|
||||
/// <remarks>Owned</remarks>
|
||||
public class PermissionToDestCountry
|
||||
{
|
||||
/// Date when <see cref="PermissionToDestCountry"/> expires
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
|
||||
/// Issuing authority
|
||||
public string Issuer { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Domains.VisaApplicationDomain
|
||||
{
|
||||
/// Permission to enter a country the issuer wants to come from
|
||||
public class ReentryPermit : IEntity
|
||||
{
|
||||
/// Unique identifier of <see cref="PastVisa"/>
|
||||
public Guid Id { get; private set; } = Guid.NewGuid();
|
||||
|
||||
/// Date when <see cref="ReentryPermit"/> expires
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Domains.ApplicantDomain;
|
||||
using Domains.Common;
|
||||
|
||||
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();
|
||||
|
||||
/// 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; }
|
||||
|
||||
/// <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!;
|
||||
|
||||
/// 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!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user