Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.MultiTenancy;

namespace Unity.AI.DataSeed;

Expand All @@ -17,7 +18,8 @@ namespace Unity.AI.DataSeed;
/// </summary>
public class AIPromptDataSeeder(
IRepository<AIPrompt, Guid> promptRepository,
IRepository<AIPromptVersion, Guid> versionRepository) : IDataSeedContributor, ITransientDependency
IRepository<AIPromptVersion, Guid> versionRepository,
ICurrentTenant currentTenant) : IDataSeedContributor, ITransientDependency
{
// Fixed deterministic GUIDs — never change these; they ensure idempotent re-seeding
private static readonly Guid AnalysisPromptId = new("4a100001-1000-4000-a000-000000000001");
Expand All @@ -28,9 +30,12 @@ public async Task SeedAsync(DataSeedContext context)
{
if (context.TenantId != null) return; // host database only

await SeedAnalysisPromptAsync();
await SeedAttachmentPromptAsync();
await SeedScoresheetPromptAsync();
using (currentTenant.Change(null))
{
await SeedAnalysisPromptAsync();
await SeedAttachmentPromptAsync();
await SeedScoresheetPromptAsync();
}
}

// ─── ANALYSIS ────────────────────────────────────────────────────────────
Expand Down
Loading