feat: include inquiry status changer in alerts
This commit is contained in:
@@ -85,7 +85,7 @@ else
|
||||
|
||||
try
|
||||
{
|
||||
await InquiryService.UpdateStatusAsync(inquiry.Id, status);
|
||||
await InquiryService.UpdateStatusAsync(inquiry.Id, status, "관리자");
|
||||
inquiry.Status = status;
|
||||
Snackbar.Add("상태가 변경되었습니다.", Severity.Success);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Security.Claims;
|
||||
using TaxBaik.Application.Services;
|
||||
|
||||
namespace TaxBaik.Web.Controllers;
|
||||
@@ -66,7 +67,8 @@ public class InquiryController : ControllerBase
|
||||
|
||||
try
|
||||
{
|
||||
await _inquiryService.UpdateStatusAsync(id, request.Status);
|
||||
var changedBy = User.FindFirstValue(ClaimTypes.Name) ?? User.Identity?.Name;
|
||||
await _inquiryService.UpdateStatusAsync(id, request.Status, changedBy);
|
||||
return Ok(new { message = "상태가 변경되었습니다." });
|
||||
}
|
||||
catch (ValidationException ex)
|
||||
|
||||
@@ -66,7 +66,7 @@ public class TelegramInquiryNotificationService : IInquiryNotificationService
|
||||
}
|
||||
}
|
||||
|
||||
public async Task NotifyStatusChangedAsync(int inquiryId, string name, string phone, string serviceType, string previousStatus, string newStatus, CancellationToken ct = default)
|
||||
public async Task NotifyStatusChangedAsync(int inquiryId, string name, string phone, string serviceType, string previousStatus, string newStatus, string? changedBy = null, CancellationToken ct = default)
|
||||
{
|
||||
var botToken = _configuration["Telegram:BotToken"];
|
||||
var chatId = _configuration["Telegram:ChatId"];
|
||||
@@ -82,6 +82,7 @@ public class TelegramInquiryNotificationService : IInquiryNotificationService
|
||||
.AppendLine($"이름: {name}")
|
||||
.AppendLine($"연락처: {phone}")
|
||||
.AppendLine($"상태: {FormatStatus(previousStatus)} -> {FormatStatus(newStatus)}")
|
||||
.AppendLine($"변경자: {(string.IsNullOrWhiteSpace(changedBy) ? "-" : changedBy)}")
|
||||
.AppendLine()
|
||||
.AppendLine($"답변 목록 링크: {adminLink}")
|
||||
.ToString();
|
||||
|
||||
Reference in New Issue
Block a user