Add category catalog management
This commit is contained in:
1 parent
b1e0638979
commit
28fc49ea39
4 files changed
+185
-11
No files matched your search
@@ -31,10 +31,20 @@ public sealed class IssueCategory
|
||||
{
|
||||
private IssueCategory() { } // EF Core
|
||||
|
||||
public IssueCategory(string name, string? description) => Update(name, description);
|
||||
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; } = null!;
|
||||
public string? Description { get; private set; }
|
||||
public bool IsActive { get; private set; } = true;
|
||||
|
||||
public void Update(string name, string? description)
|
||||
{
|
||||
Name = name.Trim();
|
||||
Description = string.IsNullOrWhiteSpace(description) ? null : description.Trim();
|
||||
}
|
||||
|
||||
public void Deactivate() => IsActive = false;
|
||||
}
|
||||
|
||||
/// <summary>Oblast návrhu na zlepšení (tabulka <c>proposal_category</c>).</summary>
|
||||
@@ -42,8 +52,18 @@ public sealed class ProposalCategory
|
||||
{
|
||||
private ProposalCategory() { } // EF Core
|
||||
|
||||
public ProposalCategory(string name, string? description) => Update(name, description);
|
||||
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; } = null!;
|
||||
public string? Description { get; private set; }
|
||||
public bool IsActive { get; private set; } = true;
|
||||
|
||||
public void Update(string name, string? description)
|
||||
{
|
||||
Name = name.Trim();
|
||||
Description = string.IsNullOrWhiteSpace(description) ? null : description.Trim();
|
||||
}
|
||||
|
||||
public void Deactivate() => IsActive = false;
|
||||
}
|
||||
Reference in new issue
Block a user