diff options
author | zberwaldt <17715430+zberwaldt@users.noreply.github.com> | 2024-03-15 22:03:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-15 22:03:11 -0400 |
commit | 6f8cfbd6cc3d5adbda38e74013c68e3d4745766d (patch) | |
tree | b3f045cd06d6622e23441b442e8f3861050ed444 /api/internal/models | |
parent | fac21fa0a72d4a7f1a01ccd44e3acf9c90fd95bd (diff) | |
parent | fd1332a3df191577e91c6d846a8b5db1747099fd (diff) |
Merge pull request #1 from zberwaldt/staging
Staging to Prod
Diffstat (limited to 'api/internal/models')
-rw-r--r-- | api/internal/models/auth.go | 11 | ||||
-rw-r--r-- | api/internal/models/preferences.go | 14 | ||||
-rw-r--r-- | api/internal/models/statistics.go | 26 | ||||
-rw-r--r-- | api/internal/models/user.go | 10 |
4 files changed, 61 insertions, 0 deletions
diff --git a/api/internal/models/auth.go b/api/internal/models/auth.go new file mode 100644 index 0000000..fa7dbe4 --- /dev/null +++ b/api/internal/models/auth.go | |||
@@ -0,0 +1,11 @@ | |||
1 | package models | ||
2 | |||
3 | import "time" | ||
4 | |||
5 | type Token struct { | ||
6 | ID int64 `json:"id"` | ||
7 | UserID int64 `json:"user_id"` | ||
8 | Token string `json:"token"` | ||
9 | CreatedAt time.Time `json:"created_at"` | ||
10 | ExpiredAt time.Time `json:"expired_at"` | ||
11 | } | ||
diff --git a/api/internal/models/preferences.go b/api/internal/models/preferences.go new file mode 100644 index 0000000..8022099 --- /dev/null +++ b/api/internal/models/preferences.go | |||
@@ -0,0 +1,14 @@ | |||
1 | package models | ||
2 | |||
3 | type Preference struct { | ||
4 | ID int64 `json:"id"` | ||
5 | Color string `json:"color"` | ||
6 | UserID int64 `json:"user_id"` | ||
7 | SizeID int64 `json:"size_id"` | ||
8 | } | ||
9 | |||
10 | type Size struct { | ||
11 | ID int64 `json:"id"` | ||
12 | Size int64 `json:"size"` | ||
13 | Unit string `json:"unit"` | ||
14 | } | ||
diff --git a/api/internal/models/statistics.go b/api/internal/models/statistics.go new file mode 100644 index 0000000..7dceb3a --- /dev/null +++ b/api/internal/models/statistics.go | |||
@@ -0,0 +1,26 @@ | |||
1 | package models | ||
2 | |||
3 | import "time" | ||
4 | |||
5 | type Statistic struct { | ||
6 | ID int64 `json:"id"` | ||
7 | Date time.Time `json:"date"` | ||
8 | User User `json:"user"` | ||
9 | Quantity int `json:"quantity"` | ||
10 | } | ||
11 | |||
12 | type StatisticPost struct { | ||
13 | Date time.Time `json:"date"` | ||
14 | Quantity int64 `json:"quantity"` | ||
15 | UserID int64 `json:"user_id"` | ||
16 | } | ||
17 | |||
18 | type WeeklyStatistic struct { | ||
19 | Date string `json:"date"` | ||
20 | Total int64 `json:"total"` | ||
21 | } | ||
22 | |||
23 | type DailyUserTotals struct { | ||
24 | Name string `json:"name"` | ||
25 | Total int64 `json:"total"` | ||
26 | } | ||
diff --git a/api/internal/models/user.go b/api/internal/models/user.go new file mode 100644 index 0000000..ca5daa4 --- /dev/null +++ b/api/internal/models/user.go | |||
@@ -0,0 +1,10 @@ | |||
1 | package models | ||
2 | |||
3 | import "github.com/google/uuid" | ||
4 | |||
5 | type User struct { | ||
6 | ID int64 `json:"id"` | ||
7 | Name string `json:"name"` | ||
8 | UUID uuid.UUID `json:"uuid"` | ||
9 | Password string `json:"-"` | ||
10 | } | ||