Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ tmp_dir = "tmp"

[build]
args_bin = []
bin = "tmp\\main.exe"
cmd = "go build -o ./tmp/main.exe ."
bin = "./tmp/main"
cmd = "go build -o ./tmp/main ."
delay = 1000
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
Expand Down
63 changes: 63 additions & 0 deletions dto/dashboard-dto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package dto

type ResponseStatistik struct {
TotalPeserta string `json:"total_peserta"`
PesertaSeminar string `json:"peserta_seminar"`
PesertaHackaton string `json:"peserta_hackaton"`
PesertaCP string `json:"peserta_cp"`
}

type Seminar struct {
ID int `json:"id"`
NamaPeserta string `json:"nama_peserta"`
Email string `json:"email"`
NomorHp string `json:"nomor_hp"`
Jenjang string `json:"jenjang"`
NamaUniversitas string `json:"nama_universitas"`
Dokumen string `json:"dokumen"`
Status bool `json:"status"`
}

type ResponseSeminar struct {
Seminar Seminar `json:"seminar"`
HasMore bool `json:"has_more"`
}

type Hackaton struct {
ID int `json:"id"`
NamaTim string `json:"nama_tim"`
Leader string `json:"leader"`
Anggota1 string `json:"anggota_1"`
Anggota2 string `json:"anggota_2"`
Anggota3 string `json:"anggota_3"`
Anggota4 string `json:"anggota_4"`
Anggota5 string `json:"anggota_5"`
KomitmenFee string `json:"komitmen_fee"`
ProposalUrl string `json:"proposal_url"`
PitchDeckUrl string `json:"pitch_deck_url"`
GithubUrl string `json:"github_url"`
Stage string `json:"stage"`
}

type ResponseHackaton struct {
Hackaton Hackaton `json:"hackaton"`
HasMore bool `json:"has_more"`
}

type Cp struct {
ID int `json:"id"`
NamaTim string `json:"nama_tim"`
Leader string `json:"leader"`
Anggota1 string `json:"anggota_1"`
Anggota2 string `json:"anggota_2"`
Anggota3 string `json:"anggota_3"`
KomitmenFee string `json:"komitmen_fee"`
Email string `json:"email"`
Password string `json:"password"`
Stage string `json:"stage"`
}

type ResponseCp struct {
Cp Cp `json:"cp"`
HasMore bool `json:"has_more"`
}
42 changes: 42 additions & 0 deletions dto/event-dto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package dto

import "time"

type User struct {
Name string `json:"name"`
Email string `json:"email"`
University string `json:"university"`
Degree string `json:"degree"`
}

type Member struct {
Name string `json:"name"`
Role string `json:"role"`
Email string `json:"email"`
}

type Team struct {
TeamName string `json:"team_name"`
Members []Member `json:"members"`
}

type Ticket struct {
TicketId string `json:"ticket_id"`
Type string `json:"type"`
IssuedAt time.Time `json:"issued_at"`
ValidUntil time.Time `json:"valid_until"`
QrCodeUrl string `json:"qr_code_url"`
}

type Event struct {
Name string `json:"name"`
Status string `json:"status"`
PaymentStatus string `json:"payment_status"`
Team []Team `json:"team"`
Ticket Ticket `json:"ticket"`
}

