mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-17 05:18:04 +00:00
aed7010508
* fix: improve scheduling * build pre-release * fix: locker * fix: user handler and print stack in case of panic in reducer * chore: remove sentry * fix: improve handler projection and implement tests * more tests * fix: race condition in tests * Update internal/eventstore/repository/sql/query.go Co-authored-by: Silvan <silvan.reusser@gmail.com> * fix: implemented suggested changes * fix: lock statement Co-authored-by: Silvan <silvan.reusser@gmail.com>
49 lines
1.6 KiB
Go
49 lines
1.6 KiB
Go
package view
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
|
"github.com/zitadel/zitadel/internal/iam/repository/view"
|
|
"github.com/zitadel/zitadel/internal/iam/repository/view/model"
|
|
global_view "github.com/zitadel/zitadel/internal/view/repository"
|
|
)
|
|
|
|
const (
|
|
stylingTyble = "adminapi.styling"
|
|
)
|
|
|
|
func (v *View) StylingByAggregateIDAndState(aggregateID, instanceID string, state int32) (*model.LabelPolicyView, error) {
|
|
return view.GetStylingByAggregateIDAndState(v.Db, stylingTyble, aggregateID, instanceID, state)
|
|
}
|
|
|
|
func (v *View) PutStyling(policy *model.LabelPolicyView, event *models.Event) error {
|
|
err := view.PutStyling(v.Db, stylingTyble, policy)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return v.ProcessedStylingSequence(event)
|
|
}
|
|
|
|
func (v *View) GetLatestStylingSequence(instanceID string) (*global_view.CurrentSequence, error) {
|
|
return v.latestSequence(stylingTyble, instanceID)
|
|
}
|
|
|
|
func (v *View) GetLatestStylingSequences(instanceIDs ...string) ([]*global_view.CurrentSequence, error) {
|
|
return v.latestSequences(stylingTyble, instanceIDs...)
|
|
}
|
|
|
|
func (v *View) ProcessedStylingSequence(event *models.Event) error {
|
|
return v.saveCurrentSequence(stylingTyble, event)
|
|
}
|
|
|
|
func (v *View) UpdateStylingSpoolerRunTimestamp() error {
|
|
return v.updateSpoolerRunSequence(stylingTyble)
|
|
}
|
|
|
|
func (v *View) GetLatestStylingFailedEvent(sequence uint64, instanceID string) (*global_view.FailedEvent, error) {
|
|
return v.latestFailedEvent(stylingTyble, instanceID, sequence)
|
|
}
|
|
|
|
func (v *View) ProcessedStylingFailedEvent(failedEvent *global_view.FailedEvent) error {
|
|
return v.saveFailedEvent(failedEvent)
|
|
}
|