Merge master to feature/oauth
This commit is contained in:
@@ -7,6 +7,7 @@ public class GetMyUser : EndpointGroupBase
|
||||
public override void Map(WebApplication app)
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.RequireAuthorization()
|
||||
.MapGet(GetCurrentUser);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Hutopy.Application.Stripe.Commands;
|
||||
using Hutopy.Application.Stripe.Queries;
|
||||
|
||||
namespace Hutopy.Web.Endpoints;
|
||||
|
||||
@@ -8,6 +9,7 @@ public class Stripe : EndpointGroupBase
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.MapPost(ConfirmTransaction, "/confirmTransaction")
|
||||
.MapGet(GetMyLastReceipt, "/getMyLastReceipt")
|
||||
.MapPost(CreateSessionCheckout);
|
||||
}
|
||||
|
||||
@@ -16,8 +18,13 @@ public class Stripe : EndpointGroupBase
|
||||
return sender.Send(command);
|
||||
}
|
||||
|
||||
private static Task<string> ConfirmTransaction(ISender sender, ConfirmStripeTransactionCommand command)
|
||||
private async static Task<string> ConfirmTransaction(ISender sender, ConfirmStripeTransactionCommand command)
|
||||
{
|
||||
return sender.Send(command);
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<MyLastReceiptDto> GetMyLastReceipt(ISender sender, [AsParameters] GetMyLastReceiptQuery query)
|
||||
{
|
||||
return await sender.Send(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Hutopy.Application.Users.Commands;
|
||||
using Hutopy.Application.Users.Queries.GetMinimalUser;
|
||||
using Hutopy.Domain.Interfaces;
|
||||
using Hutopy.Infrastructure.Identity;
|
||||
|
||||
@@ -10,6 +11,7 @@ public class Users : EndpointGroupBase
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.MapPost(CreateUser)
|
||||
.MapGet(GetMinimalUser)
|
||||
.MapIdentityApi<ApplicationUser>();
|
||||
}
|
||||
|
||||
@@ -18,4 +20,9 @@ public class Users : EndpointGroupBase
|
||||
await userService.CreateUserAsync(command.EmailAddress, command.UserName, command.FirstName, command.LastName, command.Password);
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<MinimalUserDto> GetMinimalUser(ISender sender, [AsParameters] GetMinimalUserQuery query)
|
||||
{
|
||||
return await sender.Send(query);
|
||||
}
|
||||
}
|
||||
|
||||
29
src/Web/appsettings.Development.dist
Normal file
29
src/Web/appsettings.Development.dist
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Information",
|
||||
"Microsoft.AspNetCore.SpaProxy": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Google": {
|
||||
"ClientId": "",
|
||||
"ClientSecret": "",
|
||||
"ProjectId": "",
|
||||
"AuthUri": "",
|
||||
"TokenUri": "",
|
||||
"AuthProviderX509CertUrl": "",
|
||||
"RedirectUris": [
|
||||
"https://hutopy.ca",
|
||||
"https://hutopy.com",
|
||||
"http://localhost"
|
||||
],
|
||||
"JavascriptOrigins": [
|
||||
"https://hutopy.ca",
|
||||
"https://hutopy.com",
|
||||
"http://localhost"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.AspNetCore.SpaProxy": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"JWT": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/JoinUs": {
|
||||
@@ -131,6 +136,48 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/Stripe/getMyLastReceipt": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Stripe"
|
||||
],
|
||||
"operationId": "GetMyLastReceipt",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Email",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"x-position": 1
|
||||
},
|
||||
{
|
||||
"name": "CreatorId",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"x-position": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/MyLastReceiptDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/Stripe": {
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -194,6 +241,36 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"get": {
|
||||
"tags": [
|
||||
"Users"
|
||||
],
|
||||
"operationId": "GetMinimalUser",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "UserId",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"x-position": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/MinimalUserDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/Users/register": {
|
||||
@@ -638,6 +715,9 @@
|
||||
"lastName": {
|
||||
"type": "string"
|
||||
},
|
||||
"userName": {
|
||||
"type": "string"
|
||||
},
|
||||
"userTransactions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -736,12 +816,103 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"userTransactionId": {
|
||||
"type": "string",
|
||||
"format": "guid"
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"isConfirmed": {
|
||||
"object": {
|
||||
"type": "string"
|
||||
},
|
||||
"created": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"data": {
|
||||
"$ref": "#/components/schemas/Data"
|
||||
},
|
||||
"request": {
|
||||
"$ref": "#/components/schemas/Request"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Data": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"object": {
|
||||
"$ref": "#/components/schemas/Object"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Object": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"amount": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"billing_details": {
|
||||
"$ref": "#/components/schemas/BillingDetails"
|
||||
},
|
||||
"calculated_statement_descriptor": {
|
||||
"type": "string"
|
||||
},
|
||||
"currency": {
|
||||
"type": "string"
|
||||
},
|
||||
"paid": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"payment_intent": {
|
||||
"type": "string"
|
||||
},
|
||||
"payment_method": {
|
||||
"type": "string"
|
||||
},
|
||||
"receipt_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"failure_message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"BillingDetails": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"phone": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Request": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MyLastReceiptDto": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"receiptUrl": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -785,6 +956,21 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"MinimalUserDto": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"firstName": {
|
||||
"type": "string"
|
||||
},
|
||||
"lastName": {
|
||||
"type": "string"
|
||||
},
|
||||
"userName": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"HttpValidationProblemDetails": {
|
||||
"allOf": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user