feat: handle instanceID in projections (#3442)

* feat: handle instanceID in projections

* rename functions

* fix key lock

* fix import
This commit is contained in:
Livio Amstutz
2022-04-19 08:26:12 +02:00
committed by GitHub
parent c25d853820
commit 1305c14e49
120 changed files with 2078 additions and 1209 deletions

View File

@@ -11,8 +11,8 @@ const (
stylingTyble = "adminapi.styling"
)
func (v *View) StylingByAggregateIDAndState(aggregateID string, state int32) (*model.LabelPolicyView, error) {
return view.GetStylingByAggregateIDAndState(v.Db, stylingTyble, aggregateID, state)
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 {
@@ -23,8 +23,12 @@ func (v *View) PutStyling(policy *model.LabelPolicyView, event *models.Event) er
return v.ProcessedStylingSequence(event)
}
func (v *View) GetLatestStylingSequence() (*global_view.CurrentSequence, error) {
return v.latestSequence(stylingTyble)
func (v *View) GetLatestStylingSequence(instanceID string) (*global_view.CurrentSequence, error) {
return v.latestSequence(stylingTyble, instanceID)
}
func (v *View) GetLatestStylingSequences() ([]*global_view.CurrentSequence, error) {
return v.latestSequences(stylingTyble)
}
func (v *View) ProcessedStylingSequence(event *models.Event) error {
@@ -35,8 +39,8 @@ func (v *View) UpdateStylingSpoolerRunTimestamp() error {
return v.updateSpoolerRunSequence(stylingTyble)
}
func (v *View) GetLatestStylingFailedEvent(sequence uint64) (*global_view.FailedEvent, error) {
return v.latestFailedEvent(stylingTyble, sequence)
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 {