Merge remote-tracking branch 'origin/master' into feature/oauth

# Conflicts:
#	src/Application/Common/Interfaces/IIdentityService.cs
#	src/Application/Users/Commands/CreateUser.cs
#	src/Infrastructure/Identity/IdentityService.cs
#	src/Infrastructure/Services/UserService.cs
#	src/Web/Program.cs
This commit is contained in:
Dominic Villemure
2024-06-09 18:05:49 -04:00
21 changed files with 259 additions and 61 deletions

View File

@@ -1,8 +1,6 @@
using Azure.Identity;
using Hutopy.Application.Common.Interfaces;
using Hutopy.Domain.Interfaces;
using Hutopy.Infrastructure.Data;
using Hutopy.Infrastructure.Services;
using Hutopy.Web.Services;
using Microsoft.AspNetCore.Mvc;
using NSwag;
@@ -17,8 +15,6 @@ public static class DependencyInjection
services.AddDatabaseDeveloperPageExceptionFilter();
services.AddScoped<IUser, CurrentUser>();
services.AddScoped<IUserService, UserService>();
services.AddHttpContextAccessor();

View File

@@ -1,4 +1,5 @@
using Hutopy.Application.Users.Queries;
using Hutopy.Application.Users.Queries.GetCurrentUser;
namespace Hutopy.Web.Endpoints;

View File

@@ -1,6 +1,5 @@
using Hutopy.Application.Users.Commands;
using Hutopy.Application.Users.Queries.GetMinimalUser;
using Hutopy.Domain.Interfaces;
using Hutopy.Infrastructure.Identity;
namespace Hutopy.Web.Endpoints;
@@ -15,9 +14,8 @@ public class Users : EndpointGroupBase
.MapIdentityApi<ApplicationUser>();
}
private static async Task<Guid> CreateUser(ISender sender, CreateUserCommand command, IUserService userService)
private static async Task<Guid> CreateUser(ISender sender, CreateUserCommand command)
{
await userService.CreateUserAsync(command.EmailAddress, command.UserName, command.FirstName, command.LastName, command.Password);
return await sender.Send(command);
}

View File

@@ -1,8 +1,6 @@
using Hutopy.Application;
using Hutopy.Domain.Interfaces;
using Hutopy.Infrastructure;
using Hutopy.Infrastructure.Data;
using Hutopy.Infrastructure.Services;
using Hutopy.Web;
using Azure.Identity;
using Hutopy.Infrastructure.Identity;

View File

@@ -736,6 +736,16 @@
"items": {
"$ref": "#/components/schemas/UserTransactionDto"
}
},
"userRoles": {
"type": "array",
"items": {
"type": "string"
}
},
"totalBalance": {
"type": "number",
"format": "decimal"
}
}
},
@@ -752,6 +762,13 @@
},
"tipMessage": {
"type": "string"
},
"created": {
"type": "string",
"format": "date-time"
},
"isConfirmed": {
"type": "boolean"
}
}
},