fix: deliver validated AI insight responses

This commit is contained in:
2026-08-22 15:47:38 +08:00
parent ca55c2fb3d
commit 3fba4261ee
68 changed files with 6870 additions and 493 deletions

View File

@@ -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