From 46eb74559aa79418bf0adca80dd0ba3050c5014d Mon Sep 17 00:00:00 2001 From: Timo Notheisen Date: Thu, 20 Jun 2024 15:28:33 +0200 Subject: [PATCH] fix: add method that was removed from controller --- .../Controllers/RelationshipsController.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Modules/Relationships/src/Relationships.ConsumerApi/Controllers/RelationshipsController.cs b/Modules/Relationships/src/Relationships.ConsumerApi/Controllers/RelationshipsController.cs index bda6828901..81d7a701a8 100644 --- a/Modules/Relationships/src/Relationships.ConsumerApi/Controllers/RelationshipsController.cs +++ b/Modules/Relationships/src/Relationships.ConsumerApi/Controllers/RelationshipsController.cs @@ -11,6 +11,7 @@ using Backbone.Modules.Relationships.Application.Relationships.Commands.CreateRelationship; using Backbone.Modules.Relationships.Application.Relationships.Commands.RejectRelationship; using Backbone.Modules.Relationships.Application.Relationships.Commands.RejectRelationshipReactivation; +using Backbone.Modules.Relationships.Application.Relationships.Commands.RequestRelationshipReactivation; using Backbone.Modules.Relationships.Application.Relationships.Commands.RevokeRelationship; using Backbone.Modules.Relationships.Application.Relationships.Commands.RevokeRelationshipReactivation; using Backbone.Modules.Relationships.Application.Relationships.Commands.TerminateRelationship; @@ -118,6 +119,19 @@ public async Task RevokeRelationship([FromRoute] string id, [From return Ok(response); } + [HttpPut("{id}/Reactivate")] + [ProducesResponseType(typeof(HttpResponseEnvelopeResult), StatusCodes.Status200OK)] + [ProducesError(StatusCodes.Status400BadRequest)] + [ProducesError(StatusCodes.Status404NotFound)] + public async Task RelationshipReactivationRequest([FromRoute] string id, CancellationToken cancellationToken) + { + var peerOfActiveIdentityInRelationshipResponse = await _mediator.Send(new GetPeerOfActiveIdentityInRelationshipQuery { Id = id }, cancellationToken); + await EnsurePeerIsNotToBeDeleted(peerOfActiveIdentityInRelationshipResponse.IdentityAddress, cancellationToken); + + var response = await _mediator.Send(new RequestRelationshipReactivationCommand { RelationshipId = id }, cancellationToken); + return Ok(response); + } + [HttpPut("{id}/Reactivate/Revoke")] [ProducesResponseType(typeof(HttpResponseEnvelopeResult), StatusCodes.Status200OK)] [ProducesError(StatusCodes.Status400BadRequest)]