Skip to content

Commit

Permalink
feat: return full deletion process on start
Browse files Browse the repository at this point in the history
  • Loading branch information
tnotheis committed May 6, 2024
1 parent 3f07d3b commit d4d842f
Showing 1 changed file with 3 additions and 18 deletions.
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; }
}

0 comments on commit d4d842f

Please sign in to comment.