Files
chat/internal/models/channel.go
clawbot 5e9be8ccaf Add models package with embedded DB interface pattern
- internal/models/model.go: DB interface + Base struct for all models
- internal/models/channel.go: Channel model with DB access for relation queries
- Database.NewChannel() factory injects db reference into model instances
- Uses interface to avoid circular imports (models -> db)
2026-02-09 12:24:23 -08:00

22 lines
531 B
Go

package models
import (
"time"
)
// Channel represents a chat channel.
type Channel struct {
Base
ID int64 `json:"id"`
Name string `json:"name"`
Topic string `json:"topic"`
Modes string `json:"modes"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// Example relation method — will be fleshed out when we add channel_members:
// func (c *Channel) Members(ctx context.Context) ([]*User, error) {
// return c.DB().GetChannelMembers(ctx, c.ID)
// }