Вытащил солюшен на уровень выше, чтобы прощё было дотнетить
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,65 @@
using ApplicationLayer.InfrastructureServicesInterfaces;
using Bogus;
using Domains;
using Domains.ApplicantDomain;
namespace VisaApi.Fakers.Applicants;
/// <summary>
/// Generates applicants
/// </summary>
public sealed class ApplicantFaker : Faker<Applicant>
{
public ApplicantFaker(IDateTimeProvider dateTimeProvider)
{
RuleFor(a => a.Citizenship, f => f.Address.Country());
RuleFor(a => a.Gender, f => f.Random.Enum<Gender>());
RuleForType(typeof(Name), f
=> new Name
{
FirstName = f.Name.LastName(),
Surname = f.Name.LastName(),
Patronymic = f.Name.FirstName()
});
RuleFor(a => a.BirthDate,
f => f.Date.Past(60, dateTimeProvider.Now()));
RuleFor(a => a.Passport, f
=> new Passport
{
Issuer = f.Company.CompanyName(),
Number = f.Random.String(ConfigurationConstraints.PassportNumberLength, 'a', 'z'),
ExpirationDate = f.Date.Future(4, dateTimeProvider.Now()),
IssueDate = f.Date.Past(4, dateTimeProvider.Now())
});
RuleFor(a => a.JobTitle, f => f.Name.JobTitle());
RuleFor(a => a.MaritalStatus, f => f.Random.Enum<MaritalStatus>());
RuleFor(a => a.CitizenshipByBirth, f => f.Address.Country());
RuleFor(a => a.CityOfBirth, f => f.Address.City());
RuleFor(a => a.CountryOfBirth, f => f.Address.Country());
RuleFor(a => a.IsNonResident, f => f.Random.Bool());
RuleFor(a => a.PlaceOfWork, f
=> new PlaceOfWork
{
Address = new Address
{
Country = f.Address.Country(),
City = f.Address.City(),
Street = f.Address.StreetName(),
Building = f.Address.BuildingNumber()
},
Name = f.Company.CompanyName(),
PhoneNum = f.Phone.PhoneNumber()
});
}
}

View File

@@ -0,0 +1,16 @@
using ApplicationLayer.Services.Applicants.Models;
using Bogus;
namespace VisaApi.Fakers.Applicants.Requests;
public sealed class NameModelFaker : Faker<NameModel>
{
public NameModelFaker()
{
RuleFor(m => m.FirstName, f => f.Name.FirstName());
RuleFor(m => m.Surname, f => f.Name.LastName());
RuleFor(m => m.Patronymic, f => f.Name.FirstName());
}
}

View File

@@ -0,0 +1,22 @@
using ApplicationLayer.Services.Applicants.Models;
using Bogus;
using Domains;
namespace VisaApi.Fakers.Applicants.Requests;
public sealed class PassportModelFaker : Faker<PassportModel>
{
public PassportModelFaker()
{
RuleFor(m => m.Issuer, f => f.Company.CompanyName());
RuleFor(m => m.Number,
f => f.Random.String(ConfigurationConstraints.PassportNumberLength, 'a', 'z'));
RuleFor(m => m.ExpirationDate,
f => f.Date.Future(4));
RuleFor(m => m.IssueDate,
f => f.Date.Past(4));
}
}

View File

@@ -0,0 +1,23 @@
using ApplicationLayer.Services.Applicants.Models;
using Bogus;
namespace VisaApi.Fakers.Applicants.Requests;
public sealed class PlaceOfWorkModelFaker : Faker<PlaceOfWorkModel>
{
public PlaceOfWorkModelFaker()
{
RuleFor(m => m.Name, f => f.Company.CompanyName());
RuleFor(m => m.PhoneNum, f => f.Phone.PhoneNumber("###########"));
RuleFor(m => m.Address,
f => new AddressModel
{
Country = f.Address.Country(),
City = f.Address.City(),
Street = f.Address.StreetName(),
Building = f.Address.BuildingNumber()
});
}
}