Documentation ¶
Index ¶
- func AddUserToStore(user models.User, storeID interface{}) (su models.StoreUser, err error)
- func AddUserToStoreWithCode(user models.User, code string, appScheme string) (su models.StoreUser, err error)
- func CreateStore(userID uuid.UUID, name string) (models.Store, error)
- func DeleteStore(storeID interface{}, userID uuid.UUID) (deletedStore models.Store, err error)
- func InviteToStoreByEmail(storeID interface{}, invitedEmail string) (storeUser models.StoreUser, err error)
- func RemoveStapleItem(itemID uuid.UUID) (staple models.StoreStapleItem, err error)
- func RemoveUserFromStore(user models.User, storeID interface{}) (interface{}, error)
- func RetrieveInvitedUserStores(user models.User) (stores []models.Store, err error)
- func RetrieveStoreCreator(storeID uuid.UUID) (interface{}, error)
- func RetrieveStoreForUser(storeID interface{}, userID uuid.UUID) (store models.Store, err error)
- func RetrieveStoreForUserByName(name string, userID uuid.UUID) (models.Store, error)
- func RetrieveStoreUserID(storeID interface{}, userID uuid.UUID) (storeUserID uuid.UUID, err error)
- func RetrieveStoreUserPrefs(storeUserID uuid.UUID) (sup models.StoreUserPreference, err error)
- func RetrieveStoreUsers(storeID uuid.UUID) (storeUsers []models.StoreUser, err error)
- func RetrieveUserStores(user models.User) (stores []models.Store, err error)
- func SaveStapleItem(storeID uuid.UUID, itemID uuid.UUID) (staple models.StoreStapleItem, err error)
- func UpdateStoreForUser(userID uuid.UUID, args map[string]interface{}) (interface{}, error)
- func UpdateStoreUserPrefs(storeUserID uuid.UUID, args map[string]interface{}) (sup models.StoreUserPreference, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUserToStore ¶
DEPRECATED AddUserToStore properly associates a user with a store by userID by removing the email value and adding the userID value
func AddUserToStoreWithCode ¶
func CreateStore ¶
CreateStore creates a store for a user if it does not already exist by name
func DeleteStore ¶
DeleteStore handles deletion of a store record Note: Associated trips, items, store users etc. are deleted in the AfterDelete hook on the model
func InviteToStoreByEmail ¶
func InviteToStoreByEmail(storeID interface{}, invitedEmail string) (storeUser models.StoreUser, err error)
InviteToStoreByEmail creates a store_users record for this store ID and email
The store user will be considered pending until the invitation is accepted by the user in the app, at which point they are associated by userID instead.
func RemoveStapleItem ¶
func RemoveStapleItem(itemID uuid.UUID) (staple models.StoreStapleItem, err error)
RemoveStapleItem dissocates any staple_item_id from items for this staple item and deletes the staple item
func RemoveUserFromStore ¶
RemoveUserFromStore removes a user from a store either by userID or email, whichever is present
Used for declining a store invite, and simply removing a user from a store
func RetrieveInvitedUserStores ¶
RetrieveInvitedUserStores retrieves stores that the userID has created or has been added to
func RetrieveStoreCreator ¶
RetrieveStoreCreator returns the store user who created a given store
func RetrieveStoreForUser ¶
RetrieveStoreForUser retrieves a specific store by storeID and userID
func RetrieveStoreForUserByName ¶
RetrieveStoreForUserByName retrieves a specific store by name and userID. It is used in resolvers.CreateStoreResolver to determine whether a store with a given name already exists in the user's account, to avoid duplicates.
func RetrieveStoreUserID ¶
RetrieveStoreUserID retrieves the ID of the store_users record associated with a storeID and userID
func RetrieveStoreUserPrefs ¶
func RetrieveStoreUserPrefs(storeUserID uuid.UUID) (sup models.StoreUserPreference, err error)
RetrieveStoreUserPrefs updates store user preferences
func RetrieveStoreUsers ¶
RetrieveStoreUsers finds all store users in a store by storeID
func RetrieveUserStores ¶
RetrieveUserStores retrieves stores that the userID has created or has been added to
func SaveStapleItem ¶
SaveStapleItem saves an item as a staple in the store ID provided
func UpdateStoreForUser ¶
UpdateStoreForUser updates a store for the given userID with the provided args
func UpdateStoreUserPrefs ¶
func UpdateStoreUserPrefs(storeUserID uuid.UUID, args map[string]interface{}) (sup models.StoreUserPreference, err error)
UpdateStoreUserPrefs updates store user preferences
Types ¶
This section is empty.