26 lines
361 B
Go
26 lines
361 B
Go
package domain
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Message struct {
|
|
ID uuid.UUID
|
|
ChatID uuid.UUID
|
|
SenderID uuid.UUID
|
|
Text string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type MessageDraft struct {
|
|
ChatID uuid.UUID
|
|
SenderID uuid.UUID
|
|
Text string
|
|
}
|
|
|
|
func (d MessageDraft) Validate() error {
|
|
return validateNotBlank("text", d.Text)
|
|
}
|