2024-05-09 20:48:59 +03:00
|
|
|
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 {
|
2024-05-09 23:26:21 +03:00
|
|
|
LoadForChatAndType(chatID uint64, typ model.IntegrationType) (*model.Integration, error)
|
2024-05-09 20:48:59 +03:00
|
|
|
Save(integration *model.Integration) error
|
|
|
|
DeleteForChat(id uint64) error
|
|
|
|
}
|