set up unfonctionnal rework, TODO -> pricing separation
This commit is contained in:
@@ -27,13 +27,15 @@ const (
|
||||
* every data in base root model should inherit from this struct (only exception is the ResourceModel)
|
||||
*/
|
||||
type AbstractObject struct {
|
||||
UUID string `json:"id,omitempty" bson:"id,omitempty" validate:"required"`
|
||||
Name string `json:"name,omitempty" bson:"name,omitempty" validate:"required"`
|
||||
IsDraft bool `json:"is_draft" bson:"is_draft" default:"false"`
|
||||
UpdateDate time.Time `json:"update_date" bson:"update_date"`
|
||||
LastPeerWriter string `json:"last_peer_writer" bson:"last_peer_writer"`
|
||||
CreatorID string `json:"creator_id" bson:"creator_id" default:"unknown"`
|
||||
AccessMode AccessMode `json:"access_mode" bson:"access_mode" default:"0"`
|
||||
UUID string `json:"id,omitempty" bson:"id,omitempty" validate:"required"`
|
||||
Name string `json:"name,omitempty" bson:"name,omitempty" validate:"required"`
|
||||
IsDraft bool `json:"is_draft" bson:"is_draft" default:"false"`
|
||||
CreatorID string `json:"creator_id" bson:"creator_id" default:"unknown"`
|
||||
|
||||
CreationDate time.Time `json:"creation_date" bson:"creation_date"`
|
||||
UpdateDate time.Time `json:"update_date" bson:"update_date"`
|
||||
UpdaterID string `json:"updater_id" bson:"updater_id"`
|
||||
AccessMode AccessMode `json:"access_mode" bson:"access_mode" default:"0"`
|
||||
}
|
||||
|
||||
func (r *AbstractObject) GenerateID() {
|
||||
@@ -70,8 +72,9 @@ func (ao AbstractObject) GetName() string {
|
||||
|
||||
func (ao *AbstractObject) UpToDate(user string, create bool) {
|
||||
ao.UpdateDate = time.Now()
|
||||
ao.LastPeerWriter = user
|
||||
ao.UpdaterID = user
|
||||
if create {
|
||||
ao.CreationDate = time.Now()
|
||||
ao.CreatorID = user
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user