Skip to content

Commit

Permalink
feat: add next email count reset ts to notification overview
Browse files Browse the repository at this point in the history
See: BEDS-870
  • Loading branch information
LuccaBitfly committed Oct 29, 2024
1 parent 40b8f08 commit 0a5edaf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/pkg/api/data_access/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions backend/pkg/api/types/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
3 changes: 2 additions & 1 deletion frontend/types/api/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */;
/**
Expand Down

0 comments on commit 0a5edaf

Please sign in to comment.