Different workings

This commit is contained in:
Janus C. H. Knudsen 2025-06-26 21:30:32 +02:00
parent 9d384cd18d
commit dc98178095
14 changed files with 57 additions and 22 deletions

2
.gitignore vendored
View file

@ -360,5 +360,3 @@ MigrationBackup/
# Fody - auto-generated XML schema # Fody - auto-generated XML schema
FodyWeavers.xsd FodyWeavers.xsd
.idea/.idea.PlanTempus/.idea/

13
.idea/.idea.PlanTempus/.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/modules.xml
/.idea.PlanTempus.iml
/contentModel.xml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="ptmain@192.168.1.57" uuid="26c97165-2025-4887-bf2a-e69eedd07a45">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://192.168.1.57:5432/ptmain</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.host.port" />
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
<property name="com.intellij.clouds.kubernetes.db.resource.type" value="Deployment" />
<property name="com.intellij.clouds.kubernetes.db.container.port" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

6
.idea/.idea.PlanTempus/.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfCrmConnectionInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://kdtooling.kupp.at/kdtooling/schema_1.0" />

View file

@ -1,8 +1,7 @@
 namespace PlanTempus.Core.CommandQueries;
namespace PlanTempus.Core.CommandQueries;
/// <summary> /// <summary>
/// Represents a response to a command request, typically used in asynchronous operations. /// Represents a response to a command request
/// This class includes details such as a unique request ID, correlation ID, command name, /// This class includes details such as a unique request ID, correlation ID, command name,
/// transaction ID, creation timestamp, and a URL to check the status of the command. /// transaction ID, creation timestamp, and a URL to check the status of the command.
/// </summary> /// </summary>

View file

@ -11,8 +11,6 @@ public class CommandHandlerDecorator<TCommand>(
{ {
public async Task<CommandResponse> Handle(TCommand command) public async Task<CommandResponse> Handle(TCommand command)
{ {
// var correlationId = Activity.Current?.RootId ?? command.CorrelationId;
using (var operation = using (var operation =
telemetryClient.StartOperation<RequestTelemetry>($"Handle {decoratedHandler.GetType().FullName}", telemetryClient.StartOperation<RequestTelemetry>($"Handle {decoratedHandler.GetType().FullName}",
command.CorrelationId.ToString())) command.CorrelationId.ToString()))

View file

@ -25,7 +25,7 @@ namespace PlanTempus.Components.Users.Create
@AccessFailedCount, @LockoutEnabled, @IsActive) @AccessFailedCount, @LockoutEnabled, @IsActive)
RETURNING id, created_at, email, is_active"; RETURNING id, created_at, email, is_active";
var data = await db.Connection.QuerySqlAsync<CreateUserResult>(sql, new await db.Connection.QuerySqlAsync(sql, new
{ {
command.Email, command.Email,
PasswordHash = secureTokenizer.TokenizeText(command.Password), PasswordHash = secureTokenizer.TokenizeText(command.Password),
@ -35,6 +35,7 @@ namespace PlanTempus.Components.Users.Create
LockoutEnabled = false, LockoutEnabled = false,
command.IsActive, command.IsActive,
}); });
//lav en mapping mellem requestid og userid
return new CommandResponse(command.CorrelationId, command.GetType().Name, command.TransactionId); return new CommandResponse(command.CorrelationId, command.GetType().Name, command.TransactionId);
} }

View file

@ -1,8 +0,0 @@
namespace PlanTempus.Components.Users.Create
{
public class UserCreationResult
{
public long Id { get; set; }
public DateTime CreatedAt { get; set; }
}
}

View file

@ -1 +1 @@
{"resources":{"Scripts/Script-1.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"},"Scripts/Script.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"},"Scripts/SmartConfigSystem.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"},"Scripts/grant-privileges.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"}}} {"resources":{"Scripts/Script-1.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"sandbox"},"Scripts/Script.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"},"Scripts/SmartConfigSystem.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"},"Scripts/grant-privileges.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"}}}

View file

@ -1 +1 @@
{"resources":{"Scripts/Script-1.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"},"Scripts/Script.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"},"Scripts/SmartConfigSystem.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"},"Scripts/grant-privileges.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"}}} {"resources":{"Scripts/Script-1.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"sandbox"},"Scripts/Script.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"},"Scripts/SmartConfigSystem.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"},"Scripts/grant-privileges.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"}}}

View file

@ -25,7 +25,7 @@ public class HandlerTest : TestFixture
var command = new CreateUserCommand var command = new CreateUserCommand
{ {
Email = "lloyd@dumbanddumber.com3", // Lloyd Christmas Email = "lloyd@dumbanddumber.com5", // Lloyd Christmas
Password = "1234AceVentura#LOL", // Ace Ventura Password = "1234AceVentura#LOL", // Ace Ventura
IsActive = true, IsActive = true,
CorrelationId = Guid.NewGuid() CorrelationId = Guid.NewGuid()