feat: persist candidate questionnaires and enforce company quotas
This commit is contained in:
1 parent
73c7caa225
commit
3a61a8e8bb
51 files changed
+6280
-38
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
|
||||
"lincodex/backend/config"
|
||||
v1 "lincodex/backend/internal/adapter/primary/http/v1"
|
||||
"lincodex/backend/internal/adapter/secondary/postgres"
|
||||
"lincodex/backend/internal/usecase/assessment"
|
||||
)
|
||||
|
||||
const catalogPoolMaxConns = 4
|
||||
|
||||
func newCatalogHandler(ctx context.Context, settings config.Config, logger *slog.Logger) (*v1.CatalogHandler, func(), error) {
|
||||
if settings.DatabaseURL == "" {
|
||||
logger.Warn("specialization catalog is not served because DATABASE_URL is not set")
|
||||
return nil, func() {}, nil
|
||||
}
|
||||
pool, err := postgres.NewSizedPool(ctx, settings.DatabaseURL, catalogPoolMaxConns)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
bank := assessment.NewBank(postgres.NewTransactor(pool))
|
||||
return v1.NewCatalogHandler(bank), pool.Close, nil
|
||||
}
|
||||
Reference in new issue
Block a user