#27 added userTransactions

This commit is contained in:
Dominic Villemure
2024-04-22 15:55:49 -04:00
parent cbde9838d1
commit b63d53f109
17 changed files with 696 additions and 28 deletions

View File

@@ -0,0 +1,17 @@
using Hutopy.Application.Users.Queries;
namespace Hutopy.Web.Endpoints;
public class GetMyUser : EndpointGroupBase
{
public override void Map(WebApplication app)
{
app.MapGroup(this)
.MapGet(GetCurrentUser);
}
private static async Task<UserDto> GetCurrentUser(ISender sender, [AsParameters] GetCurrentUserQuery query)
{
return await sender.Send(query);
}
}

View File

@@ -13,7 +13,7 @@ public class Users : EndpointGroupBase
.MapIdentityApi<ApplicationUser>();
}
public async Task<Guid> CreateUser(ISender sender, CreateUserCommand command, IUserService userService)
private static async Task<Guid> CreateUser(ISender sender, CreateUserCommand command, IUserService userService)
{
await userService.CreateUserAsync(command.EmailAddress, command.UserName, command.FirstName, command.LastName, command.Password);
return await sender.Send(command);

View File

@@ -6,6 +6,26 @@
"version": "1.0.0"
},
"paths": {
"/api/GetMyUser": {
"get": {
"tags": [
"GetMyUser"
],
"operationId": "GetCurrentUser",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserDto"
}
}
}
}
}
}
},
"/api/JoinUs": {
"get": {
"tags": [
@@ -559,6 +579,44 @@
},
"components": {
"schemas": {
"UserDto": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"format": "guid"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"userTransactions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserTransactionDto"
}
}
}
},
"UserTransactionDto": {
"type": "object",
"additionalProperties": false,
"properties": {
"amount": {
"type": "number",
"format": "decimal"
},
"currency": {
"type": "string"
},
"tipMessage": {
"type": "string"
}
}
},
"PaginatedListOfFutureCreatorListDto": {
"type": "object",
"additionalProperties": false,
@@ -631,15 +689,20 @@
},
"CreateSessionCheckoutCommand": {
"type": "object",
"x-abstract": true,
"additionalProperties": false,
"properties": {
"creatorId": {
"type": "string"
},
"price": {
"type": "integer",
"format": "int32"
},
"currency": {
"type": "string"
},
"tipMessage": {
"type": "string"
}
}
},