coralproject / pillar

Deprecated: Service layer for the Coral ecosystem
Other
4 stars 1 forks source link

Create users on actions #100

Closed gabelula closed 8 years ago

gabelula commented 8 years ago

Expected behavior

We want users to be created when they comment or like or flag a comment.

Actual behavior

We are only creating the users that comment.

samshub commented 8 years ago

@gabelula, Send an example of how this might look like. Is there an ID for this user?

samshub commented 8 years ago

As per our talks, here is how we might accomplish a generic "add user if doesn't exist" paradigm in the system.

type ImportSource struct {
    ID       string `json:"id,omitempty" bson:"id,omitempty"`
    UserID   string `json:"user_id,omitempty" bson:"user_id,omitempty"`
    TargetID string `json:"target_id,omitempty" bson:"target_id,omitempty"`
    AssetID  string `json:"asset_id,omitempty" bson:"asset_id,omitempty"`
    ParentID string `json:"parent_id,omitempty" bson:"parent_id,omitempty"`
    User     User   `json:"user,omitempty" bson:"user,omitempty"`
}

Introduce a new field User in ImportSource. This will take care of all use-cases of adding users to the system through various import APIs.

gabelula commented 8 years ago

This is a very good option because we can use this in everything where we have an ImportSource, for example the comments.

samshub commented 8 years ago

Resolved - See #102