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:
2026-02-25 01:02:15 +01:00
parent f21ce9a3c3
commit 8bb1777519
7 changed files with 129 additions and 68 deletions

View File

@@ -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",
}
}