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:
@@ -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", "")
|
||||
|
||||
Reference in New Issue
Block a user