| #endregion | #endregion | ||||
| #region DTOs to Models | #region DTOs to Models | ||||
| CreateMap<ApplicantCreateDto, Applicant>(); | |||||
| CreateMap<ApplicantImportDto, Applicant>(); | CreateMap<ApplicantImportDto, Applicant>(); | ||||
| CreateMap<ApplicantUpdateDto, Applicant>(); | |||||
| #endregion | #endregion | ||||
| } | } | ||||
| } | } |
| Ads = new List<Ad> { ad }, | Ads = new List<Ad> { ad }, | ||||
| SelectionProcesses = new(), | SelectionProcesses = new(), | ||||
| TechnologyApplicants = 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"); | _logger.LogInformation($"Saving applicant in database"); |
| 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; } | |||||
| } | |||||
| } |
| public string ApplicationChannel { get; set; } | public string ApplicationChannel { get; set; } | ||||
| public string TypeOfEmployment { get; set; } | public string TypeOfEmployment { get; set; } | ||||
| public string Comment { 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; } | public Diligent.WebAPI.Data.Entities.Ad Ad { get; set; } | ||||
| } | } | ||||
| } | } |
| 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; } | |||||
| } | |||||
| } |
| public int Experience { get; set; } | public int Experience { get; set; } | ||||
| public string ApplicationChannel { get; set; } | public string ApplicationChannel { get; set; } | ||||
| public string TypeOfEmployment { 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<TechnologyViewDto> TechnologyApplicants { get; set; } = new(); | ||||
| public List<CommentViewDto> Comments { get; set; } | public List<CommentViewDto> Comments { get; set; } | ||||
| public List<AdResponseDto> Ads { get; set; } | public List<AdResponseDto> Ads { get; set; } |
| public string CoverLetter { get; set; } | public string CoverLetter { get; set; } | ||||
| public IFormFile PdfFile { get; set; } | public IFormFile PdfFile { get; set; } | ||||
| public string Gender { get; set; } | |||||
| public string ProfessionalQualification { get; set; } | |||||
| } | } | ||||
| } | } |
| builder.Property(c => c.LastName).HasMaxLength(128); | builder.Property(c => c.LastName).HasMaxLength(128); | ||||
| 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.Position).HasMaxLength(128); | ||||
| builder.Property(c => c.ProfessionalQualification).HasMaxLength(128); | |||||
| builder.Property(c => c.CV).IsRequired(true); | builder.Property(c => c.CV).IsRequired(true); | ||||
| builder.Property(c => c.Email).HasMaxLength(128); | builder.Property(c => c.Email).HasMaxLength(128); | ||||
| builder.Property(c => c.PhoneNumber).HasMaxLength(30); | builder.Property(c => c.PhoneNumber).HasMaxLength(30); | ||||
| builder.Property(c => c.BitBucketLink).IsRequired(false); | builder.Property(c => c.BitBucketLink).IsRequired(false); | ||||
| builder.Property(c => c.ApplicationChannel).IsRequired(false); | builder.Property(c => c.ApplicationChannel).IsRequired(false); | ||||
| builder.Property(c => c.TypeOfEmployment).IsRequired(true).HasConversion<string>(); | builder.Property(c => c.TypeOfEmployment).IsRequired(true).HasConversion<string>(); | ||||
| builder.Property(c => c.Gender).IsRequired(true).HasConversion<string>(); | |||||
| } | } | ||||
| } | |||||
| } | |||||
| } | } |
| Posao, | Posao, | ||||
| Intership | Intership | ||||
| }; | }; | ||||
| public enum Genders | |||||
| { | |||||
| M, | |||||
| Z | |||||
| } | |||||
| public enum WorkHours { PartTime, FullTime }; | |||||
| public int ApplicantId { get; set; } | public int ApplicantId { get; set; } | ||||
| public string FirstName { get; set; } | public string FirstName { get; set; } | ||||
| public string LastName { get; set; } | public string LastName { get; set; } | ||||
| public int Experience { get; set; } | public int Experience { get; set; } | ||||
| public string ApplicationChannel { get; set; } | public string ApplicationChannel { get; set; } | ||||
| public TypesOfEmployment TypeOfEmployment { 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<TechnologyApplicant> TechnologyApplicants { get; set; } | ||||
| public List<Comment> Comments { get; set; } | public List<Comment> Comments { get; set; } | ||||
| public List<Ad> Ads { get; set; } | public List<Ad> Ads { get; set; } |
| 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"); | |||||
| } | |||||
| } | |||||
| } |
| .HasMaxLength(128) | .HasMaxLength(128) | ||||
| .HasColumnType("nvarchar(128)"); | .HasColumnType("nvarchar(128)"); | ||||
| b.Property<string>("Gender") | |||||
| .IsRequired() | |||||
| .HasColumnType("nvarchar(max)"); | |||||
| b.Property<string>("GithubLink") | b.Property<string>("GithubLink") | ||||
| .HasColumnType("nvarchar(max)"); | .HasColumnType("nvarchar(max)"); | ||||
| .HasMaxLength(128) | .HasMaxLength(128) | ||||
| .HasColumnType("nvarchar(128)"); | .HasColumnType("nvarchar(128)"); | ||||
| b.Property<string>("ProfessionalQualification") | |||||
| .IsRequired() | |||||
| .HasMaxLength(128) | |||||
| .HasColumnType("nvarchar(128)"); | |||||
| b.Property<string>("TypeOfEmployment") | b.Property<string>("TypeOfEmployment") | ||||
| .IsRequired() | .IsRequired() | ||||
| .HasColumnType("nvarchar(max)"); | .HasColumnType("nvarchar(max)"); |
| <ProjectReference Include="..\Diligent.WebAPI.Host\Diligent.WebAPI.Host.csproj" /> | <ProjectReference Include="..\Diligent.WebAPI.Host\Diligent.WebAPI.Host.csproj" /> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | |||||
| <Folder Include="TestResults\" /> | |||||
| </ItemGroup> | |||||
| </Project> | </Project> |
| new SelectionProcess{ Status = "", Name = ""}, | new SelectionProcess{ Status = "", Name = ""}, | ||||
| new SelectionProcess{ Status = "", Name = ""}, | new SelectionProcess{ Status = "", Name = ""}, | ||||
| new SelectionProcess{ Status = "", Name = ""} | new SelectionProcess{ Status = "", Name = ""} | ||||
| } | |||||
| }, | |||||
| Gender = Applicant.Genders.M, | |||||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||||
| }; | }; | ||||
| var applicant2 = new Applicant | var applicant2 = new Applicant | ||||
| new SelectionProcess{ Status = "", Name = ""}, | new SelectionProcess{ Status = "", Name = ""}, | ||||
| new SelectionProcess{ Status = "", Name = ""}, | new SelectionProcess{ Status = "", Name = ""}, | ||||
| new SelectionProcess{ Status = "", Name = ""} | new SelectionProcess{ Status = "", Name = ""} | ||||
| } | |||||
| }, | |||||
| Gender = Applicant.Genders.M, | |||||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||||
| }; | }; | ||||
| var applicants = new List<Applicant> | var applicants = new List<Applicant> |
| PdfFile = null, | PdfFile = null, | ||||
| PhoneNumber = "32312321", | PhoneNumber = "32312321", | ||||
| TechnologiesIds = new int[] { 1 }, | TechnologiesIds = new int[] { 1 }, | ||||
| Gender = "Muski", | |||||
| ProfessionalQualification = "Elektrotehincki fakultet" | |||||
| }; | }; | ||||
| _fileService.When(x => x.UploadCV(Arg.Any<string>(), Arg.Any<IFormFile>())).Do(x => { }); | _fileService.When(x => x.UploadCV(Arg.Any<string>(), Arg.Any<IFormFile>())).Do(x => { }); | ||||
| PdfFile = null, | PdfFile = null, | ||||
| PhoneNumber = "32312321", | PhoneNumber = "32312321", | ||||
| TechnologiesIds = new int[] { 1 }, | TechnologiesIds = new int[] { 1 }, | ||||
| Gender = "Muski", | |||||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||||
| }; | }; | ||||
| _fileService.When(x => x.UploadCV(Arg.Any<string>(), Arg.Any<IFormFile>())).Do(x => { }); | _fileService.When(x => x.UploadCV(Arg.Any<string>(), Arg.Any<IFormFile>())).Do(x => { }); | ||||
| _technologyService.GetEntitiesAsync(Arg.Any<int[]>()).Returns(_technologies); | _technologyService.GetEntitiesAsync(Arg.Any<int[]>()).Returns(_technologies); | ||||
| LinkedlnLink = "", | LinkedlnLink = "", | ||||
| PhoneNumber = "2321312", | PhoneNumber = "2321312", | ||||
| Position = "some position", | Position = "some position", | ||||
| TypeOfEmployment = "Intership" | |||||
| TypeOfEmployment = "Intership", | |||||
| Gender = "Muski", | |||||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||||
| } | } | ||||
| }); | }); | ||||
| { | { | ||||
| To = "dzenis@dilig.net;meris@dilig.net", | To = "dzenis@dilig.net;meris@dilig.net", | ||||
| Subject = "Forget password", | Subject = "Forget password", | ||||
| Body = "Forget password" | |||||
| Body = "Forget password", | |||||
| }; | }; | ||||
| _message = new MailMessage | _message = new MailMessage | ||||
| { | { |
| Experience = 1, | Experience = 1, | ||||
| ApplicationChannel = "", | ApplicationChannel = "", | ||||
| TypeOfEmployment = Applicant.TypesOfEmployment.Posao, | TypeOfEmployment = Applicant.TypesOfEmployment.Posao, | ||||
| Gender = Applicant.Genders.M, | |||||
| ProfessionalQualification = "Elektrotehnicki fakultet" | |||||
| }, | }, | ||||
| Comment = "Komentar" | Comment = "Komentar" | ||||
| } | } |