2020-05-20 14:28:08 +02:00
|
|
|
package view
|
|
|
|
|
|
|
|
import (
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
|
|
|
"github.com/zitadel/zitadel/internal/view/repository"
|
2020-05-20 14:28:08 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
notificationTable = "notification.notifications"
|
|
|
|
)
|
|
|
|
|
2022-04-19 08:26:12 +02:00
|
|
|
func (v *View) GetLatestNotificationSequence(instanceID string) (*repository.CurrentSequence, error) {
|
|
|
|
return v.latestSequence(notificationTable, instanceID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *View) GetLatestNotificationSequences() ([]*repository.CurrentSequence, error) {
|
|
|
|
return v.latestSequences(notificationTable)
|
2020-05-20 14:28:08 +02:00
|
|
|
}
|
|
|
|
|
2020-12-18 16:47:45 +01:00
|
|
|
func (v *View) ProcessedNotificationSequence(event *models.Event) error {
|
|
|
|
return v.saveCurrentSequence(notificationTable, event)
|
2020-12-02 08:50:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *View) UpdateNotificationSpoolerRunTimestamp() error {
|
|
|
|
return v.updateSpoolerRunSequence(notificationTable)
|
2020-05-20 14:28:08 +02:00
|
|
|
}
|
|
|
|
|
2022-04-19 08:26:12 +02:00
|
|
|
func (v *View) GetLatestNotificationFailedEvent(sequence uint64, instanceID string) (*repository.FailedEvent, error) {
|
|
|
|
return v.latestFailedEvent(notificationTable, instanceID, sequence)
|
2020-05-20 14:28:08 +02:00
|
|
|
}
|
|
|
|
|
2020-06-25 08:01:13 +02:00
|
|
|
func (v *View) ProcessedNotificationFailedEvent(failedEvent *repository.FailedEvent) error {
|
2020-05-20 14:28:08 +02:00
|
|
|
return v.saveFailedEvent(failedEvent)
|
|
|
|
}
|