fix: deliver validated AI insight responses
This commit is contained in:
@@ -24,6 +24,14 @@ const reportLeaseDuration = 3 * time.Minute
|
||||
|
||||
func NewRepository(pool *pgxpool.Pool) *Repository { return &Repository{pool: pool} }
|
||||
|
||||
func (r *Repository) ActiveCatalogVersion(ctx context.Context) (string, error) {
|
||||
var version string
|
||||
if err := r.pool.QueryRow(ctx, `SELECT version FROM calendar_catalog_versions WHERE status='ACTIVE'`).Scan(&version); err != nil {
|
||||
return "", fmt.Errorf("loading active event catalog version: %w", err)
|
||||
}
|
||||
return version, nil
|
||||
}
|
||||
|
||||
type CreateRecord struct {
|
||||
ID string
|
||||
MerchantID int64
|
||||
|
||||
Reference in New Issue
Block a user