aboutsummaryrefslogtreecommitdiff
path: root/api/models.go
blob: 0845d1dfb69a558378e1e451dd7277ae3f267c0d (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
57
package main

import (
    "time"
    "github.com/google/uuid"
)

type Statistic struct {
    ID int64 `json:"-"`
    Date time.Time `json:"date"`
    User User `json:"user"`
    Quantity int `json:"quantity"`
}

type StatisticPost struct {
    Date time.Time `json:"date"`
    Quantity int64 `json:"quantity"`
    UserID int64 `json:"user_id"`
}

type User struct {
    ID int64 `json:"-"`
    Name string `json:"name"`
    UUID uuid.UUID `json:"uuid"`
    Password string `json:"-"`
}

type Token struct {
    ID int64 `json:"-"`
    UserID int64 `json:"user_id"`
    Token string `json:"token"`
    CreatedAt time.Time `json:"created_at"`
    ExpiredAt time.Time `json:"expired_at"`
}

type Preference struct {
    ID int64 `json:"-"`
    Color string `json:"color"`
    UserID int64 `json:"-"`
    Size Size `json:"size"`
}

type Size struct {
    ID int64 `json:"-"`
    Size int64 `json:"size"`
    Unit string `json:"unit"`
}

type WeeklyStatistic struct {
    Date string `json:"date"`
    Total int64 `json:"total"`
}

type DailyUserTotals struct {
    Name string `json:"name"`
    Total int64 `json:"total"`
}