- Helpdesk.Migrator (DbUp) aplikuje db/migrations, evidence v schema_version - Domain/Application/Infrastructure/Api podle Clean Architecture - registrace, ověření e-mailu, login, refresh s rotací, logout, reset hesla - JWT podle RFC 7519 evidované jen podle jti v auth_token - správa uživatelů a rolí, číselníky, ProblemDetails, Swagger UI - Docker Compose (db, migrator, api), oddělené DB účty - notifikace mají cizí klíče na issue a proposal - unit testy domény a zabezpečení Closes #1, closes #2, closes #3, closes #4, closes #5, closes #9
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
namespace Helpdesk.Domain.Catalogs;
|
|
|
|
/// <summary>Budova / lokalita. Číselníky se nemažou, jen deaktivují.</summary>
|
|
public sealed class Building
|
|
{
|
|
private Building() { } // EF Core
|
|
|
|
public Building(string code, string name, string? address)
|
|
{
|
|
Update(code, name, address);
|
|
}
|
|
|
|
public int Id { get; private set; }
|
|
public string Code { get; private set; } = null!;
|
|
public string Name { get; private set; } = null!;
|
|
public string? Address { get; private set; }
|
|
public bool IsActive { get; private set; } = true;
|
|
|
|
public void Update(string code, string name, string? address)
|
|
{
|
|
Code = code.Trim();
|
|
Name = name.Trim();
|
|
Address = string.IsNullOrWhiteSpace(address) ? null : address.Trim();
|
|
}
|
|
|
|
public void SetActive(bool isActive) => IsActive = isActive;
|
|
}
|
|
|
|
/// <summary>Typ závady (tabulka <c>issue_category</c>).</summary>
|
|
public sealed class IssueCategory
|
|
{
|
|
private IssueCategory() { } // EF Core
|
|
|
|
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;
|
|
}
|
|
|
|
/// <summary>Oblast návrhu na zlepšení (tabulka <c>proposal_category</c>).</summary>
|
|
public sealed class ProposalCategory
|
|
{
|
|
private ProposalCategory() { } // EF Core
|
|
|
|
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;
|
|
}
|