feat: add first volunteer skill endpoint (add_skill) along with dtos

This commit is contained in:
2025-05-31 18:19:15 +02:00
parent 2a8fff39c9
commit 32027f7384
5 changed files with 96 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using WebApp.DTOs;
using WebApp.Entities;
namespace WebApp.Mapping
{
public static class SkillMapping
{
public static Skill ToSkillEntity(this SingleSkillDto SSDto, string name)
{
return new Skill()
{
SkillId = SSDto.Skill,
Name = name
};
}
public static SkillSummaryDto ToSkillSummaryDto(this Skill s)
{
return new SkillSummaryDto(
s.SkillId,
s.Name
);
}
}
}

View File

@@ -0,0 +1,17 @@
using WebApp.DTOs;
using WebApp.Entities;
namespace WebApp.Mapping
{
public static class VolunteerSkillMapping
{
public static VolunteerSkill ToVolunteerSkillEntity(this SingleSkillDto SSDto, int uid)
{
return new VolunteerSkill()
{
UserId = uid,
SkillId = SSDto.Skill,
};
}
}
}