feat(admin-console): Stage 6 — mail & notifications domain
Add the mail, notifications, and broadcast pages over the mail, notification,
and diplomail services (no new business logic), completing the operator console.
- GET /_gm/mail deliveries (paginated) + dead-letters
- GET /_gm/mail/deliveries/{id} delivery detail + attempts
- POST /_gm/mail/deliveries/{id}/resend re-enqueue a non-sent delivery
- GET /_gm/notifications notifications + dead-letters + malformed
- GET/POST /_gm/broadcast multi-game admin diplomatic broadcast
Console depends on MailAdmin / NotificationAdmin / DiplomailAdmin interfaces
(satisfied by the concrete services); pages render in tests without a database.
Delivery detail and dead-letters live under /_gm/mail/deliveries/* and
/_gm/mail/... static segments to avoid a param/static route conflict. Resend
and broadcast flow through the CSRF guard.
Tests: mail page, delivery detail (+ not-found), resend (+ bad-CSRF),
notifications overview, broadcast form + send (input assertions) + bad game
ids, and unavailable. Plus an integration test that drives /_gm end to end
through the real gateway → backend (401 challenge + authenticated dashboard).
Docs: backend/docs/admin-console.md page inventory completed.
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
package adminconsole
|
||||
|
||||
// MailDeliveryRow is one line in the mail deliveries table.
|
||||
type MailDeliveryRow struct {
|
||||
DeliveryID string
|
||||
Template string
|
||||
Status string
|
||||
Attempts int32
|
||||
NextAttempt string
|
||||
Created string
|
||||
}
|
||||
|
||||
// MailDeadLetterRow is one line in the mail dead-letters table.
|
||||
type MailDeadLetterRow struct {
|
||||
DeliveryID string
|
||||
Reason string
|
||||
Archived string
|
||||
}
|
||||
|
||||
// MailData is the view model for the mail page: a paginated deliveries list
|
||||
// plus a snapshot of dead-letters.
|
||||
type MailData struct {
|
||||
Deliveries []MailDeliveryRow
|
||||
DeadLetters []MailDeadLetterRow
|
||||
Page int
|
||||
PageSize int
|
||||
Total int64
|
||||
HasPrev bool
|
||||
HasNext bool
|
||||
PrevPage int
|
||||
NextPage int
|
||||
}
|
||||
|
||||
// MailAttemptRow is one delivery attempt on the mail detail page.
|
||||
type MailAttemptRow struct {
|
||||
AttemptNo int32
|
||||
Outcome string
|
||||
Started string
|
||||
Finished string
|
||||
Error string
|
||||
}
|
||||
|
||||
// MailDeliveryDetail is the view model for a single delivery.
|
||||
type MailDeliveryDetail struct {
|
||||
DeliveryID string
|
||||
Template string
|
||||
Status string
|
||||
Attempts int32
|
||||
NextAttempt string
|
||||
LastError string
|
||||
Created string
|
||||
Sent string
|
||||
DeadLettered string
|
||||
CanResend bool
|
||||
AttemptRows []MailAttemptRow
|
||||
}
|
||||
|
||||
// NotificationRow is one line in the notifications table.
|
||||
type NotificationRow struct {
|
||||
NotificationID string
|
||||
Kind string
|
||||
UserID string
|
||||
Created string
|
||||
}
|
||||
|
||||
// NotificationDeadLetterRow is one line in the notification dead-letters table.
|
||||
type NotificationDeadLetterRow struct {
|
||||
NotificationID string
|
||||
RouteID string
|
||||
Reason string
|
||||
Archived string
|
||||
}
|
||||
|
||||
// MalformedRow is one line in the malformed-intents table.
|
||||
type MalformedRow struct {
|
||||
ID string
|
||||
Reason string
|
||||
Received string
|
||||
}
|
||||
|
||||
// NotificationsData is the view model for the notifications overview page.
|
||||
type NotificationsData struct {
|
||||
Notifications []NotificationRow
|
||||
DeadLetters []NotificationDeadLetterRow
|
||||
Malformed []MalformedRow
|
||||
}
|
||||
Reference in New Issue
Block a user