Files
uPortal2/backend/internal/invite/model.go
T
2026-10-21 19:41:26 +03:00

18 lines
251 B
Go

package invite
import (
"time"
)
type Invite struct {
Token string
Quota int
Uses int
ExpiresAt time.Time
CreatedAt time.Time
}
func (i *Invite) IsValid() bool {
return time.Now().UTC().Before(i.ExpiresAt) || i.Uses < i.Quota
}