-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consumer API: Return the full identity deletion process on each put a…
…nd post request (#641) * feat: return full deletion process on approve * feat: return full deletion process on cancel * feat: return full deletion process on reject * feat: return full deletion process on start * fix: compiler error
- Loading branch information
Showing
5 changed files
with
16 additions
and
57 deletions.
There are no files selected for viewing
16 changes: 3 additions & 13 deletions
16
....Application/Identities/Commands/ApproveDeletionProcess/ApproveDeletionProcessResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,11 @@ | ||
using Backbone.Modules.Devices.Application.DTOs; | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
|
||
namespace Backbone.Modules.Devices.Application.Identities.Commands.ApproveDeletionProcess; | ||
|
||
public class ApproveDeletionProcessResponse | ||
public class ApproveDeletionProcessResponse : IdentityDeletionProcessOverviewDTO | ||
{ | ||
public ApproveDeletionProcessResponse(IdentityDeletionProcess deletionProcess) | ||
public ApproveDeletionProcessResponse(IdentityDeletionProcess deletionProcess) : base(deletionProcess) | ||
{ | ||
Id = deletionProcess.Id; | ||
Status = deletionProcess.Status; | ||
CreatedAt = deletionProcess.CreatedAt; | ||
ApprovedAt = deletionProcess.ApprovedAt ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.ApprovedAt)}' property of the given deletion process must not be null."); | ||
ApprovedByDevice = deletionProcess.ApprovedByDevice ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.ApprovedByDevice)}' property of the given deletion process must not be null."); | ||
} | ||
|
||
public string Id { get; } | ||
public DeletionProcessStatus Status { get; } | ||
public DateTime CreatedAt { get; } | ||
public DateTime ApprovedAt { get; } | ||
public string ApprovedByDevice { get; } | ||
} |
16 changes: 4 additions & 12 deletions
16
.../Identities/Commands/CancelDeletionProcessAsOwner/CancelDeletionProcessAsOwnerResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
using Backbone.Modules.Devices.Application.DTOs; | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
|
||
namespace Backbone.Modules.Devices.Application.Identities.Commands.CancelDeletionProcessAsOwner; | ||
|
||
public class CancelDeletionProcessAsOwnerResponse | ||
public class CancelDeletionProcessAsOwnerResponse : IdentityDeletionProcessOverviewDTO | ||
{ | ||
public CancelDeletionProcessAsOwnerResponse(IdentityDeletionProcess deletionProcess) | ||
public CancelDeletionProcessAsOwnerResponse(IdentityDeletionProcess deletionProcess) : base(deletionProcess) | ||
{ | ||
Id = deletionProcess.Id; | ||
Status = deletionProcess.Status; | ||
CancelledAt = deletionProcess.CancelledAt ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.CancelledAt)}' property of the given deletion process must not be null."); | ||
CancelledByDevice = deletionProcess.CancelledByDevice ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.CancelledByDevice)}' property of the given deletion process must not be null."); | ||
} | ||
|
||
public string Id { get; } | ||
public DeletionProcessStatus Status { get; } | ||
public DateTime CancelledAt { get; } | ||
public string CancelledByDevice { get; } | ||
} |
17 changes: 5 additions & 12 deletions
17
...es.Application/Identities/Commands/RejectDeletionProcess/RejectDeletionProcessResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
using Backbone.Modules.Devices.Application.DTOs; | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
|
||
namespace Backbone.Modules.Devices.Application.Identities.Commands.RejectDeletionProcess; | ||
public class RejectDeletionProcessResponse | ||
|
||
public class RejectDeletionProcessResponse : IdentityDeletionProcessOverviewDTO | ||
{ | ||
public RejectDeletionProcessResponse(IdentityDeletionProcess deletionProcess) | ||
public RejectDeletionProcessResponse(IdentityDeletionProcess deletionProcess) : base(deletionProcess) | ||
{ | ||
Id = deletionProcess.Id; | ||
Status = deletionProcess.Status; | ||
RejectedAt = deletionProcess.RejectedAt ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.RejectedAt)}' property of the given deletion process must not be null."); | ||
RejectedByDevice = deletionProcess.RejectedByDevice ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.RejectedByDevice)}' property of the given deletion process must not be null."); | ||
} | ||
|
||
public string Id { get; } | ||
public DeletionProcessStatus Status { get; } | ||
public DateTime RejectedAt { get; } | ||
public string RejectedByDevice { get; } | ||
} |
21 changes: 3 additions & 18 deletions
21
...on/Identities/Commands/StartDeletionProcessAsOwner/StartDeletionProcessAsOwnerResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,11 @@ | ||
using Backbone.DevelopmentKit.Identity.ValueObjects; | ||
using Backbone.Modules.Devices.Application.DTOs; | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
|
||
namespace Backbone.Modules.Devices.Application.Identities.Commands.StartDeletionProcessAsOwner; | ||
|
||
public class StartDeletionProcessAsOwnerResponse | ||
public class StartDeletionProcessAsOwnerResponse : IdentityDeletionProcessOverviewDTO | ||
{ | ||
public StartDeletionProcessAsOwnerResponse(IdentityDeletionProcess deletionProcess) | ||
public StartDeletionProcessAsOwnerResponse(IdentityDeletionProcess deletionProcess) : base(deletionProcess) | ||
{ | ||
Id = deletionProcess.Id; | ||
Status = deletionProcess.Status; | ||
CreatedAt = deletionProcess.CreatedAt; | ||
ApprovedAt = deletionProcess.ApprovedAt ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.ApprovedAt)}' property of the given deletion process must not be null."); | ||
ApprovedByDevice = deletionProcess.ApprovedByDevice ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.ApprovedByDevice)}' property of the given deletion process must not be null."); | ||
GracePeriodEndsAt = deletionProcess.GracePeriodEndsAt.GetValueOrDefault(); | ||
} | ||
|
||
public string Id { get; set; } | ||
public DeletionProcessStatus Status { get; set; } | ||
public DateTime CreatedAt { get; set; } | ||
|
||
public DateTime ApprovedAt { get; set; } | ||
public DeviceId ApprovedByDevice { get; set; } | ||
|
||
public DateTime GracePeriodEndsAt { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters