30 lines
768 B
Go
30 lines
768 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 {
|
|
Save(integration *model.Integration) error
|
|
DeleteForChat(id uint64) error
|
|
}
|