Ver código fonte

updated Applicant entity on backend

pull/161/head
Dzenis Hadzifejzovic 3 anos atrás
pai
commit
a5cf2510b3

+ 0
- 2
Diligent.WebAPI.Business/MappingProfiles/ApplicantMappingProfile.cs Ver arquivo

#endregion #endregion


#region DTOs to Models #region DTOs to Models
CreateMap<ApplicantCreateDto, Applicant>();
CreateMap<ApplicantImportDto, Applicant>(); CreateMap<ApplicantImportDto, Applicant>();
CreateMap<ApplicantUpdateDto, Applicant>();
#endregion #endregion
} }
} }

+ 3
- 1
Diligent.WebAPI.Business/Services/ApplicantService.cs Ver arquivo

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");

+ 0
- 20
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantCreateDto.cs Ver arquivo

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; }
}
}

+ 2
- 0
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantImporteDto.cs Ver arquivo

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; }
} }
} }

+ 0
- 17
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantUpdateDto.cs Ver arquivo

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; }
}
}

+ 2
- 0
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantViewDto.cs Ver arquivo

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; }

+ 2
- 0
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplyForAdRequestDto.cs Ver arquivo

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; }
} }
} }

+ 3
- 1
Diligent.WebAPI.Data/Configurations/ApplicantConfiguration.cs Ver arquivo

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>();
} }
}
}
} }

+ 8
- 0
Diligent.WebAPI.Data/Entities/Applicant.cs Ver arquivo

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; }

+ 1077
- 0
Diligent.WebAPI.Data/Migrations/20230112133613_ApplicantUpdate.Designer.cs
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 38
- 0
Diligent.WebAPI.Data/Migrations/20230112133613_ApplicantUpdate.cs Ver arquivo

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");
}
}
}

+ 9
- 0
Diligent.WebAPI.Data/Migrations/DatabaseContextModelSnapshot.cs Ver arquivo

.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)");

+ 0
- 4
Diligent.WebAPI.Tests/Diligent.WebAPI.Tests.csproj Ver arquivo

<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>

+ 6
- 2
Diligent.WebAPI.Tests/MockData.cs Ver arquivo

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>

+ 7
- 1
Diligent.WebAPI.Tests/Services/ApplicantServiceTests.cs Ver arquivo

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"
} }
}); });



+ 1
- 1
Diligent.WebAPI.Tests/Services/EmailerTests.cs Ver arquivo

{ {
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
{ {

+ 2
- 0
Diligent.WebAPI.Tests/Services/PatternServiceTests.cs Ver arquivo

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"
} }

Carregando…
Cancelar
Salvar