From adda9629bca25af2e9a2fa58d3e893c7d50de304 Mon Sep 17 00:00:00 2001 From: Salaton Date: Tue, 5 Oct 2021 13:39:22 +0300 Subject: [PATCH] fix: deduplicate ghost feed items (#60) --- .../database/firestore/default_content.go | 31 +- .../infrastructure/infrastructure.go | 3 +- .../repository/mock/repository_mock.go | 557 ------------------ pkg/engagement/repository/repository.go | 260 -------- 4 files changed, 16 insertions(+), 835 deletions(-) delete mode 100644 pkg/engagement/repository/mock/repository_mock.go delete mode 100644 pkg/engagement/repository/repository.go diff --git a/pkg/engagement/infrastructure/database/firestore/default_content.go b/pkg/engagement/infrastructure/database/firestore/default_content.go index bfac8ed6..3c3e63de 100644 --- a/pkg/engagement/infrastructure/database/firestore/default_content.go +++ b/pkg/engagement/infrastructure/database/firestore/default_content.go @@ -1354,16 +1354,15 @@ func feedItemsFromCMSFeedTag(ctx context.Context, flavour feedlib.Flavour, playM Groups: []string{}, NotificationChannels: []feedlib.Channel{}, }) + } - for _, post := range feedPosts { - if post == nil { - // non fatal, intentionally - log.Printf("ERROR: nil CMS post when adding welcome posts to feed") - continue - } - items = append(items, feedItemFromCMSPost(*post)) + for _, post := range feedPosts { + if post == nil { + // non fatal, intentionally + log.Printf("ERROR: nil CMS post when adding welcome posts to feed") + continue } - + items = append(items, feedItemFromCMSPost(*post)) } // add the slade 360 video last @@ -1419,17 +1418,17 @@ func feedItemsFromCMSFeedTag(ctx context.Context, flavour feedlib.Flavour, playM Groups: []string{}, NotificationChannels: []feedlib.Channel{}, }) + } - for _, post := range feedPosts { - if post == nil { - // non fatal, intentionally - log.Printf("ERROR: nil CMS post when adding welcome posts to feed") - continue - } - items = append(items, feedItemFromCMSPost(*post)) + for _, post := range feedPosts { + if post == nil { + // non fatal, intentionally + log.Printf("ERROR: nil CMS post when adding welcome posts to feed") + continue } - + items = append(items, feedItemFromCMSPost(*post)) } + // add the slade 360 video last items = addSlade360Video(items, future, slade360Youtube, playMP4) diff --git a/pkg/engagement/infrastructure/infrastructure.go b/pkg/engagement/infrastructure/infrastructure.go index e783db7b..c8e4f51c 100644 --- a/pkg/engagement/infrastructure/infrastructure.go +++ b/pkg/engagement/infrastructure/infrastructure.go @@ -15,14 +15,13 @@ import ( "github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/surveys" "github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/twilio" "github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/uploads" - "github.com/savannahghi/engagementcore/pkg/engagement/repository" "github.com/savannahghi/serverutils" ) // Interactor is an implementation of the infrastructure interface // It combines each individual service implementation type Interactor struct { - repository.Repository + database.Repository *fcm.ServiceFCMImpl *library.ServiceLibraryImpl *mail.ServiceMailImpl diff --git a/pkg/engagement/repository/mock/repository_mock.go b/pkg/engagement/repository/mock/repository_mock.go deleted file mode 100644 index 655b9663..00000000 --- a/pkg/engagement/repository/mock/repository_mock.go +++ /dev/null @@ -1,557 +0,0 @@ -package mock - -import ( - "context" - "time" - - "cloud.google.com/go/firestore" - "github.com/savannahghi/engagementcore/pkg/engagement/application/common/dto" - "github.com/savannahghi/engagementcore/pkg/engagement/application/common/helpers" - "github.com/savannahghi/engagementcore/pkg/engagement/domain" - "github.com/savannahghi/feedlib" -) - -// FakeEngagementRepository is a mock engagement repository -type FakeEngagementRepository struct { - GetFeedFn func( - ctx context.Context, - uid *string, - isAnonymous *bool, - flavour feedlib.Flavour, - persistent feedlib.BooleanFilter, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, - filterParams *helpers.FilterParams, - ) (*domain.Feed, error) - - // getting a the LATEST VERSION of a feed item from a feed - GetFeedItemFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - ) (*feedlib.Item, error) - - // saving a new feed item - SaveFeedItemFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - item *feedlib.Item, - ) (*feedlib.Item, error) - - // updating an existing feed item - UpdateFeedItemFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - item *feedlib.Item, - ) (*feedlib.Item, error) - - // DeleteFeedItem permanently deletes a feed item and it's copies - DeleteFeedItemFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - ) error - - // getting THE LATEST VERSION OF a nudge from a feed - GetNudgeFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudgeID string, - ) (*feedlib.Nudge, error) - - // saving a new modified nudge - SaveNudgeFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudge *feedlib.Nudge, - ) (*feedlib.Nudge, error) - - // updating an existing nudge - UpdateNudgeFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudge *feedlib.Nudge, - ) (*feedlib.Nudge, error) - - // DeleteNudge permanently deletes a nudge and it's copies - DeleteNudgeFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudgeID string, - ) error - - // getting THE LATEST VERSION OF a single action - GetActionFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - actionID string, - ) (*feedlib.Action, error) - - // saving a new action - SaveActionFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - action *feedlib.Action, - ) (*feedlib.Action, error) - - // DeleteAction permanently deletes an action and it's copies - DeleteActionFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - actionID string, - ) error - - // PostMessage posts a message or a reply to a message/thread - PostMessageFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - message *feedlib.Message, - ) (*feedlib.Message, error) - - // GetMessage retrieves THE LATEST VERSION OF a message - GetMessageFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - messageID string, - ) (*feedlib.Message, error) - - // DeleteMessage deletes a message - DeleteMessageFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - messageID string, - ) error - - // GetMessages retrieves a message - GetMessagesFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - ) ([]feedlib.Message, error) - - SaveIncomingEventFn func( - ctx context.Context, - event *feedlib.Event, - ) error - - SaveOutgoingEventFn func( - ctx context.Context, - event *feedlib.Event, - ) error - - GetNudgesFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, - ) ([]feedlib.Nudge, error) - - GetActionsFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - ) ([]feedlib.Action, error) - - GetItemsFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - persistent feedlib.BooleanFilter, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, - filterParams *helpers.FilterParams, - ) ([]feedlib.Item, error) - - LabelsFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - ) ([]string, error) - - SaveLabelFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - label string, - ) error - - UnreadPersistentItemsFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - ) (int, error) - - UpdateUnreadPersistentItemsCountFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - ) error - - GetDefaultNudgeByTitleFn func( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - title string, - ) (*feedlib.Nudge, error) - - SaveTwilioResponseFn func( - ctx context.Context, - data dto.Message, - ) error - - SaveNotificationFn func( - ctx context.Context, - firestoreClient *firestore.Client, - notification dto.SavedNotification, - ) error - - RetrieveNotificationFn func( - ctx context.Context, - firestoreClient *firestore.Client, - registrationToken string, - newerThan time.Time, - limit int, - ) ([]*dto.SavedNotification, error) - - SaveNPSResponseFn func( - ctx context.Context, - response *dto.NPSResponse, - ) error - - SaveOutgoingEmailsFn func(ctx context.Context, payload *dto.OutgoingEmailsLog) error - UpdateMailgunDeliveryStatusFn func(ctx context.Context, payload *dto.MailgunEvent) (*dto.OutgoingEmailsLog, error) -} - -// GetFeed ... -func (f *FakeEngagementRepository) GetFeed( - ctx context.Context, - uid *string, - isAnonymous *bool, - flavour feedlib.Flavour, - persistent feedlib.BooleanFilter, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, - filterParams *helpers.FilterParams, -) (*domain.Feed, error) { - return f.GetFeedFn(ctx, uid, isAnonymous, flavour, persistent, status, visibility, expired, filterParams) -} - -// GetFeedItem ... -func (f *FakeEngagementRepository) GetFeedItem( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, -) (*feedlib.Item, error) { - return f.GetFeedItemFn(ctx, uid, flavour, itemID) -} - -// SaveFeedItem ... -func (f *FakeEngagementRepository) SaveFeedItem( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - item *feedlib.Item, -) (*feedlib.Item, error) { - return f.SaveFeedItemFn(ctx, uid, flavour, item) -} - -// UpdateFeedItem ... -func (f *FakeEngagementRepository) UpdateFeedItem( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - item *feedlib.Item, -) (*feedlib.Item, error) { - return f.UpdateFeedItemFn(ctx, uid, flavour, item) -} - -// DeleteFeedItem permanently deletes a feed item and it's copies -func (f *FakeEngagementRepository) DeleteFeedItem( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, -) error { - return f.DeleteFeedItemFn(ctx, uid, flavour, itemID) -} - -// GetNudge gets THE LATEST VERSION OF a nudge from a feed -func (f *FakeEngagementRepository) GetNudge( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudgeID string, -) (*feedlib.Nudge, error) { - return f.GetNudgeFn(ctx, uid, flavour, nudgeID) -} - -// SaveNudge saves a new modified nudge -func (f *FakeEngagementRepository) SaveNudge( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudge *feedlib.Nudge, -) (*feedlib.Nudge, error) { - return f.SaveNudgeFn(ctx, uid, flavour, nudge) -} - -// UpdateNudge updates an existing nudge -func (f *FakeEngagementRepository) UpdateNudge( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudge *feedlib.Nudge, -) (*feedlib.Nudge, error) { - return f.UpdateNudgeFn(ctx, uid, flavour, nudge) -} - -// DeleteNudge permanently deletes a nudge and it's copies -func (f *FakeEngagementRepository) DeleteNudge( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudgeID string, -) error { - return f.DeleteNudgeFn(ctx, uid, flavour, nudgeID) -} - -// GetAction gets THE LATEST VERSION OF a single action -func (f *FakeEngagementRepository) GetAction( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - actionID string, -) (*feedlib.Action, error) { - return f.GetActionFn(ctx, uid, flavour, actionID) -} - -// SaveAction saves a new action -func (f *FakeEngagementRepository) SaveAction( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - action *feedlib.Action, -) (*feedlib.Action, error) { - return f.SaveActionFn(ctx, uid, flavour, action) -} - -// DeleteAction permanently deletes an action and it's copies -func (f *FakeEngagementRepository) DeleteAction( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - actionID string, -) error { - return f.DeleteActionFn(ctx, uid, flavour, actionID) -} - -// PostMessage posts a message or a reply to a message/thread -func (f *FakeEngagementRepository) PostMessage( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - message *feedlib.Message, -) (*feedlib.Message, error) { - return f.PostMessageFn(ctx, uid, flavour, itemID, message) -} - -// GetMessage retrieves THE LATEST VERSION OF a message -func (f *FakeEngagementRepository) GetMessage( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - messageID string, -) (*feedlib.Message, error) { - return f.GetMessageFn(ctx, uid, flavour, itemID, messageID) -} - -// DeleteMessage deletes a message -func (f *FakeEngagementRepository) DeleteMessage( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - messageID string, -) error { - return f.DeleteMessageFn(ctx, uid, flavour, itemID, messageID) -} - -// GetMessages retrieves a message -func (f *FakeEngagementRepository) GetMessages( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, -) ([]feedlib.Message, error) { - return f.GetMessagesFn(ctx, uid, flavour, itemID) -} - -// SaveIncomingEvent ... -func (f *FakeEngagementRepository) SaveIncomingEvent( - ctx context.Context, - event *feedlib.Event, -) error { - return f.SaveIncomingEventFn(ctx, event) -} - -// SaveOutgoingEvent ... -func (f *FakeEngagementRepository) SaveOutgoingEvent( - ctx context.Context, - event *feedlib.Event, -) error { - return f.SaveOutgoingEventFn(ctx, event) -} - -// GetNudges ... -func (f *FakeEngagementRepository) GetNudges( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, -) ([]feedlib.Nudge, error) { - return f.GetNudgesFn(ctx, uid, flavour, status, visibility, expired) -} - -// GetActions ... -func (f *FakeEngagementRepository) GetActions( - ctx context.Context, - uid string, - flavour feedlib.Flavour, -) ([]feedlib.Action, error) { - return f.GetActionsFn(ctx, uid, flavour) -} - -// GetItems ... -func (f *FakeEngagementRepository) GetItems( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - persistent feedlib.BooleanFilter, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, - filterParams *helpers.FilterParams, -) ([]feedlib.Item, error) { - return f.GetItemsFn(ctx, uid, flavour, persistent, status, visibility, expired, filterParams) -} - -// Labels ... -func (f *FakeEngagementRepository) Labels( - ctx context.Context, - uid string, - flavour feedlib.Flavour, -) ([]string, error) { - return f.LabelsFn(ctx, uid, flavour) -} - -// SaveLabel ... -func (f *FakeEngagementRepository) SaveLabel( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - label string, -) error { - return f.SaveLabelFn(ctx, uid, flavour, label) -} - -// UnreadPersistentItems ... -func (f *FakeEngagementRepository) UnreadPersistentItems( - ctx context.Context, - uid string, - flavour feedlib.Flavour, -) (int, error) { - return f.UnreadPersistentItemsFn(ctx, uid, flavour) -} - -// UpdateUnreadPersistentItemsCount ... -func (f *FakeEngagementRepository) UpdateUnreadPersistentItemsCount( - ctx context.Context, - uid string, - flavour feedlib.Flavour, -) error { - return f.UpdateUnreadPersistentItemsCountFn(ctx, uid, flavour) -} - -// GetDefaultNudgeByTitle ... -func (f *FakeEngagementRepository) GetDefaultNudgeByTitle( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - title string, -) (*feedlib.Nudge, error) { - return f.GetDefaultNudgeByTitleFn(ctx, uid, flavour, title) -} - -// SaveTwilioResponse saves the callback data for future analysis -func (f *FakeEngagementRepository) SaveTwilioResponse( - ctx context.Context, - data dto.Message, -) error { - return f.SaveTwilioResponseFn(ctx, data) -} - -// SaveNotification saves a notification -func (f *FakeEngagementRepository) SaveNotification( - ctx context.Context, - firestoreClient *firestore.Client, - notification dto.SavedNotification, -) error { - return f.SaveNotificationFn(ctx, firestoreClient, notification) -} - -// RetrieveNotification retrieves a notification -func (f *FakeEngagementRepository) RetrieveNotification( - ctx context.Context, - firestoreClient *firestore.Client, - registrationToken string, - newerThan time.Time, - limit int, -) ([]*dto.SavedNotification, error) { - return f.RetrieveNotificationFn(ctx, firestoreClient, registrationToken, newerThan, limit) -} - -// SaveNPSResponse saves a NPS response -func (f *FakeEngagementRepository) SaveNPSResponse( - ctx context.Context, - response *dto.NPSResponse, -) error { - return f.SaveNPSResponseFn(ctx, response) -} - -// SaveOutgoingEmails ... -func (f *FakeEngagementRepository) SaveOutgoingEmails(ctx context.Context, payload *dto.OutgoingEmailsLog) error { - return f.SaveOutgoingEmailsFn(ctx, payload) -} - -// UpdateMailgunDeliveryStatus ... -func (f *FakeEngagementRepository) UpdateMailgunDeliveryStatus(ctx context.Context, payload *dto.MailgunEvent) (*dto.OutgoingEmailsLog, error) { - return f.UpdateMailgunDeliveryStatusFn(ctx, payload) -} diff --git a/pkg/engagement/repository/repository.go b/pkg/engagement/repository/repository.go deleted file mode 100644 index 8a12488b..00000000 --- a/pkg/engagement/repository/repository.go +++ /dev/null @@ -1,260 +0,0 @@ -package repository - -import ( - "context" - "time" - - "cloud.google.com/go/firestore" - "github.com/savannahghi/engagementcore/pkg/engagement/application/common/dto" - "github.com/savannahghi/engagementcore/pkg/engagement/application/common/helpers" - "github.com/savannahghi/engagementcore/pkg/engagement/domain" - "github.com/savannahghi/feedlib" -) - -// Repository is the interface to be implemented by the database(s) -// The method signatures are should be database independent -type Repository interface { - // getting a feed...create a default feed if it does not exist - // return: feed, matching count, total count, optional error - GetFeed( - ctx context.Context, - uid *string, - isAnonymous *bool, - flavour feedlib.Flavour, - playMP4 bool, - persistent feedlib.BooleanFilter, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, - filterParams *helpers.FilterParams, - ) (*domain.Feed, error) - - // getting a the LATEST VERSION of a feed item from a feed - GetFeedItem( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - ) (*feedlib.Item, error) - - // saving a new feed item - SaveFeedItem( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - item *feedlib.Item, - ) (*feedlib.Item, error) - - // updating an existing feed item - UpdateFeedItem( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - item *feedlib.Item, - ) (*feedlib.Item, error) - - // DeleteFeedItem permanently deletes a feed item and it's copies - DeleteFeedItem( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - ) error - - // getting THE LATEST VERSION OF a nudge from a feed - GetNudge( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudgeID string, - ) (*feedlib.Nudge, error) - - // saving a new modified nudge - SaveNudge( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudge *feedlib.Nudge, - ) (*feedlib.Nudge, error) - - // updating an existing nudge - UpdateNudge( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudge *feedlib.Nudge, - ) (*feedlib.Nudge, error) - - // DeleteNudge permanently deletes a nudge and it's copies - DeleteNudge( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - nudgeID string, - ) error - - // getting THE LATEST VERSION OF a single action - GetAction( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - actionID string, - ) (*feedlib.Action, error) - - // saving a new action - SaveAction( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - action *feedlib.Action, - ) (*feedlib.Action, error) - - // DeleteAction permanently deletes an action and it's copies - DeleteAction( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - actionID string, - ) error - - // PostMessage posts a message or a reply to a message/thread - PostMessage( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - message *feedlib.Message, - ) (*feedlib.Message, error) - - // GetMessage retrieves THE LATEST VERSION OF a message - GetMessage( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - messageID string, - ) (*feedlib.Message, error) - - // DeleteMessage deletes a message - DeleteMessage( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - messageID string, - ) error - - // GetMessages retrieves a message - GetMessages( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - itemID string, - ) ([]feedlib.Message, error) - - SaveIncomingEvent( - ctx context.Context, - event *feedlib.Event, - ) error - - SaveOutgoingEvent( - ctx context.Context, - event *feedlib.Event, - ) error - - GetNudges( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, - ) ([]feedlib.Nudge, error) - - GetActions( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - ) ([]feedlib.Action, error) - - GetItems( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - persistent feedlib.BooleanFilter, - status *feedlib.Status, - visibility *feedlib.Visibility, - expired *feedlib.BooleanFilter, - filterParams *helpers.FilterParams, - ) ([]feedlib.Item, error) - - Labels( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - ) ([]string, error) - - SaveLabel( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - label string, - ) error - - UnreadPersistentItems( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - ) (int, error) - - UpdateUnreadPersistentItemsCount( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - ) error - - GetDefaultNudgeByTitle( - ctx context.Context, - uid string, - flavour feedlib.Flavour, - title string, - ) (*feedlib.Nudge, error) - - SaveTwilioResponse( - ctx context.Context, - data dto.Message, - ) error - - SaveNotification( - ctx context.Context, - firestoreClient *firestore.Client, - notification dto.SavedNotification, - ) error - - RetrieveNotification( - ctx context.Context, - firestoreClient *firestore.Client, - registrationToken string, - newerThan time.Time, - limit int, - ) ([]*dto.SavedNotification, error) - - SaveNPSResponse( - ctx context.Context, - response *dto.NPSResponse, - ) error - - SaveOutgoingEmails( - ctx context.Context, - payload *dto.OutgoingEmailsLog, - ) error - UpdateMailgunDeliveryStatus( - ctx context.Context, - payload *dto.MailgunEvent, - ) (*dto.OutgoingEmailsLog, error) - - SaveTwilioVideoCallbackStatus( - ctx context.Context, - data dto.CallbackData, - ) error -}