-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
38 lines (34 loc) · 1.5 KB
/
models.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
package main
import (
"github.com/SnoozeHub/snoozehub-backend/grpc_gen"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type account struct {
Id primitive.ObjectID `bson:"_id"`
PublicKey string `bson:"publicKey"`
Name string `bson:"name"`
Mail string `bson:"mail"`
TelegramUsername string `bson:"telegramUsername"`
ProfilePic []byte `bson:"profilePic"`
VerificationCode *string `bson:"verificationCode"` // If doesn't exist, the account is verified
BedIdBookings []primitive.ObjectID `bson:"bedIdBookings"`
}
type review struct {
Reviewer primitive.ObjectID `bson:"reviewer"`
Evaluation int32 `bson:"evaluation"`
Comment string `bson:"comment"`
}
type bed struct {
Id primitive.ObjectID `bson:"_id"`
Host primitive.ObjectID `bson:"host"`
Address string `bson:"address"`
Latitude float64 `bson:"latitude"`
Longitude float64 `bson:"longitude"`
Images [][]byte `bson:"images"`
Description string `bson:"description"`
Features []grpc_gen.Feature `bson:"features"`
MinimumDaysNotice int32 `bson:"minimumDaysNotice"`
DateAvailables []int32 `bson:"dateAvailables"`
AverageEvaluation *int32 `bson:"averageEvaluation"`
Reviews []review `bson:"reviews"`
}