summaryrefslogtreecommitdiffstats
path: root/internal/models/admin.go
blob: ee551f31d305fadb7a505b551ac257fabc954577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package models

type Account struct {
	ID                 int         `json:"id"`
	APIKey             string      `json:"api_key"`
	Name               string      `json:"name"`
	Credits            int         `json:"credits"`
	Unlimited          bool        `json:"unlimited"`
	Disabled           bool        `json:"disabled"`
	IsPremium          bool        `json:"is_premium"`
	IsAdmin            bool        `json:"is_admin"`
	PremiumDiscountPct int         `json:"premium_discount_pct,omitempty"`
	CreatedAt          interface{} `json:"created_at,omitempty"`
}

type AccountCreateRequest struct {
	Name      string `json:"name"`
	Credits   int    `json:"credits,omitempty"`
	Unlimited bool   `json:"unlimited,omitempty"`
	IsPremium bool   `json:"is_premium,omitempty"`
}

type AccountUpdateRequest struct {
	Credits  int  `json:"credits,omitempty"`
	Disabled bool `json:"disabled"`
}

type AddCreditsRequest struct {
	Credits int `json:"credits"`
}

type SetCreditsRequest struct {
	Credits int `json:"credits"`
}

type DisableAccountRequest struct {
	Disabled bool `json:"disabled"`
}

type AccountStatsResponse struct {
	Success       bool           `json:"success,omitempty"`
	Message       string         `json:"message,omitempty"`
	Error         string         `json:"error,omitempty"`
	Account       *Account       `json:"account,omitempty"`
	UsageStats    map[string]int `json:"usage_stats,omitempty"`
	TotalRequests int            `json:"total_requests,omitempty"`
	CreditsUsed   int            `json:"credits_used,omitempty"`
}

type AdminResponse struct {
	Success  bool      `json:"success,omitempty"`
	Message  string    `json:"message,omitempty"`
	Error    string    `json:"error,omitempty"`
	Account  *Account  `json:"account,omitempty"`
	Accounts []Account `json:"accounts,omitempty"`
}