diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs index f3eda195b5..69285d96dd 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs @@ -456,6 +456,15 @@ public static string ContentPartitionField { } } + /// + /// Looks up a localized string similar to Enrich the content with defaults.. + /// + public static string ContentRequestApplyDefaults { + get { + return ResourceManager.GetString("ContentRequestApplyDefaults", resourceCulture); + } + } + /// /// Looks up a localized string similar to The data for the content.. /// diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx index fdfd15fe8d..244ff2e519 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx +++ b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx @@ -249,6 +249,9 @@ {0} field ({1}). + + Enrich the content with defaults. + The data for the content. diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/BulkUpdateContentType.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/BulkUpdateContentType.cs index d992a9cba5..06b9098acc 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/BulkUpdateContentType.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/BulkUpdateContentType.cs @@ -15,5 +15,6 @@ public enum BulkUpdateContentType Delete, Patch, Update, - Validate + Validate, + EnrichDefaults } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/BulkUpdateJob.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/BulkUpdateJob.cs index c6e9b8de94..a0ca5d9c91 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/BulkUpdateJob.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/BulkUpdateJob.cs @@ -33,6 +33,8 @@ public sealed class BulkUpdateJob public bool Permanent { get; set; } + public bool EnrichDefaults { get; set; } + public long ExpectedCount { get; set; } = 1; public long ExpectedVersion { get; set; } = EtagVersion.Any; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/EnrichContentDefaults.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/EnrichContentDefaults.cs new file mode 100644 index 0000000000..6a8d39dc91 --- /dev/null +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/EnrichContentDefaults.cs @@ -0,0 +1,12 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +namespace Squidex.Domain.Apps.Entities.Contents.Commands; + +public sealed class EnrichContentDefaults : ContentCommand +{ +} diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/UpdateContent.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/UpdateContent.cs index 3e6fbbe538..1959a98982 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/UpdateContent.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/UpdateContent.cs @@ -9,4 +9,5 @@ namespace Squidex.Domain.Apps.Entities.Contents.Commands; public class UpdateContent : ContentDataCommand { + public bool EnrichDefaults { get; set; } } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/UpsertContent.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/UpsertContent.cs index 70906fb916..8207cbd48c 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/UpsertContent.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Commands/UpsertContent.cs @@ -19,6 +19,8 @@ public sealed class UpsertContent : ContentDataCommand, ISchemaCommand public bool Patch { get; set; } + public bool EnrichDefaults { get; set; } + public UpsertContent() { ContentId = DomainId.NewGuid(); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs index 0fb1713085..e24c9defca 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs @@ -206,6 +206,21 @@ public override Task ExecuteAsync(IAggregateCommand command, return Snapshot; }, ct); + case EnrichContentDefaults enrichContentDefaults: + return ApplyReturnAsync(enrichContentDefaults, async (c, ct) => + { + var operation = await ContentOperation.CreateAsync(serviceProvider, c, () => Snapshot); + + var newData = operation.GenerateDefaultValues(Snapshot.EditingData.Clone()); + + if (!newData.Equals(Snapshot.EditingData)) + { + Update(c, newData); + } + + return Snapshot; + }, ct); + case DeleteContent { Permanent: true } deleteContent: return DeletePermanentAsync(deleteContent, async (c, ct) => { @@ -319,6 +334,11 @@ private async Task UpdateCore(UpdateContent c, ContentOperation operation, var newData = c.Data; + if (c.EnrichDefaults) + { + newData = operation.GenerateDefaultValues(newData); + } + if (newData.Equals(Snapshot.EditingData)) { return; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentsBulkUpdateCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentsBulkUpdateCommandMiddleware.cs index bb9a5036f5..386b3b7392 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentsBulkUpdateCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentsBulkUpdateCommandMiddleware.cs @@ -189,6 +189,10 @@ private BulkTask CreateTask( return CreateTask(id, schemaId, bulkJob, bulk, jobIndex, PermissionIds.AppContentsReadOwn); + case BulkUpdateContentType.EnrichDefaults: + return CreateTask(id, schemaId, bulkJob, bulk, jobIndex, + PermissionIds.AppContentsUpdateOwn); + case BulkUpdateContentType.ChangeStatus: return CreateTask(id, schemaId, bulkJob, bulk, jobIndex, PermissionIds.AppContentsChangeStatusOwn); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs index d3703de56f..f9b4a1dad0 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs @@ -5,11 +5,9 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using LibGit2Sharp; using Squidex.Domain.Apps.Core.Contents; using Squidex.Domain.Apps.Entities.Contents.Text.State; using Squidex.Domain.Apps.Events.Contents; -using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Json; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/DomainObject/RuleDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/DomainObject/RuleDomainObject.cs index 020a3e6f00..a423fb4490 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/DomainObject/RuleDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/DomainObject/RuleDomainObject.cs @@ -110,7 +110,7 @@ public override Task ExecuteAsync(IAggregateCommand command, { await Trigger(triggerRule); - return true; + return None.Value; }, ct); default: diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsController.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsController.cs index 2ade95a562..1f584281fb 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsController.cs @@ -437,9 +437,36 @@ public async Task PostUpsertContent(string app, string schema, Do [AcceptHeader.Unpublished] [AcceptHeader.Languages] [ApiCosts(1)] - public async Task PutContent(string app, string schema, DomainId id, [FromBody] ContentData request) + public async Task PutContent(string app, string schema, DomainId id, UpdateContentDto request) { - var command = new UpdateContent { ContentId = id, Data = request }; + var command = request.ToCommand(id); + + var response = await InvokeCommandAsync(command); + + return Ok(response); + } + + /// + /// Enrich a content item with defaults. + /// + /// The name of the app. + /// The name of the schema. + /// The ID of the content item to update. + /// Content updated. + /// Content references, schema or app not found. + /// + /// You can read the generated documentation for your app at /api/content/{appName}/docs. + /// + [HttpPut] + [Route("content/{app}/{schema}/{id}/defaults")] + [ProducesResponseType(typeof(ContentDto), StatusCodes.Status200OK)] + [ApiPermissionOrAnonymous(PermissionIds.AppContentsUpdateOwn)] + [AcceptHeader.Unpublished] + [AcceptHeader.Languages] + [ApiCosts(1)] + public async Task PutContentDefaults(string app, string schema, DomainId id) + { + var command = new EnrichContentDefaults { ContentId = id }; var response = await InvokeCommandAsync(command); diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs index b4f32027b6..57ed3ef124 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs @@ -175,6 +175,7 @@ private static void GenerateSchemaOperations(OperationsBuilder builder) .OperationSummary("Upsert a [schema] content item.") .HasQuery("patch", JsonObjectType.Boolean, FieldDescriptions.ContentRequestPatch) .HasQuery("publish", JsonObjectType.Boolean, FieldDescriptions.ContentRequestPublish) + .HasQuery("enrichDefaults", JsonObjectType.String, FieldDescriptions.ContentRequestApplyDefaults) .HasId() .HasBody("data", builder.DataSchema, Resources.OpenApiSchemaBody) .Responds(200, "Content item created or updated.", builder.ContentSchema) @@ -184,11 +185,19 @@ private static void GenerateSchemaOperations(OperationsBuilder builder) .RequirePermission(PermissionIds.AppContentsUpdateOwn) .Operation("Update") .OperationSummary("Update a [schema] content item.") + .HasQuery("enrichDefaults", JsonObjectType.String, FieldDescriptions.ContentRequestApplyDefaults) .HasId() .HasBody("data", builder.DataSchema, Resources.OpenApiSchemaBody) .Responds(200, "Content item updated.", builder.ContentSchema) .Responds(400, "Content data not valid."); + builder.AddOperation(OpenApiOperationMethod.Put, "/{id}/defaults") + .RequirePermission(PermissionIds.AppContentsUpdateOwn) + .Operation("UpdateDefaults") + .OperationSummary("Apply a [schema] content item. defaults") + .HasId() + .Responds(200, "Content item updated.", builder.ContentSchema); + builder.AddOperation(OpenApiOperationMethod.Patch, "/{id}") .RequirePermission(PermissionIds.AppContentsUpdateOwn) .Operation("Patch") diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/BulkUpdateContentsJobDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/BulkUpdateContentsJobDto.cs index f16713ec37..fb4b758e97 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/BulkUpdateContentsJobDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/BulkUpdateContentsJobDto.cs @@ -62,6 +62,11 @@ public class BulkUpdateContentsJobDto /// public bool Permanent { get; set; } + /// + /// Enrich the data with the default values when updating a content item. + /// + public bool EnrichDefaults { get; set; } + /// /// The number of expected items. Set it to a higher number to update multiple items when a query is defined. /// diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/UpdateContentDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/UpdateContentDto.cs new file mode 100644 index 0000000000..e3c48e8abb --- /dev/null +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/UpdateContentDto.cs @@ -0,0 +1,36 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using Microsoft.AspNetCore.Mvc; +using Squidex.Domain.Apps.Core.Contents; +using Squidex.Domain.Apps.Entities.Contents.Commands; +using Squidex.Infrastructure; +using Squidex.Infrastructure.Reflection; +using Squidex.Web; + +namespace Squidex.Areas.Api.Controllers.Contents.Models; + +[OpenApiRequest] +public class UpdateContentDto +{ + /// + /// The full data for the content item. + /// + [FromBody] + public ContentData Data { get; set; } + + /// + /// Enrich the content with defaults. + /// + [FromQuery(Name = "enrichDefaults")] + public bool EnrichDefaults { get; set; } + + public UpdateContent ToCommand(DomainId id) + { + return SimpleMapper.Map(this, new UpdateContent { ContentId = id }); + } +} diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/UpsertContentDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/UpsertContentDto.cs index 73a2684109..56303da75b 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/UpsertContentDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/UpsertContentDto.cs @@ -36,6 +36,12 @@ public class UpsertContentDto [FromQuery(Name = "patch")] public bool Patch { get; set; } + /// + /// Enrich the content with defaults. + /// + [FromQuery(Name = "enrichDefaults")] + public bool EnrichDefaults { get; set; } + /// /// True to automatically publish the content. /// diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/DomainObject/AppDomainObjectTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/DomainObject/AppDomainObjectTests.cs index bb3077c4c0..9d5a63ed23 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/DomainObject/AppDomainObjectTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/DomainObject/AppDomainObjectTests.cs @@ -16,12 +16,12 @@ using Squidex.Domain.Apps.Entities.TestHelpers; using Squidex.Domain.Apps.Events.Apps; using Squidex.Infrastructure; -using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Json.Objects; using Squidex.Shared.Users; namespace Squidex.Domain.Apps.Entities.Apps.DomainObject; +[UsesVerify] public class AppDomainObjectTests : HandlerTestBase { private readonly IBillingPlans billingPlans = A.Fake(); @@ -108,18 +108,9 @@ public async Task Create_should_create_events_and_set_intitial_state() { var command = new CreateApp { Name = AppId.Name, AppId = AppId.Id }; - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(AppId.Name, sut.Snapshot.Name); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppCreated { Name = AppId.Name }), - CreateEvent(new AppContributorAssigned { ContributorId = User.Identifier, Role = Role.Owner }), - CreateEvent(new AppSettingsUpdated { Settings = initialSettings.Settings }) - ); + await VerifySutAsync(actual); } [Fact] @@ -127,17 +118,9 @@ public async Task Create_should_not_assign_client_as_contributor() { var command = new CreateApp { Name = AppId.Name, Actor = Client, AppId = AppId.Id }; - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(AppId.Name, sut.Snapshot.Name); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppCreated { Name = AppId.Name }, true), // Must be with client actor. - CreateEvent(new AppSettingsUpdated { Settings = initialSettings.Settings }, true) - ); + await VerifySutAsync(actual); } [Fact] @@ -147,17 +130,9 @@ public async Task Update_should_create_events_and_update_label_and_description() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.Label, sut.Snapshot.Label); - Assert.Equal(command.Description, sut.Snapshot.Description); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppUpdated { Label = command.Label, Description = command.Description }) - ); + await VerifySutAsync(actual); } [Fact] @@ -173,16 +148,9 @@ public async Task UpdateSettings_should_create_event_and_update_settings() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.Settings, sut.Snapshot.Settings); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppSettingsUpdated { Settings = command.Settings }) - ); + await VerifySutAsync(actual); } [Fact] @@ -192,16 +160,9 @@ public async Task UploadImage_should_create_events_and_update_image() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.File.MimeType, sut.Snapshot.Image!.MimeType); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppImageUploaded { Image = sut.Snapshot.Image }) - ); + await VerifySutAsync(actual); } [Fact] @@ -212,16 +173,9 @@ public async Task RemoveImage_should_create_events_and_update_image() await ExecuteCreateAsync(); await ExecuteUploadImage(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Null(sut.Snapshot.Image); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppImageRemoved()) - ); + await VerifySutAsync(actual); } [Fact] @@ -234,16 +188,9 @@ public async Task ChangePlan_should_create_events_and_update_plan() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(new PlanChangedResult(planIdPaid)); - - Assert.Equal(planIdPaid, sut.Snapshot.Plan!.PlanId); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppPlanChanged { PlanId = planIdPaid }) - ); + await VerifySutAsync(actual, new PlanChangedResult(planIdPaid)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(User.Identifier, A._, planIdPaid, CancellationToken)) .MustHaveHappened(); @@ -259,16 +206,9 @@ public async Task ChangePlan_from_callback_should_create_events_and_update_plan( await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(new PlanChangedResult(planIdPaid)); - - Assert.Equal(planIdPaid, sut.Snapshot.Plan!.PlanId); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppPlanChanged { PlanId = planIdPaid }) - ); + await VerifySutAsync(actual, new PlanChangedResult(planIdPaid)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(A._, A._, A._, A._)) .MustNotHaveHappened(); @@ -285,16 +225,9 @@ public async Task ChangePlan_from_callback_should_reset_plan_for_free_plan() await ExecuteCreateAsync(); await ExecuteChangePlanAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(new PlanChangedResult(planIdFree, true)); - - Assert.Null(sut.Snapshot.Plan); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppPlanReset()) - ); + await VerifySutAsync(actual, new PlanChangedResult(planIdFree, true)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(A._, A._, A._, A._)) .MustHaveHappenedOnceExactly(); @@ -311,16 +244,9 @@ public async Task ChangePlan_should_reset_plan_for_free_plan() await ExecuteCreateAsync(); await ExecuteChangePlanAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(new PlanChangedResult(planIdFree, true)); - - Assert.Null(sut.Snapshot.Plan); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppPlanReset()) - ); + await VerifySutAsync(actual, new PlanChangedResult(planIdFree, true)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(User.Identifier, A._, planIdPaid, CancellationToken)) .MustHaveHappenedOnceExactly(); @@ -339,11 +265,9 @@ public async Task ChangePlan_should_not_make_update_for_redirect() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(new PlanChangedResult(planIdPaid, false, new Uri("http://squidex.io"))); - - Assert.Null(sut.Snapshot.Plan); + await VerifySutAsync(actual, new PlanChangedResult(planIdPaid, false, new Uri("http://squidex.io"))); } [Fact] @@ -353,11 +277,9 @@ public async Task ChangePlan_should_not_call_billing_manager_for_callback() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(new PlanChangedResult(planIdPaid)); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal(planIdPaid, sut.Snapshot.Plan?.PlanId); + await VerifySutAsync(actual, new PlanChangedResult(planIdPaid)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(User.Identifier, A._, planIdPaid, A._)) .MustNotHaveHappened(); @@ -373,16 +295,9 @@ public async Task AssignContributor_should_create_events_and_add_contributor() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Role.Editor, sut.Snapshot.Contributors[contributorId]); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppContributorAssigned { ContributorId = contributorId, Role = Role.Editor, IsAdded = true }) - ); + await VerifySutAsync(actual); } [Fact] @@ -393,16 +308,9 @@ public async Task AssignContributor_should_create_update_events_and_update_contr await ExecuteCreateAsync(); await ExecuteAssignContributorAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Role.Owner, sut.Snapshot.Contributors[contributorId]); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppContributorAssigned { ContributorId = contributorId, Role = Role.Owner }) - ); + await VerifySutAsync(actual); } [Fact] @@ -413,16 +321,9 @@ public async Task RemoveContributor_should_create_events_and_remove_contributor( await ExecuteCreateAsync(); await ExecuteAssignContributorAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.False(sut.Snapshot.Contributors.ContainsKey(contributorId)); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppContributorRemoved { ContributorId = contributorId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -432,16 +333,9 @@ public async Task Transfer_should_create_events_and_set_team() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(TeamId, sut.Snapshot.TeamId); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppTransfered { TeamId = TeamId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -452,16 +346,9 @@ public async Task Transfer_from_team_should_create_events_and_set_team() await ExecuteCreateAsync(); await ExecuteTransferAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.Null(sut.Snapshot.TeamId); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppTransfered { TeamId = null }) - ); + await VerifySutAsync(actual); } [Fact] @@ -471,16 +358,9 @@ public async Task AttachClient_should_create_events_and_add_client() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.True(sut.Snapshot.Clients.ContainsKey(clientId)); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppClientAttached { Id = clientId, Secret = command.Secret }) - ); + await VerifySutAsync(actual); } [Fact] @@ -491,16 +371,9 @@ public async Task UpdateClient_should_create_events_and_update_client() await ExecuteCreateAsync(); await ExecuteAttachClientAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal(clientNewName, sut.Snapshot.Clients[clientId].Name); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppClientUpdated { Id = clientId, Name = clientNewName, Role = Role.Developer }) - ); + await VerifySutAsync(actual); } [Fact] @@ -511,16 +384,9 @@ public async Task RevokeClient_should_create_events_and_remove_client() await ExecuteCreateAsync(); await ExecuteAttachClientAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.False(sut.Snapshot.Clients.ContainsKey(clientId)); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppClientRevoked { Id = clientId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -530,16 +396,9 @@ public async Task AddWorkflow_should_create_events_and_add_workflow() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.NotEmpty(sut.Snapshot.Workflows); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppWorkflowAdded { WorkflowId = workflowId, Name = "my-workflow" }) - ); + await VerifySutAsync(actual); } [Fact] @@ -550,16 +409,9 @@ public async Task UpdateWorkflow_should_create_events_and_update_workflow() await ExecuteCreateAsync(); await ExecuteAddWorkflowAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.NotEmpty(sut.Snapshot.Workflows); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppWorkflowUpdated { WorkflowId = workflowId, Workflow = Workflow.Default }) - ); + await VerifySutAsync(actual); } [Fact] @@ -570,16 +422,9 @@ public async Task DeleteWorkflow_should_create_events_and_remove_workflow() await ExecuteCreateAsync(); await ExecuteAddWorkflowAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.Empty(sut.Snapshot.Workflows); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppWorkflowDeleted { WorkflowId = workflowId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -589,16 +434,9 @@ public async Task AddLanguage_should_create_events_and_add_language() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.True(sut.Snapshot.Languages.Contains(Language.DE)); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppLanguageAdded { Language = Language.DE }) - ); + await VerifySutAsync(actual); } [Fact] @@ -609,16 +447,9 @@ public async Task RemoveLanguage_should_create_events_and_remove_language() await ExecuteCreateAsync(); await ExecuteAddLanguageAsync(Language.DE); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.False(sut.Snapshot.Languages.Contains(Language.DE)); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppLanguageRemoved { Language = Language.DE }) - ); + await VerifySutAsync(actual); } [Fact] @@ -629,16 +460,9 @@ public async Task UpdateLanguage_should_create_events_and_update_language() await ExecuteCreateAsync(); await ExecuteAddLanguageAsync(Language.DE); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.True(sut.Snapshot.Languages.Contains(Language.DE)); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppLanguageUpdated { Language = Language.DE, Fallback = [Language.EN] }) - ); + await VerifySutAsync(actual); } [Fact] @@ -648,16 +472,9 @@ public async Task AddRole_should_create_events_and_add_role() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.Equal(1, sut.Snapshot.Roles.CustomCount); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppRoleAdded { Name = roleName }) - ); + await VerifySutAsync(actual); } [Fact] @@ -668,16 +485,9 @@ public async Task DeleteRole_should_create_events_and_delete_role() await ExecuteCreateAsync(); await ExecuteAddRoleAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.Equal(0, sut.Snapshot.Roles.CustomCount); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppRoleDeleted { Name = roleName }) - ); + await VerifySutAsync(actual); } [Fact] @@ -688,14 +498,9 @@ public async Task UpdateRole_should_create_events_and_update_role() await ExecuteCreateAsync(); await ExecuteAddRoleAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppRoleUpdated { Name = roleName, Permissions = command.Permissions, Properties = command.Properties }) - ); + await VerifySutAsync(actual); } [Fact] @@ -705,16 +510,9 @@ public async Task ArchiveApp_should_create_events_and_update_deleted_flag() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(None.Value); - - Assert.True(sut.Snapshot.IsDeleted); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new AppDeleted()) - ); + await VerifySutAsync(actual, None.Value); A.CallTo(() => billingManager.UnsubscribeAsync(command.Actor.Identifier, A._, default)) .MustHaveHappened(); @@ -722,63 +520,65 @@ public async Task ArchiveApp_should_create_events_and_update_deleted_flag() private Task ExecuteCreateAsync() { - return PublishAsync(new CreateApp { Name = AppId.Name, AppId = AppId.Id }); + return PublishAsync(sut, new CreateApp { Name = AppId.Name, AppId = AppId.Id }); } private Task ExecuteUploadImage() { - return PublishAsync(new UploadAppImage { File = new NoopAssetFile() }); + return PublishAsync(sut, new UploadAppImage { File = new NoopAssetFile() }); } private Task ExecuteAssignContributorAsync() { - return PublishAsync(new AssignContributor { ContributorId = contributorId, Role = Role.Editor }); + return PublishAsync(sut, new AssignContributor { ContributorId = contributorId, Role = Role.Editor }); } private Task ExecuteAttachClientAsync() { - return PublishAsync(new AttachClient { Id = clientId }); + return PublishAsync(sut, new AttachClient { Id = clientId }); } private Task ExecuteAddRoleAsync() { - return PublishAsync(new AddRole { Name = roleName }); + return PublishAsync(sut, new AddRole { Name = roleName }); } private Task ExecuteAddLanguageAsync(Language language) { - return PublishAsync(new AddLanguage { Language = language }); + return PublishAsync(sut, new AddLanguage { Language = language }); } private Task ExecuteAddWorkflowAsync() { - return PublishAsync(new AddWorkflow { WorkflowId = workflowId, Name = "my-workflow" }); + return PublishAsync(sut, new AddWorkflow { WorkflowId = workflowId, Name = "my-workflow" }); } private Task ExecuteChangePlanAsync() { - return PublishAsync(new ChangePlan { PlanId = planIdPaid }); + return PublishAsync(sut, new ChangePlan { PlanId = planIdPaid }); } private Task ExecuteTransferAsync() { - return PublishAsync(new TransferToTeam { TeamId = TeamId }); + return PublishAsync(sut, new TransferToTeam { TeamId = TeamId }); } private Task ExecuteArchiveAsync() { - return PublishAsync(new DeleteApp()); + return PublishAsync(sut, new DeleteApp()); } - private Task PublishIdempotentAsync(T command) where T : SquidexCommand, IAggregateCommand + private async Task VerifySutAsync(object? actual, object? expected = null) { - return PublishIdempotentAsync(sut, CreateCommand(command)); - } - - private async Task PublishAsync(T command) where T : SquidexCommand, IAggregateCommand - { - var actual = await sut.ExecuteAsync(CreateCommand(command), CancellationToken); + if (expected == null) + { + actual.Should().BeEquivalentTo(sut.Snapshot, o => o.IncludingProperties()); + } + else + { + actual.Should().BeEquivalentTo(expected); + } - return actual.Payload; + await Verify(new { sut, events = LastEvents }); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DomainObject/AssetDomainObjectTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DomainObject/AssetDomainObjectTests.cs index c5afc7e417..695f0134f0 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DomainObject/AssetDomainObjectTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DomainObject/AssetDomainObjectTests.cs @@ -5,6 +5,7 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== +using Esprima; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Squidex.Assets; @@ -14,12 +15,15 @@ using Squidex.Domain.Apps.Entities.Assets.Commands; using Squidex.Domain.Apps.Entities.Contents; using Squidex.Domain.Apps.Entities.Contents.Repositories; +using Squidex.Domain.Apps.Entities.Rules.Commands; using Squidex.Domain.Apps.Entities.TestHelpers; using Squidex.Domain.Apps.Events.Assets; using Squidex.Infrastructure; +using Squidex.Infrastructure.Commands; namespace Squidex.Domain.Apps.Entities.Assets.DomainObject; +[UsesVerify] public class AssetDomainObjectTests : HandlerTestBase { private readonly IAssetQueryService assetQuery = A.Fake(); @@ -87,27 +91,9 @@ public async Task Create_should_create_events_and_set_intitial_state() { var command = new CreateAsset { File = file, FileHash = "NewHash" }; - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(0, sut.Snapshot.FileVersion); - Assert.Equal(command.FileHash, sut.Snapshot.FileHash); - - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetCreated - { - FileName = file.FileName, - FileSize = file.FileSize, - FileHash = command.FileHash, - FileVersion = 0, - Metadata = [], - MimeType = file.MimeType, - Tags = [], - Slug = file.FileName.ToAssetSlug() - }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -121,7 +107,7 @@ public async Task Create_should_recreate_deleted_content() await ExecuteCreateAsync(); await ExecuteDeleteAsync(); - await PublishAsync(command); + await PublishAsync(sut, command); } [Fact] @@ -132,7 +118,7 @@ public async Task Create_should_recreate_permanently_deleted_content() await ExecuteCreateAsync(); await ExecuteDeleteAsync(true); - await PublishAsync(command); + await PublishAsync(sut, command); } [Fact] @@ -140,27 +126,9 @@ public async Task Upsert_should_create_events_and_set_intitial_state_if_not_foun { var command = new UpsertAsset { File = file, FileHash = "NewHash" }; - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(0, sut.Snapshot.FileVersion); - Assert.Equal(command.FileHash, sut.Snapshot.FileHash); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetCreated - { - FileName = file.FileName, - FileSize = file.FileSize, - FileHash = command.FileHash, - FileVersion = 0, - Metadata = [], - MimeType = file.MimeType, - Tags = [], - Slug = file.FileName.ToAssetSlug() - }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -173,24 +141,9 @@ public async Task Upsert_should_create_events_and_update_file_state_if_found() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(1, sut.Snapshot.FileVersion); - Assert.Equal(command.FileHash, sut.Snapshot.FileHash); - - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetUpdated - { - FileSize = file.FileSize, - FileHash = command.FileHash, - FileVersion = 1, - Metadata = [], - MimeType = file.MimeType - }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -203,24 +156,9 @@ public async Task Update_should_create_events_and_update_file_state() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(1, sut.Snapshot.FileVersion); - Assert.Equal(command.FileHash, sut.Snapshot.FileHash); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetUpdated - { - FileSize = file.FileSize, - FileHash = command.FileHash, - FileVersion = 1, - Metadata = [], - MimeType = file.MimeType - }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -233,16 +171,9 @@ public async Task AnnotateName_should_create_events_and_update_file_name() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.FileName, sut.Snapshot.FileName); - - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetAnnotated { FileName = command.FileName }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -255,16 +186,9 @@ public async Task AnnotateSlug_should_create_events_and_update_slug() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.Slug, sut.Snapshot.Slug); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetAnnotated { Slug = command.Slug }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -277,16 +201,9 @@ public async Task AnnotateProtected_should_create_events_and_update_protected_fl await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.IsProtected, sut.Snapshot.IsProtected); - - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetAnnotated { IsProtected = command.IsProtected }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -299,16 +216,9 @@ public async Task AnnotateMetadata_should_create_events_and_update_metadata() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal(command.Metadata, sut.Snapshot.Metadata); - - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetAnnotated { Metadata = command.Metadata }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustNotHaveHappened(); @@ -321,14 +231,9 @@ public async Task AnnotateTags_should_create_events_and_update_tags() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetAnnotated { Tags = ["tag1"] }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -341,16 +246,9 @@ public async Task Move_should_create_events_and_update_parent_id() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(parentId, sut.Snapshot.ParentId); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetMoved { ParentId = parentId }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -364,16 +262,9 @@ public async Task Delete_should_create_events_with_total_file_size_and_tags_and_ await ExecuteCreateAsync(); await ExecuteUpdateAsync(); - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(None.Value); - - Assert.True(sut.Snapshot.IsDeleted); - - LastEvents - .ShouldHaveSameEvents( - CreateAssetEvent(new AssetDeleted { DeletedSize = 2048, OldTags = [] }) - ); + await VerifySutAsync(actual, None.Value); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -389,11 +280,8 @@ public async Task Delete_should_not_create_events_if_permanent() A.CallTo(() => contentRepository.HasReferrersAsync(App, Id, SearchScope.All, A._)) .Returns(false); - var actual = await PublishAsync(command); + await PublishAsync(sut, command); - actual.ShouldBeEquivalent(None.Value); - - Assert.Equal(EtagVersion.Empty, sut.Snapshot.Version); Assert.Empty(LastEvents); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) @@ -410,7 +298,7 @@ public async Task Delete_should_throw_exception_if_referenced_by_other_item() A.CallTo(() => contentRepository.HasReferrersAsync(App, Id, SearchScope.All, A._)) .Returns(true); - await Assert.ThrowsAsync(() => PublishAsync(command)); + await Assert.ThrowsAsync(() => PublishAsync(sut, command)); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustNotHaveHappened(); @@ -426,7 +314,7 @@ public async Task Delete_should_not_throw_exception_if_referenced_by_other_item_ A.CallTo(() => contentRepository.HasReferrersAsync(App, Id, SearchScope.All, A._)) .Returns(true); - await PublishAsync(command); + await PublishAsync(sut, command); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -434,17 +322,17 @@ public async Task Delete_should_not_throw_exception_if_referenced_by_other_item_ private Task ExecuteCreateAsync() { - return PublishAsync(new CreateAsset { File = file, FileHash = "123" }); + return PublishAsync(sut, new CreateAsset { File = file, FileHash = "123" }); } private Task ExecuteUpdateAsync() { - return PublishAsync(new UpdateAsset { File = file, FileHash = "456" }); + return PublishAsync(sut, new UpdateAsset { File = file, FileHash = "456" }); } private Task ExecuteDeleteAsync(bool permanent = false) { - return PublishAsync(new DeleteAsset { Permanent = permanent }); + return PublishAsync(sut, new DeleteAsset { Permanent = permanent }); } private static ScriptOptions ScriptOptions() @@ -452,29 +340,26 @@ private static ScriptOptions ScriptOptions() return A.That.Matches(x => x.CanDisallow && x.CanReject && x.AsContext); } - private T CreateAssetEvent(T @event) where T : AssetEvent + protected override IAggregateCommand CreateCommand(IAggregateCommand command) { - @event.AssetId = assetId; + ((AssetCommand)command).AssetId = assetId; - return CreateEvent(@event); + return base.CreateCommand(command); } - private T CreateAssetCommand(T command) where T : AssetCommand + private async Task VerifySutAsync(object? actual, object? expected = null) { - command.AssetId = assetId; - - return CreateCommand(command); - } - - private Task PublishIdempotentAsync(AssetCommand command) - { - return PublishIdempotentAsync(sut, CreateAssetCommand(command)); - } + if (expected == null) + { + actual.Should().BeEquivalentTo(sut.Snapshot, o => o.IncludingProperties()); + } + else + { + actual.Should().BeEquivalentTo(expected); + } - private async Task PublishAsync(AssetCommand command) - { - var actual = await sut.ExecuteAsync(CreateAssetCommand(command), CancellationToken); + Assert.Equal(AppId, sut.Snapshot.AppId); - return actual.Payload; + await Verify(new { sut, events = LastEvents }); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DomainObject/AssetFolderDomainObjectTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DomainObject/AssetFolderDomainObjectTests.cs index 2857a4ec27..49e27825d0 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DomainObject/AssetFolderDomainObjectTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DomainObject/AssetFolderDomainObjectTests.cs @@ -11,11 +11,12 @@ using Squidex.Domain.Apps.Entities.Assets.Commands; using Squidex.Domain.Apps.Entities.Contents.Repositories; using Squidex.Domain.Apps.Entities.TestHelpers; -using Squidex.Domain.Apps.Events.Assets; using Squidex.Infrastructure; +using Squidex.Infrastructure.Commands; namespace Squidex.Domain.Apps.Entities.Assets.DomainObject; +[UsesVerify] public class AssetFolderDomainObjectTests : HandlerTestBase { private readonly IAssetQueryService assetQuery = A.Fake(); @@ -63,16 +64,9 @@ public async Task Create_should_create_events_and_set_intitial_state() { var command = new CreateAssetFolder { FolderName = "New Name" }; - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.FolderName, sut.Snapshot.FolderName); - - LastEvents - .ShouldHaveSameEvents( - CreateAssetFolderEvent(new AssetFolderCreated { FolderName = command.FolderName }) - ); + await VerifySutAsync(actual); } [Fact] @@ -82,16 +76,9 @@ public async Task Update_should_create_events_and_update_state() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.FolderName, sut.Snapshot.FolderName); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateAssetFolderEvent(new AssetFolderRenamed { FolderName = command.FolderName }) - ); + await VerifySutAsync(actual); } [Fact] @@ -101,16 +88,9 @@ public async Task Move_should_create_events_and_update_state() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(parentId, sut.Snapshot.ParentId); - - LastEvents - .ShouldHaveSameEvents( - CreateAssetFolderEvent(new AssetFolderMoved { ParentId = parentId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -120,56 +100,46 @@ public async Task Delete_should_create_events_with_total_file_size() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(None.Value); - - Assert.True(sut.Snapshot.IsDeleted); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateAssetFolderEvent(new AssetFolderDeleted()) - ); + await VerifySutAsync(actual, None.Value); } private Task ExecuteCreateAsync() { - return PublishAsync(new CreateAssetFolder { FolderName = "My Folder" }); + return PublishAsync(sut, new CreateAssetFolder { FolderName = "My Folder" }); } private Task ExecuteUpdateAsync() { - return PublishAsync(new RenameAssetFolder { FolderName = "My Folder" }); + return PublishAsync(sut, new RenameAssetFolder { FolderName = "My Folder" }); } private Task ExecuteDeleteAsync() { - return PublishAsync(new DeleteAssetFolder()); + return PublishAsync(sut, new DeleteAssetFolder()); } - private T CreateAssetFolderEvent(T @event) where T : AssetFolderEvent + protected override IAggregateCommand CreateCommand(IAggregateCommand command) { - @event.AssetFolderId = assetFolderId; + ((AssetFolderCommand)command).AssetFolderId = assetFolderId; - return CreateEvent(@event); + return base.CreateCommand(command); } - private T CreateAssetFolderCommand(T command) where T : AssetFolderCommand + private async Task VerifySutAsync(object? actual, object? expected = null) { - command.AssetFolderId = assetFolderId; - - return CreateCommand(command); - } - - private Task PublishIdempotentAsync(AssetFolderCommand command) - { - return PublishIdempotentAsync(sut, CreateAssetFolderCommand(command)); - } - - private async Task PublishAsync(AssetFolderCommand command) - { - var actual = await sut.ExecuteAsync(CreateAssetFolderCommand(command), CancellationToken); - - return actual.Payload; + if (expected == null) + { + actual.Should().BeEquivalentTo(sut.Snapshot, o => o.IncludingProperties()); + } + else + { + actual.Should().BeEquivalentTo(expected); + } + + Assert.Equal(AppId, sut.Snapshot.AppId); + + await Verify(new { sut, events = LastEvents }); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/ContentDomainObjectTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/ContentDomainObjectTests.cs index 5d0d21ca1c..dbf8dfe100 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/ContentDomainObjectTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/ContentDomainObjectTests.cs @@ -6,6 +6,7 @@ // ========================================================================== using System.Security.Claims; +using Elasticsearch.Net.Specification.WatcherApi; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NodaTime; @@ -25,6 +26,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.DomainObject; +[UsesVerify] public class ContentDomainObjectTests : HandlerTestBase { private readonly DomainId contentId = DomainId.NewGuid(); @@ -140,15 +142,7 @@ public async Task Create_should_create_events_and_update_data_and_status() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(data, sut.Snapshot.CurrentVersion.Data); - Assert.Equal(Status.Draft, sut.Snapshot.CurrentVersion.Status); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentCreated { Data = data, Status = Status.Draft }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -163,15 +157,7 @@ public async Task Create_should_not_change_status_if_set_to_initial() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(data, sut.Snapshot.CurrentVersion.Data); - Assert.Equal(Status.Draft, sut.Snapshot.CurrentVersion.Status); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentCreated { Data = data, Status = Status.Draft }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -186,16 +172,7 @@ public async Task Create_should_change_status_if_set() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(data, sut.Snapshot.CurrentVersion.Data); - Assert.Equal(Status.Archived, sut.Snapshot.EditingStatus); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentCreated { Data = data, Status = Status.Draft }), - CreateContentEvent(new ContentStatusChanged { Status = Status.Archived }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -240,15 +217,7 @@ public async Task Upsert_should_create_content_if_not_found() var actual = await PublishAsync(CreateContentCommand(command)); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(data, sut.Snapshot.CurrentVersion.Data); - Assert.Equal(Status.Draft, sut.Snapshot.EditingStatus); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentCreated { Data = data, Status = Status.Draft }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -263,15 +232,7 @@ public async Task Upsert_should_not_change_status_on_create_if_status_set_to_ini var actual = await PublishAsync(CreateContentCommand(command)); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(data, sut.Snapshot.CurrentVersion.Data); - Assert.Equal(Status.Draft, sut.Snapshot.EditingStatus); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentCreated { Data = data, Status = Status.Draft }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -286,16 +247,7 @@ public async Task Upsert_should_change_status_on_create_if_status_set() var actual = await PublishAsync(CreateContentCommand(command)); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(data, sut.Snapshot.CurrentVersion.Data); - Assert.Equal(Status.Archived, sut.Snapshot.EditingStatus); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentCreated { Data = data, Status = Status.Draft }), - CreateContentEvent(new ContentStatusChanged { Status = Status.Archived }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -312,14 +264,7 @@ public async Task Upsert_should_update_content_if_found() var actual = await PublishAsync(CreateContentCommand(command)); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(otherData, sut.Snapshot.CurrentVersion.Data); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = otherData }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(otherData, data, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -334,14 +279,7 @@ public async Task Upsert_should_patch_content_if_found() var actual = await PublishAsync(CreateContentCommand(command)); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(patched, sut.Snapshot.CurrentVersion.Data); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = patched }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(patched, data, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -356,14 +294,7 @@ public async Task Upsert_should_not_change_status_on_update_if_status_set_to_ini var actual = await PublishAsync(CreateContentCommand(command)); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(otherData, sut.Snapshot.CurrentVersion.Data); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = otherData }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(otherData, data, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -378,16 +309,7 @@ public async Task Upsert_should_change_status_on_update_if_status_set() var actual = await PublishAsync(CreateContentCommand(command)); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(otherData, sut.Snapshot.CurrentVersion.Data); - Assert.Equal(Status.Archived, sut.Snapshot.EditingStatus); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = otherData }), - CreateContentEvent(new ContentStatusChanged { Status = Status.Archived }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(otherData, data, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -404,11 +326,6 @@ public async Task Upsert_should_recreate_deleted_content() await ExecuteDeleteAsync(); await PublishAsync(command); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentCreated { Data = data, Status = Status.Draft }) - ); } [Fact] @@ -420,11 +337,6 @@ public async Task Upsert_should_recreate_permanently_deleted_content() await ExecuteDeleteAsync(true); await PublishAsync(command); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentCreated { Data = data, Status = Status.Draft }) - ); } [Fact] @@ -436,14 +348,7 @@ public async Task Update_should_create_events_and_update_data() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(otherData, sut.Snapshot.CurrentVersion.Data); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = otherData }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(otherData, data, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -460,14 +365,7 @@ public async Task Update_should_create_events_and_update_new_version_if_draft_av var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(otherData, sut.Snapshot.NewVersion?.Data); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = otherData }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(otherData, data, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -482,9 +380,7 @@ public async Task Update_should_not_create_event_for_same_data() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Single(LastEvents); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(A._, "", ScriptOptions(), CancellationToken)) .MustNotHaveHappened(); @@ -509,14 +405,7 @@ public async Task Patch_should_create_events_and_update_data() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.NotEqual(data, sut.Snapshot.CurrentVersion.Data); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = patched }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(patched, data, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -533,14 +422,7 @@ public async Task Patch_should_create_events_and_update_new_version_if_draft_ava var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(patched, sut.Snapshot.NewVersion?.Data); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = patched }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(patched, data, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -555,9 +437,7 @@ public async Task Patch_should_not_create_event_for_same_data() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Single(LastEvents); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(A._, "", ScriptOptions(), CancellationToken)) .MustNotHaveHappened(); @@ -572,14 +452,7 @@ public async Task ChangeStatus_should_create_events_and_update_status_if_publish var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Status.Archived, sut.Snapshot.CurrentVersion.Status); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentStatusChanged { Status = Status.Archived }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Archived, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -594,14 +467,7 @@ public async Task ChangeStatus_should_create_events_and_update_status_if_changed var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Status.Archived, sut.Snapshot.CurrentVersion.Status); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentStatusChanged { Status = Status.Archived }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Archived, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -617,14 +483,7 @@ public async Task ChangeStatus_should_create_events_and_update_status_if_unpubli var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Status.Draft, sut.Snapshot.CurrentVersion.Status); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentStatusChanged { Status = Status.Draft, Change = StatusChange.Unpublished }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Draft, Status.Published), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -643,16 +502,7 @@ public async Task ChangeStatus_should_also_update_if_script_changes_data() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Status.Draft, sut.Snapshot.CurrentVersion.Status); - Assert.Equal(otherData, sut.Snapshot.CurrentVersion.Data); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentUpdated { Data = otherData }), - CreateContentEvent(new ContentStatusChanged { Status = Status.Draft, Change = StatusChange.Unpublished }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Draft, Status.Published), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -669,14 +519,7 @@ public async Task ChangeStatus_should_create_events_and_update_new_version_if_dr var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Status.Archived, sut.Snapshot.NewVersion?.Status); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentStatusChanged { Change = StatusChange.Change, Status = Status.Archived }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Archived, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -693,14 +536,7 @@ public async Task ChangeStatus_should_create_events_and_delete_new_version_if_av var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Null(sut.Snapshot.NewVersion?.Status); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentStatusChanged { Change = StatusChange.Published, Status = Status.Published }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(DataScriptVars(data, null, Status.Published, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -717,17 +553,7 @@ public async Task ChangeStatus_create_events_and_set_schedule_if_duetime_set() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Status.Draft, sut.Snapshot.CurrentVersion.Status); - Assert.Equal(Status.Published, sut.Snapshot.ScheduleJob?.Status); - - Assert.Equal(dueTime, sut.Snapshot.ScheduleJob?.DueTime); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentStatusScheduled { Status = Status.Published, DueTime = dueTime }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustNotHaveHappened(); @@ -748,14 +574,7 @@ public async Task ChangeStatus_should_refresh_properties_and_unset_schedule_if_c var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Null(sut.Snapshot.ScheduleJob); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentStatusChanged { Status = Status.Archived }) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.TransformAsync(A._, "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -776,14 +595,7 @@ public async Task ChangeStatus_should_create_events_and_unset_schedule_if_failed var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Null(sut.Snapshot.ScheduleJob); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentSchedulingCancelled()) - ); + await VerifySutAsync(actual); A.CallTo(() => scriptEngine.ExecuteAsync(A._, "", ScriptOptions(), CancellationToken)) .MustNotHaveHappened(); @@ -818,7 +630,7 @@ public async Task ChangeStatus_should_not_throw_exception_if_referenced_by_other } [Fact] - public async Task CancelContentSchedule_create_events_and_unset_schedule() + public async Task CancelContentSchedule_should_create_events_and_unset_schedule() { var command = new CancelContentSchedule(); @@ -827,45 +639,58 @@ public async Task CancelContentSchedule_create_events_and_unset_schedule() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Null(sut.Snapshot.ScheduleJob); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentSchedulingCancelled()) - ); + await VerifySutAsync(actual); } [Fact] public async Task Validate_should_not_update_state() { - await ExecuteCreateAsync(); - var command = new ValidateContent(); + await ExecuteCreateAsync(); await PublishAsync(command); Assert.Equal(0, sut.Version); } [Fact] - public async Task Delete_should_create_events_and_update_deleted_flag() + public async Task EnrichContentDefaults_should_update_content() { await ExecuteCreateAsync(); - var command = new DeleteContent(); + Schema = + Schema.AddString(3, "defaults", Partitioning.Invariant, + new StringFieldProperties { DefaultValue = "Default Value" }); + + var command = new EnrichContentDefaults(); var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(None.Value); + await VerifySutAsync(actual); + } - Assert.True(sut.Snapshot.IsDeleted); + [Fact] + public async Task EnrichContentDefaults_should_not_update_content_if_all_fields_have_a_value() + { + await ExecuteCreateAsync(); - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentDeleted()) - ); + var command = new EnrichContentDefaults(); + + var actual = await PublishAsync(command); + + await VerifySutAsync(actual); + } + + [Fact] + public async Task Delete_should_create_events_and_update_deleted_flag() + { + await ExecuteCreateAsync(); + + var command = new DeleteContent(); + + var actual = await PublishAsync(command); + + await VerifySutAsync(actual, None.Value); A.CallTo(() => scriptEngine.ExecuteAsync(DataScriptVars(data, null, Status.Draft), "", ScriptOptions(), CancellationToken)) .MustHaveHappened(); @@ -880,9 +705,6 @@ public async Task Delete_should_not_create_events_if_permanent() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(None.Value); - - Assert.Equal(EtagVersion.Empty, sut.Snapshot.Version); Assert.Empty(LastEvents); A.CallTo(() => scriptEngine.ExecuteAsync(DataScriptVars(data, null, Status.Draft), "", ScriptOptions(), CancellationToken)) @@ -925,14 +747,7 @@ public async Task CreateDraft_should_create_events_and_update_new_state() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(Status.Draft, sut.Snapshot.NewVersion?.Status); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentDraftCreated { Status = Status.Draft }) - ); + await VerifySutAsync(actual); } [Fact] @@ -946,14 +761,7 @@ public async Task DeleteDraft_should_create_events_and_delete_new_version() var actual = await PublishAsync(command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Null(sut.Snapshot.NewVersion); - - LastEvents - .ShouldHaveSameEvents( - CreateContentEvent(new ContentDraftDeleted()) - ); + await VerifySutAsync(actual); } private Task ExecuteCreateAsync() @@ -1023,13 +831,27 @@ private T CreateContentCommand(T command) where T : ContentCommand { command.ContentId = contentId; - return CreateCommand(command); + return (T)CreateCommand(command); } - private async Task PublishAsync(ContentCommand command) + private Task PublishAsync(ContentCommand command) { - var actual = await sut.ExecuteAsync(CreateContentCommand(command), CancellationToken); + return PublishAsync(sut, CreateContentCommand(command)); + } + + private async Task VerifySutAsync(object? actual, object? expected = null) + { + if (expected == null) + { + actual.Should().BeEquivalentTo(sut.Snapshot, o => o.IncludingProperties()); + } + else + { + actual.Should().BeEquivalentTo(expected); + } + + Assert.Equal(AppId, sut.Snapshot.AppId); - return actual.Payload; + await Verify(new { sut, events = LastEvents }); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/ContentsBulkUpdateCommandMiddlewareTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/ContentsBulkUpdateCommandMiddlewareTests.cs index 56263f34d8..00b6d88465 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/ContentsBulkUpdateCommandMiddlewareTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/ContentsBulkUpdateCommandMiddlewareTests.cs @@ -315,6 +315,43 @@ public async Task Should_throw_security_exception_if_user_has_no_permission_for_ .MustNotHaveHappened(); } + [Fact] + public async Task Should_update_content_defaults() + { + SetupContext(PermissionIds.AppContentsUpdateOwn); + + var (id, _, _) = CreateTestData(false); + + var command = BulkCommand(BulkUpdateContentType.EnrichDefaults, new BulkUpdateJob(), id); + + var actual = await PublishAsync(command); + + Assert.Single(actual); + Assert.Single(actual, x => x.JobIndex == 0 && x.Id == id && x.Exception == null); + + A.CallTo(() => commandBus.PublishAsync( + A.That.Matches(x => x.ContentId == id), A._)) + .MustHaveHappened(); + } + + [Fact] + public async Task Should_throw_security_exception_if_user_has_no_permission_for_defaults() + { + SetupContext(PermissionIds.AppContentsReadOwn); + + var (id, _, _) = CreateTestData(false); + + var command = BulkCommand(BulkUpdateContentType.EnrichDefaults, new BulkUpdateJob(), id); + + var actual = await PublishAsync(command); + + Assert.Single(actual); + Assert.Single(actual, x => x.JobIndex == 0 && x.Id == id && x.Exception is DomainForbiddenException); + + A.CallTo(() => commandBus.PublishAsync(A._, A._)) + .MustNotHaveHappened(); + } + [Fact] public async Task Should_patch_content() { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/DomainObject/RuleDomainObjectTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/DomainObject/RuleDomainObjectTests.cs index 664c7af185..77877359a1 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/DomainObject/RuleDomainObjectTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/DomainObject/RuleDomainObjectTests.cs @@ -14,10 +14,12 @@ using Squidex.Domain.Apps.Entities.TestHelpers; using Squidex.Domain.Apps.Events.Rules; using Squidex.Infrastructure; +using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.EventSourcing; namespace Squidex.Domain.Apps.Entities.Rules.DomainObject; +[UsesVerify] public class RuleDomainObjectTests : HandlerTestBase { private readonly IRuleEnqueuer ruleEnqueuer = A.Fake(); @@ -64,19 +66,9 @@ public async Task Create_should_create_events_and_set_intitial_state() { var command = MakeCreateCommand(); - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(AppId, sut.Snapshot.AppId); - - Assert.Same(command.Trigger, sut.Snapshot.Trigger); - Assert.Same(command.Action, sut.Snapshot.Action); - - LastEvents - .ShouldHaveSameEvents( - CreateRuleEvent(new RuleCreated { Trigger = command.Trigger!, Action = command.Action! }) - ); + await VerifySutAsync(actual); } [Fact] @@ -86,21 +78,9 @@ public async Task Update_should_create_events_and_update_trigger_and_action() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.True(sut.Snapshot.IsEnabled); - - Assert.Same(command.Trigger, sut.Snapshot.Trigger); - Assert.Same(command.Action, sut.Snapshot.Action); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal(command.Name, sut.Snapshot.Name); - - LastEvents - .ShouldHaveSameEvents( - CreateRuleEvent(new RuleUpdated { Trigger = command.Trigger, Action = command.Action, Name = command.Name }) - ); + await VerifySutAsync(actual); } [Fact] @@ -111,16 +91,9 @@ public async Task Enable_should_create_events_and_update_enabled_flag() await ExecuteCreateAsync(); await ExecuteDisableAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.True(sut.Snapshot.IsEnabled); - - LastEvents - .ShouldHaveSameEvents( - CreateRuleEvent(new RuleEnabled()) - ); + await VerifySutAsync(actual); } [Fact] @@ -134,16 +107,9 @@ public async Task Enable_via_update_should_create_events_and_update_enabled_flag await ExecuteCreateAsync(); await ExecuteDisableAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.True(sut.Snapshot.IsEnabled); - - LastEvents - .ShouldHaveSameEvents( - CreateRuleEvent(new RuleUpdated { IsEnabled = true }) - ); + await VerifySutAsync(actual); } [Fact] @@ -153,16 +119,9 @@ public async Task Disable_should_create_events_and_update_enabled_flag() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.False(sut.Snapshot.IsEnabled); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateRuleEvent(new RuleDisabled()) - ); + await VerifySutAsync(actual); } [Fact] @@ -175,16 +134,9 @@ public async Task Disable_via_update_should_create_events_and_update_enabled_fla await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.False(sut.Snapshot.IsEnabled); - - LastEvents - .ShouldHaveSameEvents( - CreateRuleEvent(new RuleUpdated { IsEnabled = false }) - ); + await VerifySutAsync(actual); } [Fact] @@ -194,16 +146,9 @@ public async Task Delete_should_create_events_and_update_deleted_flag() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(None.Value); - - Assert.True(sut.Snapshot.IsDeleted); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateRuleEvent(new RuleDeleted()) - ); + await VerifySutAsync(actual, None.Value); } [Fact] @@ -213,9 +158,9 @@ public async Task Trigger_should_invoke_rule_enqueue_but_not_change_snapshot() await ExecuteCreateAsync(); - await PublishAsync(command); + var actual = await PublishAsync(sut, command); - Assert.Equal(0, sut.Version); + await VerifySutAsync(actual, None.Value); A.CallTo(() => ruleEnqueuer.EnqueueAsync(sut.Snapshot.Id, sut.Snapshot, A>.That.Matches(x => x.Payload is RuleManuallyTriggered))) @@ -224,17 +169,17 @@ public async Task Trigger_should_invoke_rule_enqueue_but_not_change_snapshot() private Task ExecuteCreateAsync() { - return PublishAsync(MakeCreateCommand()); + return PublishAsync(sut, MakeCreateCommand()); } private Task ExecuteDisableAsync() { - return PublishAsync(new DisableRule()); + return PublishAsync(sut, new DisableRule()); } private Task ExecuteDeleteAsync() { - return PublishAsync(new DeleteRule()); + return PublishAsync(sut, new DeleteRule()); } private static CreateRule MakeCreateCommand() @@ -268,29 +213,26 @@ private static UpdateRule MakeUpdateCommand() }; } - private T CreateRuleEvent(T @event) where T : RuleEvent + protected override IAggregateCommand CreateCommand(IAggregateCommand command) { - @event.RuleId = ruleId; + ((RuleCommand)command).RuleId = ruleId; - return CreateEvent(@event); + return base.CreateCommand(command); } - private T CreateRuleCommand(T command) where T : RuleCommand + private async Task VerifySutAsync(object? actual, object? expected = null) { - command.RuleId = ruleId; - - return CreateCommand(command); - } - - private Task PublishIdempotentAsync(RuleCommand command) - { - return PublishIdempotentAsync(sut, CreateRuleCommand(command)); - } + if (expected == null) + { + actual.Should().BeEquivalentTo(sut.Snapshot, o => o.IncludingProperties()); + } + else + { + actual.Should().BeEquivalentTo(expected); + } - private async Task PublishAsync(RuleCommand command) - { - var actual = await sut.ExecuteAsync(CreateRuleCommand(command), CancellationToken); + Assert.Equal(AppId, sut.Snapshot.AppId); - return actual.Payload; + await Verify(new { sut, events = LastEvents }); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/SchemaDomainObjectTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/SchemaDomainObjectTests.cs index 71813b1579..3f20263bd9 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/SchemaDomainObjectTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/SchemaDomainObjectTests.cs @@ -10,13 +10,12 @@ using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Entities.Schemas.Commands; using Squidex.Domain.Apps.Entities.TestHelpers; -using Squidex.Domain.Apps.Events.Schemas; using Squidex.Infrastructure; using Squidex.Infrastructure.Collections; -using Squidex.Infrastructure.Commands; namespace Squidex.Domain.Apps.Entities.Schemas.DomainObject; +[UsesVerify] public class SchemaDomainObjectTests : HandlerTestBase { private readonly string fieldName = "age"; @@ -60,21 +59,9 @@ public async Task Create_should_create_events_and_set_intitial_state() Properties = new SchemaProperties() }; - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(AppId, sut.Snapshot.AppId); - Assert.Equal(SchemaId.Id, sut.Snapshot.Id); - Assert.Equal(SchemaId.Name, sut.Snapshot.Name); - Assert.Equal(SchemaType.Default, sut.Snapshot.Type); - - var schema = new Schema { Name = command.Name, Properties = command.Properties }; - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaCreated { Schema = schema }) - ); + await VerifySutAsync(actual); } [Fact] @@ -103,17 +90,9 @@ public async Task Create_should_create_events_and_schema_with_initial_fields() ] }; - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - var @event = (SchemaCreated)LastEvents.Single().Payload; - - Assert.Equal(AppId, sut.Snapshot.AppId); - Assert.Equal(SchemaId.Id, sut.Snapshot.Id); - Assert.Equal(SchemaId.Name, sut.Snapshot.Name); - Assert.Equal(SchemaType.Default, sut.Snapshot.Type); - Assert.Equal(3, @event.Schema.Fields.Count); + await VerifySutAsync(actual); } [Fact] @@ -126,16 +105,9 @@ public async Task Update_should_create_events_and_update_schema_properties() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal(command.Properties, sut.Snapshot.Properties); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaUpdated { Properties = command.Properties }) - ); + await VerifySutAsync(actual); } [Fact] @@ -151,16 +123,9 @@ public async Task ConfigureScripts_should_create_events_and_update_schema_script await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal("", sut.Snapshot.Scripts.Query); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaScriptsConfigured { Scripts = command.Scripts }) - ); + await VerifySutAsync(actual); } [Fact] @@ -176,16 +141,9 @@ public async Task ConfigureFieldRules_should_create_events_and_update_schema_fie await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.NotEmpty(sut.Snapshot.FieldRules); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaFieldRulesConfigured { FieldRules = FieldRules.Create(FieldRule.Disable("field1")) }) - ); + await VerifySutAsync(actual); } [Fact] @@ -199,16 +157,9 @@ public async Task ConfigureUIFields_should_create_events_for_list_fields_and_upd await ExecuteCreateAsync(); await ExecuteAddFieldAsync(fieldName); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.FieldsInLists, sut.Snapshot.FieldsInLists); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaUIFieldsConfigured { FieldsInLists = command.FieldsInLists }) - ); + await VerifySutAsync(actual); } [Fact] @@ -222,16 +173,9 @@ public async Task ConfigureUIFields_should_create_events_for_reference_fields_an await ExecuteCreateAsync(); await ExecuteAddFieldAsync(fieldName); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.FieldsInReferences, sut.Snapshot.FieldsInReferences); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaUIFieldsConfigured { FieldsInReferences = command.FieldsInReferences }) - ); + await VerifySutAsync(actual); } [Fact] @@ -241,16 +185,9 @@ public async Task Publish_should_create_events_and_update_published_flag() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.True(sut.Snapshot.IsPublished); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaPublished()) - ); + await VerifySutAsync(actual); } [Fact] @@ -261,16 +198,9 @@ public async Task Unpublish_should_create_events_and_update_published_flag() await ExecuteCreateAsync(); await ExecutePublishAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.False(sut.Snapshot.IsPublished); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaUnpublished()) - ); + await VerifySutAsync(actual); } [Fact] @@ -280,16 +210,9 @@ public async Task ChangeCategory_should_create_events_and_update_category() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal(command.Name, sut.Snapshot.Category); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaCategoryChanged { Name = command.Name }) - ); + await VerifySutAsync(actual); } [Fact] @@ -305,16 +228,9 @@ public async Task ConfigurePreviewUrls_should_create_events_and_update_preview_u await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal(command.PreviewUrls, sut.Snapshot.PreviewUrls); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaPreviewUrlsConfigured { PreviewUrls = command.PreviewUrls }) - ); + await VerifySutAsync(actual); } [Fact] @@ -324,16 +240,9 @@ public async Task Delete_should_create_events_and_update_deleted_flag() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(None.Value); + var actual = await PublishAsync(sut, command); - Assert.True(sut.Snapshot.IsDeleted); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaDeleted()) - ); + await VerifySutAsync(actual, None.Value); } [Fact] @@ -349,14 +258,9 @@ public async Task Reorder_should_create_events_and_reorder_fields() await ExecuteAddFieldAsync("field1"); await ExecuteAddFieldAsync("field2"); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaFieldsReordered { FieldIds = command.FieldIds }) - ); + await VerifySutAsync(actual); } [Fact] @@ -373,14 +277,9 @@ public async Task Reorder_should_create_events_and_reorder_nestedy_fields() await ExecuteAddFieldAsync("field1", 1); await ExecuteAddFieldAsync("field2", 1); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaFieldsReordered { ParentFieldId = arrayId, FieldIds = command.FieldIds }) - ); + await VerifySutAsync(actual); } [Fact] @@ -395,16 +294,9 @@ public async Task Add_should_create_events_and_add_field() await ExecuteCreateAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.Properties, GetField(1).RawProperties); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldAdded { Name = fieldName, FieldId = fieldId, Properties = command.Properties }) - ); + await VerifySutAsync(actual); } [Fact] @@ -420,16 +312,9 @@ public async Task Add_should_create_events_and_add_field_to_array() await ExecuteCreateAsync(); await ExecuteAddArrayFieldAsync(); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Same(command.Properties, GetNestedField(1, 2).RawProperties); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldAdded { ParentFieldId = arrayId, Name = fieldName, FieldId = nestedId, Properties = command.Properties }) - ); + await VerifySutAsync(actual); } [Fact] @@ -445,16 +330,9 @@ public async Task UpdateField_should_create_events_and_update_field_properties() await ExecuteCreateAsync(); await ExecuteAddFieldAsync(fieldName); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.Properties, GetField(1).RawProperties); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldUpdated { FieldId = fieldId, Properties = command.Properties }) - ); + await VerifySutAsync(actual); } [Fact] @@ -471,16 +349,9 @@ public async Task UpdateField_should_create_events_and_update_nested_field_prope await ExecuteAddArrayFieldAsync(); await ExecuteAddFieldAsync(fieldName, 1); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Same(command.Properties, GetNestedField(1, 2).RawProperties); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldUpdated { ParentFieldId = arrayId, FieldId = nestedId, Properties = command.Properties }) - ); + await VerifySutAsync(actual); } [Fact] @@ -495,16 +366,9 @@ public async Task LockField_should_create_events_and_update_field_locked_flag() await ExecuteCreateAsync(); await ExecuteAddFieldAsync(fieldName); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.True(GetField(1).IsLocked); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldLocked { FieldId = fieldId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -520,16 +384,9 @@ public async Task LockField_should_create_events_and_update_nested_field_locked_ await ExecuteAddArrayFieldAsync(); await ExecuteAddFieldAsync(fieldName, 1); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.True(GetNestedField(1, 2).IsLocked); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldLocked { ParentFieldId = arrayId, FieldId = nestedId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -544,16 +401,9 @@ public async Task HideField_should_create_events_and_update_field_hidden_flag() await ExecuteCreateAsync(); await ExecuteAddFieldAsync(fieldName); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.True(GetField(1).IsHidden); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldHidden { FieldId = fieldId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -569,16 +419,9 @@ public async Task HideField_should_create_events_and_update_nested_field_hidden_ await ExecuteAddArrayFieldAsync(); await ExecuteAddFieldAsync(fieldName, 1); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.True(GetNestedField(1, 2).IsHidden); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldHidden { ParentFieldId = arrayId, FieldId = nestedId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -594,16 +437,9 @@ public async Task ShowField_should_create_events_and_update_field_hidden_flag() await ExecuteAddFieldAsync(fieldName); await ExecuteHideFieldAsync(1); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.False(GetField(1).IsHidden); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldShown { FieldId = fieldId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -620,16 +456,9 @@ public async Task ShowField_should_create_events_and_update_nested_field_hidden_ await ExecuteAddFieldAsync(fieldName, 1); await ExecuteHideFieldAsync(2, 1); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.False(GetNestedField(1, 2).IsHidden); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldShown { ParentFieldId = arrayId, FieldId = nestedId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -644,16 +473,9 @@ public async Task DisableField_should_create_events_and_update_field_disabled_fl await ExecuteCreateAsync(); await ExecuteAddFieldAsync(fieldName); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.True(GetField(1).IsDisabled); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldDisabled { FieldId = fieldId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -669,16 +491,9 @@ public async Task DisableField_should_create_events_and_update_nested_field_disa await ExecuteAddArrayFieldAsync(); await ExecuteAddFieldAsync(fieldName, 1); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.True(GetNestedField(1, 2).IsDisabled); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldDisabled { ParentFieldId = arrayId, FieldId = nestedId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -694,16 +509,9 @@ public async Task EnableField_should_create_events_and_update_field_disabled_fla await ExecuteAddFieldAsync(fieldName); await ExecuteDisableFieldAsync(1); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishIdempotentAsync(sut, command); - Assert.False(GetField(1).IsDisabled); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldEnabled { FieldId = fieldId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -720,16 +528,9 @@ public async Task EnableField_should_create_events_and_update_nested_field_disab await ExecuteAddFieldAsync(fieldName, 1); await ExecuteDisableFieldAsync(2, 1); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.False(GetNestedField(1, 2).IsDisabled); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldEnabled { ParentFieldId = arrayId, FieldId = nestedId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -744,16 +545,9 @@ public async Task DeleteField_should_create_events_and_delete_field() await ExecuteCreateAsync(); await ExecuteAddFieldAsync(fieldName); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Null(GetField(1)); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldDeleted { FieldId = fieldId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -769,16 +563,9 @@ public async Task DeleteField_should_create_events_and_delete_nested_field() await ExecuteAddArrayFieldAsync(); await ExecuteAddFieldAsync(fieldName, 1); - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Null(GetNestedField(1, 2)); + var actual = await PublishAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new FieldDeleted { ParentFieldId = arrayId, FieldId = nestedId }) - ); + await VerifySutAsync(actual); } [Fact] @@ -791,61 +578,44 @@ public async Task Synchronize_should_create_events_and_update_schema() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.Category, sut.Snapshot.Category); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new SchemaCategoryChanged { Name = command.Category }) - ); + await VerifySutAsync(actual); } private Task ExecuteCreateAsync() { - return PublishAsync(new CreateSchema { Name = SchemaId.Name, SchemaId = SchemaId.Id }); + return PublishAsync(sut, new CreateSchema { Name = SchemaId.Name, SchemaId = SchemaId.Id }); } private Task ExecuteAddArrayFieldAsync() { - return PublishAsync(new AddField { Properties = new ArrayFieldProperties(), Name = arrayName }); + return PublishAsync(sut, new AddField { Properties = new ArrayFieldProperties(), Name = arrayName }); } private Task ExecuteAddFieldAsync(string name, long? parentId = null) { - return PublishAsync(new AddField { ParentFieldId = parentId, Properties = ValidProperties(), Name = name }); + return PublishAsync(sut, new AddField { ParentFieldId = parentId, Properties = ValidProperties(), Name = name }); } private Task ExecuteHideFieldAsync(long id, long? parentId = null) { - return PublishAsync(new HideField { ParentFieldId = parentId, FieldId = id }); + return PublishAsync(sut, new HideField { ParentFieldId = parentId, FieldId = id }); } private Task ExecuteDisableFieldAsync(long id, long? parentId = null) { - return PublishAsync(new DisableField { ParentFieldId = parentId, FieldId = id }); + return PublishAsync(sut, new DisableField { ParentFieldId = parentId, FieldId = id }); } private Task ExecutePublishAsync() { - return PublishAsync(new PublishSchema()); + return PublishAsync(sut, new PublishSchema()); } private Task ExecuteDeleteAsync() { - return PublishAsync(new DeleteSchema()); - } - - private IField GetField(int id) - { - return sut.Snapshot.FieldsById.GetValueOrDefault(id)!; - } - - private IField GetNestedField(int parentId, int childId) - { - return ((IArrayField)sut.Snapshot.FieldsById[parentId]).FieldsById.GetValueOrDefault(childId)!; + return PublishAsync(sut, new DeleteSchema()); } private static StringFieldProperties ValidProperties() @@ -853,15 +623,19 @@ private static StringFieldProperties ValidProperties() return new StringFieldProperties { MinLength = 10, MaxLength = 20 }; } - private Task PublishIdempotentAsync(T command) where T : SquidexCommand, IAggregateCommand + private async Task VerifySutAsync(object? actual, object? expected = null) { - return PublishIdempotentAsync(sut, CreateCommand(command)); - } + if (expected == null) + { + actual.Should().BeEquivalentTo(sut.Snapshot, o => o.IncludingProperties()); + } + else + { + actual.Should().BeEquivalentTo(expected); + } - private async Task PublishAsync(T command) where T : SquidexCommand, IAggregateCommand - { - var actual = await sut.ExecuteAsync(CreateCommand(command), CancellationToken); + Assert.Equal(AppId, sut.Snapshot.AppId); - return actual.Payload; + await Verify(new { sut, events = LastEvents }); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj index 3e4efa59d6..5f1ba38206 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj @@ -39,6 +39,7 @@ + all diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Teams/DomainObject/TeamDomainObjectTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Teams/DomainObject/TeamDomainObjectTests.cs index d482eae39b..e876fb29df 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Teams/DomainObject/TeamDomainObjectTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Teams/DomainObject/TeamDomainObjectTests.cs @@ -7,18 +7,17 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Squidex.Domain.Apps.Core.Apps; using Squidex.Domain.Apps.Core.Teams; using Squidex.Domain.Apps.Core.TestHelpers; using Squidex.Domain.Apps.Entities.Billing; using Squidex.Domain.Apps.Entities.Teams.Commands; using Squidex.Domain.Apps.Entities.TestHelpers; -using Squidex.Domain.Apps.Events.Teams; using Squidex.Infrastructure; using Squidex.Shared.Users; namespace Squidex.Domain.Apps.Entities.Teams.DomainObject; +[UsesVerify] public class TeamDomainObjectTests : HandlerTestBase { private readonly IBillingPlans billingPlans = A.Fake(); @@ -74,17 +73,9 @@ public async Task Create_should_create_events_and_set_intitial_state() { var command = new CreateTeam { Name = name, TeamId = TeamId }; - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(name, sut.Snapshot.Name); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamCreated { Name = name }), - CreateEvent(new TeamContributorAssigned { ContributorId = User.Identifier, Role = Role.Owner }) - ); + await VerifySutAsync(actual); } [Fact] @@ -92,16 +83,9 @@ public async Task Create_should_not_assign_client_as_contributor() { var command = new CreateTeam { Name = name, Actor = Client, TeamId = TeamId }; - var actual = await PublishAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); + var actual = await PublishAsync(sut, command); - Assert.Equal(name, sut.Snapshot.Name); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamCreated { Name = name }, true) // Must be with client User. - ); + await VerifySutAsync(actual); } [Fact] @@ -111,16 +95,9 @@ public async Task Update_should_create_events_and_update_label_and_description() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.Name, sut.Snapshot.Name); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamUpdated { Name = command.Name }) - ); + await VerifySutAsync(actual); } [Fact] @@ -133,16 +110,9 @@ public async Task ChangePlan_should_create_events_and_update_plan() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(new PlanChangedResult(planPaid.Id)); - - Assert.Equal(planPaid.Id, sut.Snapshot.Plan!.PlanId); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamPlanChanged { PlanId = planPaid.Id }) - ); + await VerifySutAsync(actual, new PlanChangedResult(planPaid.Id)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(User.Identifier, A._, planPaid.Id, CancellationToken)) .MustHaveHappened(); @@ -158,16 +128,9 @@ public async Task ChangePlan_from_callback_should_create_events_and_update_plan( await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(new PlanChangedResult(planPaid.Id)); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Equal(planPaid.Id, sut.Snapshot.Plan!.PlanId); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamPlanChanged { PlanId = planPaid.Id }) - ); + await VerifySutAsync(actual, new PlanChangedResult(planPaid.Id)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(A._, A._, A._, A._)) .MustNotHaveHappened(); @@ -184,16 +147,9 @@ public async Task ChangePlan_from_callback_should_reset_plan_for_free_plan() await ExecuteCreateAsync(); await ExecuteChangePlanAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(new PlanChangedResult(planFree.Id, true)); - - Assert.Null(sut.Snapshot.Plan); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamPlanReset()) - ); + await VerifySutAsync(actual, new PlanChangedResult(planFree.Id, true)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(A._, A._, A._, CancellationToken)) .MustHaveHappenedOnceExactly(); @@ -210,16 +166,9 @@ public async Task ChangePlan_should_reset_plan_for_free_plan() await ExecuteCreateAsync(); await ExecuteChangePlanAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(new PlanChangedResult(planFree.Id, true)); - - Assert.Null(sut.Snapshot.Plan); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamPlanReset()) - ); + await VerifySutAsync(actual, new PlanChangedResult(planFree.Id, true)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(User.Identifier, A._, planPaid.Id, CancellationToken)) .MustHaveHappenedOnceExactly(); @@ -238,11 +187,9 @@ public async Task ChangePlan_should_not_make_update_for_redirect_result() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(new PlanChangedResult(planPaid.Id, false, new Uri("http://squidex.io"))); + var actual = await PublishIdempotentAsync(sut, command); - Assert.Null(sut.Snapshot.Plan); + await VerifySutAsync(actual, new PlanChangedResult(planPaid.Id, false, new Uri("http://squidex.io"))); } [Fact] @@ -252,11 +199,9 @@ public async Task ChangePlan_should_not_call_billing_manager_for_callback() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); + var actual = await PublishIdempotentAsync(sut, command); - actual.ShouldBeEquivalent(new PlanChangedResult(planPaid.Id)); - - Assert.Equal(planPaid.Id, sut.Snapshot.Plan?.PlanId); + await VerifySutAsync(actual, new PlanChangedResult(planPaid.Id)); A.CallTo(() => billingManager.MustRedirectToPortalAsync(User.Identifier, A._, planPaid.Id, A._)) .MustNotHaveHappened(); @@ -272,16 +217,9 @@ public async Task AssignContributor_should_create_events_and_add_contributor() await ExecuteCreateAsync(); - var actual = await PublishIdempotentAsync(command); - - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.Equal(command.Role, sut.Snapshot.Contributors[contributorId]); + var actual = await PublishIdempotentAsync(sut, command); - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamContributorAssigned { ContributorId = contributorId, Role = command.Role, IsAdded = true }) - ); + await Verify(actual); } [Fact] @@ -292,42 +230,37 @@ public async Task RemoveContributor_should_create_events_and_remove_contributor( await ExecuteCreateAsync(); await ExecuteAssignContributorAsync(); - var actual = await PublishAsync(command); + var actual = await PublishAsync(sut, command); - actual.ShouldBeEquivalent(sut.Snapshot); - - Assert.False(sut.Snapshot.Contributors.ContainsKey(contributorId)); - - LastEvents - .ShouldHaveSameEvents( - CreateEvent(new TeamContributorRemoved { ContributorId = contributorId }) - ); + await Verify(actual); } private Task ExecuteCreateAsync() { - return PublishAsync(new CreateTeam { Name = name, TeamId = TeamId }); + return PublishAsync(sut, new CreateTeam { Name = name, TeamId = TeamId }); } private Task ExecuteAssignContributorAsync() { - return PublishAsync(new AssignContributor { ContributorId = contributorId }); + return PublishAsync(sut, new AssignContributor { ContributorId = contributorId }); } private Task ExecuteChangePlanAsync() { - return PublishAsync(new ChangePlan { PlanId = planPaid.Id }); - } - - private Task PublishIdempotentAsync(TeamCommand command) - { - return PublishIdempotentAsync(sut, CreateCommand(command)); + return PublishAsync(sut, new ChangePlan { PlanId = planPaid.Id }); } - private async Task PublishAsync(TeamCommand command) + private async Task VerifySutAsync(object? actual, object? expected = null) { - var actual = await sut.ExecuteAsync(CreateCommand(command), CancellationToken); - - return actual.Payload; + if (expected == null) + { + actual.Should().BeEquivalentTo(sut.Snapshot, o => o.IncludingProperties()); + } + else + { + actual.Should().BeEquivalentTo(expected); + } + + await Verify(new { sut, events = LastEvents }); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/AssertHelper.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/AssertHelper.cs deleted file mode 100644 index 390ebac69b..0000000000 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/AssertHelper.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ========================================================================== -// Squidex Headless CMS -// ========================================================================== -// Copyright (c) Squidex UG (haftungsbeschraenkt) -// All rights reserved. Licensed under the MIT license. -// ========================================================================== - -using Squidex.Infrastructure.EventSourcing; - -namespace Squidex.Domain.Apps.Entities.TestHelpers; - -public static class AssertHelper -{ - public static void ShouldHaveSameEvents(this IEnumerable> events, params IEvent[] others) - { - var source = events.Select(x => x.Payload).ToArray(); - - source.Should().HaveSameCount(others); - - for (var i = 0; i < source.Length; i++) - { - var lhs = source[i]; - var rhs = others[i]; - - lhs.ShouldBeSameEvent(rhs); - } - } - - public static void ShouldBeSameEvent(this IEvent lhs, IEvent rhs) - { - lhs.Should().BeOfType(rhs.GetType()); - - ((object)lhs).Should().BeEquivalentTo(rhs, o => o.IncludingAllRuntimeProperties()); - } - - public static void ShouldBeEquivalent(this T lhs, T rhs) - { - lhs.Should().BeEquivalentTo(rhs, o => o.IncludingProperties()); - } -} diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/HandlerTestBase.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/HandlerTestBase.cs index e0067ace40..4de5c860b3 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/HandlerTestBase.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/HandlerTestBase.cs @@ -45,13 +45,13 @@ protected HandlerTestBase() #pragma warning restore MA0056 // Do not call overridable members in constructor } - protected CommandContext CreateCommandContext(TCommand command) where TCommand : SquidexCommand + protected CommandContext CreateCommandContext(TCommand command) where TCommand : IAggregateCommand { return new CommandContext(CreateCommand(command), A.Dummy()); } protected async Task HandleAsync(ICommandMiddleware middleware, TCommand command, - CancellationToken ct = default) where TCommand : SquidexCommand + CancellationToken ct = default) where TCommand : IAggregateCommand { var context = new CommandContext(CreateCommand(command), A.Dummy()); @@ -60,29 +60,48 @@ protected async Task HandleAsync(ICommandMiddleware mi return context; } + protected async Task PublishAsync(DomainObject domainObject, IAggregateCommand command) where T : Entity, new() + { + LastEvents = []; + + return await ExecuteCoreAsync(domainObject, command); + } + protected async Task PublishIdempotentAsync(DomainObject domainObject, IAggregateCommand command) where T : Entity, new() { - var actual = await domainObject.ExecuteAsync(command, CancellationToken); + LastEvents = []; + + var actual = await ExecuteCoreAsync(domainObject, command); var previousSnapshot = domainObject.Snapshot; var previousVersion = domainObject.Snapshot.Version; - await domainObject.ExecuteAsync(command, CancellationToken); + await ExecuteCoreAsync(domainObject, command); Assert.Same(previousSnapshot, domainObject.Snapshot); Assert.Equal(previousVersion, domainObject.Snapshot.Version); - return actual.Payload; + return actual; } - protected TCommand CreateCommand(TCommand command) where TCommand : SquidexCommand + private async Task ExecuteCoreAsync(DomainObject domainObject, IAggregateCommand command) where T : Entity, new() { - command.ExpectedVersion = EtagVersion.Any; - command.Actor ??= User; + var actual = await domainObject.ExecuteAsync(CreateCommand(command), CancellationToken); - if (command.User == null && command.Actor.IsUser) + return actual.Payload; + } + + protected virtual IAggregateCommand CreateCommand(IAggregateCommand command) + { + if (command is SquidexCommand baseCommand) { - command.User = ApiContext.UserPrincipal; + baseCommand.ExpectedVersion = EtagVersion.Any; + baseCommand.Actor ??= User; + + if (baseCommand.User == null && baseCommand.Actor.IsUser) + { + baseCommand.User = ApiContext.UserPrincipal; + } } if (command is IAppCommand { AppId: null } appCommand) diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/VerifySettings.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/VerifySettings.cs new file mode 100644 index 0000000000..0255a34081 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/VerifySettings.cs @@ -0,0 +1,147 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.Runtime.CompilerServices; +using Argon; +using NodaTime; +using Squidex.Infrastructure; +using Squidex.Infrastructure.Json.Objects; + +namespace Squidex.Domain.Apps.Entities.TestHelpers; + +public static partial class VerifySettings +{ + private sealed class JsonArrayConverter : WriteOnlyJsonConverter + { + public override void Write(VerifyJsonWriter writer, JsonArray value) + { + writer.WriteStartArray(); + + foreach (var item in value) + { + writer.Serialize(item); + } + + writer.WriteEndArray(); + } + } + + private sealed class JsonObjectConverter : WriteOnlyJsonConverter + { + public override void Write(VerifyJsonWriter writer, JsonObject value) + { + writer.WriteStartObject(); + + foreach (var (key, item) in value) + { + writer.WritePropertyName(key); + writer.Serialize(item); + } + + writer.WriteEndObject(); + } + } + + private sealed class JsonValueConverter : WriteOnlyJsonConverter + { + public override void Write(VerifyJsonWriter writer, JsonValue value) + { + switch (value.Type) + { + case JsonValueType.Null: + writer.WriteNull(); + break; + case JsonValueType.Array: + writer.Serialize(value.AsArray); + break; + case JsonValueType.Boolean: + writer.WriteValue(value.AsBoolean); + break; + case JsonValueType.Number: + writer.WriteValue(value.AsNumber); + break; + case JsonValueType.Object: + writer.Serialize(value.AsObject); + break; + case JsonValueType.String: + writer.WriteValue(value.AsString); + break; + } + } + } + + private sealed class ContractResolver : IContractResolver + { + private readonly IContractResolver inner; + + public ContractResolver(IContractResolver inner) + { + this.inner = inner; + } + + public JsonNameTable GetNameTable() + { + return inner.GetNameTable(); + } + + public JsonContract ResolveContract(Type type) + { + var contract = inner.ResolveContract(type); + + if (contract is not JsonDictionaryContract dictionaryContract) + { + return contract; + } + + var originalKeyResolver = dictionaryContract.DictionaryKeyResolver!; + + dictionaryContract.DictionaryKeyResolver = (name, original) => + { + if (original is string id && Guid.TryParse(id, out var guid1)) + { + var index = Counter.Current.Next(guid1); + + return $"Guid_{index}"; + } + + if (original is DomainId id2 && Guid.TryParse(id2.ToString(), out var guid2)) + { + var index = Counter.Current.Next(guid2); + + return $"Guid_{index}"; + } + + return originalKeyResolver(name, original); + }; + + return contract; + } + } + + [ModuleInitializer] + public static void Initialize() + { + DerivePathInfo((sourceFile, projectDirectory, type, method) => + { + var path = Path.Combine(projectDirectory, "Verify"); + + return new PathInfo(path, type.Name, method.Name); + }); + + VerifierSettings.AddExtraSettings(s => + { + s.Converters.Add(new JsonArrayConverter()); + s.Converters.Add(new JsonObjectConverter()); + s.Converters.Add(new JsonValueConverter()); + s.ContractResolver = new ContractResolver(s.ContractResolver!); + }); + + VerifierSettings.ScrubInlineGuids(); + VerifierSettings.IgnoreMembersWithType(); + VerifierSettings.IgnoreMember("Secret"); + } +} diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddLanguage_should_create_events_and_add_language.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddLanguage_should_create_events_and_add_language.verified.txt new file mode 100644 index 0000000000..f9707f2572 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddLanguage_should_create_events_and_add_language.verified.txt @@ -0,0 +1,127 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en, + de + ], + Languages: { + de: { + IsOptional: false + }, + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Language: de, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddRole_should_create_events_and_add_role.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddRole_should_create_events_and_add_role.verified.txt new file mode 100644 index 0000000000..908438a114 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddRole_should_create_events_and_add_role.verified.txt @@ -0,0 +1,134 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + CustomCount: 1, + Custom: [ + { + Name: My Role, + IsDefault: false + } + ], + All: [ + { + Name: My Role, + IsDefault: false + }, + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: My Role, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddWorkflow_should_create_events_and_add_workflow.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddWorkflow_should_create_events_and_add_workflow.verified.txt new file mode 100644 index 0000000000..1611d2604b --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AddWorkflow_should_create_events_and_add_workflow.verified.txt @@ -0,0 +1,156 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + Workflows: { + Guid_2: { + Initial: Draft, + Name: my-workflow, + Steps: { + Archived: { + Color: #eb3142, + NoUpdate: {}, + Validate: false, + Transitions: { + Draft: {} + } + }, + Draft: { + Color: #8091a5, + Validate: false, + Transitions: { + Archived: {}, + Published: {} + } + }, + Published: { + Color: #4bb958, + Validate: false, + Transitions: { + Archived: {}, + Draft: {} + } + } + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + WorkflowId: Guid_2, + Name: my-workflow, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ArchiveApp_should_create_events_and_update_deleted_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ArchiveApp_should_create_events_and_update_deleted_flag.verified.txt new file mode 100644 index 0000000000..9a25207e96 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ArchiveApp_should_create_events_and_update_deleted_flag.verified.txt @@ -0,0 +1,122 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: true, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Deleted + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AssignContributor_should_create_events_and_add_contributor.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AssignContributor_should_create_events_and_add_contributor.verified.txt new file mode 100644 index 0000000000..a24ab6382d --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AssignContributor_should_create_events_and_add_contributor.verified.txt @@ -0,0 +1,127 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + Guid_2: Editor, + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContributorId: Guid_2, + Role: Editor, + IsCreated: false, + IsAdded: true, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AssignContributor_should_create_update_events_and_update_contributor.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AssignContributor_should_create_update_events_and_update_contributor.verified.txt new file mode 100644 index 0000000000..bff95fe1d6 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AssignContributor_should_create_update_events_and_update_contributor.verified.txt @@ -0,0 +1,127 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + Guid_2: Owner, + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContributorId: Guid_2, + Role: Owner, + IsCreated: false, + IsAdded: false, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AttachClient_should_create_events_and_add_client.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AttachClient_should_create_events_and_add_client.verified.txt new file mode 100644 index 0000000000..f5d3261377 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.AttachClient_should_create_events_and_add_client.verified.txt @@ -0,0 +1,130 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Clients: { + client: { + Name: client, + AllowAnonymous: false, + Role: Editor + } + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Id: client, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_from_callback_should_create_events_and_update_plan.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_from_callback_should_create_events_and_update_plan.verified.txt new file mode 100644 index 0000000000..581aa2bafd --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_from_callback_should_create_events_and_update_plan.verified.txt @@ -0,0 +1,127 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Plan: { + Owner: subject:me, + PlanId: premium + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + PlanId: premium, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_from_callback_should_reset_plan_for_free_plan.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_from_callback_should_reset_plan_for_free_plan.verified.txt new file mode 100644 index 0000000000..11e31efaf9 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_from_callback_should_reset_plan_for_free_plan.verified.txt @@ -0,0 +1,122 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_create_events_and_update_plan.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_create_events_and_update_plan.verified.txt new file mode 100644 index 0000000000..581aa2bafd --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_create_events_and_update_plan.verified.txt @@ -0,0 +1,127 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Plan: { + Owner: subject:me, + PlanId: premium + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + PlanId: premium, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_not_call_billing_manager_for_callback.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_not_call_billing_manager_for_callback.verified.txt new file mode 100644 index 0000000000..581aa2bafd --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_not_call_billing_manager_for_callback.verified.txt @@ -0,0 +1,127 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Plan: { + Owner: subject:me, + PlanId: premium + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + PlanId: premium, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_not_make_update_for_redirect.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_not_make_update_for_redirect.verified.txt new file mode 100644 index 0000000000..452724a826 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_not_make_update_for_redirect.verified.txt @@ -0,0 +1,108 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2, + UniqueId: Guid_1 + }, + Version: 2, + ObjectState: Created + } +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_reset_plan_for_free_plan.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_reset_plan_for_free_plan.verified.txt new file mode 100644 index 0000000000..11e31efaf9 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.ChangePlan_should_reset_plan_for_free_plan.verified.txt @@ -0,0 +1,122 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt new file mode 100644 index 0000000000..433eac9b9d --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt @@ -0,0 +1,155 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2, + UniqueId: Guid_1 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: my-app, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + }, + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContributorId: me, + Role: Owner, + IsCreated: false, + IsAdded: false, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + }, + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Create_should_not_assign_client_as_contributor.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Create_should_not_assign_client_as_contributor.verified.txt new file mode 100644 index 0000000000..214f41dbb2 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Create_should_not_assign_client_as_contributor.verified.txt @@ -0,0 +1,136 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: client:client, + LastModifiedBy: client:client, + Version: 1, + UniqueId: Guid_1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: my-app, + AppId: Guid_1,my-app, + Actor: client:client, + FromRule: false + } + }, + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AppId: Guid_1,my-app, + Actor: client:client, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.DeleteRole_should_create_events_and_delete_role.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.DeleteRole_should_create_events_and_delete_role.verified.txt new file mode 100644 index 0000000000..7d98512440 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.DeleteRole_should_create_events_and_delete_role.verified.txt @@ -0,0 +1,123 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: My Role, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.DeleteWorkflow_should_create_events_and_remove_workflow.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.DeleteWorkflow_should_create_events_and_remove_workflow.verified.txt new file mode 100644 index 0000000000..a0ca359b4f --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.DeleteWorkflow_should_create_events_and_remove_workflow.verified.txt @@ -0,0 +1,123 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + WorkflowId: Guid_3, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveContributor_should_create_events_and_remove_contributor.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveContributor_should_create_events_and_remove_contributor.verified.txt new file mode 100644 index 0000000000..e84d9db3db --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveContributor_should_create_events_and_remove_contributor.verified.txt @@ -0,0 +1,123 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContributorId: Guid_3, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveImage_should_create_events_and_update_image.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveImage_should_create_events_and_update_image.verified.txt new file mode 100644 index 0000000000..11e31efaf9 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveImage_should_create_events_and_update_image.verified.txt @@ -0,0 +1,122 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveLanguage_should_create_events_and_remove_language.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveLanguage_should_create_events_and_remove_language.verified.txt new file mode 100644 index 0000000000..c4450204f5 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RemoveLanguage_should_create_events_and_remove_language.verified.txt @@ -0,0 +1,123 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Language: de, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RevokeClient_should_create_events_and_remove_client.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RevokeClient_should_create_events_and_remove_client.verified.txt new file mode 100644 index 0000000000..789d735325 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.RevokeClient_should_create_events_and_remove_client.verified.txt @@ -0,0 +1,123 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Id: client, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Transfer_from_team_should_create_events_and_set_team.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Transfer_from_team_should_create_events_and_set_team.verified.txt new file mode 100644 index 0000000000..11e31efaf9 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Transfer_from_team_should_create_events_and_set_team.verified.txt @@ -0,0 +1,122 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Transfer_should_create_events_and_set_team.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Transfer_should_create_events_and_set_team.verified.txt new file mode 100644 index 0000000000..b80ab67615 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Transfer_should_create_events_and_set_team.verified.txt @@ -0,0 +1,124 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + TeamId: Guid_2, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + TeamId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateClient_should_create_events_and_update_client.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateClient_should_create_events_and_update_client.verified.txt new file mode 100644 index 0000000000..38b319cebf --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateClient_should_create_events_and_update_client.verified.txt @@ -0,0 +1,132 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Clients: { + client: { + Name: My Client, + AllowAnonymous: false, + Role: Developer + } + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Id: client, + Name: My Client, + Role: Developer, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateLanguage_should_create_events_and_update_language.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateLanguage_should_create_events_and_update_language.verified.txt new file mode 100644 index 0000000000..46332aa9d7 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateLanguage_should_create_events_and_update_language.verified.txt @@ -0,0 +1,135 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en, + de + ], + Languages: { + de: { + IsOptional: false, + Fallbacks: [ + en + ] + }, + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Language: de, + IsOptional: false, + IsMaster: false, + Fallback: [ + en + ], + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateRole_should_create_events_and_update_role.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateRole_should_create_events_and_update_role.verified.txt new file mode 100644 index 0000000000..ec120f39e2 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateRole_should_create_events_and_update_role.verified.txt @@ -0,0 +1,147 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + CustomCount: 1, + Custom: [ + { + Name: My Role, + Permissions: [ + { + Id: clients.read + } + ], + IsDefault: false + } + ], + All: [ + { + Name: My Role, + Permissions: [ + { + Id: clients.read + } + ], + IsDefault: false + }, + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: My Role, + Permissions: [ + clients.read + ], + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateSettings_should_create_event_and_update_settings.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateSettings_should_create_event_and_update_settings.verified.txt new file mode 100644 index 0000000000..ad3a422af0 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateSettings_should_create_event_and_update_settings.verified.txt @@ -0,0 +1,126 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: false, + HideDateTimeModeButton: true + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Settings: { + HideScheduler: false, + HideDateTimeModeButton: true + }, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateWorkflow_should_create_events_and_update_workflow.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateWorkflow_should_create_events_and_update_workflow.verified.txt new file mode 100644 index 0000000000..9320522210 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UpdateWorkflow_should_create_events_and_update_workflow.verified.txt @@ -0,0 +1,185 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + Workflows: { + Guid_2: { + Initial: Draft, + Name: Unnamed, + Steps: { + Archived: { + Color: #eb3142, + NoUpdate: {}, + Validate: false, + Transitions: { + Draft: {} + } + }, + Draft: { + Color: #8091a5, + Validate: false, + Transitions: { + Archived: {}, + Published: {} + } + }, + Published: { + Color: #4bb958, + Validate: false, + Transitions: { + Archived: {}, + Draft: {} + } + } + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4, + UniqueId: Guid_1 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + WorkflowId: Guid_2, + Workflow: { + Initial: Draft, + Name: Unnamed, + Steps: { + Archived: { + Color: #eb3142, + NoUpdate: {}, + Validate: false, + Transitions: { + Draft: {} + } + }, + Draft: { + Color: #8091a5, + Validate: false, + Transitions: { + Archived: {}, + Published: {} + } + }, + Published: { + Color: #4bb958, + Validate: false, + Transitions: { + Archived: {}, + Draft: {} + } + } + } + }, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Update_should_create_events_and_update_label_and_description.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Update_should_create_events_and_update_label_and_description.verified.txt new file mode 100644 index 0000000000..442d78ba89 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.Update_should_create_events_and_update_label_and_description.verified.txt @@ -0,0 +1,126 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Label: my-label, + Description: my-description, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Label: my-label, + Description: my-description, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UploadImage_should_create_events_and_update_image.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UploadImage_should_create_events_and_update_image.verified.txt new file mode 100644 index 0000000000..a3a4b604e1 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AppDomainObjectTests.UploadImage_should_create_events_and_update_image.verified.txt @@ -0,0 +1,130 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: my-app, + Contributors: { + me: Owner + }, + Roles: { + All: [ + { + Name: Owner, + Permissions: [ + { + Id: * + } + ], + IsDefault: true + }, + { + Name: Reader, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets.read + }, + { + Id: contents.*.read + } + ], + IsDefault: true + }, + { + Name: Editor, + Properties: { + ui.api.hide: true + }, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: workflows.read + } + ], + IsDefault: true + }, + { + Name: Developer, + Permissions: [ + { + Id: assets + }, + { + Id: contents.* + }, + { + Id: roles.read + }, + { + Id: rules + }, + { + Id: schemas + }, + { + Id: workflows + } + ], + IsDefault: true + } + ] + }, + Image: { + MimeType: image/png, + Etag: Guid_2 + }, + Settings: { + HideScheduler: true, + HideDateTimeModeButton: false + }, + AssetScripts: {}, + Languages: { + Master: en, + AllKeys: [ + en + ], + Languages: { + en: { + IsOptional: false + } + } + }, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Image: { + MimeType: image/png, + Etag: Guid_2 + }, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateMetadata_should_create_events_and_update_metadata.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateMetadata_should_create_events_and_update_metadata.verified.txt new file mode 100644 index 0000000000..1d58d00c43 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateMetadata_should_create_events_and_update_metadata.verified.txt @@ -0,0 +1,44 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: 123, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + TotalSize: 1024, + IsProtected: false, + Metadata: { + pixelWidth: 800.0 + }, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Metadata: { + pixelWidth: 800.0 + }, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateName_should_create_events_and_update_file_name.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateName_should_create_events_and_update_file_name.verified.txt new file mode 100644 index 0000000000..049dd3dc70 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateName_should_create_events_and_update_file_name.verified.txt @@ -0,0 +1,39 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: My New Image.png, + FileHash: 123, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + TotalSize: 1024, + IsProtected: false, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FileName: My New Image.png, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateProtected_should_create_events_and_update_protected_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateProtected_should_create_events_and_update_protected_flag.verified.txt new file mode 100644 index 0000000000..a7be27efc8 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateProtected_should_create_events_and_update_protected_flag.verified.txt @@ -0,0 +1,39 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: 123, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + TotalSize: 1024, + IsProtected: true, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + IsProtected: true, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateSlug_should_create_events_and_update_slug.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateSlug_should_create_events_and_update_slug.verified.txt new file mode 100644 index 0000000000..bc5cb3c356 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateSlug_should_create_events_and_update_slug.verified.txt @@ -0,0 +1,39 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: 123, + MimeType: image/png, + Slug: my-new-image.png, + FileSize: 1024, + TotalSize: 1024, + IsProtected: false, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Slug: my-new-image.png, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateTags_should_create_events_and_update_tags.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateTags_should_create_events_and_update_tags.verified.txt new file mode 100644 index 0000000000..a0d42902a1 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.AnnotateTags_should_create_events_and_update_tags.verified.txt @@ -0,0 +1,44 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: 123, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + TotalSize: 1024, + IsProtected: false, + Tags: [ + tag1 + ], + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Tags: [ + tag1 + ], + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt new file mode 100644 index 0000000000..781398eae3 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt @@ -0,0 +1,41 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: NewHash, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + TotalSize: 1024, + IsProtected: false, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FileName: image.png, + FileHash: NewHash, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Delete_should_create_events_with_total_file_size_and_tags_and_update_deleted_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Delete_should_create_events_with_total_file_size_and_tags_and_update_deleted_flag.verified.txt new file mode 100644 index 0000000000..81250d05b9 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Delete_should_create_events_with_total_file_size_and_tags_and_update_deleted_flag.verified.txt @@ -0,0 +1,40 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: 456, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + FileVersion: 1, + TotalSize: 2048, + IsProtected: false, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: true, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Deleted + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + DeletedSize: 2048, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Move_should_create_events_and_update_parent_id.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Move_should_create_events_and_update_parent_id.verified.txt new file mode 100644 index 0000000000..f45e2914ce --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Move_should_create_events_and_update_parent_id.verified.txt @@ -0,0 +1,40 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: 123, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + TotalSize: 1024, + IsProtected: false, + ParentId: Guid_2, + UniqueId: Guid_3--Guid_1, + AppId: Guid_3,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ParentId: Guid_2, + AssetId: Guid_1, + AppId: Guid_3,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Update_should_create_events_and_update_file_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Update_should_create_events_and_update_file_state.verified.txt new file mode 100644 index 0000000000..cc925f2713 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Update_should_create_events_and_update_file_state.verified.txt @@ -0,0 +1,43 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: NewHash, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + FileVersion: 1, + TotalSize: 2048, + IsProtected: false, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + MimeType: image/png, + FileHash: NewHash, + FileSize: 1024, + FileVersion: 1, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Upsert_should_create_events_and_set_intitial_state_if_not_found.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Upsert_should_create_events_and_set_intitial_state_if_not_found.verified.txt new file mode 100644 index 0000000000..781398eae3 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Upsert_should_create_events_and_set_intitial_state_if_not_found.verified.txt @@ -0,0 +1,41 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: NewHash, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + TotalSize: 1024, + IsProtected: false, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FileName: image.png, + FileHash: NewHash, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Upsert_should_create_events_and_update_file_state_if_found.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Upsert_should_create_events_and_update_file_state_if_found.verified.txt new file mode 100644 index 0000000000..cc925f2713 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetDomainObjectTests.Upsert_should_create_events_and_update_file_state_if_found.verified.txt @@ -0,0 +1,43 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + FileName: image.png, + FileHash: NewHash, + MimeType: image/png, + Slug: image.png, + FileSize: 1024, + FileVersion: 1, + TotalSize: 2048, + IsProtected: false, + UniqueId: Guid_2--Guid_1, + AppId: Guid_2,my-app, + IsDeleted: false, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + MimeType: image/png, + FileHash: NewHash, + FileSize: 1024, + FileVersion: 1, + AssetId: Guid_1, + AppId: Guid_2,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt new file mode 100644 index 0000000000..d207f8978c --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt @@ -0,0 +1,31 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + FolderName: New Name, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FolderName: New Name, + AssetFolderId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Delete_should_create_events_with_total_file_size.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Delete_should_create_events_with_total_file_size.verified.txt new file mode 100644 index 0000000000..b3d5120b23 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Delete_should_create_events_with_total_file_size.verified.txt @@ -0,0 +1,32 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + FolderName: My Folder, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: true, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Deleted + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + AssetFolderId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Move_should_create_events_and_update_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Move_should_create_events_and_update_state.verified.txt new file mode 100644 index 0000000000..f25e41723b --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Move_should_create_events_and_update_state.verified.txt @@ -0,0 +1,34 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + FolderName: My Folder, + ParentId: Guid_3, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ParentId: Guid_3, + AssetFolderId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Update_should_create_events_and_update_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Update_should_create_events_and_update_state.verified.txt new file mode 100644 index 0000000000..6de487f77a --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/AssetFolderDomainObjectTests.Update_should_create_events_and_update_state.verified.txt @@ -0,0 +1,33 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + FolderName: New Name, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FolderName: New Name, + AssetFolderId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ApplyDefaults_should_not_update_content_if_all_fields_have_a_value.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ApplyDefaults_should_not_update_content_if_all_fields_have_a_value.verified.txt new file mode 100644 index 0000000000..5f282702bb --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ApplyDefaults_should_not_update_content_if_all_fields_have_a_value.verified.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ApplyDefaults_should_update_content.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ApplyDefaults_should_update_content.verified.txt new file mode 100644 index 0000000000..0815487103 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ApplyDefaults_should_update_content.verified.txt @@ -0,0 +1,61 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + defaults: { + iv: Default Value + }, + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + defaults: { + iv: Default Value + }, + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Draft, + Data: { + defaults: { + iv: Default Value + }, + my-field1: { + iv: 1.0 + } + }, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CancelContentSchedule_create_events_and_unset_schedule.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CancelContentSchedule_create_events_and_unset_schedule.verified.txt new file mode 100644 index 0000000000..f0be5b5045 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CancelContentSchedule_create_events_and_unset_schedule.verified.txt @@ -0,0 +1,48 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CancelContentSchedule_should_create_events_and_unset_schedule.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CancelContentSchedule_should_create_events_and_unset_schedule.verified.txt new file mode 100644 index 0000000000..f0be5b5045 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CancelContentSchedule_should_create_events_and_unset_schedule.verified.txt @@ -0,0 +1,48 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_create_events_and_set_schedule_if_duetime_set.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_create_events_and_set_schedule_if_duetime_set.verified.txt new file mode 100644 index 0000000000..b860628dd0 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_create_events_and_set_schedule_if_duetime_set.verified.txt @@ -0,0 +1,54 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + ScheduleJob: { + Id: Guid_4, + Status: Published, + ScheduledBy: subject:me + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_5, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Published, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_also_update_if_script_changes_data.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_also_update_if_script_changes_data.verified.txt new file mode 100644 index 0000000000..90f66b95d1 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_also_update_if_script_changes_data.verified.txt @@ -0,0 +1,80 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + EditingData: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + }, + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_5, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Change: Unpublished, + Status: Draft, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_delete_new_version_if_available.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_delete_new_version_if_available.verified.txt new file mode 100644 index 0000000000..fa6c2baf54 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_delete_new_version_if_available.verified.txt @@ -0,0 +1,51 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Published, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Published, + IsPublished: true, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Change: Published, + Status: Published, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_unset_schedule_if_failed.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_unset_schedule_if_failed.verified.txt new file mode 100644 index 0000000000..f0be5b5045 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_unset_schedule_if_failed.verified.txt @@ -0,0 +1,48 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_new_version_if_draft_available.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_new_version_if_draft_available.verified.txt new file mode 100644 index 0000000000..3b029e3c55 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_new_version_if_draft_available.verified.txt @@ -0,0 +1,58 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + NewVersion: { + Status: Archived, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + CurrentVersion: { + Status: Published, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Archived, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Archived, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_changed.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_changed.verified.txt new file mode 100644 index 0000000000..d144d88366 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_changed.verified.txt @@ -0,0 +1,50 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Archived, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Archived, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Archived, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_published.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_published.verified.txt new file mode 100644 index 0000000000..d144d88366 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_published.verified.txt @@ -0,0 +1,50 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Archived, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Archived, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Archived, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_unpublished.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_unpublished.verified.txt new file mode 100644 index 0000000000..ffd8efa3ba --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_create_events_and_update_status_if_unpublished.verified.txt @@ -0,0 +1,51 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Change: Unpublished, + Status: Draft, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_refresh_properties_and_unset_schedule_if_completed.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_refresh_properties_and_unset_schedule_if_completed.verified.txt new file mode 100644 index 0000000000..8fa1db599a --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.ChangeStatus_should_refresh_properties_and_unset_schedule_if_completed.verified.txt @@ -0,0 +1,50 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Archived, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Archived, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Archived, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CreateDraft_should_create_events_and_update_new_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CreateDraft_should_create_events_and_update_new_state.verified.txt new file mode 100644 index 0000000000..5a73a76747 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.CreateDraft_should_create_events_and_update_new_state.verified.txt @@ -0,0 +1,57 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + NewVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + CurrentVersion: { + Status: Published, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Draft, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_change_status_if_set.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_change_status_if_set.verified.txt new file mode 100644 index 0000000000..ae174cca8a --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_change_status_if_set.verified.txt @@ -0,0 +1,70 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Archived, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Archived, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + }, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + }, + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_5, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Archived, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_create_events_and_update_data_and_status.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_create_events_and_update_data_and_status.verified.txt new file mode 100644 index 0000000000..146724eea3 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_create_events_and_update_data_and_status.verified.txt @@ -0,0 +1,52 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + }, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_not_change_status_if_set_to_initial.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_not_change_status_if_set_to_initial.verified.txt new file mode 100644 index 0000000000..146724eea3 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Create_should_not_change_status_if_set_to_initial.verified.txt @@ -0,0 +1,52 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + }, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.DeleteDraft_should_create_events_and_delete_new_version.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.DeleteDraft_should_create_events_and_delete_new_version.verified.txt new file mode 100644 index 0000000000..16033cd8fe --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.DeleteDraft_should_create_events_and_delete_new_version.verified.txt @@ -0,0 +1,48 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Published, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Published, + IsPublished: true, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt new file mode 100644 index 0000000000..f7496a5d9b --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt @@ -0,0 +1,48 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: true, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Deleted + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.EnrichContentDefaults_should_not_update_content_if_all_fields_have_a_value.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.EnrichContentDefaults_should_not_update_content_if_all_fields_have_a_value.verified.txt new file mode 100644 index 0000000000..c0fd6964f2 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.EnrichContentDefaults_should_not_update_content_if_all_fields_have_a_value.verified.txt @@ -0,0 +1,30 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + } +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.EnrichContentDefaults_should_update_content.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.EnrichContentDefaults_should_update_content.verified.txt new file mode 100644 index 0000000000..ce9b066c32 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.EnrichContentDefaults_should_update_content.verified.txt @@ -0,0 +1,63 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + defaults: { + iv: Default Value + }, + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + defaults: { + iv: Default Value + }, + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + defaults: { + iv: Default Value + }, + my-field1: { + iv: 1.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_create_events_and_update_data.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_create_events_and_update_data.verified.txt new file mode 100644 index 0000000000..d6b84f4992 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_create_events_and_update_data.verified.txt @@ -0,0 +1,63 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_create_events_and_update_new_version_if_draft_available.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_create_events_and_update_new_version_if_draft_available.verified.txt new file mode 100644 index 0000000000..647e050320 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_create_events_and_update_new_version_if_draft_available.verified.txt @@ -0,0 +1,71 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + NewVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + CurrentVersion: { + Status: Published, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_not_create_event_for_same_data.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_not_create_event_for_same_data.verified.txt new file mode 100644 index 0000000000..c0fd6964f2 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Patch_should_not_create_event_for_same_data.verified.txt @@ -0,0 +1,30 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + } +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_create_events_and_update_data.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_create_events_and_update_data.verified.txt new file mode 100644 index 0000000000..ed8799182a --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_create_events_and_update_data.verified.txt @@ -0,0 +1,63 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + EditingData: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_create_events_and_update_new_version_if_draft_available.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_create_events_and_update_new_version_if_draft_available.verified.txt new file mode 100644 index 0000000000..9c61c387d5 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_create_events_and_update_new_version_if_draft_available.verified.txt @@ -0,0 +1,71 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + NewVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + CurrentVersion: { + Status: Published, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_not_create_event_for_same_data.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_not_create_event_for_same_data.verified.txt new file mode 100644 index 0000000000..c0fd6964f2 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Update_should_not_create_event_for_same_data.verified.txt @@ -0,0 +1,30 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + } +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_change_status_on_create_if_status_set.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_change_status_on_create_if_status_set.verified.txt new file mode 100644 index 0000000000..ae174cca8a --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_change_status_on_create_if_status_set.verified.txt @@ -0,0 +1,70 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Archived, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Archived, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + }, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + }, + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_5, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Archived, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_change_status_on_update_if_status_set.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_change_status_on_update_if_status_set.verified.txt new file mode 100644 index 0000000000..2ed941a5e8 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_change_status_on_update_if_status_set.verified.txt @@ -0,0 +1,79 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Archived, + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + EditingData: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Archived, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + }, + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_5, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Archived, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_create_content_if_not_found.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_create_content_if_not_found.verified.txt new file mode 100644 index 0000000000..146724eea3 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_create_content_if_not_found.verified.txt @@ -0,0 +1,52 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + }, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_not_change_status_on_create_if_status_set_to_initial.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_not_change_status_on_create_if_status_set_to_initial.verified.txt new file mode 100644 index 0000000000..146724eea3 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_not_change_status_on_create_if_status_set_to_initial.verified.txt @@ -0,0 +1,52 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + } + }, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_not_change_status_on_update_if_status_set_to_initial.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_not_change_status_on_update_if_status_set_to_initial.verified.txt new file mode 100644 index 0000000000..ed8799182a --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_not_change_status_on_update_if_status_set_to_initial.verified.txt @@ -0,0 +1,63 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + EditingData: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_patch_content_if_found.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_patch_content_if_found.verified.txt new file mode 100644 index 0000000000..d6b84f4992 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_patch_content_if_found.verified.txt @@ -0,0 +1,63 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + EditingData: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 1.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_update_content_if_found.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_update_content_if_found.verified.txt new file mode 100644 index 0000000000..ed8799182a --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/ContentDomainObjectTests.Upsert_should_update_content_if_found.verified.txt @@ -0,0 +1,63 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + SchemaId: Guid_3,my-schema, + CurrentVersion: { + Status: Draft, + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + } + }, + EditingData: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + EditingStatus: Draft, + IsPublished: false, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_4, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Data: { + my-field1: { + iv: 2.0 + }, + my-field2: { + iv: 2.0 + } + }, + NewVersion: false, + ContentId: Guid_2, + SchemaId: Guid_3,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt new file mode 100644 index 0000000000..e6cf0da25c --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt @@ -0,0 +1,42 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Trigger: { + HandleAll: false + }, + Action: { + Value: 123 + }, + IsEnabled: true, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Trigger: { + HandleAll: false + }, + Action: { + Value: 123 + }, + RuleId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt new file mode 100644 index 0000000000..424d02b231 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt @@ -0,0 +1,38 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Trigger: { + HandleAll: false + }, + Action: { + Value: 123 + }, + IsEnabled: true, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: true, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Deleted + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + RuleId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Disable_should_create_events_and_update_enabled_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Disable_should_create_events_and_update_enabled_flag.verified.txt new file mode 100644 index 0000000000..3dd5a296b2 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Disable_should_create_events_and_update_enabled_flag.verified.txt @@ -0,0 +1,38 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Trigger: { + HandleAll: false + }, + Action: { + Value: 123 + }, + IsEnabled: false, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + RuleId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Disable_via_update_should_create_events_and_update_enabled_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Disable_via_update_should_create_events_and_update_enabled_flag.verified.txt new file mode 100644 index 0000000000..872dfd3617 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Disable_via_update_should_create_events_and_update_enabled_flag.verified.txt @@ -0,0 +1,39 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Trigger: { + HandleAll: false + }, + Action: { + Value: 123 + }, + IsEnabled: false, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + IsEnabled: false, + RuleId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Enable_should_create_events_and_update_enabled_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Enable_should_create_events_and_update_enabled_flag.verified.txt new file mode 100644 index 0000000000..8de784feca --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Enable_should_create_events_and_update_enabled_flag.verified.txt @@ -0,0 +1,38 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Trigger: { + HandleAll: false + }, + Action: { + Value: 123 + }, + IsEnabled: true, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + RuleId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Enable_via_update_should_create_events_and_update_enabled_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Enable_via_update_should_create_events_and_update_enabled_flag.verified.txt new file mode 100644 index 0000000000..41765b6245 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Enable_via_update_should_create_events_and_update_enabled_flag.verified.txt @@ -0,0 +1,39 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Trigger: { + HandleAll: false + }, + Action: { + Value: 123 + }, + IsEnabled: true, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + IsEnabled: true, + RuleId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Trigger_should_invoke_rule_enqueue_but_not_change_snapshot.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Trigger_should_invoke_rule_enqueue_but_not_change_snapshot.verified.txt new file mode 100644 index 0000000000..710b4a2748 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Trigger_should_invoke_rule_enqueue_but_not_change_snapshot.verified.txt @@ -0,0 +1,21 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Trigger: { + HandleAll: false + }, + Action: { + Value: 123 + }, + IsEnabled: true, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + } +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Update_should_create_events_and_update_trigger_and_action.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Update_should_create_events_and_update_trigger_and_action.verified.txt new file mode 100644 index 0000000000..449045c12e --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/RuleDomainObjectTests.Update_should_create_events_and_update_trigger_and_action.verified.txt @@ -0,0 +1,46 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: NewName, + Trigger: { + HandleAll: true + }, + Action: { + Value: 456 + }, + IsEnabled: true, + UniqueId: Guid_1--Guid_2, + AppId: Guid_1,my-app, + IsDeleted: false, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: NewName, + Trigger: { + HandleAll: true + }, + Action: { + Value: 456 + }, + RuleId: Guid_2, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Add_should_create_events_and_add_field.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Add_should_create_events_and_add_field.verified.txt new file mode 100644 index 0000000000..f2b72a3dfa --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Add_should_create_events_and_add_field.verified.txt @@ -0,0 +1,257 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: age, + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + FieldId: 1,age, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Add_should_create_events_and_add_field_to_array.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Add_should_create_events_and_add_field_to_array.verified.txt new file mode 100644 index 0000000000..e9bae47266 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Add_should_create_events_and_add_field_to_array.verified.txt @@ -0,0 +1,1314 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: age, + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + FieldId: 2,age, + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ChangeCategory_should_create_events_and_update_category.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ChangeCategory_should_create_events_and_update_category.verified.txt new file mode 100644 index 0000000000..d58678a701 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ChangeCategory_should_create_events_and_update_category.verified.txt @@ -0,0 +1,40 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + Category: my-category, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: my-category, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureFieldRules_should_create_events_and_update_schema_field_rules.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureFieldRules_should_create_events_and_update_schema_field_rules.verified.txt new file mode 100644 index 0000000000..5676c76f18 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureFieldRules_should_create_events_and_update_schema_field_rules.verified.txt @@ -0,0 +1,48 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + FieldRules: [ + { + Field: field1 + } + ], + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldRules: [ + { + Field: field1 + } + ], + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigurePreviewUrls_should_create_events_and_update_preview_urls.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigurePreviewUrls_should_create_events_and_update_preview_urls.verified.txt new file mode 100644 index 0000000000..b59f22704d --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigurePreviewUrls_should_create_events_and_update_preview_urls.verified.txt @@ -0,0 +1,44 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + PreviewUrls: { + Web: web-url + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + PreviewUrls: { + Web: web-url + }, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureScripts_should_create_events_and_update_schema_scripts.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureScripts_should_create_events_and_update_schema_scripts.verified.txt new file mode 100644 index 0000000000..3e13ebbc6d --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureScripts_should_create_events_and_update_schema_scripts.verified.txt @@ -0,0 +1,43 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + Scripts: { + Query: + }, + Properties: { + ValidateOnPublish: false + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Scripts: { + Query: + }, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureUIFields_should_create_events_for_list_fields_and_update_schema.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureUIFields_should_create_events_for_list_fields_and_update_schema.verified.txt new file mode 100644 index 0000000000..c730040ac6 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureUIFields_should_create_events_for_list_fields_and_update_schema.verified.txt @@ -0,0 +1,250 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + FieldsInLists: [ + data.age + ], + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldsInLists: [ + data.age + ], + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureUIFields_should_create_events_for_reference_fields_and_update_schema.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureUIFields_should_create_events_for_reference_fields_and_update_schema.verified.txt new file mode 100644 index 0000000000..eb6af84075 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ConfigureUIFields_should_create_events_for_reference_fields_and_update_schema.verified.txt @@ -0,0 +1,250 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + FieldsInReferences: [ + data.age + ], + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldsInReferences: [ + data.age + ], + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Create_should_create_events_and_schema_with_initial_fields.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Create_should_create_events_and_schema_with_initial_fields.verified.txt new file mode 100644 index 0000000000..d805b506cc --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Create_should_create_events_and_schema_with_initial_fields.verified.txt @@ -0,0 +1,5427 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field3: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 5, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field3: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Schema: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field3: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field3: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 4: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 5: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + nested1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 4, + Name: nested1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + nested2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 5, + Name: nested2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field3, + Partitioning: { + Key: language + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + IsDeleted: false, + UniqueId: Guid_Empty--Guid_Empty, + Version: -1 + }, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt new file mode 100644 index 0000000000..0633113c18 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt @@ -0,0 +1,48 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Schema: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + IsDeleted: false, + UniqueId: Guid_Empty--Guid_Empty, + Version: -1 + }, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DeleteField_should_create_events_and_delete_field.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DeleteField_should_create_events_and_delete_field.verified.txt new file mode 100644 index 0000000000..082fa78717 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DeleteField_should_create_events_and_delete_field.verified.txt @@ -0,0 +1,40 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 1,age, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DeleteField_should_create_events_and_delete_nested_field.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DeleteField_should_create_events_and_delete_nested_field.verified.txt new file mode 100644 index 0000000000..46b53d8cb0 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DeleteField_should_create_events_and_delete_nested_field.verified.txt @@ -0,0 +1,180 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + FieldCollection: {}, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + FieldCollection: {}, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + FieldCollection: {}, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + FieldCollection: {}, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + FieldCollection: {}, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + FieldCollection: {}, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 2,age, + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt new file mode 100644 index 0000000000..01a1718e4c --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Delete_should_create_events_and_update_deleted_flag.verified.txt @@ -0,0 +1,38 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + AppId: Guid_1,my-app, + IsDeleted: true, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Deleted + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DisableField_should_create_events_and_update_field_disabled_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DisableField_should_create_events_and_update_field_disabled_flag.verified.txt new file mode 100644 index 0000000000..c0704aa615 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DisableField_should_create_events_and_update_field_disabled_flag.verified.txt @@ -0,0 +1,245 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 1,age, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DisableField_should_create_events_and_update_nested_field_disabled_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DisableField_should_create_events_and_update_nested_field_disabled_flag.verified.txt new file mode 100644 index 0000000000..9f5eb684b2 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.DisableField_should_create_events_and_update_nested_field_disabled_flag.verified.txt @@ -0,0 +1,1302 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: true + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 2,age, + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.EnableField_should_create_events_and_update_field_disabled_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.EnableField_should_create_events_and_update_field_disabled_flag.verified.txt new file mode 100644 index 0000000000..e37023ee24 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.EnableField_should_create_events_and_update_field_disabled_flag.verified.txt @@ -0,0 +1,245 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 1,age, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.EnableField_should_create_events_and_update_nested_field_disabled_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.EnableField_should_create_events_and_update_nested_field_disabled_flag.verified.txt new file mode 100644 index 0000000000..ee742bbb57 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.EnableField_should_create_events_and_update_nested_field_disabled_flag.verified.txt @@ -0,0 +1,1302 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 2,age, + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.HideField_should_create_events_and_update_field_hidden_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.HideField_should_create_events_and_update_field_hidden_flag.verified.txt new file mode 100644 index 0000000000..af008d05b3 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.HideField_should_create_events_and_update_field_hidden_flag.verified.txt @@ -0,0 +1,245 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 1,age, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.HideField_should_create_events_and_update_nested_field_hidden_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.HideField_should_create_events_and_update_nested_field_hidden_flag.verified.txt new file mode 100644 index 0000000000..c354ace021 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.HideField_should_create_events_and_update_nested_field_hidden_flag.verified.txt @@ -0,0 +1,1302 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: true, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 2,age, + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.LockField_should_create_events_and_update_field_locked_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.LockField_should_create_events_and_update_field_locked_flag.verified.txt new file mode 100644 index 0000000000..1ad4bc00b4 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.LockField_should_create_events_and_update_field_locked_flag.verified.txt @@ -0,0 +1,245 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 1,age, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.LockField_should_create_events_and_update_nested_field_locked_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.LockField_should_create_events_and_update_nested_field_locked_flag.verified.txt new file mode 100644 index 0000000000..f47393c2b1 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.LockField_should_create_events_and_update_nested_field_locked_flag.verified.txt @@ -0,0 +1,1302 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: true, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 2,age, + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Publish_should_create_events_and_update_published_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Publish_should_create_events_and_update_published_flag.verified.txt new file mode 100644 index 0000000000..106b7bea64 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Publish_should_create_events_and_update_published_flag.verified.txt @@ -0,0 +1,38 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: true, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Reorder_should_create_events_and_reorder_fields.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Reorder_should_create_events_and_reorder_fields.verified.txt new file mode 100644 index 0000000000..93b79f2b25 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Reorder_should_create_events_and_reorder_fields.verified.txt @@ -0,0 +1,440 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: field1, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field2, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldIds: [ + 2, + 1 + ], + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Reorder_should_create_events_and_reorder_nestedy_fields.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Reorder_should_create_events_and_reorder_nestedy_fields.verified.txt new file mode 100644 index 0000000000..e7b9507d92 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Reorder_should_create_events_and_reorder_nestedy_fields.verified.txt @@ -0,0 +1,2349 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 3, + Fields: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + 3: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + field1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: field1, + IsLocked: false, + IsHidden: false, + IsDisabled: false + }, + field2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 3, + Name: field2, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldIds: [ + 3, + 2 + ], + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ShowField_should_create_events_and_update_field_hidden_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ShowField_should_create_events_and_update_field_hidden_flag.verified.txt new file mode 100644 index 0000000000..e37023ee24 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ShowField_should_create_events_and_update_field_hidden_flag.verified.txt @@ -0,0 +1,245 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 1,age, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ShowField_should_create_events_and_update_nested_field_hidden_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ShowField_should_create_events_and_update_nested_field_hidden_flag.verified.txt new file mode 100644 index 0000000000..ee742bbb57 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.ShowField_should_create_events_and_update_nested_field_hidden_flag.verified.txt @@ -0,0 +1,1302 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + Fields: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + MinLength: 10, + MaxLength: 20, + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 4 + }, + Version: 4, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + FieldId: 2,age, + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Synchronize_should_create_events_and_update_schema.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Synchronize_should_create_events_and_update_schema.verified.txt new file mode 100644 index 0000000000..b114f27c53 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Synchronize_should_create_events_and_update_schema.verified.txt @@ -0,0 +1,40 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + Category: My-Category, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: My-Category, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Unpublish_should_create_events_and_update_published_flag.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Unpublish_should_create_events_and_update_published_flag.verified.txt new file mode 100644 index 0000000000..ad50302fdb --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Unpublish_should_create_events_and_update_published_flag.verified.txt @@ -0,0 +1,38 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.UpdateField_should_create_events_and_update_field_properties.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.UpdateField_should_create_events_and_update_field_properties.verified.txt new file mode 100644 index 0000000000..5ba534d0b2 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.UpdateField_should_create_events_and_update_field_properties.verified.txt @@ -0,0 +1,230 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 1, + Fields: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: age, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + FieldId: 1,age, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.UpdateField_should_create_events_and_update_nested_field_properties.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.UpdateField_should_create_events_and_update_nested_field_properties.verified.txt new file mode 100644 index 0000000000..2f66a80266 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.UpdateField_should_create_events_and_update_nested_field_properties.verified.txt @@ -0,0 +1,1167 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: { + Ordered: [ + { + Fields: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 1: { + Fields: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + array: { + Fields: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Scripts: {}, + Properties: { + ValidateOnPublish: false + }, + SchemaFieldsTotal: 2, + Fields: [ + { + Fields: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 1: { + Fields: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + array: { + Fields: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + FieldsById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldsByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + FieldCollection: { + Ordered: [ + { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + ], + ById: { + 2: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + ByName: { + age: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 2, + Name: age, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + } + }, + Properties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + RawProperties: { + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + Id: 1, + Name: array, + Partitioning: { + Key: invariant + }, + IsLocked: false, + IsHidden: false, + IsDisabled: false + } + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Properties: { + IsUnique: false, + IsEmbeddable: false, + InlineEditable: false, + CreateEnum: false, + IsRequired: false, + IsRequiredOnPublish: false, + IsHalfWidth: false + }, + FieldId: 2,age, + ParentFieldId: 1,array, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Update_should_create_events_and_update_schema_properties.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Update_should_create_events_and_update_schema_properties.verified.txt new file mode 100644 index 0000000000..058f413d21 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/SchemaDomainObjectTests.Update_should_create_events_and_update_schema_properties.verified.txt @@ -0,0 +1,43 @@ +{ + sut: { + UniqueId: Guid_1--Guid_2, + Snapshot: { + Name: my-schema, + IsPublished: false, + FieldCollection: {}, + Scripts: {}, + Properties: { + ValidateOnPublish: false, + Label: My Properties + }, + AppId: Guid_1,my-app, + IsDeleted: false, + UniqueId: Guid_1--Guid_2, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1--Guid_2, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Properties: { + ValidateOnPublish: false, + Label: My Properties + }, + SchemaId: Guid_2,my-schema, + AppId: Guid_1,my-app, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.AssignContributor_should_create_events_and_add_contributor.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.AssignContributor_should_create_events_and_add_contributor.verified.txt new file mode 100644 index 0000000000..da8d36d6ab --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.AssignContributor_should_create_events_and_add_contributor.verified.txt @@ -0,0 +1,12 @@ +{ + Name: My Team, + Contributors: { + Guid_1: Owner, + me: Owner + }, + Id: Guid_2, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2, + UniqueId: Guid_2 +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_from_callback_should_create_events_and_update_plan.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_from_callback_should_create_events_and_update_plan.verified.txt new file mode 100644 index 0000000000..3e00f00e14 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_from_callback_should_create_events_and_update_plan.verified.txt @@ -0,0 +1,37 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: My Team, + Contributors: { + me: Owner + }, + Plan: { + Owner: subject:me, + PlanId: premium + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2, + UniqueId: Guid_1 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + PlanId: premium, + TeamId: Guid_1, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_from_callback_should_reset_plan_for_free_plan.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_from_callback_should_reset_plan_for_free_plan.verified.txt new file mode 100644 index 0000000000..ab42d5df42 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_from_callback_should_reset_plan_for_free_plan.verified.txt @@ -0,0 +1,32 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: My Team, + Contributors: { + me: Owner + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + TeamId: Guid_1, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_create_events_and_update_plan.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_create_events_and_update_plan.verified.txt new file mode 100644 index 0000000000..3e00f00e14 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_create_events_and_update_plan.verified.txt @@ -0,0 +1,37 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: My Team, + Contributors: { + me: Owner + }, + Plan: { + Owner: subject:me, + PlanId: premium + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2, + UniqueId: Guid_1 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + PlanId: premium, + TeamId: Guid_1, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_not_call_billing_manager_for_callback.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_not_call_billing_manager_for_callback.verified.txt new file mode 100644 index 0000000000..3e00f00e14 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_not_call_billing_manager_for_callback.verified.txt @@ -0,0 +1,37 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: My Team, + Contributors: { + me: Owner + }, + Plan: { + Owner: subject:me, + PlanId: premium + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2, + UniqueId: Guid_1 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + PlanId: premium, + TeamId: Guid_1, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_not_make_update_for_redirect_result.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_not_make_update_for_redirect_result.verified.txt new file mode 100644 index 0000000000..91c63c7c13 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_not_make_update_for_redirect_result.verified.txt @@ -0,0 +1,18 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: My Team, + Contributors: { + me: Owner + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1, + UniqueId: Guid_1 + }, + Version: 1, + ObjectState: Created + } +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_reset_plan_for_free_plan.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_reset_plan_for_free_plan.verified.txt new file mode 100644 index 0000000000..ab42d5df42 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.ChangePlan_should_reset_plan_for_free_plan.verified.txt @@ -0,0 +1,32 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: My Team, + Contributors: { + me: Owner + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 + }, + Version: 3, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + TeamId: Guid_1, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt new file mode 100644 index 0000000000..58e2e85e47 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Create_should_create_events_and_set_intitial_state.verified.txt @@ -0,0 +1,49 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: My Team, + Contributors: { + me: Owner + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 1, + UniqueId: Guid_1 + }, + Version: 1, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: My Team, + TeamId: Guid_1, + Actor: subject:me, + FromRule: false + } + }, + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_3, + Timestamp: DateTimeOffset_1 + }, + Payload: { + ContributorId: me, + Role: Owner, + IsCreated: false, + IsAdded: false, + TeamId: Guid_1, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Create_should_not_assign_client_as_contributor.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Create_should_not_assign_client_as_contributor.verified.txt new file mode 100644 index 0000000000..3fb9df90ec --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Create_should_not_assign_client_as_contributor.verified.txt @@ -0,0 +1,28 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: My Team, + Id: Guid_1, + CreatedBy: client:client, + LastModifiedBy: client:client, + UniqueId: Guid_1 + }, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: My Team, + TeamId: Guid_1, + Actor: client:client, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.RemoveContributor_should_create_events_and_remove_contributor.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.RemoveContributor_should_create_events_and_remove_contributor.verified.txt new file mode 100644 index 0000000000..39668ba943 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.RemoveContributor_should_create_events_and_remove_contributor.verified.txt @@ -0,0 +1,11 @@ +{ + Name: My Team, + Contributors: { + me: Owner + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 3, + UniqueId: Guid_1 +} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Update_should_create_events_and_update_label_and_description.verified.txt b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Update_should_create_events_and_update_label_and_description.verified.txt new file mode 100644 index 0000000000..feefda3584 --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Verify/TeamDomainObjectTests.Update_should_create_events_and_update_label_and_description.verified.txt @@ -0,0 +1,33 @@ +{ + sut: { + UniqueId: Guid_1, + Snapshot: { + Name: Changed Name, + Contributors: { + me: Owner + }, + Id: Guid_1, + CreatedBy: subject:me, + LastModifiedBy: subject:me, + Version: 2, + UniqueId: Guid_1 + }, + Version: 2, + ObjectState: Created + }, + events: [ + { + Headers: { + AggregateId: Guid_1, + EventId: Guid_2, + Timestamp: DateTimeOffset_1 + }, + Payload: { + Name: Changed Name, + TeamId: Guid_1, + Actor: subject:me, + FromRule: false + } + } + ] +} \ No newline at end of file diff --git a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html index b1ec97967c..4dd0b4b90d 100644 --- a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html +++ b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html @@ -34,7 +34,7 @@

