Project Init
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// EpicId Value Object (strongly-typed ID)
|
||||
/// </summary>
|
||||
public sealed class EpicId : ValueObject
|
||||
{
|
||||
public Guid Value { get; private set; }
|
||||
|
||||
private EpicId(Guid value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public static EpicId Create() => new EpicId(Guid.NewGuid());
|
||||
public static EpicId Create(Guid value) => new EpicId(value);
|
||||
public static EpicId From(Guid value) => new EpicId(value);
|
||||
|
||||
protected override IEnumerable<object> GetAtomicValues()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
|
||||
public override string ToString() => Value.ToString();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// ProjectId Value Object (strongly-typed ID)
|
||||
/// </summary>
|
||||
public sealed class ProjectId : ValueObject
|
||||
{
|
||||
public Guid Value { get; private set; }
|
||||
|
||||
private ProjectId(Guid value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public static ProjectId Create() => new ProjectId(Guid.NewGuid());
|
||||
public static ProjectId Create(Guid value) => new ProjectId(value);
|
||||
public static ProjectId From(Guid value) => new ProjectId(value);
|
||||
|
||||
protected override IEnumerable<object> GetAtomicValues()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
|
||||
public override string ToString() => Value.ToString();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
using ColaFlow.Modules.ProjectManagement.Domain.Exceptions;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// ProjectKey Value Object (e.g., "COLA", "FLOW")
|
||||
/// </summary>
|
||||
public sealed class ProjectKey : ValueObject
|
||||
{
|
||||
public string Value { get; private set; }
|
||||
|
||||
private ProjectKey(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public static ProjectKey Create(string value)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
throw new DomainException("Project key cannot be empty");
|
||||
|
||||
if (value.Length > 10)
|
||||
throw new DomainException("Project key cannot exceed 10 characters");
|
||||
|
||||
if (!System.Text.RegularExpressions.Regex.IsMatch(value, "^[A-Z0-9]+$"))
|
||||
throw new DomainException("Project key must contain only uppercase letters and numbers");
|
||||
|
||||
return new ProjectKey(value);
|
||||
}
|
||||
|
||||
protected override IEnumerable<object> GetAtomicValues()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
|
||||
public override string ToString() => Value;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// ProjectStatus Enumeration
|
||||
/// </summary>
|
||||
public sealed class ProjectStatus : Enumeration
|
||||
{
|
||||
public static readonly ProjectStatus Active = new(1, "Active");
|
||||
public static readonly ProjectStatus Archived = new(2, "Archived");
|
||||
public static readonly ProjectStatus OnHold = new(3, "On Hold");
|
||||
|
||||
private ProjectStatus(int id, string name) : base(id, name)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// StoryId Value Object (strongly-typed ID)
|
||||
/// </summary>
|
||||
public sealed class StoryId : ValueObject
|
||||
{
|
||||
public Guid Value { get; private set; }
|
||||
|
||||
private StoryId(Guid value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public static StoryId Create() => new StoryId(Guid.NewGuid());
|
||||
public static StoryId Create(Guid value) => new StoryId(value);
|
||||
public static StoryId From(Guid value) => new StoryId(value);
|
||||
|
||||
protected override IEnumerable<object> GetAtomicValues()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
|
||||
public override string ToString() => Value.ToString();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// TaskId Value Object (strongly-typed ID)
|
||||
/// </summary>
|
||||
public sealed class TaskId : ValueObject
|
||||
{
|
||||
public Guid Value { get; private set; }
|
||||
|
||||
private TaskId(Guid value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public static TaskId Create() => new TaskId(Guid.NewGuid());
|
||||
public static TaskId Create(Guid value) => new TaskId(value);
|
||||
public static TaskId From(Guid value) => new TaskId(value);
|
||||
|
||||
protected override IEnumerable<object> GetAtomicValues()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
|
||||
public override string ToString() => Value.ToString();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// TaskPriority Enumeration
|
||||
/// </summary>
|
||||
public sealed class TaskPriority : Enumeration
|
||||
{
|
||||
public static readonly TaskPriority Low = new(1, "Low");
|
||||
public static readonly TaskPriority Medium = new(2, "Medium");
|
||||
public static readonly TaskPriority High = new(3, "High");
|
||||
public static readonly TaskPriority Urgent = new(4, "Urgent");
|
||||
|
||||
private TaskPriority(int id, string name) : base(id, name)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// UserId Value Object (strongly-typed ID)
|
||||
/// </summary>
|
||||
public sealed class UserId : ValueObject
|
||||
{
|
||||
public Guid Value { get; private set; }
|
||||
|
||||
private UserId(Guid value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public static UserId Create() => new UserId(Guid.NewGuid());
|
||||
public static UserId Create(Guid value) => new UserId(value);
|
||||
public static UserId From(Guid value) => new UserId(value);
|
||||
|
||||
protected override IEnumerable<object> GetAtomicValues()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
|
||||
public override string ToString() => Value.ToString();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using ColaFlow.Shared.Kernel.Common;
|
||||
|
||||
namespace ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// WorkItemStatus Enumeration (renamed from TaskStatus to avoid conflict with System.Threading.Tasks.TaskStatus)
|
||||
/// </summary>
|
||||
public sealed class WorkItemStatus : Enumeration
|
||||
{
|
||||
public static readonly WorkItemStatus ToDo = new(1, "To Do");
|
||||
public static readonly WorkItemStatus InProgress = new(2, "In Progress");
|
||||
public static readonly WorkItemStatus InReview = new(3, "In Review");
|
||||
public static readonly WorkItemStatus Done = new(4, "Done");
|
||||
public static readonly WorkItemStatus Blocked = new(5, "Blocked");
|
||||
|
||||
private WorkItemStatus(int id, string name) : base(id, name)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user