feat(profile): persist candidate edits and enforce company access
This commit is contained in:
1 parent
3ab6bd91a3
commit
73c7caa225
67 files changed
+5286
-229
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"time"
|
||||
|
||||
"lincodex/backend/config"
|
||||
v1 "lincodex/backend/internal/adapter/primary/http/v1"
|
||||
"lincodex/backend/internal/adapter/secondary/postgres"
|
||||
profileusecase "lincodex/backend/internal/usecase/profile"
|
||||
)
|
||||
|
||||
const profilePoolMaxConns = 8
|
||||
|
||||
func newProfileHandler(ctx context.Context, settings config.Config, logger *slog.Logger) (*v1.ProfileHandler, func(), error) {
|
||||
if settings.DatabaseURL == "" {
|
||||
logger.Warn("candidate profile operations are not served because DATABASE_URL is not set")
|
||||
return nil, func() {}, nil
|
||||
}
|
||||
pool, err := postgres.NewSizedPool(ctx, settings.DatabaseURL, profilePoolMaxConns)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
service := profileusecase.NewService(postgres.NewTransactor(pool), time.Now)
|
||||
return v1.NewProfileHandler(service), pool.Close, nil
|
||||
}
|
||||
Reference in new issue
Block a user