{{ 'clients.connectWizard.step1Title' | sqxTranslate }}

- +
@@ -105,7 +105,7 @@
3 {{ 'clients.connectWizard.
1 {{ 'clients.connectWizard.cliStep1' | sqxTranslate }}
-
+
{{ 'clients.connectWizard.cliStep1Hint' | sqxTranslate }} @@ -113,7 +113,7 @@
1 {{ 'clients.connectWizard.
-
2
+
2
diff --git a/frontend/src/app/framework/angular/pipes/markdown.pipe.ts b/frontend/src/app/framework/angular/pipes/markdown.pipe.ts index 4ba1428560..cedb9ed2ce 100644 --- a/frontend/src/app/framework/angular/pipes/markdown.pipe.ts +++ b/frontend/src/app/framework/angular/pipes/markdown.pipe.ts @@ -14,8 +14,8 @@ import { renderMarkdown } from '@app/framework/internal'; standalone: true, }) export class MarkdownPipe implements PipeTransform { - public transform(text: string | undefined | null): string { - return renderMarkdown(text, false); + public transform(text: string | undefined | null, trusted = false): string { + return renderMarkdown(text, false, trusted); } } @@ -25,7 +25,7 @@ export class MarkdownPipe implements PipeTransform { standalone: true, }) export class MarkdownInlinePipe implements PipeTransform { - public transform(text: string | undefined | null): string { - return renderMarkdown(text, true); + public transform(text: string | undefined | null, trusted = false): string { + return renderMarkdown(text, true, trusted); } } \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs b/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs index 5c84831156..46afeaa4a2 100644 --- a/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs @@ -790,4 +790,66 @@ await Parallel.ForEachAsync(Enumerable.Range(0, 20), async (i, ct) => Assert.Equal(2, content.Data.Number); } + + [Theory] + [InlineData(ContentStrategies.EnrichDefaults.Normal)] + [InlineData(ContentStrategies.EnrichDefaults.Update)] + [InlineData(ContentStrategies.EnrichDefaults.UpdateBulk)] + [InlineData(ContentStrategies.EnrichDefaults.Upsert)] + [InlineData(ContentStrategies.EnrichDefaults.UpsertBulk)] + [InlineData(ContentStrategies.EnrichDefaults.Bulk)] + [InlineData(ContentStrategies.EnrichDefaults.BulkWithSchema)] + [InlineData(ContentStrategies.EnrichDefaults.BulkShared)] + public async Task Should_enrich_defaults(ContentStrategies.EnrichDefaults strategy) + { + var schemaName = $"schema-{Guid.NewGuid()}"; + + // STEP 0: Create initial schema. + var schemaRequest = new CreateSchemaDto + { + Name = schemaName, + Fields = + [ + new UpsertSchemaFieldDto + { + Name = TestEntityData.NumberField, + Properties = new NumberFieldPropertiesDto() + }, + ], + IsPublished = true + }; + + await _.Client.Schemas.PostSchemaAsync(schemaRequest); + + var contents = _.Client.DynamicContents(schemaName); + + + // STEP 1: Create a new item. + var content_0 = await contents.CreateAsync(new DynamicData(), ContentCreateOptions.AsPublish); + + Assert.Null(content_0.Data.GetValueOrDefault(TestEntityData.StringField)); + + + // STEP 2: Add required field. + var fieldRequest = new AddFieldDto + { + Name = TestEntityData.StringField, + Properties = new StringFieldPropertiesDto + { + DefaultValue = "Hello Squidex" + } + }; + + await _.Client.Schemas.PostFieldAsync(schemaName, fieldRequest); + + + // STEP 3: Create required field. + await _.Client.EnrichDefaultsAsync(content_0, content_0.Data, strategy); + + + // STEP 4: Get content. + var content_1 = await contents.GetAsync(content_0.Id); + + Assert.Equal("Hello Squidex", content_1.Data[TestEntityData.StringField]!["iv"]!.ToString()); + } } diff --git a/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj b/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj index 4e5a48a983..7e0bb06209 100644 --- a/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj +++ b/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj @@ -7,22 +7,22 @@ enable - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj b/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj index 446d8d7a36..c86e2bbc51 100644 --- a/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj +++ b/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj @@ -7,14 +7,14 @@ enable - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/tools/TestSuite/TestSuite.Shared/ContentStrategies.cs b/tools/TestSuite/TestSuite.Shared/ContentStrategies.cs index 4253c09fbc..6b3a2503e5 100644 --- a/tools/TestSuite/TestSuite.Shared/ContentStrategies.cs +++ b/tools/TestSuite/TestSuite.Shared/ContentStrategies.cs @@ -88,29 +88,29 @@ IContentsClient GetClient() return GetClient().UpdateAsync(content.Id, data); case Update.Upsert: return GetClient().UpsertAsync(content.Id, data); - case Update.UpsertBulk: + case Update.Bulk: return GetClient().BulkUpdateAsync(new BulkUpdate { Jobs = [ new BulkUpdateJob { + Type = BulkUpdateType.Update, Id = content.Id, - Data = data, - Type = BulkUpdateType.Upsert + Data = data }, ] }); - case Update.Bulk: + case Update.UpsertBulk: return GetClient().BulkUpdateAsync(new BulkUpdate { Jobs = [ new BulkUpdateJob { + Type = BulkUpdateType.Upsert, Id = content.Id, - Data = data, - Type = BulkUpdateType.Update, + Data = data }, ] }); @@ -121,23 +121,23 @@ IContentsClient GetClient() [ new BulkUpdateJob { + Type = BulkUpdateType.Update, Id = content.Id, Data = data, - Type = BulkUpdateType.Update, Schema = content.SchemaName }, ] }); case Update.BulkShared: - return client.SharedContents().BulkUpdateAsync(new BulkUpdate + return GetSharedClient(client).BulkUpdateAsync(new BulkUpdate { Jobs = [ new BulkUpdateJob { + Type = BulkUpdateType.Update, Id = content.Id, Data = data, - Type = BulkUpdateType.Update, Schema = content.SchemaName }, ] @@ -151,10 +151,10 @@ public enum Patch { Normal, Upsert, + UpsertBulk, Bulk, BulkWithSchema, - BulkShared, - UpsertBulk + BulkShared } public static Task PatchAsync(this ISquidexClient client, ContentBase content, object data, Patch strategy) @@ -177,9 +177,10 @@ IContentsClient GetClient() [ new BulkUpdateJob { + Type = BulkUpdateType.Upsert, Id = content.Id, Data = data, - Patch = true, + Patch = true }, ] }); @@ -190,9 +191,9 @@ IContentsClient GetClient() [ new BulkUpdateJob { + Type = BulkUpdateType.Patch, Id = content.Id, Data = data, - Type = BulkUpdateType.Patch }, ] }); @@ -203,23 +204,23 @@ IContentsClient GetClient() [ new BulkUpdateJob { + Type = BulkUpdateType.Patch, Id = content.Id, Data = data, - Type = BulkUpdateType.Patch, Schema = content.SchemaName }, ] }); case Patch.BulkShared: - return client.SharedContents().BulkUpdateAsync(new BulkUpdate + return GetSharedClient(client).BulkUpdateAsync(new BulkUpdate { Jobs = [ new BulkUpdateJob { + Type = BulkUpdateType.Patch, Id = content.Id, Data = data, - Type = BulkUpdateType.Patch, Schema = content.SchemaName }, ] @@ -229,6 +230,109 @@ IContentsClient GetClient() } } + public enum EnrichDefaults + { + Normal, + Upsert, + Update, + Bulk, + BulkWithSchema, + BulkShared, + UpsertBulk, + UpdateBulk + } + + public static Task EnrichDefaultsAsync(this ISquidexClient client, ContentBase content, object data, EnrichDefaults strategy) + { + IContentsClient GetClient() + { + return client.Contents(content.SchemaName); + } + + switch (strategy) + { + case EnrichDefaults.Normal: + return GetClient().EnrichDefaultsAsync(content.Id); + case EnrichDefaults.Update: + return GetClient().UpdateAsync(content.Id, data, ContentUpdateOptions.AsEnrichDefaults); + case EnrichDefaults.Upsert: + return GetClient().UpsertAsync(content.Id, data, ContentUpsertOptions.AsEnrichDefaults); + case EnrichDefaults.Bulk: + return GetClient().BulkUpdateAsync(new BulkUpdate + { + Jobs = + [ + new BulkUpdateJob + { + Type = BulkUpdateType.EnrichDefaults, + Id = content.Id + }, + ] + }); + case EnrichDefaults.UpdateBulk: + return GetClient().BulkUpdateAsync(new BulkUpdate + { + Jobs = + [ + new BulkUpdateJob + { + Type = BulkUpdateType.Update, + Id = content.Id, + Data = data, + EnrichDefaults = true, + }, + ] + }); + case EnrichDefaults.UpsertBulk: + return GetClient().BulkUpdateAsync(new BulkUpdate + { + Jobs = + [ + new BulkUpdateJob + { + Type = BulkUpdateType.Upsert, + Id = content.Id, + Data = data, + EnrichDefaults = true, + }, + ] + }); + case EnrichDefaults.BulkWithSchema: + return GetClient().BulkUpdateAsync(new BulkUpdate + { + Jobs = + [ + new BulkUpdateJob + { + Type = BulkUpdateType.EnrichDefaults, + Id = content.Id, + Schema = content.SchemaName + }, + ] + }); + case EnrichDefaults.BulkShared: + return GetSharedClient(client).BulkUpdateAsync(new BulkUpdate + { + Jobs = + [ + new BulkUpdateJob + { + Type = BulkUpdateType.EnrichDefaults, + Id = content.Id, + Schema = content.SchemaName + }, + ] + }); + default: + return Task.CompletedTask; + } + } + + private static IContentsSharedClient GetSharedClient(ISquidexClient client) + { + return client.SharedContents(); + } + private sealed class MyContent : Content { } diff --git a/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj b/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj index f7b7614cd0..7d7a9c6b60 100644 --- a/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj +++ b/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj @@ -7,7 +7,7 @@ enable - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -17,12 +17,12 @@ - - - + + + - +