ソースを参照

updated Applicant entity on backend

pull/161/head
Dzenis Hadzifejzovic 3年前
コミット
a5cf2510b3

+ 0
- 2
Diligent.WebAPI.Business/MappingProfiles/ApplicantMappingProfile.cs ファイルの表示

@@ -16,9 +16,7 @@ namespace Diligent.WebAPI.Business.MappingProfiles
#endregion

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

+ 3
- 1
Diligent.WebAPI.Business/Services/ApplicantService.cs ファイルの表示

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

+ 0
- 20
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantCreateDto.cs ファイルの表示

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

+ 2
- 0
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantImporteDto.cs ファイルの表示

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

+ 0
- 17
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantUpdateDto.cs ファイルの表示

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

+ 2
- 0
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantViewDto.cs ファイルの表示

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

+ 2
- 0
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplyForAdRequestDto.cs ファイルの表示

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

+ 3
- 1
Diligent.WebAPI.Data/Configurations/ApplicantConfiguration.cs ファイルの表示

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

+ 8
- 0
Diligent.WebAPI.Data/Entities/Applicant.cs ファイルの表示

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

+ 1077
- 0
Diligent.WebAPI.Data/Migrations/20230112133613_ApplicantUpdate.Designer.cs
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 38
- 0
Diligent.WebAPI.Data/Migrations/20230112133613_ApplicantUpdate.cs ファイルの表示

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

+ 9
- 0
Diligent.WebAPI.Data/Migrations/DatabaseContextModelSnapshot.cs ファイルの表示

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

+ 0
- 4
Diligent.WebAPI.Tests/Diligent.WebAPI.Tests.csproj ファイルの表示

@@ -31,8 +31,4 @@
<ProjectReference Include="..\Diligent.WebAPI.Host\Diligent.WebAPI.Host.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="TestResults\" />
</ItemGroup>

</Project>

+ 6
- 2
Diligent.WebAPI.Tests/MockData.cs ファイルの表示

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

+ 7
- 1
Diligent.WebAPI.Tests/Services/ApplicantServiceTests.cs ファイルの表示

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


+ 1
- 1
Diligent.WebAPI.Tests/Services/EmailerTests.cs ファイルの表示

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

+ 2
- 0
Diligent.WebAPI.Tests/Services/PatternServiceTests.cs ファイルの表示

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

読み込み中…
キャンセル
保存