package storage import "time" // GardenInviteModelInterface persists pending garden invitations. type GardenInviteModelInterface interface { Upsert(invite GardenInvite) (GardenInvite, error) GetByToken(tokenPlaintext string) (GardenInvite, error) GetAllForGarden(gardenID int) ([]GardenInvite, error) Delete(gardenID, inviteID int) error Accept(tokenPlaintext string, user User) (GardenMember, error) } // GardenInvite grants a user identified by email a garden role. type GardenInvite struct { ID int `json:"id"` GardenID int `json:"garden_id"` Email string `json:"email"` Role GardenRole `json:"role"` Token string `json:"token,omitempty"` InvitedBy int `json:"invited_by"` ExpiresAt time.Time `json:"expires_at"` AcceptedAt *time.Time `json:"accepted_at,omitempty"` CreatedAt time.Time `json:"created_at"` }