Integrate Notification SDK into Inquiry Service

- Updated the InquiryService to include a notification SDK for sending notifications upon inquiry creation, enhancing user engagement.
- Modified the NewInquiryService constructor to accept the notification SDK as a dependency, adhering to dependency injection principles.
- Refactored the Create method to send notifications with inquiry details, improving communication and response to inquiries.
- Cleaned up commented-out code related to duplicate inquiry checks for better readability and maintainability.
This commit is contained in:
n.nakhostin
2025-09-21 12:23:26 +03:30
parent 5906904caf
commit c22d98d4bb
4 changed files with 377 additions and 42 deletions
+2 -2
View File
@@ -59,7 +59,7 @@ func (h *Handler) CreateInquiry(c echo.Context) error {
"status": duplicateErr.Status,
"created_at": duplicateErr.CreatedAt,
})
// Return conflict with detailed error information
return c.JSON(409, response.APIResponse{
Success: false,
@@ -116,7 +116,7 @@ func (h *Handler) GetInquiryByID(c echo.Context) error {
// @Router /admin/v1/inquiries/{id}/status [put]
func (h *Handler) UpdateInquiryStatus(c echo.Context) error {
idStr := c.Param("id")
form, err := response.Parse[UpdateInquiryStatusForm](c)
if err != nil {
return response.BadRequest(c, "Invalid request format", "")