Skip to content

Commit

Permalink
Merge pull request #99 from pinpt/GOLD-30
Browse files Browse the repository at this point in the history
GOLD-30 add partial model interface😀
  • Loading branch information
Robin Diddams authored Jul 3, 2020
2 parents 5c9a509 + d0096da commit cb348ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions datamodel/datamodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,13 @@ type ModelSendEvent interface {
// Timestamp returns the event timestamp. If empty, will default to time.Now()
Timestamp() time.Time
}

// PartialModel is a generic model interface that all our models implement
type PartialModel interface {
// Stringfy converts the instance to JSON string
Stringify() string
// ToMap converts the instance to a map
ToMap() map[string]interface{}
// GetModelName returns the name of the model
GetModelName() ModelNameType
}

0 comments on commit cb348ee

Please sign in to comment.