feat(sender): route editor save and send through unified envelope upsert API

- expose POST /api/Envelope for sender-authenticated create/update/send operations

- replace client draft-specific call with EnvelopeService.UpsertAsync(CreateEnvelopeCommand)

- update sender editor save/send flow to persist draft first and send by envelope id

- allow editor hydration without document by making sender document fetch nullable
This commit is contained in:
2026-09-26 13:11:44 +02:00
parent 4d2538cc2c
commit 4dba965c75
4 changed files with 46 additions and 77 deletions

View File

@@ -95,7 +95,6 @@ public class EnvelopeController : ControllerBase
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
[NonAction]
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
[HttpPost]
public async Task<IActionResult> CreateAsync([FromBody] CreateEnvelopeCommand command)
@@ -124,11 +123,4 @@ public class EnvelopeController : ControllerBase
return Ok(result);
}
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
[HttpPost("draft")]
public async Task<IActionResult> SaveDraftAsync([FromBody] SaveEnvelopeDraftCommand command)
{
var result = await _mediator.Send(command.WithAuth(User.GetId()));
return Ok(result);
}
}