Skip to content

Commit 5771e7d

Browse files
dcl10claude
andauthored
Feature/data models (#11)
* DB user entity * role enum * skill entity and model * user skill entity * Skill model class to record * user skill model * project entity and model * team entity and model * team membership * Recommendation entity * Add Recommendation model Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add XML doc comments to all entities, enums, and models Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 79dc2c0 commit 5771e7d

19 files changed

Lines changed: 308 additions & 0 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
namespace SkillMatrixLlm.Api.Data.Entities;
2+
3+
using SkillMatrixLlm.Api.Enums;
4+
5+
/// <summary>A project requiring team assembly.</summary>
6+
public class Project
7+
{
8+
/// <summary>Primary key.</summary>
9+
public Guid Id { get; set; }
10+
11+
/// <summary>Short title of the project.</summary>
12+
public required string Title { get; set; }
13+
14+
/// <summary>Full description of the project's goals and requirements.</summary>
15+
public required string Description { get; set; }
16+
17+
/// <summary>Target number of team members.</summary>
18+
public required int DesiredTeamSize { get; set; }
19+
20+
/// <summary>Expected timeline or duration of the project.</summary>
21+
public required string Timeline { get; set; }
22+
23+
/// <summary>Current lifecycle status of the project.</summary>
24+
public ProjectStatus Status { get; set; }
25+
26+
/// <summary>Foreign key to the user who created the project.</summary>
27+
public Guid CreatedByUserId { get; set; }
28+
/// <summary>The user who created the project.</summary>
29+
public User? CreatedByUser { get; set; }
30+
31+
/// <summary>When the project was created.</summary>
32+
public DateTime CreatedAt { get; set; }
33+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
namespace SkillMatrixLlm.Api.Data.Entities;
2+
3+
using System.ComponentModel.DataAnnotations.Schema;
4+
5+
/// <summary>Audit record storing a raw LLM team recommendation.</summary>
6+
public class Recommendation
7+
{
8+
/// <summary>Primary key.</summary>
9+
public Guid Id { get; set; }
10+
11+
/// <summary>Foreign key to the project the recommendation was generated for.</summary>
12+
public Guid ProjectId { get; set; }
13+
/// <summary>The project this recommendation was generated for.</summary>
14+
public Project? Project { get; set; }
15+
16+
/// <summary>Foreign key to the team proposed by this recommendation.</summary>
17+
public Guid TeamId { get; set; }
18+
/// <summary>The team proposed by this recommendation.</summary>
19+
public Team? Team { get; set; }
20+
21+
/// <summary>Raw JSON response from the LLM.</summary>
22+
[Column(TypeName = "jsonb")]
23+
public required string RawResponse { get; set; }
24+
25+
/// <summary>When the recommendation was generated.</summary>
26+
public DateTime CreatedAt { get; set; }
27+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace SkillMatrixLlm.Api.Data.Entities;
2+
3+
/// <summary>A skill in the curated catalogue.</summary>
4+
public class Skill
5+
{
6+
/// <summary>Primary key.</summary>
7+
public Guid Id { get; set; }
8+
9+
/// <summary>Display name of the skill.</summary>
10+
public required string Name { get; set; }
11+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace SkillMatrixLlm.Api.Data.Entities;
2+
3+
using SkillMatrixLlm.Api.Enums;
4+
5+
/// <summary>A proposed or confirmed team for a project.</summary>
6+
public class Team
7+
{
8+
/// <summary>Primary key.</summary>
9+
public Guid Id { get; set; }
10+
11+
/// <summary>Foreign key to the project this team was assembled for.</summary>
12+
public Guid ProjectId { get; set; }
13+
/// <summary>The project this team was assembled for.</summary>
14+
public Project? Project { get; set; }
15+
16+
/// <summary>Whether the team was LLM-generated or manually assembled.</summary>
17+
public ProjectSource Source { get; set; }
18+
19+
/// <summary>Current status of the team.</summary>
20+
public TeamStatus Status { get; set; }
21+
22+
/// <summary>When the team was created.</summary>
23+
public DateTime CreatedAt { get; set; }
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace SkillMatrixLlm.Api.Data.Entities;
2+
3+
using SkillMatrixLlm.Api.Enums;
4+
5+
/// <summary>Join entity linking a user to a team with a role and invitation status.</summary>
6+
public class TeamMembership
7+
{
8+
/// <summary>Primary key.</summary>
9+
public Guid Id { get; set; }
10+
11+
/// <summary>Foreign key to the team.</summary>
12+
public Guid TeamId { get; set; }
13+
/// <summary>The team this membership belongs to.</summary>
14+
public Team? Team { get; set; }
15+
16+
/// <summary>Foreign key to the user.</summary>
17+
public Guid UserId { get; set; }
18+
/// <summary>The user who is a member of the team.</summary>
19+
public User? User { get; set; }
20+
21+
/// <summary>The role this user plays within the project.</summary>
22+
public required string ProjectRole { get; set; }
23+
24+
/// <summary>Whether the user has been invited, accepted, or declined.</summary>
25+
public MembershipStatus MembershipStatus { get; set; }
26+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
namespace SkillMatrixLlm.Api.Data.Entities;
2+
3+
using SkillMatrixLlm.Api.Enums;
4+
5+
/// <summary>Represents an authenticated user in the application database.</summary>
6+
public class User
7+
{
8+
/// <summary>Primary key.</summary>
9+
public Guid Id { get; set; }
10+
11+
/// <summary>The corresponding user ID in Keycloak.</summary>
12+
public required string KeycloakId { get; set; }
13+
14+
/// <summary>Display name shown in the UI.</summary>
15+
public required string DisplayName { get; set; }
16+
17+
/// <summary>Email address.</summary>
18+
public required string Email { get; set; }
19+
20+
/// <summary>Application role determining what the user can do.</summary>
21+
public Role Role { get; set; }
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace SkillMatrixLlm.Api.Data.Entities;
2+
3+
using SkillMatrixLlm.Api.Enums;
4+
5+
/// <summary>Join entity representing a user's proficiency in a skill.</summary>
6+
public class UserSkill
7+
{
8+
/// <summary>Primary key.</summary>
9+
public Guid Id { get; set; }
10+
11+
/// <summary>Foreign key to the user.</summary>
12+
public Guid UserId { get; set; }
13+
/// <summary>The user this skill entry belongs to.</summary>
14+
public User? User { get; set; }
15+
16+
/// <summary>Foreign key to the skill.</summary>
17+
public Guid SkillId { get; set; }
18+
/// <summary>The skill this entry describes.</summary>
19+
public Skill? Skill { get; set; }
20+
21+
/// <summary>The user's proficiency level in this skill.</summary>
22+
public Level Level { get; set; }
23+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace SkillMatrixLlm.Api.Enums;
2+
3+
/// <summary>Proficiency level of a user in a skill.</summary>
4+
public enum Level
5+
{
6+
/// <summary>Basic familiarity with the skill.</summary>
7+
Basic,
8+
/// <summary>Working proficiency.</summary>
9+
Intermediate,
10+
/// <summary>Expert-level proficiency.</summary>
11+
Pro
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace SkillMatrixLlm.Api.Enums;
2+
3+
/// <summary>Invitation status of a user's team membership.</summary>
4+
public enum MembershipStatus
5+
{
6+
/// <summary>The user has been invited but not yet responded.</summary>
7+
Invited,
8+
/// <summary>The user has accepted the invitation.</summary>
9+
Accepted,
10+
/// <summary>The user has declined the invitation.</summary>
11+
Declined
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace SkillMatrixLlm.Api.Enums;
2+
3+
/// <summary>Indicates how a team was assembled for a project.</summary>
4+
public enum ProjectSource
5+
{
6+
/// <summary>The team was proposed by the LLM.</summary>
7+
LlmGenerated,
8+
/// <summary>The team was manually assembled by a project manager.</summary>
9+
ManuallyAssembled
10+
}

0 commit comments

Comments
 (0)