Limit work

This commit is contained in:
binwiederhier 2022-12-18 14:35:05 -05:00
parent 56ab34a57f
commit 42e46a7c22
9 changed files with 114 additions and 62 deletions

View file

@ -64,7 +64,7 @@ type User struct {
Role Role
Grants []Grant
Prefs *UserPrefs
Plan *UserPlan
Plan *Plan
}
type UserPrefs struct {
@ -73,9 +73,18 @@ type UserPrefs struct {
Subscriptions []*UserSubscription `json:"subscriptions,omitempty"`
}
type UserPlan struct {
Name string `json:"name"`
MessagesLimit int `json:"messages_limit"`
type PlanCode string
const (
PlanUnlimited = PlanCode("unlimited")
PlanDefault = PlanCode("default")
PlanNone = PlanCode("none")
)
type Plan struct {
Code string `json:"name"`
Upgradable bool `json:"upgradable"`
RequestLimit int `json:"request_limit"`
EmailsLimit int `json:"emails_limit"`
AttachmentBytesLimit int64 `json:"attachment_bytes_limit"`
}