瀏覽代碼

Merge branch 'feature/updated_applicant_entity' of Neca/HRCenter into BE_dev

pull/177/head
safet.purkovic 3 年之前
父節點
當前提交
0e0a55876e

+ 0
- 2
Diligent.WebAPI.Business/MappingProfiles/ApplicantMappingProfile.cs 查看文件

#endregion #endregion


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

+ 6
- 2
Diligent.WebAPI.Business/Services/ApplicantService.cs 查看文件

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");
}, },
Ads = new List<Ad> { request.Ad }, Ads = new List<Ad> { request.Ad },
SelectionProcesses = new(), SelectionProcesses = new(),
TechnologyApplicants = new()
TechnologyApplicants = new(),
Gender = Genders.M,
ProfessionalQualification = "Elektrotehnicki fakultet",
}; };
res.Add(applicant); res.Add(applicant);
} }

+ 0
- 20
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantCreateDto.cs 查看文件

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

+ 0
- 17
Diligent.WebAPI.Contracts/DTOs/Applicant/ApplicantUpdateDto.cs 查看文件

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 查看文件

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 查看文件

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 查看文件

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 查看文件

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
文件差異過大導致無法顯示
查看文件


+ 38
- 0
Diligent.WebAPI.Data/Migrations/20230112133613_ApplicantUpdate.cs 查看文件

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 查看文件

.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 查看文件

<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 查看文件

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>

+ 4
- 0
Diligent.WebAPI.Tests/Services/ApplicantServiceTests.cs 查看文件

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

+ 1
- 1
Diligent.WebAPI.Tests/Services/EmailerTests.cs 查看文件

{ {
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 查看文件

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

Loading…
取消
儲存