@@ -6,11 +6,13 @@ import (
66 "fmt"
77 "math/rand/v2"
88 "reflect"
9+ "slices"
910 "time"
1011
1112 "github.com/go-faker/faker/v4"
1213 "github.com/go-faker/faker/v4/pkg/options"
1314 "github.com/gobitfly/beaconchain/pkg/api/enums"
15+ "github.com/gobitfly/beaconchain/pkg/api/types"
1416 t "github.com/gobitfly/beaconchain/pkg/api/types"
1517 "github.com/gobitfly/beaconchain/pkg/userservice"
1618 "github.com/shopspring/decimal"
@@ -253,10 +255,6 @@ func (d *DummyService) GetValidatorDashboardGroupExists(ctx context.Context, das
253255 return true , nil
254256}
255257
256- func (d * DummyService ) GetValidatorDashboardExistingValidatorCount (ctx context.Context , dashboardId t.VDBIdPrimary , validators []t.VDBValidator ) (uint64 , error ) {
257- return getDummyData [uint64 ]()
258- }
259-
260258func (d * DummyService ) AddValidatorDashboardValidators (ctx context.Context , dashboardId t.VDBIdPrimary , groupId uint64 , validators []t.VDBValidator ) ([]t.VDBPostValidatorsData , error ) {
261259 return getDummyData [[]t.VDBPostValidatorsData ]()
262260}
@@ -488,6 +486,11 @@ func (d *DummyService) UpdateNotificationSettingsPairedDevice(ctx context.Contex
488486func (d * DummyService ) DeleteNotificationSettingsPairedDevice (ctx context.Context , userId uint64 , pairedDeviceId string ) error {
489487 return nil
490488}
489+
490+ func (d * DummyService ) UpdateNotificationSettingsClients (ctx context.Context , userId uint64 , clientId uint64 , IsSubscribed bool ) (* t.NotificationSettingsClient , error ) {
491+ return getDummyStruct [t.NotificationSettingsClient ]()
492+ }
493+
491494func (d * DummyService ) GetNotificationSettingsDashboards (ctx context.Context , userId uint64 , cursor string , colSort t.Sort [enums.NotificationSettingsDashboardColumn ], search string , limit uint64 ) ([]t.NotificationSettingsDashboardsTableRow , * t.Paging , error ) {
492495 r , p , err := getDummyWithPaging [t.NotificationSettingsDashboardsTableRow ]()
493496 for i , n := range r {
@@ -656,3 +659,20 @@ func (d *DummyService) IncrementBundleDeliveryCount(ctx context.Context, bundleV
656659func (d * DummyService ) GetValidatorDashboardMobileWidget (ctx context.Context , dashboardId t.VDBIdPrimary ) (* t.MobileWidgetData , error ) {
657660 return getDummyStruct [t.MobileWidgetData ]()
658661}
662+
663+ func (d * DummyService ) GetUserMachineMetrics (ctx context.Context , userID uint64 , limit uint64 , offset uint64 ) (* types.MachineMetricsData , error ) {
664+ data , err := getDummyStruct [types.MachineMetricsData ]()
665+ if err != nil {
666+ return nil , err
667+ }
668+ data .SystemMetrics = slices .SortedFunc (slices .Values (data .SystemMetrics ), func (i , j * t.MachineMetricSystem ) int {
669+ return int (i .Timestamp ) - int (j .Timestamp )
670+ })
671+ data .ValidatorMetrics = slices .SortedFunc (slices .Values (data .ValidatorMetrics ), func (i , j * t.MachineMetricValidator ) int {
672+ return int (i .Timestamp ) - int (j .Timestamp )
673+ })
674+ data .NodeMetrics = slices .SortedFunc (slices .Values (data .NodeMetrics ), func (i , j * t.MachineMetricNode ) int {
675+ return int (i .Timestamp ) - int (j .Timestamp )
676+ })
677+ return data , nil
678+ }
0 commit comments