Index fetches the bulk message order history. @Summary List bulk message orders @Description Fetches the last 10 bulk message order summaries for the authenticated user showing counts per status. @Security ApiKeyAuth @Tags BulkSMS @Accept json @Produce json @Success 20
(c fiber.Ctx)
| 62 | // @Failure 500 {object} responses.InternalServerError |
| 63 | // @Router /bulk-messages [get] |
| 64 | func (h *BulkMessageHandler) Index(c fiber.Ctx) error { |
| 65 | ctx, span, ctxLogger := h.tracer.StartFromFiberCtxWithLogger(c, h.logger) |
| 66 | defer span.End() |
| 67 | |
| 68 | orders, err := h.messageService.GetBulkMessages(ctx, h.userIDFomContext(c)) |
| 69 | if err != nil { |
| 70 | msg := fmt.Sprintf("cannot fetch bulk messages for user [%s]", h.userIDFomContext(c)) |
| 71 | ctxLogger.Error(stacktrace.Propagate(err, msg)) |
| 72 | return h.responseInternalServerError(c) |
| 73 | } |
| 74 | |
| 75 | return h.responseOK(c, fmt.Sprintf("fetched %d bulk %s", len(orders), h.pluralize("message", len(orders))), orders) |
| 76 | } |
| 77 | |
| 78 | // Store sends bulk SMS messages from a CSV or Excel file. |
| 79 | // @Summary Store bulk SMS file |
nothing calls this directly
no test coverage detected