package domain import ( "errors" ) type Entity interface { Identifiable Validate() error } type entity struct { ID ID `json:"id" jsonapi:"primary,entities"` } func (s *entity) GetID() ID { return s.ID } func (s *entity) SetID(id ID) error { s.ID = id return nil } func (s *entity) Validate() error { return errors.New("method Validate not implemented") } func (s *entity) ToGID() GlobalID { return GlobalID("gid://sparkle/Entity/" + s.ID.String()) }