Skills now saved / returned
Edging closer to #2 completion; need to finish styles, create display page, and put some interesting stuff on the dashboard
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace JobsJobsJobs.Shared.Api
|
||||
{
|
||||
@@ -52,7 +53,17 @@ namespace JobsJobsJobs.Shared.Api
|
||||
/// The user's past experience
|
||||
/// </summary>
|
||||
public string Experience { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// The skills for the user
|
||||
/// </summary>
|
||||
public ICollection<SkillForm> Skills { get; set; } = new List<SkillForm>();
|
||||
|
||||
/// <summary>
|
||||
/// Create an instance of this form from the given profile
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile off which this form will be based</param>
|
||||
/// <returns>The profile form, popluated with values from the given profile</returns>
|
||||
public static ProfileForm FromProfile(Profile profile) =>
|
||||
new ProfileForm
|
||||
{
|
||||
|
||||
28
src/JobsJobsJobs/Shared/Api/SkillForm.cs
Normal file
28
src/JobsJobsJobs/Shared/Api/SkillForm.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace JobsJobsJobs.Shared.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// The fields required for a skill
|
||||
/// </summary>
|
||||
public class SkillForm
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID of this skill
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string Id { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// The description of the skill
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Notes regarding the skill
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string? Notes { get; set; } = null;
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,15 @@ namespace JobsJobsJobs.Shared
|
||||
/// </summary>
|
||||
/// <returns>A new skill ID</returns>
|
||||
public static async Task<SkillId> Create() => new SkillId(await ShortId.Create());
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to create a skill ID from a string
|
||||
/// </summary>
|
||||
/// <param name="id">The prospective ID</param>
|
||||
/// <returns>The skill ID</returns>
|
||||
/// <exception cref="System.FormatException">If the string is not a valid skill ID</exception>
|
||||
public static SkillId Parse(string id) => new SkillId(ShortId.Parse(id));
|
||||
|
||||
public override string ToString() => Id.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user