package chat import ( "context" "errors" "gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain" ) var ( ErrUsernameTaken = errors.New("username is already taken") ErrUserNotFound = errors.New("user not found") ErrChatNotFound = errors.New("chat not found") ErrNotMember = errors.New("user is not a chat member") ) // Repository is the persistence port required by the chat use case. type Repository interface { CreateUser(ctx context.Context, username, displayName string) (domain.User, error) User(ctx context.Context, id string) (domain.User, bool, error) CreateChat(ctx context.Context, title string, memberIDs []string) (domain.Chat, error) ChatForUser(ctx context.Context, chatID, userID string) (domain.Chat, error) ListChats(ctx context.Context, userID string, after *domain.Position, limit int) ([]domain.Chat, error) CreateMessage(ctx context.Context, chatID, senderID, text string) (domain.Message, error) ListMessages(ctx context.Context, chatID string, after *domain.Position, limit int) ([]domain.Message, error) }