generator-codedesignplus 0.1.0-alpha.1 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators/microservice/templates/microservice/LICENSE.md +21 -0
- package/generators/microservice/templates/microservice/README.md +175 -0
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/CodeDesignPlus.Net.Microservice.Application.csproj +4 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/AddProductToOrder/AddProductToOrderCommandHandler.cs +3 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/CancelOrder/CancelOrderCommandHandler.cs +5 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/CompleteOrder/CompleteOrderCommandHandler.cs +2 -2
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/CreateOrder/CreateOrderCommandHandler.cs +4 -5
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/RemoveProduct/RemoveProductCommandHandler.cs +2 -2
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/UpdateQuantityProduct/UpdateQuantityProductCommandHandler.cs +3 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/DataTransferObjects/OrderDto.cs +4 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Queries/FindOrderById/FindOrderByIdQueryHandler.cs +3 -6
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Queries/GetAllOrders/GetAllOrdersQueryHandler.cs +3 -6
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Usings.cs +1 -0
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/CodeDesignPlus.Net.Microservice.Domain.csproj +2 -2
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/AddProductToOrderParams.cs +1 -2
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/CancelOrderParams.cs +2 -2
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/CompleteOrderParams.cs +2 -2
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/RemoveProductFromOrderParams.cs +1 -1
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/UpdateQuantityProductParams.cs +1 -2
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/OrderCancelledDomainEvent.cs +4 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/OrderCompletedDomainEvent.cs +4 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/OrderCreatedDomainEvent.cs +4 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/ProductAddedToOrderDomainEvent.cs +1 -1
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/ProductQuantityUpdatedDomainEvent.cs +1 -1
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/ProductRemovedFromOrderDomainEvent.cs +1 -1
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/OrderAggregate.cs +13 -15
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/Repositories/IOrderRepository.cs +5 -9
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/Usings.cs +1 -0
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Infrastructure/Repositories/OrderRepository.cs +29 -39
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/CodeDesignPlus.Net.Microservice.AsyncWorker.csproj +8 -8
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/Dockerfile +36 -0
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/Program.cs +1 -1
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/Properties/launchSettings.json +5 -5
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/appsettings.Docker.json +25 -0
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/appsettings.json +9 -45
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/CodeDesignPlus.Net.Microservice.Rest.csproj +9 -8
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/Dockerfile +7 -8
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/Program.cs +6 -1
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/Properties/launchSettings.json +3 -5
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.Docker.json +25 -0
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.json +12 -4
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/CodeDesignPlus.Net.Microservice.gRpc.csproj +12 -10
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Core/Mapster/MapsterConfig.cs +10 -2
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Dockerfile +36 -0
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Program.cs +1 -3
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Properties/launchSettings.json +2 -11
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Protos/orders.proto +7 -7
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Services/OrderService.cs +1 -2
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/appsettings.Docker.json +25 -0
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/appsettings.json +7 -5
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.AsyncWorker.Test/CodeDesignPlus.Net.Microservice.AsyncWorker.Test.csproj +5 -5
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.Rest.Test/CodeDesignPlus.Net.Microservice.Rest.Test.csproj +6 -6
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.Rest.Test/Controllers/OrderControllerTest.cs +28 -28
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.Rest.Test/Usings.cs +1 -0
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.gRpc.Test/CodeDesignPlus.Net.Microservice.gRpc.Test.csproj +11 -9
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.gRpc.Test/Protos/orders.proto +8 -7
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.gRpc.Test/Services/{OrdersServiceTest.cs → OrderServiceTest.cs} +13 -6
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/CodeDesignPlus.Net.Microservice.Application.Test.csproj +4 -4
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/AddProductToOrder/AddProductToOrderCommandHandlerTest.cs +6 -6
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/CancelOrder/CancelOrderCommandHandlerTest.cs +6 -7
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/CompleteOrder/CompleteOrderCommandHandlerTest.cs +6 -6
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/CreateOrder/CreateOrderCommandHandlerTest.cs +11 -11
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/RemoveProduct/RemoveProductCommandHandlerTest.cs +7 -5
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/UpdateQuantityProduct/UpdateQuantityProductCommandHandlerTest.cs +6 -6
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Queries/FindOrderById/FindOrderByIdQueryHandlerTest.cs +18 -6
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Queries/GetAllOrders/GetAllOrdersQueryHandlerTest.cs +11 -7
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Usings.cs +1 -0
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.AsyncWorker.Test/CodeDesignPlus.Net.Microservice.AsyncWorker.Test.csproj +5 -5
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.AsyncWorker.Test/Usings.cs +0 -1
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Default.Test/CodeDesignPlus.Net.Microservice.Default.Test.csproj +6 -6
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Domain.Test/CodeDesignPlus.Net.Microservice.Domain.Test.csproj +4 -4
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Domain.Test/DomainEvents/OrderCancelledDomainEventTest.cs +3 -3
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Domain.Test/OrderAggregateTest.cs +2 -2
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Domain.Test/Usings.cs +2 -0
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Infrastructure.Test/CodeDesignPlus.Net.Microservice.Infrastructure.Test.csproj +4 -4
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Infrastructure.Test/Repositories/OrderRepositoryTest.cs +20 -91
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Infrastructure.Test/Usings.cs +1 -0
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Rest.Test/CodeDesignPlus.Net.Microservice.Rest.Test.csproj +5 -5
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.gRpc.Test/CodeDesignPlus.Net.Microservice.gRpc.Test.csproj +5 -5
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.gRpc.Test/Services/OrderServiceTest.cs +2 -2
- package/generators/microservice/templates/microservice/tools/vault/config-vault.ps1 +2 -2
- package/generators/microservice/templates/microservice/tools/vault/config-vault.sh +1 -2
- package/package.json +1 -1
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/appsettings.Development.json +0 -2
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/CodeDesignPlus.Net.Microservice.Rest.csproj.user +0 -11
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.Development.json +0 -3
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/CodeDesignPlus.Net.Microservice.gRpc.csproj.user +0 -9
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/appsettings.Development.json +0 -3
|
@@ -4,34 +4,32 @@ namespace CodeDesignPlus.Net.Microservice.Domain;
|
|
|
4
4
|
|
|
5
5
|
public class OrderAggregate(Guid id) : AggregateRoot(id)
|
|
6
6
|
{
|
|
7
|
-
public
|
|
8
|
-
public
|
|
7
|
+
public Instant? CompletedAt { get; private set; }
|
|
8
|
+
public Instant? CancelledAt { get; private set; }
|
|
9
9
|
public ClientValueObject Client { get; private set; } = default!;
|
|
10
10
|
public List<ProductEntity> Products { get; private set; } = [];
|
|
11
11
|
public OrderStatus Status { get; private set; }
|
|
12
12
|
public string? ReasonForCancellation { get; private set; }
|
|
13
13
|
public AddressValueObject ShippingAddress { get; private set; } = default!;
|
|
14
14
|
|
|
15
|
-
public static OrderAggregate Create(Guid id, ClientValueObject client, AddressValueObject shippingAddress, Guid tenant, Guid
|
|
15
|
+
public static OrderAggregate Create(Guid id, ClientValueObject client, AddressValueObject shippingAddress, Guid tenant, Guid createdBy)
|
|
16
16
|
{
|
|
17
17
|
DomainGuard.GuidIsEmpty(id, Errors.IdOrderIsInvalid);
|
|
18
18
|
DomainGuard.IsNull(client, Errors.ClientIsNull);
|
|
19
19
|
DomainGuard.GuidIsEmpty(tenant, Errors.TenantIsInvalid);
|
|
20
20
|
DomainGuard.IsNull(shippingAddress, Errors.AddressIsNull);
|
|
21
21
|
|
|
22
|
-
var @event = OrderCreatedDomainEvent.Create(id, client, shippingAddress, tenant, createBy);
|
|
23
|
-
|
|
24
22
|
var aggregate = new OrderAggregate(id)
|
|
25
23
|
{
|
|
26
24
|
Client = client,
|
|
27
25
|
ShippingAddress = shippingAddress,
|
|
28
|
-
CreatedAt =
|
|
29
|
-
Status =
|
|
26
|
+
CreatedAt = SystemClock.Instance.GetCurrentInstant(),
|
|
27
|
+
Status = OrderStatus.Created,
|
|
30
28
|
Tenant = tenant,
|
|
31
|
-
CreatedBy =
|
|
29
|
+
CreatedBy = createdBy
|
|
32
30
|
};
|
|
33
31
|
|
|
34
|
-
aggregate.AddEvent(
|
|
32
|
+
aggregate.AddEvent(OrderCreatedDomainEvent.Create(aggregate.Id, aggregate.Client, aggregate.ShippingAddress, aggregate.Tenant, aggregate.CreatedBy));
|
|
35
33
|
|
|
36
34
|
return aggregate;
|
|
37
35
|
}
|
|
@@ -43,7 +41,7 @@ public class OrderAggregate(Guid id) : AggregateRoot(id)
|
|
|
43
41
|
DomainGuard.IsLessThan(price, 0, Errors.PriceProductIsInvalid);
|
|
44
42
|
DomainGuard.IsLessThan(quantity, 0, Errors.QuantityProductIsInvalid);
|
|
45
43
|
|
|
46
|
-
this.UpdatedAt =
|
|
44
|
+
this.UpdatedAt = SystemClock.Instance.GetCurrentInstant();
|
|
47
45
|
this.UpdatedBy = updateBy;
|
|
48
46
|
|
|
49
47
|
var product = new ProductEntity
|
|
@@ -68,7 +66,7 @@ public class OrderAggregate(Guid id) : AggregateRoot(id)
|
|
|
68
66
|
|
|
69
67
|
DomainGuard.IsNull(product, Errors.ProductNotFound);
|
|
70
68
|
|
|
71
|
-
this.UpdatedAt =
|
|
69
|
+
this.UpdatedAt = SystemClock.Instance.GetCurrentInstant();
|
|
72
70
|
this.UpdatedBy = updateBy;
|
|
73
71
|
|
|
74
72
|
Products.Remove(product);
|
|
@@ -85,7 +83,7 @@ public class OrderAggregate(Guid id) : AggregateRoot(id)
|
|
|
85
83
|
|
|
86
84
|
DomainGuard.IsNull(product, Errors.ProductNotFound);
|
|
87
85
|
|
|
88
|
-
this.UpdatedAt =
|
|
86
|
+
this.UpdatedAt = SystemClock.Instance.GetCurrentInstant();
|
|
89
87
|
this.UpdatedBy = updateBy;
|
|
90
88
|
|
|
91
89
|
product.Quantity = newQuantity;
|
|
@@ -100,7 +98,7 @@ public class OrderAggregate(Guid id) : AggregateRoot(id)
|
|
|
100
98
|
|
|
101
99
|
var @event = OrderCompletedDomainEvent.Create(Id);
|
|
102
100
|
|
|
103
|
-
this.UpdatedAt =
|
|
101
|
+
this.UpdatedAt = SystemClock.Instance.GetCurrentInstant();
|
|
104
102
|
this.UpdatedBy = updateBy;
|
|
105
103
|
|
|
106
104
|
this.CompletedAt = @event.CompletedAt;
|
|
@@ -113,10 +111,10 @@ public class OrderAggregate(Guid id) : AggregateRoot(id)
|
|
|
113
111
|
{
|
|
114
112
|
DomainGuard.IsTrue(Status == OrderStatus.Cancelled, Errors.OrderAlreadyCancelled);
|
|
115
113
|
|
|
116
|
-
this.UpdatedAt =
|
|
114
|
+
this.UpdatedAt = SystemClock.Instance.GetCurrentInstant();
|
|
117
115
|
this.UpdatedBy = updateBy;
|
|
118
116
|
this.ReasonForCancellation = reason;
|
|
119
|
-
this.CancelledAt =
|
|
117
|
+
this.CancelledAt = SystemClock.Instance.GetCurrentInstant();
|
|
120
118
|
this.Status = OrderStatus.Cancelled;
|
|
121
119
|
|
|
122
120
|
AddEvent(OrderCancelledDomainEvent.Create(Id, reason));
|
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
public interface IOrderRepository : IRepositoryBase
|
|
4
4
|
{
|
|
5
|
-
Task
|
|
6
|
-
Task
|
|
7
|
-
Task
|
|
8
|
-
Task
|
|
9
|
-
Task
|
|
10
|
-
Task UpdateQuantityProductAsync(UpdateQuantityProductParams parameters, CancellationToken cancellationToken);
|
|
11
|
-
Task CompleteOrderAsync(CompleteOrderParams parameters, CancellationToken cancellationToken);
|
|
12
|
-
Task CancelOrderAsync(CancelOrderParams parameters, CancellationToken cancellationToken);
|
|
13
|
-
Task UpdateOrderAsync(OrderAggregate order, CancellationToken cancellationToken);
|
|
5
|
+
Task AddProductToOrderAsync(Guid id, Guid tenant, AddProductToOrderParams parameters, CancellationToken cancellationToken);
|
|
6
|
+
Task CancelOrderAsync(CancelOrderParams parameters, Guid tenant, CancellationToken cancellationToken);
|
|
7
|
+
Task CompleteOrderAsync(CompleteOrderParams parameters, Guid tenant, CancellationToken cancellationToken);
|
|
8
|
+
Task RemoveProductFromOrderAsync(RemoveProductFromOrderParams parameters, Guid tenant, CancellationToken cancellationToken);
|
|
9
|
+
Task UpdateQuantityProductAsync(Guid id, Guid tenant, UpdateQuantityProductParams parameters, CancellationToken cancellationToken);
|
|
14
10
|
}
|
|
@@ -4,6 +4,7 @@ global using CodeDesignPlus.Net.Exceptions.Guards;
|
|
|
4
4
|
global using CodeDesignPlus.Net.Mongo.Abstractions;
|
|
5
5
|
global using CodeDesignPlus.Net.Serializers;
|
|
6
6
|
global using System.Text.RegularExpressions;
|
|
7
|
+
global using NodaTime;
|
|
7
8
|
|
|
8
9
|
global using CodeDesignPlus.Net.Microservice.Domain.DomainEvents;
|
|
9
10
|
global using CodeDesignPlus.Net.Microservice.Domain.Entities;
|
|
@@ -3,18 +3,22 @@
|
|
|
3
3
|
public class OrderRepository(IServiceProvider serviceProvider, IOptions<MongoOptions> mongoOptions, ILogger<RepositoryBase> logger)
|
|
4
4
|
: RepositoryBase(serviceProvider, mongoOptions, logger), IOrderRepository
|
|
5
5
|
{
|
|
6
|
-
public Task AddProductToOrderAsync(AddProductToOrderParams parameters, CancellationToken cancellationToken)
|
|
6
|
+
public Task AddProductToOrderAsync(Guid id, Guid tenant, AddProductToOrderParams parameters, CancellationToken cancellationToken)
|
|
7
7
|
{
|
|
8
8
|
var product = new ProductEntity
|
|
9
9
|
{
|
|
10
|
-
Id = parameters.
|
|
10
|
+
Id = parameters.Id,
|
|
11
11
|
Name = parameters.Name,
|
|
12
12
|
Description = parameters.Description,
|
|
13
13
|
Price = parameters.Price,
|
|
14
|
-
Quantity = parameters.Quantity
|
|
14
|
+
Quantity = parameters.Quantity,
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var filter = Builders<OrderAggregate>.Filter.And(
|
|
18
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Id, id),
|
|
19
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Tenant, tenant)
|
|
20
|
+
);
|
|
21
|
+
|
|
18
22
|
var update = Builders<OrderAggregate>.Update
|
|
19
23
|
.Push(x => x.Products, product)
|
|
20
24
|
.Set(x => x.UpdatedAt, parameters.UpdatedAt)
|
|
@@ -23,15 +27,18 @@ public class OrderRepository(IServiceProvider serviceProvider, IOptions<MongoOpt
|
|
|
23
27
|
var collection = base.GetCollection<OrderAggregate>();
|
|
24
28
|
|
|
25
29
|
return collection.UpdateOneAsync(
|
|
26
|
-
|
|
30
|
+
filter,
|
|
27
31
|
update,
|
|
28
32
|
cancellationToken: cancellationToken
|
|
29
33
|
);
|
|
30
34
|
}
|
|
31
35
|
|
|
32
|
-
public Task CancelOrderAsync(CancelOrderParams parameters, CancellationToken cancellationToken)
|
|
36
|
+
public Task CancelOrderAsync(CancelOrderParams parameters, Guid tenant, CancellationToken cancellationToken)
|
|
33
37
|
{
|
|
34
|
-
var
|
|
38
|
+
var filter = Builders<OrderAggregate>.Filter.And(
|
|
39
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Id, parameters.Id),
|
|
40
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Tenant, tenant)
|
|
41
|
+
);
|
|
35
42
|
|
|
36
43
|
var update = Builders<OrderAggregate>.Update
|
|
37
44
|
.Set(x => x.Status, parameters.OrderStatus)
|
|
@@ -40,12 +47,15 @@ public class OrderRepository(IServiceProvider serviceProvider, IOptions<MongoOpt
|
|
|
40
47
|
.Set(x => x.UpdatedAt, parameters.UpdatedAt)
|
|
41
48
|
.Set(x => x.UpdatedBy, parameters.UpdateBy);
|
|
42
49
|
|
|
43
|
-
return base.GetCollection<OrderAggregate>().UpdateOneAsync(
|
|
50
|
+
return base.GetCollection<OrderAggregate>().UpdateOneAsync(filter, update, cancellationToken: cancellationToken);
|
|
44
51
|
}
|
|
45
52
|
|
|
46
|
-
public Task CompleteOrderAsync(CompleteOrderParams parameters, CancellationToken cancellationToken)
|
|
53
|
+
public Task CompleteOrderAsync(CompleteOrderParams parameters, Guid tenant, CancellationToken cancellationToken)
|
|
47
54
|
{
|
|
48
|
-
var filterId = Builders<OrderAggregate>.Filter.
|
|
55
|
+
var filterId = Builders<OrderAggregate>.Filter.And(
|
|
56
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Id, parameters.Id),
|
|
57
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Tenant, tenant)
|
|
58
|
+
);
|
|
49
59
|
|
|
50
60
|
var update = Builders<OrderAggregate>.Update
|
|
51
61
|
.Set(x => x.CompletedAt, parameters.CompletedAt)
|
|
@@ -56,28 +66,12 @@ public class OrderRepository(IServiceProvider serviceProvider, IOptions<MongoOpt
|
|
|
56
66
|
return base.GetCollection<OrderAggregate>().UpdateOneAsync(filterId, update, cancellationToken: cancellationToken);
|
|
57
67
|
}
|
|
58
68
|
|
|
59
|
-
public Task
|
|
60
|
-
{
|
|
61
|
-
return this.CreateAsync(order, cancellationToken);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public Task<OrderAggregate> FindAsync(Guid id, CancellationToken cancellationToken)
|
|
65
|
-
{
|
|
66
|
-
var filterId = Builders<OrderAggregate>.Filter.Eq(x => x.Id, id);
|
|
67
|
-
|
|
68
|
-
return base.GetCollection<OrderAggregate>().FindAsync(filterId, cancellationToken: cancellationToken).Result.FirstOrDefaultAsync(cancellationToken);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
public async Task<List<OrderAggregate>> GetAllOrdersAsync(CancellationToken cancellationToken)
|
|
69
|
+
public Task RemoveProductFromOrderAsync(RemoveProductFromOrderParams parameters, Guid tenant, CancellationToken cancellationToken)
|
|
72
70
|
{
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
public Task RemoveProductFromOrderAsync(RemoveProductFromOrderParams parameters, CancellationToken cancellationToken)
|
|
79
|
-
{
|
|
80
|
-
var filterId = Builders<OrderAggregate>.Filter.Eq(x => x.Id, parameters.Id);
|
|
71
|
+
var filterId = Builders<OrderAggregate>.Filter.And(
|
|
72
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Id, parameters.Id),
|
|
73
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Tenant, tenant)
|
|
74
|
+
);
|
|
81
75
|
|
|
82
76
|
var update = Builders<OrderAggregate>.Update
|
|
83
77
|
.PullFilter(x => x.Products, p => p.Id == parameters.IdProduct)
|
|
@@ -87,16 +81,12 @@ public class OrderRepository(IServiceProvider serviceProvider, IOptions<MongoOpt
|
|
|
87
81
|
return base.GetCollection<OrderAggregate>().UpdateOneAsync(filterId, update, cancellationToken: cancellationToken);
|
|
88
82
|
}
|
|
89
83
|
|
|
90
|
-
public Task
|
|
91
|
-
{
|
|
92
|
-
return this.UpdateAsync(order, cancellationToken);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
public Task UpdateQuantityProductAsync(UpdateQuantityProductParams parameters, CancellationToken cancellationToken)
|
|
84
|
+
public Task UpdateQuantityProductAsync(Guid id, Guid tenant, UpdateQuantityProductParams parameters, CancellationToken cancellationToken)
|
|
96
85
|
{
|
|
97
86
|
var filterId = Builders<OrderAggregate>.Filter.And(
|
|
98
|
-
Builders<OrderAggregate>.Filter.Eq(x => x.Id,
|
|
99
|
-
Builders<OrderAggregate>.Filter.
|
|
87
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Id, id),
|
|
88
|
+
Builders<OrderAggregate>.Filter.Eq(x => x.Tenant, tenant),
|
|
89
|
+
Builders<OrderAggregate>.Filter.ElemMatch(x => x.Products, x => x.Id == parameters.Id)
|
|
100
90
|
);
|
|
101
91
|
|
|
102
92
|
var update = Builders<OrderAggregate>.Update
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
<PublishAot>false</PublishAot>
|
|
8
8
|
</PropertyGroup>
|
|
9
9
|
<ItemGroup>
|
|
10
|
-
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.5.0-beta.
|
|
11
|
-
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.5.0-beta.
|
|
12
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.5.0-beta.
|
|
13
|
-
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.5.0-beta.
|
|
14
|
-
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.5.0-beta.
|
|
15
|
-
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.5.0-beta.
|
|
16
|
-
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.5.0-beta.
|
|
17
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.5.0-beta.
|
|
10
|
+
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.5.0-beta.81" />
|
|
11
|
+
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.5.0-beta.81" />
|
|
12
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.5.0-beta.81" />
|
|
13
|
+
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.5.0-beta.81" />
|
|
14
|
+
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.5.0-beta.81" />
|
|
15
|
+
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.5.0-beta.81" />
|
|
16
|
+
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.5.0-beta.81" />
|
|
17
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.5.0-beta.81" />
|
|
18
18
|
</ItemGroup>
|
|
19
19
|
<ItemGroup>
|
|
20
20
|
<SonarQubeSetting Include="sonar.coverage.exclusions">
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
|
2
|
+
|
|
3
|
+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
|
4
|
+
USER app
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
EXPOSE 5002
|
|
7
|
+
|
|
8
|
+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|
9
|
+
# Install clang/zlib1g-dev dependencies for publishing to native
|
|
10
|
+
RUN apt-get update \
|
|
11
|
+
&& apt-get install -y --no-install-recommends \
|
|
12
|
+
clang zlib1g-dev \
|
|
13
|
+
&& apt-get clean
|
|
14
|
+
|
|
15
|
+
ARG BUILD_CONFIGURATION=Release
|
|
16
|
+
WORKDIR /src
|
|
17
|
+
COPY ["src/domain/", "domain/"]
|
|
18
|
+
COPY ["src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/", "entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/"]
|
|
19
|
+
RUN dotnet restore "./entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/CodeDesignPlus.Net.Microservice.AsyncWorker.csproj"
|
|
20
|
+
|
|
21
|
+
WORKDIR "/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker"
|
|
22
|
+
RUN dotnet build "./CodeDesignPlus.Net.Microservice.AsyncWorker.csproj" -c "$BUILD_CONFIGURATION" -o /app/build
|
|
23
|
+
|
|
24
|
+
FROM build AS publish
|
|
25
|
+
WORKDIR /src
|
|
26
|
+
ARG BUILD_CONFIGURATION=Release
|
|
27
|
+
RUN dotnet publish "./entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/CodeDesignPlus.Net.Microservice.AsyncWorker.csproj" \
|
|
28
|
+
-c "$BUILD_CONFIGURATION" \
|
|
29
|
+
-o /app/publish /p:UseAppHost=true
|
|
30
|
+
|
|
31
|
+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
|
32
|
+
USER app
|
|
33
|
+
WORKDIR /app
|
|
34
|
+
EXPOSE 5002
|
|
35
|
+
COPY --from=publish /app/publish .
|
|
36
|
+
ENTRYPOINT ["dotnet", "CodeDesignPlus.Net.Microservice.AsyncWorker.dll"]
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"profiles": {
|
|
4
4
|
"http": {
|
|
5
5
|
"commandName": "Project",
|
|
6
|
-
"dotnetRunMessages": true,
|
|
7
6
|
"launchBrowser": true,
|
|
8
|
-
"launchUrl": "
|
|
9
|
-
"applicationUrl": "http://localhost:5246",
|
|
7
|
+
"launchUrl": "swagger",
|
|
10
8
|
"environmentVariables": {
|
|
11
9
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
12
|
-
}
|
|
13
|
-
|
|
10
|
+
},
|
|
11
|
+
"dotnetRunMessages": true,
|
|
12
|
+
"applicationUrl": "http://localhost:5002"
|
|
13
|
+
},
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Redis": {
|
|
3
|
+
"Instances": {
|
|
4
|
+
"Core": {
|
|
5
|
+
"ConnectionString": "host.docker.internal:6379"
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"RabbitMQ": {
|
|
10
|
+
"Host": "host.docker.internal"
|
|
11
|
+
},
|
|
12
|
+
"Logger": {
|
|
13
|
+
"OTelEndpoint": "http://host.docker.internal:4317"
|
|
14
|
+
},
|
|
15
|
+
"Observability": {
|
|
16
|
+
"ServerOtel": "http://host.docker.internal:4317"
|
|
17
|
+
},
|
|
18
|
+
"Vault": {
|
|
19
|
+
"Address": "http://host.docker.internal:8200",
|
|
20
|
+
"Mongo": {
|
|
21
|
+
"TemplateConnectionString": "mongodb://{0}:{1}@host.docker.internal:27017"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Kestrel": {
|
|
3
|
+
"Endpoints": {
|
|
4
|
+
"Http": {
|
|
5
|
+
"Url": "http://*:5002",
|
|
6
|
+
"Protocols": "Http1"
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
},
|
|
2
10
|
"Core": {
|
|
3
11
|
"AppName": "ms-archetype",
|
|
4
12
|
"Version": "v1",
|
|
@@ -76,54 +84,10 @@
|
|
|
76
84
|
"Vault": {
|
|
77
85
|
"Address": "http://127.0.0.1:8200",
|
|
78
86
|
"AppName": "ms-archetype",
|
|
79
|
-
"Solution": "
|
|
87
|
+
"Solution": "vault",
|
|
80
88
|
"Token": "root",
|
|
81
89
|
"Mongo": {
|
|
82
90
|
"TemplateConnectionString": "mongodb://{0}:{1}@localhost:27017"
|
|
83
91
|
}
|
|
84
|
-
},
|
|
85
|
-
"Serilog": {
|
|
86
|
-
"Using": [
|
|
87
|
-
"Serilog.Sinks.Console"
|
|
88
|
-
],
|
|
89
|
-
"Filter": [
|
|
90
|
-
{
|
|
91
|
-
"Name": "ByExcluding",
|
|
92
|
-
"Args": {
|
|
93
|
-
"expression": "RequestPath like '/health%'"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
],
|
|
97
|
-
"MinimumLevel": {
|
|
98
|
-
"Default": "Verbose",
|
|
99
|
-
"Override": {
|
|
100
|
-
"Microsoft.AspNetCore.Hosting.Diagnostics": "Warning",
|
|
101
|
-
"Microsoft": "Warning",
|
|
102
|
-
"System": "Warning"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"Enrich": [
|
|
106
|
-
"FromLogContext"
|
|
107
|
-
],
|
|
108
|
-
"Properties": {
|
|
109
|
-
"Category": "Event"
|
|
110
|
-
},
|
|
111
|
-
"WriteTo": [
|
|
112
|
-
{
|
|
113
|
-
"Name": "Async",
|
|
114
|
-
"Args": {
|
|
115
|
-
"configure": [
|
|
116
|
-
{
|
|
117
|
-
"Name": "Console",
|
|
118
|
-
"Args": {
|
|
119
|
-
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
|
|
120
|
-
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{Message:lj}] [{EscapedException}]{NewLine}",
|
|
121
|
-
"restrictedToMinimumLevel": "Verbose"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
92
|
}
|
|
129
93
|
}
|
|
@@ -10,17 +10,18 @@
|
|
|
10
10
|
<DockerfileContext>..\..</DockerfileContext>
|
|
11
11
|
</PropertyGroup>
|
|
12
12
|
<ItemGroup>
|
|
13
|
-
<PackageReference Include="
|
|
14
|
-
<PackageReference Include="CodeDesignPlus.Net.
|
|
13
|
+
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.3.0" />
|
|
14
|
+
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.5.0-beta.81" />
|
|
15
|
+
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.5.0-beta.81" />
|
|
15
16
|
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="7.2.0" />
|
|
16
17
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="7.2.0" />
|
|
17
18
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.2.0" />
|
|
18
|
-
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.5.0-beta.
|
|
19
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.5.0-beta.
|
|
20
|
-
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.5.0-beta.
|
|
21
|
-
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.5.0-beta.
|
|
22
|
-
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.5.0-beta.
|
|
23
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.5.0-beta.
|
|
19
|
+
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.5.0-beta.81" />
|
|
20
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.5.0-beta.81" />
|
|
21
|
+
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.5.0-beta.81" />
|
|
22
|
+
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.5.0-beta.81" />
|
|
23
|
+
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.5.0-beta.81" />
|
|
24
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.5.0-beta.81" />
|
|
24
25
|
</ItemGroup>
|
|
25
26
|
<ItemGroup>
|
|
26
27
|
<InternalsVisibleTo Include="CodeDesignPlus.Net.Microservice.Rest.Test" />
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
|
2
2
|
|
|
3
|
-
FROM mcr.microsoft.com/dotnet/aspnet:
|
|
3
|
+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
|
4
4
|
USER app
|
|
5
5
|
WORKDIR /app
|
|
6
|
-
EXPOSE
|
|
6
|
+
EXPOSE 5000
|
|
7
7
|
|
|
8
|
-
FROM mcr.microsoft.com/dotnet/sdk:
|
|
8
|
+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|
9
9
|
# Install clang/zlib1g-dev dependencies for publishing to native
|
|
10
10
|
RUN apt-get update \
|
|
11
11
|
&& apt-get install -y --no-install-recommends \
|
|
@@ -14,8 +14,8 @@ RUN apt-get update \
|
|
|
14
14
|
|
|
15
15
|
ARG BUILD_CONFIGURATION=Release
|
|
16
16
|
WORKDIR /src
|
|
17
|
-
COPY ["domain/", "domain/"]
|
|
18
|
-
COPY ["entrypoints/CodeDesignPlus.Net.Microservice.Rest/", "entrypoints/CodeDesignPlus.Net.Microservice.Rest/"]
|
|
17
|
+
COPY ["src/domain/", "domain/"]
|
|
18
|
+
COPY ["src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/", "entrypoints/CodeDesignPlus.Net.Microservice.Rest/"]
|
|
19
19
|
RUN dotnet restore "./entrypoints/CodeDesignPlus.Net.Microservice.Rest/CodeDesignPlus.Net.Microservice.Rest.csproj"
|
|
20
20
|
|
|
21
21
|
WORKDIR "/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest"
|
|
@@ -28,10 +28,9 @@ RUN dotnet publish "./entrypoints/CodeDesignPlus.Net.Microservice.Rest/CodeDesig
|
|
|
28
28
|
-c "$BUILD_CONFIGURATION" \
|
|
29
29
|
-o /app/publish /p:UseAppHost=true
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
|
31
|
+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
|
33
32
|
USER app
|
|
34
33
|
WORKDIR /app
|
|
35
|
-
EXPOSE
|
|
34
|
+
EXPOSE 5000
|
|
36
35
|
COPY --from=publish /app/publish .
|
|
37
36
|
ENTRYPOINT ["dotnet", "CodeDesignPlus.Net.Microservice.Rest.dll"]
|
|
@@ -4,6 +4,8 @@ using CodeDesignPlus.Net.Microservice.Commons.FluentValidation;
|
|
|
4
4
|
using CodeDesignPlus.Net.Microservice.Commons.MediatR;
|
|
5
5
|
using CodeDesignPlus.Net.Redis.Cache.Extensions;
|
|
6
6
|
using CodeDesignPlus.Net.Vault.Extensions;
|
|
7
|
+
using NodaTime;
|
|
8
|
+
using NodaTime.Serialization.SystemTextJson;
|
|
7
9
|
|
|
8
10
|
var builder = WebApplication.CreateSlimBuilder(args);
|
|
9
11
|
|
|
@@ -13,7 +15,10 @@ builder.Host.UseSerilog();
|
|
|
13
15
|
|
|
14
16
|
builder.Configuration.AddVault();
|
|
15
17
|
|
|
16
|
-
builder.Services
|
|
18
|
+
builder.Services
|
|
19
|
+
.AddControllers()
|
|
20
|
+
.AddJsonOptions(opt => opt.JsonSerializerOptions.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb));
|
|
21
|
+
|
|
17
22
|
|
|
18
23
|
builder.Services.AddEndpointsApiExplorer();
|
|
19
24
|
|
|
@@ -5,19 +5,17 @@
|
|
|
5
5
|
"launchBrowser": true,
|
|
6
6
|
"launchUrl": "swagger",
|
|
7
7
|
"environmentVariables": {
|
|
8
|
-
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
9
|
-
"VAULT_ROLE_ID": "vault_role_id",
|
|
10
|
-
"VAULT_SECRET_ID": "vault_secret_id",
|
|
8
|
+
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
11
9
|
},
|
|
12
10
|
"dotnetRunMessages": true,
|
|
13
|
-
"applicationUrl": "http://localhost:
|
|
11
|
+
"applicationUrl": "http://localhost:5000"
|
|
14
12
|
},
|
|
15
13
|
"Docker": {
|
|
16
14
|
"commandName": "Docker",
|
|
17
15
|
"launchBrowser": true,
|
|
18
16
|
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
|
|
19
17
|
"environmentVariables": {
|
|
20
|
-
"ASPNETCORE_HTTP_PORTS": "
|
|
18
|
+
"ASPNETCORE_HTTP_PORTS": "5000"
|
|
21
19
|
},
|
|
22
20
|
"publishAllPorts": true
|
|
23
21
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Redis": {
|
|
3
|
+
"Instances": {
|
|
4
|
+
"Core": {
|
|
5
|
+
"ConnectionString": "host.docker.internal:6379"
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"RabbitMQ": {
|
|
10
|
+
"Host": "host.docker.internal"
|
|
11
|
+
},
|
|
12
|
+
"Logger": {
|
|
13
|
+
"OTelEndpoint": "http://host.docker.internal:4317"
|
|
14
|
+
},
|
|
15
|
+
"Observability": {
|
|
16
|
+
"ServerOtel": "http://host.docker.internal:4317"
|
|
17
|
+
},
|
|
18
|
+
"Vault": {
|
|
19
|
+
"Address": "http://host.docker.internal:8200",
|
|
20
|
+
"Mongo": {
|
|
21
|
+
"TemplateConnectionString": "mongodb://{0}:{1}@host.docker.internal:27017"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"AllowedHosts": "*",
|
|
3
|
+
"Kestrel": {
|
|
4
|
+
"Endpoints": {
|
|
5
|
+
"Http": {
|
|
6
|
+
"Url": "http://*:5000",
|
|
7
|
+
"Protocols": "Http1"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
},
|
|
3
11
|
"Core": {
|
|
4
12
|
"AppName": "ms-archetype",
|
|
5
13
|
"Version": "v1",
|
|
@@ -50,11 +58,11 @@
|
|
|
50
58
|
},
|
|
51
59
|
"Logger": {
|
|
52
60
|
"Enable": true,
|
|
53
|
-
"OTelEndpoint": "http://
|
|
61
|
+
"OTelEndpoint": "http://localhost:4317"
|
|
54
62
|
},
|
|
55
63
|
"Observability": {
|
|
56
64
|
"Enable": true,
|
|
57
|
-
"ServerOtel": "http://
|
|
65
|
+
"ServerOtel": "http://localhost:4317",
|
|
58
66
|
"Trace": {
|
|
59
67
|
"Enable": true,
|
|
60
68
|
"AspNetCore": true,
|
|
@@ -71,9 +79,9 @@
|
|
|
71
79
|
},
|
|
72
80
|
"Vault": {
|
|
73
81
|
"Enable": true,
|
|
74
|
-
"Address": "http://
|
|
82
|
+
"Address": "http://localhost:8200",
|
|
75
83
|
"AppName": "ms-archetype",
|
|
76
|
-
"Solution": "
|
|
84
|
+
"Solution": "vault",
|
|
77
85
|
"Token": "root",
|
|
78
86
|
"Mongo": {
|
|
79
87
|
"Enable": true,
|