Skip to content

Commit

Permalink
fix: event timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandaal committed Dec 20, 2023
1 parent 02aea13 commit 92615b4
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record ApproveStreetNameLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<ApproveStreetNameRequest>,
IHasStreetNamePersistentLocalId
{
Expand All @@ -33,7 +32,10 @@ public ApproveStreetNameLambdaRequest(string groupId, ApproveStreetNameSqsReques
/// <returns>ApproveStreetName.</returns>
public ApproveStreetName ToCommand()
{
return new ApproveStreetName(this.MunicipalityPersistentLocalId(), new PersistentLocalId(StreetNamePersistentLocalId), Provenance);
return new ApproveStreetName(
this.MunicipalityPersistentLocalId(),
new PersistentLocalId(StreetNamePersistentLocalId),
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions.Convertors;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record ChangeStreetNameNamesLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<ChangeStreetNameNamesRequest>,
IHasStreetNamePersistentLocalId
{
Expand Down Expand Up @@ -42,7 +41,7 @@ public ChangeStreetNameNames ToCommand()
this.MunicipalityPersistentLocalId(),
new PersistentLocalId(StreetNamePersistentLocalId),
names,
Provenance);
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record CorrectStreetNameApprovalLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<CorrectStreetNameApprovalRequest>,
IHasStreetNamePersistentLocalId
{
Expand All @@ -33,7 +32,10 @@ public CorrectStreetNameApprovalLambdaRequest(string groupId, CorrectStreetNameA
/// <returns>CorrectStreetNameApproval.</returns>
public CorrectStreetNameApproval ToCommand()
{
return new CorrectStreetNameApproval(this.MunicipalityPersistentLocalId(), new PersistentLocalId(StreetNamePersistentLocalId), Provenance);
return new CorrectStreetNameApproval(
this.MunicipalityPersistentLocalId(),
new PersistentLocalId(StreetNamePersistentLocalId),
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions.Convertors;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record CorrectStreetNameHomonymAdditionsLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<CorrectStreetNameHomonymAdditionsRequest>,
IHasStreetNamePersistentLocalId
{
Expand Down Expand Up @@ -50,7 +49,7 @@ public CorrectStreetNameHomonymAdditions ToCommand()
new PersistentLocalId(StreetNamePersistentLocalId),
homonymAdditionsToCorrect,
homonymsToRemove,
Provenance);
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions.Convertors;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record CorrectStreetNameNamesLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<CorrectStreetNameNamesRequest>,
IHasStreetNamePersistentLocalId
{
Expand Down Expand Up @@ -42,7 +41,7 @@ public CorrectStreetNameNames ToCommand()
this.MunicipalityPersistentLocalId(),
new PersistentLocalId(StreetNamePersistentLocalId),
names,
Provenance);
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record CorrectStreetNameRejectionLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<CorrectStreetNameRejectionRequest>,
IHasStreetNamePersistentLocalId
{
Expand All @@ -33,7 +32,10 @@ public CorrectStreetNameRejectionLambdaRequest(string groupId, CorrectStreetName
/// <returns>CorrectStreetNameRejection.</returns>
public CorrectStreetNameRejection ToCommand()
{
return new CorrectStreetNameRejection(this.MunicipalityPersistentLocalId(), new PersistentLocalId(StreetNamePersistentLocalId), Provenance);
return new CorrectStreetNameRejection(
this.MunicipalityPersistentLocalId(),
new PersistentLocalId(StreetNamePersistentLocalId),
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record CorrectStreetNameRetirementLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<CorrectStreetNameRetirementRequest>,
IHasStreetNamePersistentLocalId
{
Expand All @@ -33,7 +32,10 @@ public CorrectStreetNameRetirementLambdaRequest(string groupId, CorrectStreetNam
/// <returns>CorrectStreetNameRetirement.</returns>
public CorrectStreetNameRetirement ToCommand()
{
return new CorrectStreetNameRetirement(this.MunicipalityPersistentLocalId(), new PersistentLocalId(StreetNamePersistentLocalId), Provenance);
return new CorrectStreetNameRetirement(
this.MunicipalityPersistentLocalId(),
new PersistentLocalId(StreetNamePersistentLocalId),
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions.Convertors;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record ProposeStreetNameLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<ProposeStreetNameRequest>
{
public ProposeStreetNameLambdaRequest(string groupId, ProposeStreetNameSqsRequest sqsRequest)
Expand Down Expand Up @@ -39,8 +38,8 @@ public ProposeStreetName ToCommand()
return new ProposeStreetName(
this.MunicipalityPersistentLocalId(),
names,
this.PersistentLocalId,
Provenance);
PersistentLocalId,
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record RejectStreetNameLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<RejectStreetNameRequest>,
IHasStreetNamePersistentLocalId
{
Expand All @@ -33,7 +32,10 @@ public RejectStreetNameLambdaRequest(string groupId, RejectStreetNameSqsRequest
/// <returns>RejectStreetName.</returns>
public RejectStreetName ToCommand(PersistentLocalId streetNamePersistentLocalId)
{
return new RejectStreetName(this.MunicipalityPersistentLocalId(), streetNamePersistentLocalId, Provenance);
return new RejectStreetName(
this.MunicipalityPersistentLocalId(),
streetNamePersistentLocalId,
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record RemoveStreetNameLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<RemoveStreetNameRequest>,
IHasStreetNamePersistentLocalId
{
Expand All @@ -33,7 +32,10 @@ public RemoveStreetNameLambdaRequest(string groupId, RemoveStreetNameSqsRequest
/// <returns>RemoveStreetName.</returns>
public RemoveStreetName ToCommand()
{
return new RemoveStreetName(this.MunicipalityPersistentLocalId(), new PersistentLocalId(StreetNamePersistentLocalId), Provenance);
return new RemoveStreetName(
this.MunicipalityPersistentLocalId(),
new PersistentLocalId(StreetNamePersistentLocalId),
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.GrAr.Common.Oslo.Extensions;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record RenameStreetNameLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<RenameStreetNameRequest>,
IHasStreetNamePersistentLocalId
{
Expand Down Expand Up @@ -43,7 +42,7 @@ public RenameStreetName ToCommand()
this.MunicipalityPersistentLocalId(),
new PersistentLocalId(StreetNamePersistentLocalId),
new PersistentLocalId(identifier.Value),
Provenance);
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
using Abstractions;
using Abstractions.Requests;
using Abstractions.SqsRequests;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using Municipality;
using Municipality.Commands;

public sealed record RetireStreetNameLambdaRequest :
SqsLambdaRequest,
StreetNameLambdaRequest,
IHasBackOfficeRequest<RetireStreetNameRequest>,
IHasStreetNamePersistentLocalId
{
Expand All @@ -33,7 +32,10 @@ public RetireStreetNameLambdaRequest(string groupId, RetireStreetNameSqsRequest
/// <returns>RetireStreetName.</returns>
public RetireStreetName ToCommand(PersistentLocalId streetNamePersistentLocalId)
{
return new RetireStreetName(this.MunicipalityPersistentLocalId(), streetNamePersistentLocalId, Provenance);
return new RetireStreetName(
this.MunicipalityPersistentLocalId(),
streetNamePersistentLocalId,
CommandProvenance);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace StreetNameRegistry.Api.BackOffice.Handlers.Lambda.Requests
{
using Be.Vlaanderen.Basisregisters.GrAr.Provenance;
using Be.Vlaanderen.Basisregisters.Sqs.Lambda.Requests;
using NodaTime;

public abstract record StreetNameLambdaRequest : SqsLambdaRequest
{
protected StreetNameLambdaRequest(
string messageGroupId,
Guid ticketId,
string? ifMatchHeaderValue,
Provenance provenance,
IDictionary<string, object?> metadata)
: base(messageGroupId, ticketId, ifMatchHeaderValue, provenance, metadata)
{ }

protected Provenance CommandProvenance => new Provenance(
SystemClock.Instance.GetCurrentInstant(),
Provenance.Application,
Provenance.Reason,
Provenance.Operator,
Provenance.Modification,
Provenance.Organisation);
}
}

0 comments on commit 92615b4

Please sign in to comment.