package domain import "github.com/xlgmokha/x/pkg/x" type User struct { ID ID `json:"id" jsonapi:"primary,users"` Username string `json:"username" jsonapi:"attr,username"` ProfileURL string `json:"profile" jsonapi:"attr,profile"` Picture string `json:"picture" jsonapi:"attr,picture"` } func NewUser(options ...x.Configure[*User]) *User { return New[*User](options...) } func (u *User) GetID() ID { return u.ID } func (u *User) SetID(id ID) error { u.ID = id return nil } func (u *User) Validate() error { return nil } func (self *User) Sparkle(sparklee string, reason string) *Sparkle { return &Sparkle{ Sparklee: sparklee, Author: self, Reason: reason, } } func (self *User) ToGID() string { return "gid://sparkle/User/" + self.ID.String() }