Skip to content

Commit f8fc25b

Browse files
AchoArnoldCopilot
andcommitted
feat: add expired count to bulk messages history table
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7a9b2f6 commit f8fc25b

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

api/pkg/entities/bulk_message.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type BulkMessage struct {
99
ScheduledCount int64 `json:"scheduled_count" example:"50"`
1010
PendingCount int64 `json:"pending_count" example:"30"`
1111
FailedCount int64 `json:"failed_count" example:"5"`
12+
ExpiredCount int64 `json:"expired_count" example:"3"`
1213
SentCount int64 `json:"sent_count" example:"40"`
1314
DeliveredCount int64 `json:"delivered_count" example:"25"`
1415
CreatedAt time.Time `json:"created_at" example:"2022-06-05T14:26:02.302718+03:00"`

api/pkg/repositories/gorm_message_repository.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ func (repository *gormMessageRepository) GetBulkMessages(ctx context.Context, us
189189
COUNT(*) FILTER (WHERE status = 'scheduled') as scheduled_count,
190190
COUNT(*) FILTER (WHERE status = 'pending') as pending_count,
191191
COUNT(*) FILTER (WHERE status = 'failed') as failed_count,
192+
COUNT(*) FILTER (WHERE status = 'expired') as expired_count,
192193
COUNT(*) FILTER (WHERE status = 'sent') as sent_count,
193194
COUNT(*) FILTER (WHERE status = 'delivered') as delivered_count,
194195
MIN(created_at) as created_at

web/pages/bulk-messages/index.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,27 @@
100100
<v-col cols="12">
101101
<h4 class="text-h4 mb-3">Bulk Message History</h4>
102102
<p class="text--secondary">
103-
Your 10 most recent bulk SMS uploads are listed below with a
104-
breakdown of message delivery status. Click
105-
<strong>View</strong> to see all individual messages in a batch.
103+
Your 10 most recent bulk SMS uploads are shown below, including a
104+
delivery status breakdown for each batch. Click
105+
<code>View</code> to see individual messages.
106106
</p>
107107
<v-progress-linear
108108
v-if="loadingHistory"
109109
indeterminate
110110
class="mb-4"
111111
></v-progress-linear>
112-
<v-simple-table v-if="bulkOrders.length">
112+
<v-simple-table>
113113
<template #default>
114114
<thead>
115115
<tr class="text-uppercase subtitle-2">
116116
<th class="text-left">Name</th>
117117
<th class="text-center">Total</th>
118-
<th class="text-center">Scheduled</th>
119118
<th class="text-center">Pending</th>
119+
<th class="text-center">Scheduled</th>
120120
<th class="text-center">Sent</th>
121121
<th class="text-center">Delivered</th>
122122
<th class="text-center">Failed</th>
123+
<th class="text-center">Expired</th>
123124
<th class="text-center">Created At</th>
124125
<th class="text-center">Action</th>
125126
</tr>
@@ -130,11 +131,12 @@
130131
{{ order.request_id }}
131132
</td>
132133
<td class="text-center">{{ order.total }}</td>
133-
<td class="text-center">{{ order.scheduled_count }}</td>
134134
<td class="text-center">{{ order.pending_count }}</td>
135+
<td class="text-center">{{ order.scheduled_count }}</td>
135136
<td class="text-center">{{ order.sent_count }}</td>
136137
<td class="text-center">{{ order.delivered_count }}</td>
137138
<td class="text-center">{{ order.failed_count }}</td>
139+
<td class="text-center">{{ order.expired_count }}</td>
138140
<td class="text-center">
139141
{{ order.created_at | timestamp }}
140142
</td>
@@ -153,9 +155,6 @@
153155
</tbody>
154156
</template>
155157
</v-simple-table>
156-
<p v-else-if="!loadingHistory" class="text--secondary">
157-
No bulk message uploads found.
158-
</p>
159158
</v-col>
160159
</v-row>
161160
</v-container>

0 commit comments

Comments
 (0)