mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:27:31 +00:00
fix(eventstore): use decimal, correct mirror (#9906)
back port #9812, #9878, #9881, #9884 --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"database/sql"
|
||||
"time"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/zerrors"
|
||||
)
|
||||
@@ -26,7 +28,7 @@ type SearchQueryBuilder struct {
|
||||
lockRows bool
|
||||
lockOption LockOption
|
||||
allowTimeTravel bool
|
||||
positionAfter float64
|
||||
positionAtLeast decimal.Decimal
|
||||
awaitOpenTransactions bool
|
||||
creationDateAfter time.Time
|
||||
creationDateBefore time.Time
|
||||
@@ -81,8 +83,8 @@ func (b *SearchQueryBuilder) GetAllowTimeTravel() bool {
|
||||
return b.allowTimeTravel
|
||||
}
|
||||
|
||||
func (b SearchQueryBuilder) GetPositionAfter() float64 {
|
||||
return b.positionAfter
|
||||
func (b SearchQueryBuilder) GetPositionAtLeast() decimal.Decimal {
|
||||
return b.positionAtLeast
|
||||
}
|
||||
|
||||
func (b SearchQueryBuilder) GetAwaitOpenTransactions() bool {
|
||||
@@ -118,7 +120,7 @@ type SearchQuery struct {
|
||||
aggregateIDs []string
|
||||
eventTypes []EventType
|
||||
eventData map[string]interface{}
|
||||
positionAfter float64
|
||||
positionAfter decimal.Decimal
|
||||
}
|
||||
|
||||
func (q SearchQuery) GetAggregateTypes() []AggregateType {
|
||||
@@ -137,7 +139,7 @@ func (q SearchQuery) GetEventData() map[string]interface{} {
|
||||
return q.eventData
|
||||
}
|
||||
|
||||
func (q SearchQuery) GetPositionAfter() float64 {
|
||||
func (q SearchQuery) GetPositionAfter() decimal.Decimal {
|
||||
return q.positionAfter
|
||||
}
|
||||
|
||||
@@ -161,8 +163,8 @@ type Columns int8
|
||||
const (
|
||||
//ColumnsEvent represents all fields of an event
|
||||
ColumnsEvent = iota + 1
|
||||
// ColumnsMaxSequence represents the latest sequence of the filtered events
|
||||
ColumnsMaxSequence
|
||||
// ColumnsMaxPosition represents the latest sequence of the filtered events
|
||||
ColumnsMaxPosition
|
||||
// ColumnsInstanceIDs represents the instance ids of the filtered events
|
||||
ColumnsInstanceIDs
|
||||
|
||||
@@ -296,9 +298,9 @@ func (builder *SearchQueryBuilder) AllowTimeTravel() *SearchQueryBuilder {
|
||||
return builder
|
||||
}
|
||||
|
||||
// PositionAfter filters for events which happened after the specified time
|
||||
func (builder *SearchQueryBuilder) PositionAfter(position float64) *SearchQueryBuilder {
|
||||
builder.positionAfter = position
|
||||
// PositionAtLeast filters for events which happened after the specified time
|
||||
func (builder *SearchQueryBuilder) PositionAtLeast(position decimal.Decimal) *SearchQueryBuilder {
|
||||
builder.positionAtLeast = position
|
||||
return builder
|
||||
}
|
||||
|
||||
@@ -405,7 +407,7 @@ func (query *SearchQuery) EventData(data map[string]interface{}) *SearchQuery {
|
||||
return query
|
||||
}
|
||||
|
||||
func (query *SearchQuery) PositionAfter(position float64) *SearchQuery {
|
||||
func (query *SearchQuery) PositionAfter(position decimal.Decimal) *SearchQuery {
|
||||
query.positionAfter = position
|
||||
return query
|
||||
}
|
||||
|
Reference in New Issue
Block a user