This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mv.go
82 lines (75 loc) · 5.04 KB
/
mv.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package models
import "go.mongodb.org/mongo-driver/bson/primitive"
// Model for the ballot box object
type MVBox struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Number int64 `json:"number" bson:"number"` // 1001
City string `json:"city" bson:"city"` // Ankara
CityNumber int64 `json:"citynumber" bson:"citynumber"` // 6
Constituency string `json:"constituency" bson:"constituency"` // Ankara-1
District string `json:"district" bson:"district"` // Çankaya
Quarter string `json:"quarter" bson:"quarter"` // Çukurambar
Candidates []MVCandidateInBox `json:"candidates" bson:"candidates"`
EligibleVoters int64 `json:"eligiblevoters" bson:"eligiblevoters"` // 12621
ActualVoters int64 `json:"actualvoters" bson:"actualvoters"` // 10262
ValidVotes int64 `json:"validvotes" bson:"validvotes"` // 10101
InvalidVotes int64 `json:"invalidvotes" bson:"invalidvotes"` // 161
SST string `json:"sst" bson:"sst"` // 24923948264 (Static File Storage Microservice)
SDC string `json:"sdc" bson:"sdc"` // 42424234242 (Static File Storage Microservice)
}
// Model for the city
type MVCity struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name" validate:"required"` // Ankara
Number int64 `json:"number" bson:"number" validate:"required,numeric"` // 6
Candidates []MVCandidateInBox `json:"candidates" bson:"candidates"`
EligibleVoters int64 `json:"eligiblevoters" bson:"eligiblevoters" validate:"numeric"` // 12621
ActualVoters int64 `json:"actualvoters" bson:"actualvoters" validate:"numeric"` // 10262
ValidVotes int64 `json:"validvotes" bson:"validvotes" validate:"numeric"` // 10101
InvalidVotes int64 `json:"invalidvotes" bson:"invalidvotes" validate:"numeric"` // 161
}
// Model for the constituency
type MVConstituency struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name" validate:"required"`
City string `json:"city" bson:"city" validate:"required"` // Ankara
CityNumber int64 `json:"citynumber" bson:"citynumber" validate:"required,numeric"` // 6
Candidates []MVCandidateInBox `json:"candidates" bson:"candidates"`
EligibleVoters int64 `json:"eligiblevoters" bson:"eligiblevoters"` // 12621
ActualVoters int64 `json:"actualvoters" bson:"actualvoters"` // 10262
ValidVotes int64 `json:"validvotes" bson:"validvotes"` // 10101
InvalidVotes int64 `json:"invalidvotes" bson:"invalidvotes"` // 161
}
// Model for the district
type MVDistrict struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"` // Cankaya
City string `json:"city" bson:"city"` // Ankara
CityNumber int64 `json:"citynumber" bson:"citynumber"` // 6
Constituency string `json:"constituency" bson:"constituency"` // ankara-1
Candidates []MVCandidateInBox `json:"candidates" bson:"candidates"`
EligibleVoters int64 `json:"eligiblevoters" bson:"eligiblevoters"` // 12621
ActualVoters int64 `json:"actualvoters" bson:"actualvoters"` // 10262
ValidVotes int64 `json:"validvotes" bson:"validvotes"` // 10101
InvalidVotes int64 `json:"invalidvotes" bson:"invalidvotes"` // 161
}
// Model for the quarter
type MVQuarter struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"` // Cevizlidere
City string `json:"city" bson:"city"` // Ankara
CityNumber int64 `json:"citynumber" bson:"citynumber"` // 6
Constituency string `json:"constituency" bson:"constituency"` // Ankara-1
District string `json:"district" bson:"district"` // Cankaya
Candidates []MVCandidateInBox `json:"candidates" bson:"candidates"`
EligibleVoters int64 `json:"eligiblevoters" bson:"eligiblevoters"` // 12621
ActualVoters int64 `json:"actualvoters" bson:"actualvoters"` // 10262
ValidVotes int64 `json:"validvotes" bson:"validvotes"` // 10101
InvalidVotes int64 `json:"invalidvotes" bson:"invalidvotes"` // 161
}
// Model for a Party in a Box
type MVCandidateInBox struct {
FirstName string `json:"firstname" bson:"firstname"`
LastName string `json:"lastname" bson:"lastname"`
Votes int64 `json:"votes" bson:"votes"` // 121
}