fix(email): retire legacy SMTP follow-up
Keep follow-up draft generation but remove the direct application SMTP delivery boundary. Route users to the provider-aware Job email flow and return 410 for legacy API callers.
This commit is contained in:
@@ -103,9 +103,29 @@ public sealed class JobApplicationsFollowUpDraftTests
|
||||
Assert.Contains("Maria Recruiter", payload.LastCorrespondenceFrom ?? string.Empty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Legacy_follow_up_delivery_is_gone_and_has_no_smtp_dependency()
|
||||
{
|
||||
using var db = CreateDb();
|
||||
var controller = CreateController(db, Mock.Of<ISummarizerService>(), "user-1");
|
||||
|
||||
var result = controller.SendFollowUp(42, new SendFollowUpRequest(
|
||||
"recruiter@example.test",
|
||||
"Synthetic subject",
|
||||
"Synthetic body",
|
||||
DateTime.UtcNow.AddDays(3)), default);
|
||||
|
||||
var gone = Assert.IsType<ObjectResult>(result);
|
||||
Assert.Equal(StatusCodes.Status410Gone, gone.StatusCode);
|
||||
Assert.Equal("Legacy email delivery retired", Assert.IsType<ProblemDetails>(gone.Value).Title);
|
||||
Assert.Empty(db.Correspondences);
|
||||
Assert.DoesNotContain(typeof(JobApplicationsController).GetConstructors().Single().GetParameters(),
|
||||
parameter => parameter.ParameterType == typeof(IAppEmailSender));
|
||||
}
|
||||
|
||||
private static JobApplicationsController CreateController(JobTrackerContext db, ISummarizerService summarizer, string userId)
|
||||
{
|
||||
var controller = new JobApplicationsController(db, summarizer, Mock.Of<IAppEmailSender>(), CreateUserManager().Object, NullLogger<JobApplicationsController>.Instance);
|
||||
var controller = new JobApplicationsController(db, summarizer, CreateUserManager().Object);
|
||||
controller.ControllerContext = new ControllerContext
|
||||
{
|
||||
HttpContext = new DefaultHttpContext
|
||||
|
||||
Reference in New Issue
Block a user