forked from xiongyuxing/tiku-backend.net
feat: add content platform operations persistence
This commit is contained in:
@@ -28,7 +28,7 @@ public sealed class PersistenceModelTests
|
||||
.Select(entity => entity.GetTableName())
|
||||
.ToHashSet(StringComparer.Ordinal);
|
||||
|
||||
Assert.Equal(106, tableNames.Count);
|
||||
Assert.Equal(111, tableNames.Count);
|
||||
Assert.Contains("tenants", tableNames);
|
||||
Assert.Contains("tenant_settings", tableNames);
|
||||
Assert.Contains("content_entries", tableNames);
|
||||
@@ -92,6 +92,11 @@ public sealed class PersistenceModelTests
|
||||
Assert.Contains("commerce_reconciliation_items", tableNames);
|
||||
Assert.Contains("commerce_reconciliation_issues", tableNames);
|
||||
Assert.Contains("commerce_reconciliation_issue_events", tableNames);
|
||||
Assert.Contains("content_asset_access_events", tableNames);
|
||||
Assert.Contains("content_asset_security_scan_events", tableNames);
|
||||
Assert.Contains("question_bank_grants", tableNames);
|
||||
Assert.Contains("tenant_question_bank_adoptions", tableNames);
|
||||
Assert.Contains("ai_recommendation_reports", tableNames);
|
||||
Assert.Contains("referral_tracks", tableNames);
|
||||
Assert.Contains("referral_codes", tableNames);
|
||||
Assert.Contains("referral_leads", tableNames);
|
||||
@@ -287,12 +292,21 @@ public sealed class PersistenceModelTests
|
||||
[Theory]
|
||||
[InlineData(typeof(ContentAsset), nameof(ContentAsset.AccessRules), "'{}'::jsonb")]
|
||||
[InlineData(typeof(ContentAsset), nameof(ContentAsset.VerificationDetails), "'{}'::jsonb")]
|
||||
[InlineData(typeof(ContentAsset), nameof(ContentAsset.SecurityScanSummary), "'{}'::jsonb")]
|
||||
[InlineData(typeof(ContentAsset), nameof(ContentAsset.SecurityFlags), "'{}'::jsonb")]
|
||||
[InlineData(typeof(ContentAssetAccessEvent), nameof(ContentAssetAccessEvent.Metadata), "'{}'::jsonb")]
|
||||
[InlineData(typeof(ContentAssetSecurityScanEvent), nameof(ContentAssetSecurityScanEvent.Details), "'{}'::jsonb")]
|
||||
[InlineData(typeof(ContentImportJob), nameof(ContentImportJob.RawPayload), "'[]'::jsonb")]
|
||||
[InlineData(typeof(ContentImportItem), nameof(ContentImportItem.SourcePayload), "'{}'::jsonb")]
|
||||
[InlineData(typeof(ContentImportIssue), nameof(ContentImportIssue.Details), "'{}'::jsonb")]
|
||||
[InlineData(typeof(VideoExplanation), nameof(VideoExplanation.KnowledgeTags), "'[]'::jsonb")]
|
||||
[InlineData(typeof(QuestionVideo), nameof(QuestionVideo.Metadata), "'{}'::jsonb")]
|
||||
[InlineData(typeof(QuestionBankGrant), nameof(QuestionBankGrant.Metadata), "'{}'::jsonb")]
|
||||
[InlineData(typeof(TenantQuestionBankAdoption), nameof(TenantQuestionBankAdoption.SourceSnapshot), "'{}'::jsonb")]
|
||||
[InlineData(typeof(TenantQuestionBankAdoption), nameof(TenantQuestionBankAdoption.Metadata), "'{}'::jsonb")]
|
||||
[InlineData(typeof(AiRecommendationReport), nameof(AiRecommendationReport.InputPayload), "'{}'::jsonb")]
|
||||
[InlineData(typeof(AiRecommendationReport), nameof(AiRecommendationReport.ContextPayload), "'{}'::jsonb")]
|
||||
[InlineData(typeof(AiRecommendationReport), nameof(AiRecommendationReport.ResultPayload), "'{}'::jsonb")]
|
||||
public void Asset_import_and_video_json_properties_are_mapped_to_jsonb(
|
||||
Type entityType,
|
||||
string propertyName,
|
||||
@@ -321,6 +335,17 @@ public sealed class PersistenceModelTests
|
||||
nameof(QuestionVideo.QuestionId),
|
||||
nameof(QuestionVideo.VideoId),
|
||||
nameof(QuestionVideo.VideoType));
|
||||
AssertHasUniqueIndex<TenantQuestionBankAdoption>(
|
||||
nameof(TenantQuestionBankAdoption.TenantId),
|
||||
nameof(TenantQuestionBankAdoption.SourceQuestionBankId));
|
||||
|
||||
var allowedPlanCodes = context.Model.FindEntityType(typeof(QuestionBankGrant))!
|
||||
.FindProperty(nameof(QuestionBankGrant.AllowedPlanCodes))!;
|
||||
Assert.Equal("text[]", allowedPlanCodes.GetColumnType());
|
||||
|
||||
var allowedTenantIds = context.Model.FindEntityType(typeof(QuestionBankGrant))!
|
||||
.FindProperty(nameof(QuestionBankGrant.AllowedTenantIds))!;
|
||||
Assert.Equal("uuid[]", allowedTenantIds.GetColumnType());
|
||||
|
||||
void AssertHasUniqueIndex<TEntity>(params string[] propertyNames)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user