feat: list repository now supports managing users for lists, adding and updating list items
This commit is contained in:
@@ -13,8 +13,21 @@ type List struct {
|
||||
ModifiedAt time.Time `json:"modified_at"`
|
||||
}
|
||||
|
||||
type ListItem struct {
|
||||
ID string `json:"id"`
|
||||
ListID string `json:"list_id"`
|
||||
Title string `json:"title"`
|
||||
IsCompleted bool `json:"is_completed"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ModifiedAt time.Time `json:"modified_at"`
|
||||
}
|
||||
|
||||
type ListRepository interface {
|
||||
CreateList(ctx context.Context, name string, userIDs []string) (*List, error)
|
||||
AddUserToList(ctx context.Context, listID string, userID string) error
|
||||
RemoveUserFromList(ctx context.Context, listID string, userID string) error
|
||||
AddListItem(ctx context.Context, listID string, title string) (*ListItem, error)
|
||||
UpdateListItem(ctx context.Context, listItemID string, title string, isCompleted bool) error
|
||||
}
|
||||
|
||||
type ListService struct {
|
||||
|
||||
Reference in New Issue
Block a user