Skip to content
Merged

Rc #126

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
7b07be0
fix: update Swagger endpoint path to use relative URL
Apr 23, 2025
a50452e
Merge pull request #106 from codedesignplus/feature/fix-swagger-rever…
Apr 23, 2025
154435c
feat: add configuration callback to StartupAttribute for service setup
Apr 24, 2025
dc8e906
chroe: update SonarQube job condition to only run for RC branch
Apr 24, 2025
3fc3898
refactor: change Configure property to private readonly field in Star…
Apr 24, 2025
b2c273f
refactor: remove configuration callback from StartupAttribute
Apr 24, 2025
93dda67
refactor: update service configuration handling in Server class
Apr 24, 2025
84e2387
refactor: change service lifetime from Singleton to Scoped in AddFile…
Apr 25, 2025
731bcce
refactor: add default value for Stream type in TypeExtensions
Apr 25, 2025
88adc7b
refactor: update Redis image version in docker-compose.yml
Apr 28, 2025
10dfbf9
refactor: add default value for nullable Guid type in TypeExtensions
Apr 28, 2025
95fa91f
refactor: update AzureBlobFactory and AzureFileFactory to return self…
Apr 29, 2025
c1fff7c
refactor: update Swagger documentation comment for clarity
codedesignplus-wliscano May 2, 2025
a4e17cc
refactor: add PathBase property to CoreOptions and implement UsePath …
codedesignplus-wliscano May 3, 2025
c2189f3
refactor: restore and enhance CI workflow configuration
codedesignplus-wliscano May 3, 2025
9f979d8
refactor: restore and enhance CI workflow configuration
codedesignplus-wliscano May 3, 2025
2fdaee7
refactor: add MinimumLevel configuration to Serilog and enhance Logge…
codedesignplus-wliscano May 4, 2025
880d8fe
feat: add FileUploadOperationFilter to handle file uploads in Swagger UI
codedesignplus-wliscano May 4, 2025
b3b6e95
refactor: remove FileUploadOperationFilter and its registration from …
codedesignplus-wliscano May 4, 2025
43d23d1
feat: add ValidIssuers property to SecurityOptions and update token v…
codedesignplus-wliscano May 6, 2025
cd5cb3f
fix: update token validation logic to handle multiple valid issuers i…
codedesignplus-wliscano May 6, 2025
2bdef17
fix: reorder token validation parameters assignment for clarity in Se…
codedesignplus-wliscano May 6, 2025
85b1e77
chroe: add missing using directive for IServiceCollection in Exceptio…
codedesignplus-wliscano May 10, 2025
ec79927
feat: enhance user ID retrieval in UserContext to prioritize 'sub' an…
codedesignplus-wliscano May 11, 2025
ebaf9ed
fix: update claim retrieval logic in UserContext to prioritize Object…
codedesignplus-wliscano May 11, 2025
0afd721
feat: enhance logging configuration and error handling in RabbitMQ se…
codedesignplus-wliscano May 12, 2025
4502712
feat: improve error handling and logging in RabbitPubSubService for e…
codedesignplus-wliscano May 13, 2025
27fde12
feat: update OrdersData to use Guid for Id and enhance example usage …
codedesignplus-wliscano May 14, 2025
59a46e4
feat: enhance UserAggregate to include IdCountry and update related u…
codedesignplus-wliscano May 14, 2025
23cfffd
feat: enhance observability setup by adding telemetry SDK and environ…
codedesignplus-wliscano May 26, 2025
9dbe8de
feat: add SecretContexts property to Transit class for key management
codedesignplus-wliscano May 26, 2025
af69bdc
feat: add RabbitMQ instrumentation support for tracing in observability
codedesignplus-wliscano May 27, 2025
79e15c5
feat: add composite text map propagator for enhanced tracing support
codedesignplus-wliscano May 27, 2025
d2539a3
feat: enhance exception middleware to return standardized problem det…
codedesignplus-wliscano May 30, 2025
44f767d
feat: Initialize CodeDesignPlus.Net.gRpc.Clients project with gRPC pa…
codedesignplus-wliscano Jun 10, 2025
1eb7761
feat: update project configuration for SonarQube integration and pack…
codedesignplus-wliscano Jun 10, 2025
616ef25
feat: update logo for CodeDesignPlus.Net.gRpc.Clients project
codedesignplus-wliscano Jun 10, 2025
5936063
fix: correct spelling of 'amount' in Order message of payment.proto
codedesignplus-wliscano Jun 10, 2025
f62ac21
feat: add IHttpContextAccessor to PaymentService for improved request…
codedesignplus-wliscano Jun 10, 2025
04b1588
feat: implement gRPC services for User and Tenant management, update …
codedesignplus-wliscano Jun 10, 2025
f820386
fix: correct typo in PaymentUrl configuration key in PaymentServiceTest
codedesignplus-wliscano Jun 10, 2025
d4a5163
refactor: reorder fields in Transaction message for consistency, upda…
codedesignplus-wliscano Jun 10, 2025
26e5e02
feat: add IPaymentGrpc and ITenantGrpc interfaces for payment and ten…
codedesignplus-wliscano Jun 10, 2025
3c96264
feat: enhance gRPC services with detailed XML documentation and nulla…
codedesignplus-wliscano Jun 10, 2025
c41f027
feat: enhance user context integration in gRPC services with access t…
codedesignplus-wliscano Jun 12, 2025
adaf615
feat: add AccessToken, UserAgent, and IpAddress properties to UserCon…
codedesignplus-wliscano Jun 12, 2025
69ebaf8
feat: implement ErrorInterceptor with logging and add ServiceCollecti…
codedesignplus-wliscano Jun 12, 2025
8d766a7
feat: add logging capabilities to PaymentService, TenantService, and …
codedesignplus-wliscano Jun 12, 2025
fa53712
feat: add paymentMethod field to Transaction message and enhance logg…
codedesignplus-wliscano Jun 12, 2025
4f22dc4
feat: change domain and timezone fields to google.protobuf.StringValu…
codedesignplus-wliscano Jun 13, 2025
50c7b25
feat: enhance PaymentResponse and TransactionResponseDetails messages…
codedesignplus-wliscano Jun 13, 2025
402266c
feat: update Payment, Tenant, and User services to remove logger depe…
codedesignplus-wliscano Jun 13, 2025
7061d4f
feat: change fields in TransactionResponseDetails to google.protobuf.…
codedesignplus-wliscano Jun 13, 2025
5620efd
feat: reorder fields in TransactionResponseDetails for improved clari…
codedesignplus-wliscano Jun 16, 2025
1a3b9bc
feat: mark CreditCard and Pse fields as optional in Transaction messa…
codedesignplus-wliscano Jun 17, 2025
227f65c
feat: mark Address and PostalCode fields as optional in Location mess…
codedesignplus-wliscano Jun 17, 2025
fe37a02
feat: update Pay RPC to return PaymentResponse and fix typo in Order …
codedesignplus-wliscano Jun 17, 2025
0fd29ce
fix: correct typo in Order message field name from 'ammount' to 'amount'
codedesignplus-wliscano Jun 17, 2025
32fb21b
feat: reorder fields in CreateTenantRequest and GetTenantResponse for…
codedesignplus-wliscano Jun 17, 2025
6d29e8b
fix: correct field name casing in CreateTenantRequest and Location me…
codedesignplus-wliscano Jun 18, 2025
3ec5e04
fix: change orderId and transactionId fields to use google.protobuf.S…
codedesignplus-wliscano Jun 18, 2025
48cad96
feat: update PayAsync method to return PaymentResponse and enhance do…
codedesignplus-wliscano Jun 19, 2025
167f16a
refactor: update payment service methods to use InitiatePaymentReques…
codedesignplus-wliscano Jun 27, 2025
6daa70e
refactor: comment out PaymentServiceTest class and its methods for fu…
codedesignplus-wliscano Jun 27, 2025
d61589c
feat: rename PayAsync to InitiatePaymentAsync and add UpdateStatusAsy…
codedesignplus-wliscano Jun 28, 2025
6a1a05e
fix: update message and FinancialNetwork fields to use google.protobu…
codedesignplus-wliscano Jun 28, 2025
9cc2a5e
feat: update InitiatePayment RPC to return InitiatePaymentResponse in…
codedesignplus-wliscano Jun 28, 2025
1339e17
feat: update InitiatePaymentAsync method to return InitiatePaymentRes…
codedesignplus-wliscano Jun 28, 2025
0265a8b
feat: add support for automatic event handler registration and exchan…
codedesignplus-wliscano Jul 2, 2025
b94bedd
feat: add TypeEntryPoint property to CoreOptions and update logging a…
codedesignplus-wliscano Jul 2, 2025
258c7ad
feat: add nullable reference type support and auto-generated comment …
codedesignplus-wliscano Jul 4, 2025
c2c6051
Merge branch 'dev' of https://github.com/codedesignplus/CodeDesignPlu…
codedesignplus-wliscano Jul 4, 2025
ecd9daf
feat: add nullable reference type support for generated properties in…
codedesignplus-wliscano Jul 4, 2025
9d6cbcc
feat: update DtoGenerator to remove nullable reference type and adjus…
codedesignplus-wliscano Jul 4, 2025
65de879
Merge pull request #108 from codedesignplus/dev
codedesignplus-wliscano Jul 4, 2025
fd3190d
feat: update SonarQube commands to use server variable and remove har…
codedesignplus-wliscano Jul 5, 2025
e7c128a
Merge pull request #109 from codedesignplus/dev
codedesignplus-wliscano Jul 5, 2025
6e5196f
feat: update SonarQube project arguments for multiple packages to ref…
codedesignplus-wliscano Jul 5, 2025
932902f
Merge pull request #110 from codedesignplus/dev
codedesignplus-wliscano Jul 5, 2025
971d32b
feat: update SonarQube project arguments to include server URL for al…
codedesignplus-wliscano Jul 6, 2025
6edc405
Merge pull request #111 from codedesignplus/dev
codedesignplus-wliscano Jul 6, 2025
61e455d
feat: remove hardcoded SonarQube server URLs from project configurations
codedesignplus-wliscano Jul 6, 2025
e3622e2
feat: comment out GitHub and NuGet package push steps in CI workflow
codedesignplus-wliscano Jul 6, 2025
70c62ec
Merge pull request #112 from codedesignplus/dev
codedesignplus-wliscano Jul 6, 2025
17023ff
feat: remove server argument from SonarQube run commands in CI workflow
codedesignplus-wliscano Jul 6, 2025
9b259f9
Merge pull request #113 from codedesignplus/dev
codedesignplus-wliscano Jul 6, 2025
1cec407
Refactor SonarScanner commands in project.json files to remove server…
codedesignplus-wliscano Jul 6, 2025
18bd3ae
Merge pull request #114 from codedesignplus/dev
codedesignplus-wliscano Jul 6, 2025
2980a72
feat: comment out conditional execution for SonarQube step and set SO…
codedesignplus-wliscano Jul 6, 2025
38ee17c
Add SonarQube token to sonar scanner commands for various projects
codedesignplus-wliscano Jul 6, 2025
bd192db
feat: update ExceptionMiddlewareTests to improve response handling an…
codedesignplus-wliscano Jul 6, 2025
2b6d002
Refactor SonarScanner commands to remove sensitive token exposure
codedesignplus-wliscano Jul 6, 2025
08adff9
feat: implement unit tests for RegisterResourcesBackgroundService and…
codedesignplus-wliscano Jul 8, 2025
0042162
feat: enhance MongoDB serializers and tests with new functionality an…
codedesignplus-wliscano Jul 8, 2025
a3b3719
feat: update RabbitMQ services and tests for improved functionality a…
codedesignplus-wliscano Jul 8, 2025
97a8256
Refactor: Remove MongoDB diagnostics implementation and related tests
codedesignplus-wliscano Jul 8, 2025
3c38299
refactor: remove MongoDB diagnostics options and related code
codedesignplus-wliscano Jul 8, 2025
4f6707f
feat: update SonarQube integration by replacing command options with …
codedesignplus-wliscano Jul 8, 2025
f639564
fix: correct formatting in SonarQube execution command in CI workflow
codedesignplus-wliscano Jul 8, 2025
e89a71d
feat: add SONAR_HOST_URL environment variable for SonarQube execution
codedesignplus-wliscano Jul 8, 2025
68e4757
fix: update token references in CI workflow for NuGet and SonarQube
codedesignplus-wliscano Jul 8, 2025
c8c2ec4
refactor: streamline SonarQube execution by consolidating command exe…
codedesignplus-wliscano Jul 8, 2025
5fb68ab
fix: add missing newline before error handling in SonarQube execution
codedesignplus-wliscano Jul 8, 2025
b41959a
fix: update SonarQube project reference in project.json and specify K…
codedesignplus-wliscano Jul 9, 2025
f4899e8
refactor: comment out UseSerilog_SendsLogsToOpenTelemetryAndLoki_Succ…
codedesignplus-wliscano Jul 9, 2025
0b66dbe
fix: enable conditions for SonarQube and package push steps in CI wor…
codedesignplus-wliscano Jul 9, 2025
831763c
fix: add default text map propagator for OpenTelemetry tracing
codedesignplus-wliscano Jul 9, 2025
98296cd
Merge pull request #115 from codedesignplus/dev
codedesignplus-wliscano Jul 9, 2025
e4e1995
Update package references across multiple projects to latest versions
codedesignplus-wliscano Jul 9, 2025
786b916
Merge pull request #116 from codedesignplus/dev
codedesignplus-wliscano Jul 9, 2025
2d05ac3
fix: update container configurations to use ComposeVersion V2 and sim…
codedesignplus-wliscano Jul 9, 2025
dfc9200
Merge pull request #117 from codedesignplus/dev
codedesignplus-wliscano Jul 9, 2025
badc102
fix: enhance CI workflow and SonarQube integration with improved step…
codedesignplus-wliscano Jul 9, 2025
b894caa
Merge pull request #118 from codedesignplus/dev
codedesignplus-wliscano Jul 9, 2025
a47c9d0
fix: update CI workflow dependencies and improve Docker Compose confi…
codedesignplus-wliscano Jul 9, 2025
b8cd184
Merge branch 'main' into rc
codedesignplus-wliscano Jul 9, 2025
5b3e47c
chore: remove Snyk security workflow file
codedesignplus-wliscano Jul 9, 2025
5eb98c3
Dev (#122)
codedesignplus-wliscano Jul 10, 2025
1201bf2
Merge branch 'main' into rc
codedesignplus-wliscano Jul 10, 2025
98d3199
Dev (#125)
codedesignplus-wliscano Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
{
"extends": "nx/presets/npm.json",
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": [
"build",
"lint",
"test",
"e2e",
"restore",
"format",
"sonarqube",
"pack",
"push"
],
"accessToken": "NTAzMmE4OGMtY2FjMC00ZmFiLTgwMzktOGE5NDQxNTcxODVlfHJlYWQtd3JpdGU="
}
}
}
"$schema": "./node_modules/nx/schemas/nx-schema.json"
}
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "codedesignplus",
"version": "0.0.0",
"license": "LGPL",
"scripts": {
"scripts": {
"affected": "npx nx show projects --affected --skip-nx-cache --head=HEAD --base=remotes/origin/main",
"affected:restore": "npx nx affected --skip-nx-cache --target restore --head=HEAD --base=remotes/origin/main",
"affected:format": "npx nx affected --skip-nx-cache --target format --head=HEAD --base=remotes/origin/main",
"affected:build": "npx nx affected --skip-nx-cache --parallel 1 --target build --head=HEAD --base=remotes/origin/main",
"affected:test": "npx nx affected --skip-nx-cache --target test --head=HEAD --base=remotes/origin/main",
"affected:sonarqube": "npx nx affected --skip-nx-cache --parallel 1 --target sonarqube --head=HEAD --base=remotes/origin/main",
"affected:sonarqube": "npx nx affected --skip-nx-cache --parallel 1 --target sonarqube --head=HEAD --base=remotes/origin/main",
"affected:graph": "npx nx affected --skip-nx-cache --target dep-graph --head=HEAD --base=remotes/origin/main",
"all:restore": "npx nx run-many --all --skip-nx-cache --target restore --parallel 1 ",
"all:format": "npx nx run-many --all --skip-nx-cache --target format",
Expand All @@ -22,13 +22,12 @@
"all-cache:sonarqube": "npx nx run-many --all --target sonarqube --parallel 1"
},
"private": true,
"dependencies": {
},
"devDependencies": {
"@codedesignplus/netcore": "^1.0.3-rc.0",
"@nrwl/workspace": "^16.10.0",
"@nx/js": "16.10.0",
"nx": "16.10.0",
"nx-cloud": "latest",
"@codedesignplus/netcore": "^1.0.3-rc.0",
"@nrwl/workspace": "^16.10.0"
"nx-cloud": "latest",
"which": "^5.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace CodeDesignPlus.Net.Core.Abstractions;
/// Represents the base class for aggregate roots in the domain.
/// </summary>
public abstract class AggregateRootBase : IAggregateRoot
{
{
private ConcurrentQueue<IDomainEvent> domainEvents = [];

/// <summary>
Expand All @@ -21,22 +21,31 @@ public abstract class AggregateRootBase : IAggregateRoot
/// Gets or sets the timestamp when the aggregate root was created.
/// </summary>
public Instant CreatedAt { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the user who created the aggregate root.
/// </summary>
public Guid CreatedBy { get; set; }

/// <summary>
/// Gets or sets the timestamp when the aggregate root was last updated.
/// </summary>
public Instant? UpdatedAt { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the user who last updated the aggregate root.
/// </summary>
public Guid? UpdatedBy { get; set; }

/// <summary>
/// Gets or sets the timestamp when the aggregate root was deleted.
/// </summary>
public Instant? DeletedAt { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user who deleted the aggregate root.
/// </summary>
public Guid? DeletedBy { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the aggregate root is deleted.
/// This property is used to mark the aggregate root as deleted without physically removing it from the database.
/// </summary>
public bool IsDeleted { get; set; } = false;

/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootBase"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,38 @@ public interface IEntityBase
/// </summary>
public interface IEntity : IEntityBase
{

/// <summary>
/// Get or sets the is active
/// </summary>
bool IsActive { get; set; }

/// <summary>
/// Get or sets the creatae at
/// Gets or sets the timestamp when the aggregate root was created.
/// </summary>
Instant CreatedAt { get; set; }
/// <summary>
/// Get or sets the create by
/// Gets or sets the unique identifier of the user who created the aggregate root.
/// </summary>
Guid CreatedBy { get; set; }
/// <summary>
/// Get or sets the update at
/// Gets or sets the timestamp when the aggregate root was last updated.
/// </summary>
Instant? UpdatedAt { get; set; }
/// <summary>
/// Get or sets the update by
/// Gets or sets the unique identifier of the user who last updated the aggregate root.
/// </summary>
Guid? UpdatedBy { get; set; }
/// <summary>
/// Gets or sets the timestamp when the aggregate root was deleted.
/// </summary>
Instant? DeletedAt { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user who deleted the aggregate root.
/// </summary>
Guid? DeletedBy { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the aggregate root is deleted.
/// This property is used to mark the aggregate root as deleted without physically removing it from the database.
/// </summary>
bool IsDeleted { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace CodeDesignPlus.Net.Core.Abstractions;

/// <summary>
/// Represents an item with a unique identifier and a value.
/// </summary>
/// <typeparam name="TValue">The type of the value associated with the item.</typeparam>
/// <param name="Id">The unique identifier of the item.</param>
/// <param name="Value">The value associated with the item.</param>
public record Item<TValue>(Guid Id, TValue Value);
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class CoreOptions : IValidatableObject
public required string AppName { get; set; }
/// <summary>
/// Gets or sets the type entry point (worker, rest, grpc)
/// </summary>
/// </summary>
[Required]
public string TypeEntryPoint { get; set; } = null!;
/// <summary>
/// Gets or sets the version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public async Task AggregateRoot_ValidateState_Success()
var createBy = Guid.NewGuid();
var updatedBy = Guid.NewGuid();
var tenant = Guid.NewGuid();
var deletedBy = Guid.NewGuid();

var orderAggregate = OrderAggregate.Create(id, "Test", "Test Description", 10, tenant, createBy);

Expand All @@ -47,7 +48,7 @@ public async Task AggregateRoot_ValidateState_Success()

await Task.Delay(100);

orderAggregate.Delete();
orderAggregate.Delete(deletedBy);

await Task.Delay(100);

Expand Down Expand Up @@ -122,14 +123,15 @@ public void Aggregate_AddEventWhenDomainEventIsNull_Success()
var id = Guid.NewGuid();
var createBy = Guid.NewGuid();
var tenant = Guid.NewGuid();
var deletedBy = Guid.NewGuid();

var orderAggregate = OrderAggregate.Create(id, "Test", "Test Description", 10, tenant, createBy);

var domainEventsField = typeof(AggregateRootBase).GetField("domainEvents", BindingFlags.NonPublic | BindingFlags.Instance);
domainEventsField!.SetValue(orderAggregate, null);

// Act
orderAggregate.Delete();
orderAggregate.Delete(deletedBy);

// Assert
var events = orderAggregate.GetAndClearEvents();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
namespace CodeDesignPlus.Net.Core.Test.Abstractions;

public class ItemTest
{
[Fact]
public void Constructor_ShouldSetProperties()
{
// Arrange
var id = Guid.NewGuid();
var value = "TestValue";

// Act
var item = new Item<string>(id, value);

// Assert
Assert.Equal(id, item.Id);
Assert.Equal(value, item.Value);
}

[Fact]
public void Records_WithSameValues_ShouldBeEqual()
{
// Arrange
var id = Guid.NewGuid();
var value = 42;

// Act
var item1 = new Item<int>(id, value);
var item2 = new Item<int>(id, value);

// Assert
Assert.Equal(item1, item2);
Assert.True(item1 == item2);
}

[Fact]
public void Records_WithDifferentValues_ShouldNotBeEqual()
{
// Arrange
var id = Guid.NewGuid();

// Act
var item1 = new Item<int>(id, 1);
var item2 = new Item<int>(id, 2);

// Assert
Assert.NotEqual(item1, item2);
Assert.False(item1 == item2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public static class ConfigurationUtil
{
Business = nameof(Core.Abstractions.Options.CoreOptions.Business),
AppName = "ms-test",
TypeEntryPoint = "rest",
Version = "v1",
Description = nameof(Core.Abstractions.Options.CoreOptions.Description),
Contact = new Contact()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ public class FakeEntity : IEntity
public Instant? UpdatedAt { get; set; }
public Guid? UpdatedBy { get; set; }
public bool IsActive { get; set; }
public Instant? DeletedAt { get; set; }
public Guid? DeletedBy { get; set; }
public bool IsDeleted { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ public OrderAggregate(Guid id, string name, string description, decimal price) :
public decimal Price { get; private set; }




public static OrderAggregate Create(Guid id, string name, string description, decimal price, Guid tenant, Guid createBy)
{
var aggregate = new OrderAggregate(id, name, description, price)
{
CreatedAt = SystemClock.Instance.GetCurrentInstant(),
CreatedBy = createBy,
IsActive = true,
Tenant = tenant
};

aggregate.CreatedAt = SystemClock.Instance.GetCurrentInstant();
aggregate.CreatedBy = createBy;

aggregate.AddEvent(new OrderCreatedDomainEvent(id, name, description, price, SystemClock.Instance.GetCurrentInstant(), createBy, null, metadata: new Dictionary<string, object>
{
{ "MetaKey1", "Value1" }
Expand All @@ -51,10 +50,12 @@ public void Update(string name, string description, decimal price, Guid updatedB
AddEvent(new OrderUpdatedDomainEvent(Id, name, description, price, UpdatedAt, updatedBy));
}

public void Delete()
public void Delete(Guid deletedBy)
{
UpdatedAt = SystemClock.Instance.GetCurrentInstant();
DeletedAt = SystemClock.Instance.GetCurrentInstant();
DeletedBy = deletedBy;
IsDeleted = true;

AddEvent(new OrderDeletedDomainEvent(Id, UpdatedAt));
AddEvent(new OrderDeletedDomainEvent(Id, DeletedAt));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public void CoreOptions_DefaultValues_Valid()
Id = Guid.NewGuid(),
Business = Guid.NewGuid().ToString(),
AppName = "ms-test",
TypeEntryPoint = "rest",
Version = "v1",
Description = Guid.NewGuid().ToString(),
Contact = new Contact()
Expand Down Expand Up @@ -87,6 +88,7 @@ public void CoreOptions_EmailInvalid_FailedValidation()
Id = Guid.NewGuid(),
Business = Guid.NewGuid().ToString(),
AppName = "ms-test",
TypeEntryPoint = "rest",
Version = "v1",
Description = Guid.NewGuid().ToString(),
Contact = new Contact()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ public class AppPermision : IEntity
public Instant? UpdatedAt { get; set; }
public Guid? UpdatedBy { get; set; }
public Instant CreatedAt { get; set; }
public Instant? DeletedAt { get; set; }
public Guid? DeletedBy { get; set; }
public bool IsDeleted { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ public class Application : IEntity

public List<AppPermision> AppPermisions { get; set; } = [];
public List<RolePermission> RolePermisions { get; set; } = [];
public Instant? DeletedAt { get; set; }
public Guid? DeletedBy { get; set; }
public bool IsDeleted { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ public class FakeEntity : IEntity
public Instant? UpdatedAt { get; set; }
public Guid? UpdatedBy { get; set; }
public Guid Tenant { get; set; }
public Instant? DeletedAt { get; set; }
public Guid? DeletedBy { get; set; }
public bool IsDeleted { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class Permission : IEntity
public Guid CreatedBy { get; set; }
public Instant? UpdatedAt { get; set; }
public Guid? UpdatedBy { get; set; }
public Instant? DeletedAt { get; set; }
public Guid? DeletedBy { get; set; }
public bool IsDeleted { get; set; }

public List<AppPermision> AppPermisions { get; set; } = [];
public List<RolePermission> RolePermisions { get; set; } = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public class RolePermission : IEntity
public Guid CreatedBy { get; set; }
public Instant? UpdatedAt { get; set; }
public Guid? UpdatedBy { get; set; }
public Instant? DeletedAt { get; set; }
public Guid? DeletedBy { get; set; }
public bool IsDeleted { get; set; }

public Application Application { get; set; }
public Permission Permission { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ public async Task TransactionAsync_CommitedTransaction_ReturnResultDelegate()

var builder = new DbContextOptionsBuilder<CodeDesignPlusContextInMemory>();

var connectionString = $"Server=localhost,{this.sqlServerContainer.Port};Database=temp1;User Id=sa;Password=Temporal1;Encrypt=True;TrustServerCertificate=True";
var connectionString = $"Server=localhost,{this.sqlServerContainer.Port};Database=temp1;User Id=sa;Password={this.sqlServerContainer.Password};Encrypt=True;TrustServerCertificate=True";

var options = builder.UseSqlServer(connectionString, x =>
{
Expand Down Expand Up @@ -633,7 +633,7 @@ public async Task TransactionAsync_RollbackTransaction_InvalidOperationException

var builder = new DbContextOptionsBuilder<CodeDesignPlusContextInMemory>();

var connectionString = $"Server=localhost,{sqlServerContainer.Port};Database=temp2;User Id=sa;Password=Temporal1;Encrypt=True;TrustServerCertificate=True";
var connectionString = $"Server=localhost,{sqlServerContainer.Port};Database=temp2;User Id=sa;Password={sqlServerContainer.Password};Encrypt=True;TrustServerCertificate=True";

var options = builder.UseSqlServer(connectionString, x =>
{
Expand Down
Loading