type ResponseEvents struct {
User User `json:"user"`
Events []Event `json:"events"`
}
72 changes: 72 additions & 0 deletions dto/tes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"user": {
"name": "Prajoko Susilo",
"email": "danantara@esemka.gov.id",
"university": "Universitas Gundarma",
"degree": "Strata 1"
},
"events": [
{
"name": "Competitive Programming",
"status": "Registered",
"payment_status": "Paid",
"team": {
"team_name": "Algorangers",
"members": [
{
"name": "Prajoko Susilo",
"role": "Leader",
"email": "danantara@esemka.gov.id"
},
{
"name": "Dina Wulandari",
"role": "Member",
"email": "dina@esemka.gov.id"
},
{
"name": "Rizal Hakim",
"role": "Member",
"email": "rizal@esemka.gov.id"
}
]
}
},
{
"name": "Hackathon",
"status": "Registered",
"payment_status": "Unpaid",
"team": {
"team_name": "CodeStorm",
"members": [
{
"name": "Prajoko Susilo",
"role": "Developer",
"email": "danantara@esemka.gov.id"
},
{
"name": "Santi Nurhidayah",
"role": "UI/UX Designer",
"email": "santi@esemka.gov.id"
},
{
"name": "Budi Prasetyo",
"role": "Project Manager",
"email": "budi@esemka.gov.id"
}
]
}
},
{
"name": "Seminar Nasional Teknologi AI",
"status": "Registered",
"payment_status": "Paid",
"ticket": {
"ticket_id": "TKT-AI2025-00123",
"type": "General Admission",
"issued_at": "2025-04-20T09:45:00Z",
"valid_until": "2025-04-28T17:00:00Z",
"qr_code_url": "https://gcwug.id/ticket/TKT-AI2025-00123/qr"
}
}
]
}
2 changes: 2 additions & 0 deletions entity/cp_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ type CPTeam struct {
DomjudgePassword string `gorm:"varchar(255); not null"`

IDTeam uint64 `gorm:"not null"`
Team Team `gorm:"foreignKey:IDTeam"`

IsDeleted bool
CreatedAt time.Time
UpdatedAt time.Time
}
1 change: 1 addition & 0 deletions entity/hackathon_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type HackathonTeam struct {
IDTeam uint64
Team Team `gorm:"foreignKey:IDTeam"`

IsDeleted bool
CreatedAt time.Time
UpdatedAt time.Time
}
8 changes: 5 additions & 3 deletions entity/seminar.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ type Seminar struct {
ID_Seminar uint64 `gorm:"primary_key:auto_increment"`
ID_Tiket string `gorm:"varchar(255); not null"`

IDUser uint64 `gorm:"not null"`
User User `gorm:"foreignKey:IDUser"`

IDUser uint64 `gorm:"not null"`
User User `gorm:"foreignKey:IDUser;references:ID"`
PaymentStatus string `gorm:"type:varchar(60)"`

IsDeleted bool
CreatedAt time.Time
UpdatedAt time.Time
}
1 change: 1 addition & 0 deletions entity/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type Team struct {
Supervisor string `gorm:"varchar(255); not null"`
SupervisorNIDN string `gorm:"varchar(255); not null"`
JoinCode string `gorm:"varchar(255); not null"`
KomitmenFee string `gorm:"varchar(255)"`

Event string `gorm:"varchar(255); not null"`

Expand Down
17 changes: 10 additions & 7 deletions entity/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ type User struct {
ID uint64 `gorm:"primary_key:auto_increment"`
Email string `gorm:"varchar(255); not null"`

Name string `gorm:"varchar(55); not null"`
Gender *string `gorm:"varchar(55);"`
NIM *string `gorm:"varchar(55);"`
BirthPlace *string `gorm:"varchar(55);"`
BirthDate *time.Time `gorm:"date"`
Institusi *string `gorm:"varchar(55);"`
Name string `gorm:"varchar(55); not null"`
Gender *string `gorm:"varchar(55);"`
NIM *string `gorm:"varchar(55);"`
BirthPlace *string `gorm:"varchar(55);"`
BirthDate *time.Time `gorm:"date"`
Institusi string `gorm:"varchar(55);"`
Phone string `gorm:"type:varchar(16)"`
DokumenFilename string `gorm:"type:varchar(255)"`
Jenjang string `gorm:"type:varchar(120)"`

ProfileHasUpdated bool `gorm:"bool; default:false"`
DataHasVerified bool `gorm:"bool; default:false"`
Expand All @@ -22,7 +25,7 @@ type User struct {
Role string `gorm:"varchar(255); not null; default:'user'"` // user, admin, superadmin

IDTeam *uint64
Team Team `gorm:"foreignKey:IDTeam"`
Team Team `gorm:"foreignKey:IDTeam;references:ID_Team"`

CreatedAt time.Time
UpdatedAt time.Time
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ require (
github.com/PuerkitoBio/purell v1.2.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gin-contrib/cors v1.7.5 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
Expand Down Expand Up @@ -76,7 +77,7 @@ require (
github.com/gin-contrib/sse v1.0.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.25.0 // indirect
github.com/go-playground/validator/v10 v10.26.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
Expand All @@ -94,11 +95,11 @@ require (
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.15.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/api v0.226.0
google.golang.org/protobuf v1.36.5 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uq
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
github.com/gin-contrib/cors v1.7.5 h1:cXC9SmofOrRg0w9PigwGlHG3ztswH6bqq4vJVXnvYMk=
github.com/gin-contrib/cors v1.7.5/go.mod h1:4q3yi7xBEDDWKapjT2o1V7mScKDDr8k+jZ0fSquGoy0=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E=
Expand Down Expand Up @@ -100,6 +102,8 @@ github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBEx
github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-playground/validator/v10 v10.25.0 h1:5Dh7cjvzR7BRZadnsVOzPhWsrwUr0nmsZJxEAnFLNO8=
github.com/go-playground/validator/v10 v10.25.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k=
github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
Expand Down Expand Up @@ -224,6 +228,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc=
golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -264,6 +270,8 @@ google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
Loading