-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
41 lines (35 loc) · 859 Bytes
/
types.go
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
package main
import (
"math/rand"
"time"
)
type CreateAccountRequest struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
}
type TransferRequest struct {
ToAccount int `json:"toAccount"`
Amount int `json:"amount"`
}
type Account struct {
Id int `json:"id"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Number int64 `json:"number"`
Balance int64 `json:"balance"`
CreatedAt time.Time `json:"createdAt"`
}
func NewAccount(firstName, lastName string) *Account {
return &Account{
FirstName: firstName,
LastName: lastName,
Number: rand.Int63n(10_000_000),
CreatedAt: time.Now().UTC(),
}
}
type DiscordUser struct {
Id string `json:"id"`
GlobalName string `json:"global_name"`
Avatar string `json:"avatar"`
LastSignIn time.Time
}