Initial commit
CI / test (push) Canceled after 0s

This commit is contained in:
2026-09-12 22:22:17 +02:00
commit 904d14b64c
314 changed files with 31884 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
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"`
}