feat: enforce tenant isolation and shared question bank

This commit is contained in:
2026-07-27 16:59:12 +08:00
parent 28e9a9fa41
commit db4c7b4496
137 changed files with 6402 additions and 112274 deletions

View File

@@ -0,0 +1,37 @@
using System.Text.Json;
using Tiku.Domain.Common;
namespace Tiku.Domain.Catalog;
public sealed class TaxonomyNode : AuditableTenantEntity
{
public Guid? ParentOwnerTenantId { get; set; }
public Guid? ParentId { get; set; }
public TaxonomyNodeType NodeType { get; set; } = TaxonomyNodeType.KnowledgePoint;
public string Code { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string? Path { get; set; }
public int Depth { get; set; }
public int SortOrder { get; set; }
public bool IsActive { get; set; } = true;
public JsonElement Metadata { get; set; } = JsonDefaults.Object();
}
public sealed class QuestionTaxonomyAssignment : Entity, ITenantOwned
{
public Guid TenantId { get; set; }
public Guid QuestionId { get; set; }
public Guid TaxonomyOwnerTenantId { get; set; }
public Guid TaxonomyNodeId { get; set; }
public bool IsPrimary { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
}
public enum TaxonomyNodeType
{
Subject,
Chapter,
KnowledgePoint,
Paper,
Custom
}