vegapokerbot/internal/handler/iface/repositories.go

31 lines
858 B
Go

package iface
import "gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/db/model"
type Repositories interface {
ForUser() UserRepository
ForChat() ChatRepository
ForIntegration() IntegrationRepository
}
type UserRepository interface {
ByID(id uint64) (*model.User, error)
ByTelegramID(id int64) (*model.User, error)
ByTelegramIDs(ids []int64) ([]model.User, error)
Save(user *model.User) error
}
type ChatRepository interface {
ByID(id uint64) (*model.Chat, error)
ByTelegramID(id int64) (*model.Chat, error)
ByTelegramIDWithIntegrations(id int64) (*model.Chat, error)
Save(chat *model.Chat) error
Delete(chat *model.Chat) error
}
type IntegrationRepository interface {
LoadForChatAndType(chatID uint64, typ model.IntegrationType) (*model.Integration, error)
Save(integration *model.Integration) error
DeleteForChat(id uint64) error
}