removed 'internal' directory
This commit is contained in:
parent
8c200a5a6c
commit
65709049d7
42 changed files with 35 additions and 44 deletions
8
models/auth.go
Normal file
8
models/auth.go
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type Token struct {
|
||||
User string
|
||||
Expiration time.Time
|
||||
}
|
||||
37
models/data.go
Normal file
37
models/data.go
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type Cake struct {
|
||||
Name string
|
||||
ID int
|
||||
Price int
|
||||
Amount int
|
||||
Category string
|
||||
Availability string
|
||||
}
|
||||
|
||||
type Order struct {
|
||||
ID int
|
||||
Name string
|
||||
Surname string
|
||||
Phone string
|
||||
Location string
|
||||
Date time.Time
|
||||
Accepted time.Time
|
||||
Status string
|
||||
Paid int // increments of 0.01
|
||||
Cakes []Cake
|
||||
}
|
||||
|
||||
func (o *Order) Total() int {
|
||||
out := o.Paid * (-1)
|
||||
for _, e := range o.Cakes {
|
||||
out += e.Price * e.Amount
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func (c *Cake) Total() int {
|
||||
return c.Amount * c.Price
|
||||
}
|
||||
6
models/user.go
Normal file
6
models/user.go
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
package models
|
||||
|
||||
type User struct {
|
||||
Password string
|
||||
Salt string
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue