Skip to content

Commit

Permalink
🔨 add project fieds with description in seekers api
Browse files Browse the repository at this point in the history
  • Loading branch information
nixhantb committed Jan 27, 2025
1 parent 6c297df commit 455701e
Show file tree
Hide file tree
Showing 13 changed files with 1,148 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class ExperienceModel : BaseModel
{
public ExperienceLevel ExperienceLevel { get; set; }
public CompanyModel? CompanyModel { get; set; }
public DateTime ExperienceDateFrom { get; set; }
public DateTime ExperienceDateTill { get; set; }
}

[JsonConverter(typeof(JsonStringEnumConverter))]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace JobLeet.WebApi.JobLeet.Api.Models.Common.V1
{
public class ProjectModel : BaseModel
{
public string Title { get; set; }

public List<string> Responsibilities { get; set; }

public List<string> TechnologiesUsed { get; set; }

public string? Role { get; set; }
public DateOnly StartDate { get; set; }
public DateOnly? EndDate { get; set; }

public bool IsOngoing => !EndDate.HasValue;

public string? ProjectUrl { get; set; }
public string? GitHubUrl { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class SeekerModel : BaseModel
public List<SocialMedia> SocialMedias { get; set; } = new List<SocialMedia>();
public List<string>? Interests { get; set; }
public List<string>? Achievements { get; set; }
public ProjectModel? Projects { get; set; }
}

public class SocialMedia : BaseModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class Experience : BaseEntity
public ExperienceLevel ExperienceLevel { get; set; }

public Company? Company { get; set; }
public DateTime ExperienceDateFrom { get; set; }
public DateTime ExperienceDateTill { get; set; }
}

[JsonConverter(typeof(JsonStringEnumConverter))]
Expand Down
22 changes: 22 additions & 0 deletions Server/JobLeet.WebApi/JobLeet.Core/Entities/Common/V1/Projects.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace JobLeet.WebApi.JobLeet.Core.Entities.Common.V1
{
public class Project : BaseEntity
{
public string Title { get; set; }

public List<string> Responsibilities { get; set; }

public List<string> TechnologiesUsed { get; set; }

public string? Role { get; set; }

public DateOnly StartDate { get; set; }

public DateOnly? EndDate { get; set; }

public bool IsOngoing => !EndDate.HasValue;

public string? ProjectUrl { get; set; }
public string? GitHubUrl { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class Seeker : BaseEntity
public List<SocialMedia>? SocialMedias { get; set; }
public List<string>? Interests { get; set; }
public List<string>? Achievements { get; set; }
public Project? Projects { get; set; }
}

public class SocialMedia : BaseEntity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static Company ToCompanyDataBase(Company entity)
{
Id = entity.Id,
CompanyName = entity.CompanyName,

Profile =
entity.Profile == null
? null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static Experience ToExperienceDatabase(Experience entity)
Id = entity.Id,
Company = CompanyMapper.ToCompanyDataBase(entity.Company),
ExperienceLevel = entity.ExperienceLevel,
ExperienceDateFrom = entity.ExperienceDateFrom,
};
}

Expand All @@ -22,6 +23,7 @@ public static ExperienceModel ToExperienceModel(Experience model)
Id = model.Id,
CompanyModel = CompanyMapper.ToCompanyModel(model.Company),
ExperienceLevel = (Api.Models.Common.V1.ExperienceLevel)model.ExperienceLevel,
ExperienceDateTill = model.ExperienceDateTill,
};
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using JobLeet.WebApi.JobLeet.Api.Models.Common.V1;
using JobLeet.WebApi.JobLeet.Core.Entities.Common.V1;

namespace JobLeet.WebApi.JobLeet.Mappers.V1
{
public static class ProjectsMapper
{
public static Project ToProjectDatabase(Project entity)
{
return new Project
{
Id = entity.Id,
Title = entity.Title,
Responsibilities = entity.Responsibilities,
TechnologiesUsed = entity.TechnologiesUsed,
Role = entity.Role,
StartDate = entity.StartDate,
EndDate = entity.EndDate,
ProjectUrl = entity.ProjectUrl,
GitHubUrl = entity.ProjectUrl,
};
}

public static ProjectModel ToProjectModel(Project model)
{
return new ProjectModel
{
Id = model.Id,
Title = model.Title,
Responsibilities = model.Responsibilities,
TechnologiesUsed = model.TechnologiesUsed,
Role = model.Role,
StartDate = model.StartDate,
EndDate = model.EndDate,
ProjectUrl = model.ProjectUrl,
GitHubUrl = model.ProjectUrl,
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public static Seeker ToSeekerDataBase(Seeker entity, string UserId)
MiddleName = entity.PersonName.MiddleName,
LastName = entity.PersonName.LastName,
},
Projects = ProjectsMapper.ToProjectDatabase(entity.Projects),

Phone = PhoneMapper.ToPhoneDatabase(entity.Phone),
Address = AddressMapper.ToAddressDatabase(entity.Address),
Skills = SkillsMapper.ToSkillsDB(entity.Skills),
Expand Down Expand Up @@ -67,6 +69,8 @@ public static SeekerModel ToSeekerModel(Seeker model)
MiddleName = model.PersonName.MiddleName,
LastName = model.PersonName.LastName,
},
Projects =
model.Projects != null ? ProjectsMapper.ToProjectModel(model.Projects) : null,
Phone = model.Phone != null ? PhoneMapper.ToPhoneModel(model.Phone) : null,
Address =
model.Address != null ? AddressMapper.ToAddressModel(model.Address) : null,
Expand Down
Loading

0 comments on commit 455701e

Please sign in to comment.