Ignore wallet gift events in dashboard metrics
This commit is contained in:
parent
c02d057c80
commit
071daba7a5
@ -19,7 +19,7 @@ var walletGameEvents = map[string]struct{}{
|
||||
func (m *Mapper) mapWalletGame(ctx context.Context, schema string, table string, action string, row Row) ([]Contribution, error) {
|
||||
eventType := row.String("event_type")
|
||||
if isWalletGiftConsumeEvent(eventType) {
|
||||
return m.mapWalletGift(ctx, schema, table, action, row)
|
||||
return nil, nil
|
||||
}
|
||||
if !isWalletGameEvent(eventType) {
|
||||
return nil, nil
|
||||
|
||||
@ -73,7 +73,7 @@ func TestWalletLuckyGiftIsNotMappedAsGiftConsume(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWalletGiveGiftIsMappedAsGiftConsume(t *testing.T) {
|
||||
func TestWalletGiveGiftIsNotMappedAsGiftConsume(t *testing.T) {
|
||||
mapper := NewMapper(walletMapperTestStore{users: map[int64]UserCountry{
|
||||
1001: {UserID: 1001, SysOrigin: "LIKEI", Country: Country{Code: "BD", Name: "Bangladesh"}},
|
||||
}}, []string{"LIKEI"}, "UNKNOWN", 0)
|
||||
@ -92,11 +92,8 @@ func TestWalletGiveGiftIsMappedAsGiftConsume(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(contributions) != 1 {
|
||||
t.Fatalf("expected one gift contribution, got %d", len(contributions))
|
||||
}
|
||||
if !contributions[0].GiftConsume.Equal(decimal.NewFromInt(100)) {
|
||||
t.Fatalf("expected gift consume 100, got %s", contributions[0].GiftConsume.String())
|
||||
if len(contributions) != 0 {
|
||||
t.Fatalf("expected wallet GIVE_GIFT to be ignored, got %#v", contributions)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user