Skip to content

Commit

Permalink
Merge pull request #87 from nixhantb/feature/nishantb/inttostr
Browse files Browse the repository at this point in the history
Feature/nishantb/inttostr
  • Loading branch information
nixhantb authored Jan 23, 2025
2 parents e0a22bd + bea5064 commit cf4271f
Show file tree
Hide file tree
Showing 50 changed files with 1,220 additions and 2,448 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public virtual async Task<IActionResult> GetAllAsync()
/// <exception cref="Exception">Thrown when there is an error while fetching data from the database.</exception>
/// <remarks>This method fetches the record by ID from the database using Entity Framework Core.</remarks>
[HttpGet("{id}")]
public virtual async Task<IActionResult> GetByIdAsync(int id)
public virtual async Task<IActionResult> GetByIdAsync(string id)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ IValidator<Application> validator

[HttpPost("apply")]
public async Task<IActionResult> ApplyForJobAsync(
[FromQuery] int seekerId,
[FromQuery] int jobId,
[FromQuery] int companyId
[FromQuery] string seekerId,
[FromQuery] string jobId,
[FromQuery] string companyId
)
{
try
Expand Down
2 changes: 1 addition & 1 deletion Server/JobLeet.WebApi/JobLeet.Api/Models/BaseModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
public class BaseModel
{
public int Id { get; set; }
public string Id { get; set; }
}
}
2 changes: 1 addition & 1 deletion Server/JobLeet.WebApi/JobLeet.Core/Entities/BaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace JobLeet.WebApi.JobLeet.Core.Entities;
public class BaseEntity
{
[JsonIgnore]
public int Id { get; set; }
public string Id { get; set; } = Guid.NewGuid().ToString();

[Required]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace JobLeet.WebApi.JobLeet.Core.Entities.Jobs.V1
{
public class Application : BaseEntity
{
public int SeekerId { get; set; }
public string SeekerId { get; set; }
public Seeker? Seekers { get; set; }

public int CompanyId { get; set; }
public string CompanyId { get; set; }
public Company? Company { get; set; }

public int JobId { get; set; }
public string JobId { get; set; }

[ForeignKey(nameof(JobId))]
public JobEntity? Jobs { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions Server/JobLeet.WebApi/JobLeet.Core/Interfaces/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public interface IRepository<TEntity, TModel>
where TEntity : class
where TModel : class
{
Task<TModel> GetByIdAsync(int id);
Task<TModel> GetByIdAsync(string id);
Task<List<TModel>> GetAllAsync();
Task<TModel> AddAsync(TEntity entity);
Task UpdateAsync(TEntity entity);
Task DeleteAsync(int id);
Task DeleteAsync(string id);
}
}
4 changes: 2 additions & 2 deletions Server/JobLeet.WebApi/JobLeet.Core/Interfaces/IService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public interface IService<TEntity, TModel>
where TEntity : class
where TModel : class
{
Task<TModel> GetByIdAsync(int id);
Task<TModel> GetByIdAsync(string id);
Task<List<TModel>> GetAllAsync();
Task<TModel> AddAsync(TEntity entity);
Task UpdateAsync(TEntity entity);
Task DeleteAsync(int id);
Task DeleteAsync(string id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace JobLeet.WebApi.JobLeet.Core.Interfaces.Jobs.V1
{
public interface IApplicationRepository : IRepository<Application, ApplicationModel>
{
Task<Application> ApplyForJobAsync(int seekerId, int jobId, int companyId);
Task<Application> UpdateApplicationStatusAsync(int applicationId, Status status);
Task<Application> ApplyForJobAsync(string seekerId, string jobId, string companyId);
Task<Application> UpdateApplicationStatusAsync(string applicationId, Status status);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace JobLeet.WebApi.JobLeet.Core.Interfaces.Jobs.V1
{
public interface IApplicationService : IService<Application, ApplicationModel>
{
Task<Application> ApplyForJobAsync(int seekerId, int jobId, int companyId);
Task<Application> UpdateApplicationStatusAsync(int applicationId, Status status);
Task<Application> ApplyForJobAsync(string seekerId, string jobId, string companyId);
Task<Application> UpdateApplicationStatusAsync(string applicationId, Status status);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public Task<AddressModel> AddAsync(Address entity)
return result;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _addressRepository.DeleteAsync(id);
}
Expand All @@ -33,7 +33,7 @@ public async Task<List<AddressModel>> GetAllAsync()
return address;
}

public async Task<AddressModel> GetByIdAsync(int id)
public async Task<AddressModel> GetByIdAsync(string id)
{
var address = await _addressRepository.GetByIdAsync(id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ public async Task<ApplicationModel> AddAsync(Application entity)
return await _applicationRepository.AddAsync(entity);
}

public async Task<Application> ApplyForJobAsync(int seekerId, int jobId, int companyId)
public async Task<Application> ApplyForJobAsync(
string seekerId,
string jobId,
string companyId
)
{
if (seekerId <= 0 || jobId <= 0)
throw new ArgumentException("Seeker ID and Job ID must be greater than zero.");

return await _applicationRepository.ApplyForJobAsync(seekerId, jobId, companyId);
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
var application = await _applicationRepository.GetByIdAsync(id);
if (application == null)
Expand All @@ -45,7 +46,7 @@ public async Task<List<ApplicationModel>> GetAllAsync()
return await _applicationRepository.GetAllAsync();
}

public async Task<ApplicationModel> GetByIdAsync(int id)
public async Task<ApplicationModel> GetByIdAsync(string id)
{
var application = await _applicationRepository.GetByIdAsync(id);
if (application == null)
Expand All @@ -55,7 +56,7 @@ public async Task<ApplicationModel> GetByIdAsync(int id)
}

public async Task<Application> UpdateApplicationStatusAsync(
int applicationId,
string applicationId,
Status status
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task<CompanyModel> AddAsync(Company entity)
return await _companyRepository.AddAsync(entity);
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
var company = await _companyRepository.GetByIdAsync(id);
if (company == null)
Expand All @@ -36,7 +36,7 @@ public async Task<List<CompanyModel>> GetAllAsync()
return await _companyRepository.GetAllAsync();
}

public async Task<CompanyModel> GetByIdAsync(int id)
public async Task<CompanyModel> GetByIdAsync(string id)
{
var company = await _companyRepository.GetByIdAsync(id);
if (company == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task<EducationModel> AddAsync(Education entity)
return education;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _educationRepository.DeleteAsync(id);
}
Expand All @@ -31,7 +31,7 @@ public async Task<List<EducationModel>> GetAllAsync()
return education;
}

public async Task<EducationModel> GetByIdAsync(int id)
public async Task<EducationModel> GetByIdAsync(string id)
{
var education = await _educationRepository.GetByIdAsync(id);
if (education == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task<EmailModel> AddAsync(Email entity)
return email;
}

public Task DeleteAsync(int id)
public Task DeleteAsync(string id)
{
throw new NotImplementedException();
}
Expand All @@ -31,7 +31,7 @@ public async Task<List<EmailModel>> GetAllAsync()
return email;
}

public async Task<EmailModel> GetByIdAsync(int id)
public async Task<EmailModel> GetByIdAsync(string id)
{
var email = await _emailTypeRepository.GetByIdAsync(id);
if (email == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task<EmployerModel> AddAsync(Employer entity)
return result;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _employerRepository.DeleteAsync(id);
}
Expand All @@ -33,7 +33,7 @@ public async Task<List<EmployerModel>> GetAllAsync()
return employer;
}

public async Task<EmployerModel> GetByIdAsync(int id)
public async Task<EmployerModel> GetByIdAsync(string id)
{
var employer = await _employerRepository.GetByIdAsync(id);
if (employer == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task<ExperienceModel> AddAsync(Experience entity)
return experience;
}

public Task DeleteAsync(int id)
public Task DeleteAsync(string id)
{
throw new NotImplementedException();
}
Expand All @@ -32,7 +32,7 @@ public async Task<List<ExperienceModel>> GetAllAsync()
return experience;
}

public async Task<ExperienceModel> GetByIdAsync(int id)
public async Task<ExperienceModel> GetByIdAsync(string id)
{
var experience = await _experienceRepository.GetByIdAsync(id);
if (experience == null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using JobLeet.WebApi.JobLeet.Api.Models.Common.V1;
using JobLeet.WebApi.JobLeet.Api.Models.Companies.V1;
using JobLeet.WebApi.JobLeet.Core.Entities.Common.V1;
using JobLeet.WebApi.JobLeet.Core.Entities.Companies.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Common.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Companies.V1;

namespace JobLeet.WebApi.JobLeet.Core.Services
Expand All @@ -24,7 +21,7 @@ public async Task<IndustryModel> AddAsync(Industry entity)
return industry;
}

public Task DeleteAsync(int id)
public Task DeleteAsync(string id)
{
throw new NotImplementedException();
}
Expand All @@ -35,7 +32,7 @@ public async Task<List<IndustryModel>> GetAllAsync()
return industry;
}

public async Task<IndustryModel> GetByIdAsync(int id)
public async Task<IndustryModel> GetByIdAsync(string id)
{
var industry = await _industryTypeRepository.GetByIdAsync(id);
if (industry == null)
Expand Down
4 changes: 2 additions & 2 deletions Server/JobLeet.WebApi/JobLeet.Core/Services/V1/JobService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task<JobModel> AddAsync(JobEntity entity)
return result;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _jobRepository.DeleteAsync(id);
}
Expand All @@ -33,7 +33,7 @@ public async Task<List<JobModel>> GetAllAsync()
return jobs;
}

public async Task<JobModel> GetByIdAsync(int id)
public async Task<JobModel> GetByIdAsync(string id)
{
var job = await _jobRepository.GetByIdAsync(id);
if (job == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task<PersonNameModel> AddAsync(PersonName entity)
return result;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _personNameRepository.DeleteAsync(id);
}
Expand All @@ -34,7 +34,7 @@ public async Task<List<PersonNameModel>> GetAllAsync()
return person;
}

public async Task<PersonNameModel> GetByIdAsync(int id)
public async Task<PersonNameModel> GetByIdAsync(string id)
{
var job = await _personNameRepository.GetByIdAsync(id);
if (job == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task<PhoneModel> AddAsync(Phone entity)
return result;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _phoneRepository.DeleteAsync(id);
}
Expand All @@ -33,7 +33,7 @@ public async Task<List<PhoneModel>> GetAllAsync()
return phone;
}

public async Task<PhoneModel> GetByIdAsync(int id)
public async Task<PhoneModel> GetByIdAsync(string id)
{
var phone = await _phoneRepository.GetByIdAsync(id);
if (phone == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task<QualificationModel> AddAsync(Qualification entity)
return result;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _qualificationTypeRepository.DeleteAsync(id);
}
Expand All @@ -34,7 +34,7 @@ public async Task<List<QualificationModel>> GetAllAsync()
return qualification;
}

public async Task<QualificationModel> GetByIdAsync(int id)
public async Task<QualificationModel> GetByIdAsync(string id)
{
var qualification = await _qualificationTypeRepository.GetByIdAsync(id);
if (qualification == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public Task<SeekerModel> AddAsync(Seeker entity)
return seeker;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _seekerRepository.DeleteAsync(id);
}
Expand All @@ -31,7 +31,7 @@ public Task<List<SeekerModel>> GetAllAsync()
return seeker;
}

public Task<SeekerModel> GetByIdAsync(int id)
public Task<SeekerModel> GetByIdAsync(string id)
{
var seeker = _seekerRepository.GetByIdAsync(id);
if (seeker == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task<SkillModel> AddAsync(Skill entity)
return result;
}

public async Task DeleteAsync(int id)
public async Task DeleteAsync(string id)
{
await _skillRepository.DeleteAsync(id);
}
Expand All @@ -33,7 +33,7 @@ public async Task<List<SkillModel>> GetAllAsync()
return skills;
}

public async Task<SkillModel> GetByIdAsync(int id)
public async Task<SkillModel> GetByIdAsync(string id)
{
var skill = await _skillRepository.GetByIdAsync(id);
if (skill == null)
Expand Down
Loading

0 comments on commit cf4271f

Please sign in to comment.