diff --git a/backend/pkg/api/data_access/notifications.go b/backend/pkg/api/data_access/notifications.go index 3c99595de..8f1e6961d 100644 --- a/backend/pkg/api/data_access/notifications.go +++ b/backend/pkg/api/data_access/notifications.go @@ -253,6 +253,7 @@ func (d *DataAccessService) GetNotificationOverview(ctx context.Context, userId err = d.userReader.GetContext(ctx, &response, querySql, args...) return err }) + response.NextEmailCountResetTimestamp = time.Now().Add(utils.Day).Truncate(utils.Day).Unix() err = eg.Wait() return &response, err diff --git a/backend/pkg/api/types/notifications.go b/backend/pkg/api/types/notifications.go index c28ed0370..a31d3ebe6 100644 --- a/backend/pkg/api/types/notifications.go +++ b/backend/pkg/api/types/notifications.go @@ -15,9 +15,10 @@ type NotificationOverviewData struct { VDBMostNotifiedGroups [3]string `json:"vdb_most_notified_groups"` ADBMostNotifiedGroups [3]string `json:"adb_most_notified_groups"` - Last24hEmailCount uint64 `json:"last_24h_email_count"` // daily limit should be available in user info - Last24hPushCount uint64 `json:"last_24h_push_count"` - Last24hWebhookCount uint64 `json:"last_24h_webhook_count"` + NextEmailCountResetTimestamp int64 `json:"next_email_count_reset_timestamp"` + Last24hEmailCount uint64 `json:"last_24h_email_count"` // daily limit should be available in user info + Last24hPushCount uint64 `json:"last_24h_push_count"` + Last24hWebhookCount uint64 `json:"last_24h_webhook_count"` // counts are shown in their respective tables VDBSubscriptionsCount uint64 `db:"vdb_subscriptions_count" json:"vdb_subscriptions_count"` diff --git a/frontend/types/api/notifications.ts b/frontend/types/api/notifications.ts index 230ac73e0..2891cb1f7 100644 --- a/frontend/types/api/notifications.ts +++ b/frontend/types/api/notifications.ts @@ -17,7 +17,8 @@ export interface NotificationOverviewData { */ vdb_most_notified_groups: string[]; adb_most_notified_groups: string[]; - last_24h_emails_count: number /* uint64 */; // daily limit should be available in user info + next_email_count_reset_timestamp: number /* int64 */; + last_24h_email_count: number /* uint64 */; // daily limit should be available in user info last_24h_push_count: number /* uint64 */; last_24h_webhook_count: number /* uint64 */; /**