Základní backend: migrace, autentizace JWT, role, Swagger

- 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
This commit is contained in:
PatTheEvil committed 2026-10-28 21:43:17 +01:00
1 parent fc76be7d69
commit a51d386278
64 files changed
+4394 -1

No files matched your search

@@ -0,0 +1,24 @@
using Helpdesk.Application.Abstractions;
using Helpdesk.Application.Users;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Helpdesk.Api.Controllers;
/// <summary>Profil přihlášeného uživatele.</summary>
[ApiController]
[Authorize]
[Route("api/users")]
[Produces("application/json")]
public sealed class UsersController(UserService users, ICurrentUser currentUser) : ControllerBase
{
/// <summary>Můj profil.</summary>
[HttpGet("me")]
public Task<UserDto> GetMe(CancellationToken ct) => users.GetMeAsync(currentUser, ct);
/// <summary>Úprava profilu – jméno, telefon (ukládá se šifrovaně), e-mailové notifikace.</summary>
[HttpPut("me")]
[ProducesResponseType<UserDto>(StatusCodes.Status200OK)]
[ProducesResponseType<ValidationProblemDetails>(StatusCodes.Status400BadRequest)]
public Task<UserDto> UpdateMe(UpdateProfileRequest request, CancellationToken ct) => users.UpdateMeAsync(currentUser, request, ct);
}