From 84161ee2d9925aa6536bef4bae41186577ca80e1 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 28 Jun 2026 21:40:10 +0900 Subject: [PATCH] fix(contact): allow suppressing inquiry telegrams --- TaxBaik.Application/Services/InquiryService.cs | 7 +++++-- TaxBaik.Web/Controllers/InquiryController.cs | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/TaxBaik.Application/Services/InquiryService.cs b/TaxBaik.Application/Services/InquiryService.cs index b5303e5..d6d7c66 100644 --- a/TaxBaik.Application/Services/InquiryService.cs +++ b/TaxBaik.Application/Services/InquiryService.cs @@ -15,7 +15,7 @@ public class InquiryService( public async Task SubmitAsync( string name, string phone, string serviceType, string message, - string? email = null, string? ipAddress = null, CancellationToken ct = default) + string? email = null, string? ipAddress = null, bool suppressNotification = false, CancellationToken ct = default) { if (string.IsNullOrWhiteSpace(name)) throw new ValidationException("이름을 입력하세요."); @@ -39,7 +39,10 @@ public class InquiryService( }; var inquiryId = await repository.CreateAsync(inquiry, ct); - await notificationService.NotifyCreatedAsync(inquiryId, inquiry.Name, inquiry.Phone, inquiry.ServiceType, inquiry.Message, inquiry.IpAddress, inquiry.CreatedAt, ct); + if (!suppressNotification) + { + await notificationService.NotifyCreatedAsync(inquiryId, inquiry.Name, inquiry.Phone, inquiry.ServiceType, inquiry.Message, inquiry.IpAddress, inquiry.CreatedAt, ct); + } memoryCache.Remove(AdminDashboardService.CacheKey); return inquiryId; } diff --git a/TaxBaik.Web/Controllers/InquiryController.cs b/TaxBaik.Web/Controllers/InquiryController.cs index 3dd8b9a..1a03994 100644 --- a/TaxBaik.Web/Controllers/InquiryController.cs +++ b/TaxBaik.Web/Controllers/InquiryController.cs @@ -32,7 +32,8 @@ public class InquiryController : ControllerBase request.ServiceType, request.Message, request.Email, - HttpContext.Connection.RemoteIpAddress?.ToString()); + HttpContext.Connection.RemoteIpAddress?.ToString(), + request.SuppressNotification); return Ok(new { message = "상담 신청이 접수되었습니다." }); } catch (ValidationException ex) @@ -135,6 +136,7 @@ public class SubmitInquiryRequest public string? Email { get; set; } public string ServiceType { get; set; } = string.Empty; public string Message { get; set; } = string.Empty; + public bool SuppressNotification { get; set; } } public class UpdateStatusRequest