Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: feedback #36

Merged
merged 2 commits into from
Jan 17, 2024
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
1 change: 1 addition & 0 deletions apperror/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ var (
NonRegisterableEvent = &AppError{"non-registerable-event", http.StatusBadRequest}
Forbidden = &AppError{"forbidden", http.StatusForbidden}
AlreadyCheckin = &AppError{"already-checkin", http.StatusConflict}
AlreadySubmitted = &AppError{"already-submitted", http.StatusConflict}
NotFound = &AppError{"not-found", http.StatusNotFound}
)
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func main() {
r.GET("/events/:eventId", container.EventHandler.GetEventById)
r.POST("/schedules/:scheduleId/register", container.EvtregHandler.RegisterEvent)
r.POST("/staff/checkin/:userId", container.StaffHandler.AttendeeStaffCheckin)
r.POST("/feedback", container.FeedbackHandler.SubmitFeedback)
r.POST("/auth/register", container.AuthHandler.Register)
r.GET("/auth/me", container.AuthHandler.GetProfile)
r.GET("/auth/login", container.AuthHandler.GoogleLogin)
Expand Down
7 changes: 7 additions & 0 deletions di/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
event "github.com/isd-sgcu/oph66-backend/internal/event"
"github.com/isd-sgcu/oph66-backend/internal/evtreg"
featureflag "github.com/isd-sgcu/oph66-backend/internal/feature_flag"
"github.com/isd-sgcu/oph66-backend/internal/feedback"
healthcheck "github.com/isd-sgcu/oph66-backend/internal/health_check"
"github.com/isd-sgcu/oph66-backend/internal/middleware"
"github.com/isd-sgcu/oph66-backend/internal/router"
Expand All @@ -27,6 +28,7 @@ type Container struct {
AuthHandler auth.Handler
EvtregHandler evtreg.Handler
StaffHandler staff.Handler
FeedbackHandler feedback.Handler
Config *cfgldr.Config
Logger *zap.Logger
CorsHandler cfgldr.CorsHandler
Expand All @@ -40,6 +42,7 @@ func newContainer(
authHandler auth.Handler,
evtregHandler evtreg.Handler,
staffHandler staff.Handler,
feedbackHandler feedback.Handler,
config *cfgldr.Config,
logger *zap.Logger,
corsHandler cfgldr.CorsHandler,
Expand All @@ -52,6 +55,7 @@ func newContainer(
authHandler,
evtregHandler,
staffHandler,
feedbackHandler,
config,
logger,
corsHandler,
Expand Down Expand Up @@ -81,6 +85,9 @@ func Init() (Container, error) {
staff.NewRepository,
staff.NewService,
staff.NewHandler,
feedback.NewRepository,
feedback.NewService,
feedback.NewHandler,
auth.NewHandler,
auth.NewService,
auth.NewRepository,
Expand Down
9 changes: 8 additions & 1 deletion di/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

123 changes: 123 additions & 0 deletions docs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

123 changes: 123 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,40 @@
}
}
},
"/feedback": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "Submit feedback form",
"produces": [
"application/json"
],
"tags": [
"feedback"
],
"summary": "Submit feedback form",
"operationId": "SubmitFeedback",
"parameters": [
{
"description": "Feedback dto",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SubmitFeedbackDTO"
}
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/live": {
"get": {
"description": "Get livestream flag",
Expand Down Expand Up @@ -928,6 +962,91 @@
}
}
},
"dto.SubmitFeedbackDTO": {
"type": "object",
"properties": {
"comment": {
"type": "string",
"example": "very good"
},
"q1": {
"type": "string",
"example": "1"
},
"q10": {
"type": "string",
"example": "1"
},
"q11": {
"type": "string",
"example": "1"
},
"q12": {
"type": "string",
"example": "1"
},
"q13": {
"type": "string",
"example": "1"
},
"q14": {
"type": "string",
"example": "1"
},
"q15": {
"type": "string",
"example": "1"
},
"q16": {
"type": "string",
"example": "1"
},
"q17": {
"type": "string",
"example": "1"
},
"q18": {
"type": "string",
"example": "1"
},
"q19": {
"type": "string",
"example": "1"
},
"q2": {
"type": "string",
"example": "1"
},
"q3": {
"type": "string",
"example": "1"
},
"q4": {
"type": "string",
"example": "1"
},
"q5": {
"type": "string",
"example": "1"
},
"q6": {
"type": "string",
"example": "1"
},
"q7": {
"type": "string",
"example": "1"
},
"q8": {
"type": "string",
"example": "1"
},
"q9": {
"type": "string",
"example": "1"
}
}
},
"dto.User": {
"type": "object",
"properties": {
Expand All @@ -950,6 +1069,10 @@
"type": "string",
"example": "Ph.D."
},
"feedback_submitted": {
"type": "boolean",
"example": true
},
"first_name": {
"type": "string",
"example": "John"
Expand Down
Loading