feat: booking can only in between specified hours
every booking happening outside these hours will be clamped to the hours also added few more config options + regex filters
This commit is contained in:
@@ -52,6 +52,8 @@ func main() {
|
||||
|
||||
defer models.DB.(*sql.DB).Close()
|
||||
|
||||
models.Options = configure()
|
||||
|
||||
if helper.GetEnv("GO_ENV", "production") != "debug" {
|
||||
err = Migrate()
|
||||
if err != nil {
|
||||
@@ -114,3 +116,10 @@ func loggingMiddleware(next http.Handler) http.Handler {
|
||||
slog.Info("Completet Request", slog.String("Time", time.Since(start).String()))
|
||||
})
|
||||
}
|
||||
|
||||
func configure() models.BookingOptions {
|
||||
return models.BookingOptions{
|
||||
AllowOutOfBounds: helper.GetEnv("BOOKING_OUT_OF_BOUNDS", "false") == "true",
|
||||
AllowUnknownUser: helper.GetEnv("BOOKING_FOR_UNKNOWN_USER", "false") == "true",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user