| @@ -16,9 +16,7 @@ namespace Diligent.WebAPI.Business.MappingProfiles | |||
| #endregion | |||
| #region DTOs to Models | |||
| CreateMap<ApplicantCreateDto, Applicant>(); | |||
| CreateMap<ApplicantImportDto, Applicant>(); | |||
| CreateMap<ApplicantUpdateDto, Applicant>(); | |||
| #endregion | |||
| } | |||
| } | |||
| @@ -172,7 +172,9 @@ namespace Diligent.WebAPI.Business.Services | |||
| Ads = new List<Ad> { ad }, | |||
| SelectionProcesses = new(), | |||
| TechnologyApplicants = new(), | |||
| ApplicationChannel = "Putem sajta" | |||
| ApplicationChannel = "Putem sajta", | |||
| Gender = request.Gender == "Muski" ? Genders.M : Genders.Z, | |||
| ProfessionalQualification = request.ProfessionalQualification | |||
| }; | |||
| _logger.LogInformation($"Saving applicant in database"); | |||
| @@ -1,20 +0,0 @@ | |||
| using Diligent.WebAPI.Contracts.DTOs.SelectionProcess; | |||
| namespace Diligent.WebAPI.Contracts.DTOs.Applicant | |||
| { | |||
| public class ApplicantCreateDto | |||
| { | |||
| public string FirstName { get; set; } | |||
| public string LastName { get; set; } | |||
| public string Position { get; set; } | |||
| public string CV { get; set; } | |||
| public string Email { get; set; } | |||
| public string PhoneNumber { get; set; } | |||
| public string LinkedlnLink { get; set; } | |||
| public string GithubLink { get; set; } | |||
| public string BitBucketLink { get; set; } | |||
| public int Experience { get; set; } | |||
| public string ApplicationChannel { get; set; } | |||
| public string TypeOfEmployment { get; set; } | |||
| } | |||
| } | |||
| @@ -16,6 +16,8 @@ | |||
| public string ApplicationChannel { get; set; } | |||
| public string TypeOfEmployment { get; set; } | |||
| public string Comment { get; set; } | |||
| public string Gender { get; set; } | |||
| public string ProfessionalQualification { get; set; } | |||
| public Diligent.WebAPI.Data.Entities.Ad Ad { get; set; } | |||
| } | |||
| } | |||
| @@ -1,17 +0,0 @@ | |||
| namespace Diligent.WebAPI.Contracts.DTOs.Applicant | |||
| { | |||
| public class ApplicantUpdateDto | |||
| { | |||
| public string FirstName { get; set; } | |||
| public string LastName { get; set; } | |||
| public string Position { get; set; } | |||
| public string CV { get; set; } | |||
| public string Email { get; set; } | |||
| public string PhoneNumber { get; set; } | |||
| public string LinkedlnLink { get; set; } | |||
| public string GithubLink { get; set; } | |||
| public string BitBucketLink { get; set; } | |||
| public int Experience { get; set; } | |||
| public string ApplicationChannel { get; set; } | |||
| } | |||
| } | |||
| @@ -21,6 +21,8 @@ namespace Diligent.WebAPI.Contracts.DTOs.Applicant | |||
| public int Experience { get; set; } | |||
| public string ApplicationChannel { get; set; } | |||
| public string TypeOfEmployment { get; set; } | |||
| public string Gender { get; set; } | |||
| public string ProfessionalQualification { get; set; } | |||
| public List<TechnologyViewDto> TechnologyApplicants { get; set; } = new(); | |||
| public List<CommentViewDto> Comments { get; set; } | |||
| public List<AdResponseDto> Ads { get; set; } | |||
| @@ -34,5 +34,7 @@ namespace Diligent.WebAPI.Contracts.DTOs.Applicant | |||
| public string CoverLetter { get; set; } | |||
| public IFormFile PdfFile { get; set; } | |||
| public string Gender { get; set; } | |||
| public string ProfessionalQualification { get; set; } | |||
| } | |||
| } | |||
| @@ -10,6 +10,7 @@ namespace Diligent.WebAPI.Data.Configurations | |||
| builder.Property(c => c.LastName).HasMaxLength(128); | |||
| builder.Property(c => c.LastName).HasMaxLength(128); | |||
| builder.Property(c => c.Position).HasMaxLength(128); | |||
| builder.Property(c => c.ProfessionalQualification).HasMaxLength(128); | |||
| builder.Property(c => c.CV).IsRequired(true); | |||
| builder.Property(c => c.Email).HasMaxLength(128); | |||
| builder.Property(c => c.PhoneNumber).HasMaxLength(30); | |||
| @@ -18,6 +19,7 @@ namespace Diligent.WebAPI.Data.Configurations | |||
| builder.Property(c => c.BitBucketLink).IsRequired(false); | |||
| builder.Property(c => c.ApplicationChannel).IsRequired(false); | |||
| builder.Property(c => c.TypeOfEmployment).IsRequired(true).HasConversion<string>(); | |||
| builder.Property(c => c.Gender).IsRequired(true).HasConversion<string>(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -7,6 +7,12 @@ | |||
| Posao, | |||
| Intership | |||
| }; | |||
| public enum Genders | |||
| { | |||
| M, | |||
| Z | |||
| } | |||
| public enum WorkHours { PartTime, FullTime }; | |||
| public int ApplicantId { get; set; } | |||
| public string FirstName { get; set; } | |||
| public string LastName { get; set; } | |||
| @@ -21,6 +27,8 @@ | |||
| public int Experience { get; set; } | |||
| public string ApplicationChannel { get; set; } | |||
| public TypesOfEmployment TypeOfEmployment { get; set; } | |||
| public Genders Gender { get; set; } | |||
| public string ProfessionalQualification { get; set; } | |||
| public List<TechnologyApplicant> TechnologyApplicants { get; set; } | |||
| public List<Comment> Comments { get; set; } | |||
| public List<Ad> Ads { get; set; } | |||
| @@ -0,0 +1,38 @@ | |||
| using Microsoft.EntityFrameworkCore.Migrations; | |||
| #nullable disable | |||
| namespace Diligent.WebAPI.Data.Migrations | |||
| { | |||
| public partial class ApplicantUpdate : Migration | |||
| { | |||
| protected override void Up(MigrationBuilder migrationBuilder) | |||
| { | |||
| migrationBuilder.AddColumn<string>( | |||
| name: "Gender", | |||
| table: "Applicants", | |||
| type: "nvarchar(max)", | |||
| nullable: false, | |||
| defaultValue: ""); | |||
| migrationBuilder.AddColumn<string>( | |||
| name: "ProfessionalQualification", | |||
| table: "Applicants", | |||
| type: "nvarchar(128)", | |||
| maxLength: 128, | |||
| nullable: false, | |||
| defaultValue: ""); | |||
| } | |||
| protected override void Down(MigrationBuilder migrationBuilder) | |||
| { | |||
| migrationBuilder.DropColumn( | |||
| name: "Gender", | |||
| table: "Applicants"); | |||
| migrationBuilder.DropColumn( | |||
| name: "ProfessionalQualification", | |||
| table: "Applicants"); | |||
| } | |||
| } | |||
| } | |||
| @@ -132,6 +132,10 @@ namespace Diligent.WebAPI.Data.Migrations | |||
| .HasMaxLength(128) | |||
| .HasColumnType("nvarchar(128)"); | |||
| b.Property<string>("Gender") | |||
| .IsRequired() | |||
| .HasColumnType("nvarchar(max)"); | |||
| b.Property<string>("GithubLink") | |||
| .HasColumnType("nvarchar(max)"); | |||
| @@ -153,6 +157,11 @@ namespace Diligent.WebAPI.Data.Migrations | |||
| .HasMaxLength(128) | |||
| .HasColumnType("nvarchar(128)"); | |||
| b.Property<string>("ProfessionalQualification") | |||
| .IsRequired() | |||
| .HasMaxLength(128) | |||
| .HasColumnType("nvarchar(128)"); | |||
| b.Property<string>("TypeOfEmployment") | |||
| .IsRequired() | |||
| .HasColumnType("nvarchar(max)"); | |||
| @@ -31,8 +31,4 @@ | |||
| <ProjectReference Include="..\Diligent.WebAPI.Host\Diligent.WebAPI.Host.csproj" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <Folder Include="TestResults\" /> | |||
| </ItemGroup> | |||
| </Project> | |||
| @@ -36,7 +36,9 @@ namespace Diligent.WebAPI.Tests | |||
| new SelectionProcess{ Status = "", Name = ""}, | |||
| new SelectionProcess{ Status = "", Name = ""}, | |||
| new SelectionProcess{ Status = "", Name = ""} | |||
| } | |||
| }, | |||
| Gender = Applicant.Genders.M, | |||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||
| }; | |||
| var applicant2 = new Applicant | |||
| @@ -60,7 +62,9 @@ namespace Diligent.WebAPI.Tests | |||
| new SelectionProcess{ Status = "", Name = ""}, | |||
| new SelectionProcess{ Status = "", Name = ""}, | |||
| new SelectionProcess{ Status = "", Name = ""} | |||
| } | |||
| }, | |||
| Gender = Applicant.Genders.M, | |||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||
| }; | |||
| var applicants = new List<Applicant> | |||
| @@ -140,6 +140,8 @@ namespace Diligent.WebAPI.Tests.Services | |||
| PdfFile = null, | |||
| PhoneNumber = "32312321", | |||
| TechnologiesIds = new int[] { 1 }, | |||
| Gender = "Muski", | |||
| ProfessionalQualification = "Elektrotehincki fakultet" | |||
| }; | |||
| _fileService.When(x => x.UploadCV(Arg.Any<string>(), Arg.Any<IFormFile>())).Do(x => { }); | |||
| @@ -167,6 +169,8 @@ namespace Diligent.WebAPI.Tests.Services | |||
| PdfFile = null, | |||
| PhoneNumber = "32312321", | |||
| TechnologiesIds = new int[] { 1 }, | |||
| Gender = "Muski", | |||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||
| }; | |||
| _fileService.When(x => x.UploadCV(Arg.Any<string>(), Arg.Any<IFormFile>())).Do(x => { }); | |||
| _technologyService.GetEntitiesAsync(Arg.Any<int[]>()).Returns(_technologies); | |||
| @@ -295,7 +299,9 @@ namespace Diligent.WebAPI.Tests.Services | |||
| LinkedlnLink = "", | |||
| PhoneNumber = "2321312", | |||
| Position = "some position", | |||
| TypeOfEmployment = "Intership" | |||
| TypeOfEmployment = "Intership", | |||
| Gender = "Muski", | |||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||
| } | |||
| }); | |||
| @@ -27,7 +27,7 @@ namespace Diligent.WebAPI.Tests.Services | |||
| { | |||
| To = "dzenis@dilig.net;meris@dilig.net", | |||
| Subject = "Forget password", | |||
| Body = "Forget password" | |||
| Body = "Forget password", | |||
| }; | |||
| _message = new MailMessage | |||
| { | |||
| @@ -73,6 +73,8 @@ namespace Diligent.WebAPI.Tests.Services | |||
| Experience = 1, | |||
| ApplicationChannel = "", | |||
| TypeOfEmployment = Applicant.TypesOfEmployment.Posao, | |||
| Gender = Applicant.Genders.M, | |||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||
| }, | |||
| Comment = "Komentar" | |||
| } | |||