diff --git a/api/modules/Kurs.Languages/Kurs.Languages.Application/LanguagesApplicationAutoMapperProfile.cs b/api/modules/Kurs.Languages/Kurs.Languages.Application/LanguagesApplicationAutoMapperProfile.cs index 7b7692f9..9b795ec2 100644 --- a/api/modules/Kurs.Languages/Kurs.Languages.Application/LanguagesApplicationAutoMapperProfile.cs +++ b/api/modules/Kurs.Languages/Kurs.Languages.Application/LanguagesApplicationAutoMapperProfile.cs @@ -14,9 +14,12 @@ public class LanguagesApplicationAutoMapperProfile : Profile CreateMap(); CreateMap(); CreateMap(); + CreateMap() .IgnoreAllPropertiesWithAnInaccessibleSetter() - .IgnoreFullAuditedObjectProperties(); + .IgnoreFullAuditedObjectProperties() + .ForMember(dest => dest.LanguageKey, opt => opt.Ignore()); + CreateMap() .ForMember(d => d.Key, o => o.MapFrom(s => s.Key)) .ForMember(d => d.ResourceName, o => o.MapFrom(s => s.ResourceName)) diff --git a/api/modules/Kurs.Languages/Kurs.Languages.Domain/Entities/LanguageKey.cs b/api/modules/Kurs.Languages/Kurs.Languages.Domain/Entities/LanguageKey.cs index 481788dd..7d549adf 100644 --- a/api/modules/Kurs.Languages/Kurs.Languages.Domain/Entities/LanguageKey.cs +++ b/api/modules/Kurs.Languages/Kurs.Languages.Domain/Entities/LanguageKey.cs @@ -9,6 +9,6 @@ public class LanguageKey : FullAuditedEntity public string Key { get; set; } public string ResourceName { get; set; } - public ICollection Texts { get; set; } + public virtual ICollection Texts { get; set; } = []; } diff --git a/api/modules/Kurs.Languages/Kurs.Languages.Domain/Entities/LanguageText.cs b/api/modules/Kurs.Languages/Kurs.Languages.Domain/Entities/LanguageText.cs index 35d1f2b3..4aab8a2e 100644 --- a/api/modules/Kurs.Languages/Kurs.Languages.Domain/Entities/LanguageText.cs +++ b/api/modules/Kurs.Languages/Kurs.Languages.Domain/Entities/LanguageText.cs @@ -7,7 +7,8 @@ public class LanguageText : FullAuditedEntity { public string CultureName { get; set; } public string? Key { get; set; } - public string Value { get; set; } public string? ResourceName { get; set; } + public string Value { get; set; } + public virtual LanguageKey LanguageKey { get; set; } } diff --git a/api/modules/Kurs.Languages/Kurs.Languages.EntityFrameworkCore/EntityFrameworkCore/LanguagesDbContextModelCreatingExtensions.cs b/api/modules/Kurs.Languages/Kurs.Languages.EntityFrameworkCore/EntityFrameworkCore/LanguagesDbContextModelCreatingExtensions.cs index ec67f1af..50fec8c4 100644 --- a/api/modules/Kurs.Languages/Kurs.Languages.EntityFrameworkCore/EntityFrameworkCore/LanguagesDbContextModelCreatingExtensions.cs +++ b/api/modules/Kurs.Languages/Kurs.Languages.EntityFrameworkCore/EntityFrameworkCore/LanguagesDbContextModelCreatingExtensions.cs @@ -20,6 +20,13 @@ public static class LanguagesDbContextModelCreatingExtensions b.Property(a => a.CultureName).HasMaxLength(10).IsRequired(); b.Property(a => a.UiCultureName).HasMaxLength(10).IsRequired(); b.Property(a => a.DisplayName).HasMaxLength(50).IsRequired(); + + // Language → LanguageText (CultureName üzerinden) + b.HasMany() + .WithOne() + .HasForeignKey(t => t.CultureName) + .HasPrincipalKey(l => l.CultureName) + .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => @@ -27,13 +34,18 @@ public static class LanguagesDbContextModelCreatingExtensions b.ToTable(LanguagesDbProperties.DbTablePrefix + nameof(LanguageKey), LanguagesDbProperties.DbSchema); b.ConfigureByConvention(); - b.HasKey(a => new { a.ResourceName, a.Key }); - b.HasMany(a => a.Texts).WithOne() - .HasForeignKey(a => new { a.ResourceName, a.Key }) - .OnDelete(DeleteBehavior.SetNull); - b.Property(a => a.Key).HasMaxLength(100).IsRequired(); b.Property(a => a.ResourceName).HasMaxLength(50).IsRequired(); + + // LanguageKey → LanguageText (ResourceName + Key üzerinden) + b.HasMany(a => a.Texts) + .WithOne(t => t.LanguageKey) + .HasForeignKey(t => new { t.ResourceName, t.Key }) + .HasPrincipalKey(k => new { k.ResourceName, k.Key }) + .OnDelete(DeleteBehavior.Cascade); + + // Unique index (ResourceName + Key) + b.HasIndex(x => new { x.ResourceName, x.Key }).IsUnique(); }); builder.Entity(b => diff --git a/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueue.cs b/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueue.cs index 0ace701c..59d823b4 100644 --- a/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueue.cs +++ b/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueue.cs @@ -1,34 +1,22 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.MailQueue.Domain.Entities; public class BackgroundWorker_MailQueue : FullAuditedEntity { public Guid TemplateId { get; set; } - [Required] - [StringLength(100)] public string From { get; set; } - [Required] - [StringLength(100)] public string To { get; set; } - [StringLength(8000)] - public string MailParameter { get; set; } //{0:KURYE=FEDEX&ABWNO=777705877048} - [StringLength(100)] - public string Table { get; set; } - [StringLength(500)] + public string MailParameter { get; set; } + public string TableName { get; set; } public string TableParameter { get; set; } - [StringLength(100)] public string Attachment { get; set; } - [StringLength(500)] public string AttachmentParameter { get; set; } - public bool SendStatus { get; set; } // Mail gönderildi mi, vs - // [Column(TypeName = "datetime")] - public DateTime? SendTime { get; set; } // Gönderim zamanı - [StringLength(100)] - public string AwsMessageId { get; set; } // AWS'ten gelen response - [StringLength(100)] - public string RelatedRecordId { get; set; } // İlgili kaydın ID'si + public bool SendStatus { get; set; } + public DateTime? SendTime { get; set; } + public string AwsMessageId { get; set; } + public string RelatedRecordId { get; set; } + public virtual ICollection Events { get; set; } + public virtual BackgroundWorker_MailQueueTableFormat TableFormat { get; set; } } diff --git a/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueueEvents.cs b/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueueEvents.cs index f937d9ea..dbddf8c2 100644 --- a/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueueEvents.cs +++ b/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueueEvents.cs @@ -1,18 +1,14 @@ -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.MailQueue.Domain.Entities; public partial class BackgroundWorker_MailQueueEvents : FullAuditedEntity { - [Required] - [StringLength(100)] public string AwsMessageId { get; set; } - // [Column(TypeName = "datetime")] public DateTime? EventDate { get; set; } - [StringLength(20)] public string Event { get; set; } - [StringLength(100)] public string MailAddress { get; set; } public string ResponseDescription { get; set; } + + public virtual BackgroundWorker_MailQueue MailQueue { get; set; } } diff --git a/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueueTableFormat.cs b/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueueTableFormat.cs index a76fba24..798749d9 100644 --- a/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueueTableFormat.cs +++ b/api/modules/Kurs.MailQueue/Domain/Entities/BackgroundWorker_MailQueueTableFormat.cs @@ -1,33 +1,22 @@ -using System.ComponentModel.DataAnnotations; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Entities; namespace Kurs.MailQueue.Domain.Entities; -[Index(nameof(TableName), nameof(Order), Name = "IX_MailQueueTableFormat", IsUnique = true)] public partial class BackgroundWorker_MailQueueTableFormat : Entity { - [Required] - [StringLength(100)] public string TableName { get; set; } public short Order { get; set; } - [StringLength(50)] public string ColumnName { get; set; } - [StringLength(50)] public string Caption { get; set; } - [StringLength(1000)] public string HeaderCss { get; set; } - [StringLength(1000)] public string Css { get; set; } - [StringLength(1000)] public string FooterCss { get; set; } - [StringLength(50)] public string DataType { get; set; } - [StringLength(50)] public string DataFormat { get; set; } public bool IsHidden { get; set; } - public bool IsProtected { get; set; } // Excel'deki sutun korumali mi olacak? - [StringLength(50)] + public bool IsProtected { get; set; } public string SubTotal { get; set; } public int Width { get; set; } + + public virtual ICollection MailQueues { get; set; } } diff --git a/api/modules/Kurs.MailQueue/Domain/MailQueueWorker.cs b/api/modules/Kurs.MailQueue/Domain/MailQueueWorker.cs index cada3580..d6ee556b 100644 --- a/api/modules/Kurs.MailQueue/Domain/MailQueueWorker.cs +++ b/api/modules/Kurs.MailQueue/Domain/MailQueueWorker.cs @@ -117,7 +117,7 @@ public class MailQueueWorker : BackgroundWorkerBase //LogManager.LogInformation("Kuyruk process başladı", "KUYRUK", "KUYRUK", kuyruk.Id, jobId); // Tablo oluştur - var tables = await TableGenerator.GenerateAsync(queue.Table, queue.TableParameter, queue.Id); + var tables = await TableGenerator.GenerateAsync(queue.TableName, queue.TableParameter, queue.Id); //LogManager.LogInformation($"{tables.Count} adet tablo oluşturuldu", "TABLO", "KUYRUK", kuyruk.Id, jobId); diff --git a/api/modules/Kurs.MailQueue/EntityFrameworkCore/MailQueueDbContextModelCreatingExtensions.cs b/api/modules/Kurs.MailQueue/EntityFrameworkCore/MailQueueDbContextModelCreatingExtensions.cs index 3cdb7760..e1e9603a 100644 --- a/api/modules/Kurs.MailQueue/EntityFrameworkCore/MailQueueDbContextModelCreatingExtensions.cs +++ b/api/modules/Kurs.MailQueue/EntityFrameworkCore/MailQueueDbContextModelCreatingExtensions.cs @@ -10,23 +10,66 @@ public static class MailQueueDbContextModelCreatingExtensions public static void ConfigureMailQueue(this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - + builder.Entity(b => { b.ToTable(MailQueueDbProperties.DbTablePrefix + nameof(Domain.Entities.BackgroundWorker_MailQueue), MailQueueDbProperties.DbSchema); b.ConfigureByConvention(); + + b.Property(x => x.From).IsRequired().HasMaxLength(100); + b.Property(x => x.To).IsRequired().HasMaxLength(100); + b.Property(x => x.MailParameter).HasMaxLength(8000); + b.Property(x => x.TableName).HasMaxLength(100); + b.Property(x => x.TableParameter).HasMaxLength(500); + b.Property(x => x.Attachment).HasMaxLength(100); + b.Property(x => x.AttachmentParameter).HasMaxLength(500); + b.Property(x => x.AwsMessageId).HasMaxLength(100); + b.Property(x => x.RelatedRecordId).HasMaxLength(100); + + // 🔗 İlişki: MailQueue ↔ MailQueueEvents (AwsMessageId) + b.HasMany(x => x.Events) + .WithOne(x => x.MailQueue) + .HasPrincipalKey(x => x.AwsMessageId) // Principal key + .HasForeignKey(x => x.AwsMessageId) // Dependent key + .OnDelete(DeleteBehavior.Cascade); + + // 🔗 İlişki: MailQueue ↔ MailQueueTableFormat (TableName) + b.HasOne(x => x.TableFormat) + .WithMany(x => x.MailQueues) + .HasPrincipalKey(x => x.TableName) // Principal key + .HasForeignKey(x => x.TableName) // Dependent key + .OnDelete(DeleteBehavior.Cascade); + }); + + builder.Entity(b => + { + b.ToTable(MailQueueDbProperties.DbTablePrefix + nameof(Domain.Entities.BackgroundWorker_MailQueueEvents), MailQueueDbProperties.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.AwsMessageId).IsRequired().HasMaxLength(100); + b.Property(x => x.Event).HasMaxLength(20); + b.Property(x => x.MailAddress).HasMaxLength(100); }); builder.Entity(b => { b.ToTable(MailQueueDbProperties.DbTablePrefix + nameof(Domain.Entities.BackgroundWorker_MailQueueTableFormat), MailQueueDbProperties.DbSchema); b.ConfigureByConvention(); - }); - - builder.Entity< Domain.Entities.BackgroundWorker_MailQueueEvents> (b => - { - b.ToTable(MailQueueDbProperties.DbTablePrefix + nameof(Domain.Entities.BackgroundWorker_MailQueueEvents), MailQueueDbProperties.DbSchema); - b.ConfigureByConvention(); + + b.Property(x => x.TableName).IsRequired().HasMaxLength(100); + b.Property(x => x.ColumnName).HasMaxLength(50); + b.Property(x => x.Caption).HasMaxLength(50); + b.Property(x => x.HeaderCss).HasMaxLength(1000); + b.Property(x => x.Css).HasMaxLength(1000); + b.Property(x => x.FooterCss).HasMaxLength(1000); + b.Property(x => x.DataType).HasMaxLength(50); + b.Property(x => x.DataFormat).HasMaxLength(50); + b.Property(x => x.SubTotal).HasMaxLength(50); + + // Unique index (TableName + Order) + b.HasIndex(x => new { x.TableName, x.Order }) + .IsUnique() + .HasDatabaseName("IX_MailQueueTableFormat"); }); } } diff --git a/api/modules/Kurs.Notifications/Kurs.Notifications.Domain/Entities/Notification.cs b/api/modules/Kurs.Notifications/Kurs.Notifications.Domain/Entities/Notification.cs index b82c1bf5..36c967ed 100644 --- a/api/modules/Kurs.Notifications/Kurs.Notifications.Domain/Entities/Notification.cs +++ b/api/modules/Kurs.Notifications/Kurs.Notifications.Domain/Entities/Notification.cs @@ -5,7 +5,7 @@ namespace Kurs.Notifications.Entities; public class Notification : FullAuditedEntity { - public Guid? NotificationRuleId { get; set; } + public Guid NotificationRuleId { get; set; } public required string NotificationChannel { get; set; } public required string NotificationType { get; set; } @@ -17,4 +17,6 @@ public class Notification : FullAuditedEntity public bool IsSent { get; set; } public bool IsRead { get; set; } public DateTime? ReadTime { get; set; } + + public virtual NotificationRule NotificationRule { get; set; } } diff --git a/api/modules/Kurs.Notifications/Kurs.Notifications.Domain/Entities/NotificationRule.cs b/api/modules/Kurs.Notifications/Kurs.Notifications.Domain/Entities/NotificationRule.cs index 64820efb..9012707b 100644 --- a/api/modules/Kurs.Notifications/Kurs.Notifications.Domain/Entities/NotificationRule.cs +++ b/api/modules/Kurs.Notifications/Kurs.Notifications.Domain/Entities/NotificationRule.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.Notifications.Entities; @@ -19,4 +20,6 @@ public class NotificationRule : FullAuditedEntity public bool IsActive { get; set; } public bool IsFixed { get; set; } public bool IsCustomized { get; set; } + + public virtual ICollection Notifications { get; set; } = []; } diff --git a/api/modules/Kurs.Notifications/Kurs.Notifications.EntityFrameworkCore/EntityFrameworkCore/NotificationDbContextModelCreatingExtensions.cs b/api/modules/Kurs.Notifications/Kurs.Notifications.EntityFrameworkCore/EntityFrameworkCore/NotificationDbContextModelCreatingExtensions.cs index 9aaa8dbc..713aada2 100644 --- a/api/modules/Kurs.Notifications/Kurs.Notifications.EntityFrameworkCore/EntityFrameworkCore/NotificationDbContextModelCreatingExtensions.cs +++ b/api/modules/Kurs.Notifications/Kurs.Notifications.EntityFrameworkCore/EntityFrameworkCore/NotificationDbContextModelCreatingExtensions.cs @@ -18,8 +18,16 @@ public static class NotificationDbContextModelCreatingExtensions b.ToTable(NotificationDbProperties.DbTablePrefix + nameof(NotificationRule), NotificationDbProperties.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.Channel).HasMaxLength(10).IsRequired(); - b.Property(a => a.NotificationType).HasMaxLength(100).IsRequired(); + b.Property(x => x.NotificationType).IsRequired().HasMaxLength(100); + b.Property(x => x.RecipientType).IsRequired().HasMaxLength(50); + b.Property(x => x.RecipientId).HasMaxLength(200); + b.Property(x => x.Channel).IsRequired().HasMaxLength(50); + + // 1:N ilişki NotificationRule -> Notifications + b.HasMany(x => x.Notifications) + .WithOne(x => x.NotificationRule) + .HasForeignKey(x => x.NotificationRuleId) + .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => @@ -27,27 +35,10 @@ public static class NotificationDbContextModelCreatingExtensions b.ToTable(NotificationDbProperties.DbTablePrefix + nameof(Notification), NotificationDbProperties.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.NotificationChannel).HasMaxLength(10).IsRequired(); - b.Property(a => a.NotificationType).HasMaxLength(100).IsRequired(); + b.Property(x => x.NotificationChannel).IsRequired().HasMaxLength(50); + b.Property(x => x.NotificationType).IsRequired().HasMaxLength(100); + b.Property(x => x.Identifier).IsRequired().HasMaxLength(200); + b.Property(x => x.Message).IsRequired().HasMaxLength(2000); }); - /* Configure all entities here. Example: - - builder.Entity(b => - { - //Configure table & schema name - b.ToTable(NotificationDbProperties.DbTablePrefix + "Questions", NotificationDbProperties.DbSchema); - - b.ConfigureByConvention(); - - //Properties - b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); - - //Relations - b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); - - //Indexes - b.HasIndex(q => q.CreationTime); - }); - */ } } diff --git a/api/src/Kurs.Platform.Application.Contracts/Contact/CityDto.cs b/api/src/Kurs.Platform.Application.Contracts/Contact/CityDto.cs index 535eceeb..b74b242b 100644 --- a/api/src/Kurs.Platform.Application.Contracts/Contact/CityDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/Contact/CityDto.cs @@ -8,5 +8,5 @@ public class CityDto : AuditedEntityDto public string Code { get; set; } public string Name { get; set; } public string PlateCode { get; set; } - public string CountryCode { get; set; } + public string Country { get; set; } } \ No newline at end of file diff --git a/api/src/Kurs.Platform.Application.Contracts/Contact/DistrictDto.cs b/api/src/Kurs.Platform.Application.Contracts/Contact/DistrictDto.cs index b984c6d2..f71b959d 100644 --- a/api/src/Kurs.Platform.Application.Contracts/Contact/DistrictDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/Contact/DistrictDto.cs @@ -5,8 +5,8 @@ namespace Kurs.Platform.Contacts; public class DistrictDto : AuditedEntityDto { - public string CountryCode { get; set; } - public string CityCode { get; set; } + public string Country { get; set; } + public string City { get; set; } public string Name { get; set; } public string Township { get; set; } public string Street { get; set; } diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 95a35da7..2ab01a0c 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -44,8 +44,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency public async Task SeedAsync(DataSeedContext context) { - var lookupQueryLanguageKeyValues = $"SELECT \"{DbTablePrefix}LanguageKey\".\"Key\", CONCAT(\"{DbTablePrefix}LanguageKey\".\"Key\", ' (', \"{DbTablePrefix}LanguageText\".\"Value\", ')') AS \"Name\" FROM \"{DbTablePrefix}LanguageKey\" LEFT OUTER JOIN \"{DbTablePrefix}LanguageText\" ON \"{DbTablePrefix}LanguageKey\".\"Key\" = \"{DbTablePrefix}LanguageText\".\"Key\" AND \"{DbTablePrefix}LanguageKey\".\"ResourceName\" = \"{DbTablePrefix}LanguageText\".\"ResourceName\" WHERE \"{DbTablePrefix}LanguageKey\".\"IsDeleted\" = 'false' AND \"{DbTablePrefix}LanguageText\".\"IsDeleted\" = 'false' AND \"{DbTablePrefix}LanguageText\".\"CultureName\" = 'tr' ORDER BY \"{DbTablePrefix}LanguageKey\".\"Key\";"; - var lookupQueryCultureValues = $"SELECT \"CultureName\" AS \"Key\", \"DisplayName\" AS \"Name\", \"CreationTime\" FROM \"{DbTablePrefix}Language\" WHERE \"IsEnabled\" = 'true' and \"IsDeleted\" = 'false'"; + var lookupQueryLanguageKeyValues = $"SELECT \"{SelectCommandByTableName("LanguageKey")}\".\"Key\", CONCAT(\"{SelectCommandByTableName("LanguageKey")}\".\"Key\", ' (', \"{SelectCommandByTableName("LanguageText")}\".\"Value\", ')') AS \"Name\" FROM \"{SelectCommandByTableName("LanguageKey")}\" LEFT OUTER JOIN \"{SelectCommandByTableName("LanguageText")}\" ON \"{SelectCommandByTableName("LanguageKey")}\".\"Key\" = \"{SelectCommandByTableName("LanguageText")}\".\"Key\" AND \"{SelectCommandByTableName("LanguageKey")}\".\"ResourceName\" = \"{SelectCommandByTableName("LanguageText")}\".\"ResourceName\" WHERE \"{SelectCommandByTableName("LanguageKey")}\".\"IsDeleted\" = 'false' AND \"{SelectCommandByTableName("LanguageText")}\".\"IsDeleted\" = 'false' AND \"{SelectCommandByTableName("LanguageText")}\".\"CultureName\" = 'tr' ORDER BY \"{SelectCommandByTableName("LanguageKey")}\".\"Key\";"; + var lookupQueryCultureValues = $"SELECT \"CultureName\" AS \"Key\", \"DisplayName\" AS \"Name\", \"CreationTime\" FROM \"{SelectCommandByTableName("Language")}\" WHERE \"IsEnabled\" = 'true' and \"IsDeleted\" = 'false'"; + var htmlEditorOptions = "{\"toolbar\": {\"multiline\": true, \"items\": [{\"name\": \"undo\"},{\"name\": \"redo\"},{\"name\": \"separator\"},{\"name\": \"size\",\"acceptedValues\": [\"8pt\",\"10pt\",\"12pt\",\"14pt\",\"18pt\",\"24pt\",\"36pt\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font size\"}}},{\"name\": \"font\",\"acceptedValues\": [\"Arial\",\"Courier New\",\"Georgia\",\"Impact\",\"Lucida Console\",\"Tahoma\",\"Times New Roman\",\"Verdana\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"bold\"},{\"name\": \"italic\"},{\"name\": \"strike\"},{\"name\": \"underline\"},{\"name\": \"separator\"},{\"name\": \"alignLeft\"},{\"name\": \"alignCenter\"},{\"name\": \"alignRight\"},{\"name\": \"alignJustify\"},{\"name\": \"separator\"},{\"name\": \"orderedList\"},{\"name\": \"bulletList\"},{\"name\": \"separator\"},{\"name\": \"header\",\"acceptedValues\": [false,1,2,3,4,5],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"color\"},{\"name\": \"background\"},{\"name\": \"separator\"},{\"name\": \"link\"},{\"name\": \"image\"},{\"name\": \"separator\"},{\"name\": \"clear\"},{\"name\": \"codeBlock\"},{\"name\": \"blockquote\"},{\"name\": \"separator\"},{\"name\": \"insertTable\"},{\"name\": \"deleteTable\"},{\"name\": \"insertRowAbove\"},{\"name\": \"insertRowBelow\"},{\"name\": \"deleteRow\"},{\"name\": \"insertColumnLeft\"},{\"name\": \"insertColumnRight\"},{\"name\": \"deleteColumn\"}]}}"; var showClearButton = "{ \"showClearButton\" : true }"; @@ -116,7 +117,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Languages.Language + ".Export", I = AppCodes.Languages.Language + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Language\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Language\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -386,7 +387,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Definitions.SkillType, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("SkillType"), + SelectCommand = SelectCommandByTableName("SkillType", Prefix.DbTableDefinition), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -400,7 +401,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Definitions.SkillType + ".Export", I = AppCodes.Definitions.SkillType + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}SkillType\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -553,7 +554,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Definitions.UomCategory, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("UomCategory"), + SelectCommand = SelectCommandByTableName("UomCategory", Prefix.DbTableDefinition), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -567,7 +568,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Definitions.UomCategory + ".Export", I = AppCodes.Definitions.UomCategory + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}UomCategory\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("UomCategory", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -734,7 +735,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Definitions.Bank + ".Export", I = AppCodes.Definitions.Bank + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Bank\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -791,6 +792,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "Country", + FieldDbType = DbType.String, + Value = "TR", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) } ); #region Bank Fields @@ -929,7 +937,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"", + LookupQuery = $"SELECT \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\"", CascadeEmptyFields = "City,District,Street" }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto @@ -964,7 +972,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"", + LookupQuery = $"SELECT \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\" WHERE \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL ORDER BY \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\"", CascadeRelationField = "Country", CascadeFilterOperator="=", CascadeParentFields = "Country", @@ -1002,7 +1010,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Name\" AS \"Key\", \"{DbTablePrefix}District\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Name\" ORDER BY \"{DbTablePrefix}District\".\"Name\"", + LookupQuery = $"SELECT \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" AS \"Key\", \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" WHERE (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" ORDER BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\"", CascadeRelationField = "City", CascadeFilterOperator="=", CascadeParentFields = "Country,City", @@ -1462,7 +1470,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}Country\".\"Code\" AS \"Key\", \"{Prefix.DbTableDefault}Country\".\"Name\" as \"Name\" FROM \"{Prefix.DbTableDefault}Country\" ORDER BY \"{Prefix.DbTableDefault}Country\".\"Name\"", CascadeEmptyFields = "City,District,Street" }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto @@ -1498,7 +1506,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}City\".\"Code\" AS \"Key\", \"{Prefix.DbTableDefault}City\".\"Name\" as \"Name\" FROM \"{Prefix.DbTableDefault}City\" WHERE \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL ORDER BY \"{Prefix.DbTableDefault}City\".\"Name\"", CascadeRelationField = "Country", CascadeFilterOperator="=", CascadeParentFields = "Country", @@ -1537,7 +1545,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Name\" AS \"Key\", \"{DbTablePrefix}District\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Name\" ORDER BY \"{DbTablePrefix}District\".\"Name\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}District\".\"Name\" AS \"Key\", \"{Prefix.DbTableDefault}District\".\"Name\" as \"Name\" FROM \"{Prefix.DbTableDefault}District\" WHERE (\"{Prefix.DbTableDefault}District\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{Prefix.DbTableDefault}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{Prefix.DbTableDefault}District\".\"Name\" ORDER BY \"{Prefix.DbTableDefault}District\".\"Name\"", CascadeRelationField = "City", CascadeFilterOperator="=", CascadeParentFields = "Country,City", @@ -1576,7 +1584,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Street\" AS \"Key\", \"{DbTablePrefix}District\".\"Street\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) AND (\"{DbTablePrefix}District\".\"Name\" = @param2 OR @param2 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Street\" ORDER BY \"{DbTablePrefix}District\".\"Street\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}District\".\"Street\" AS \"Key\", \"{Prefix.DbTableDefault}District\".\"Street\" as \"Name\" FROM \"{Prefix.DbTableDefault}District\" WHERE (\"{Prefix.DbTableDefault}District\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{Prefix.DbTableDefault}District\".\"CityCode\" = @param1 OR @param1 IS NULL) AND (\"{Prefix.DbTableDefault}District\".\"Name\" = @param2 OR @param2 IS NULL) GROUP BY \"{Prefix.DbTableDefault}District\".\"Street\" ORDER BY \"{Prefix.DbTableDefault}District\".\"Street\"", CascadeRelationField = "District", CascadeFilterOperator="=", CascadeParentFields = "Country,City,District" @@ -1974,7 +1982,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ] } }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Branch\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Branch\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -2206,7 +2214,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}Country\".\"Code\" AS \"Key\", \"{Prefix.DbTableDefault}Country\".\"Name\" as \"Name\" FROM \"{Prefix.DbTableDefault}Country\" ORDER BY \"{Prefix.DbTableDefault}Country\".\"Name\"", CascadeEmptyFields = "City,District,Street" }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto @@ -2242,7 +2250,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}City\".\"Code\" AS \"Key\", \"{Prefix.DbTableDefault}City\".\"Name\" as \"Name\" FROM \"{Prefix.DbTableDefault}City\" WHERE \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL ORDER BY \"{Prefix.DbTableDefault}City\".\"Name\"", CascadeRelationField = "Country", CascadeFilterOperator="=", CascadeParentFields = "Country", @@ -2281,7 +2289,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Name\" AS \"Key\", \"{DbTablePrefix}District\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Name\" ORDER BY \"{DbTablePrefix}District\".\"Name\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}District\".\"Name\" AS \"Key\", \"{Prefix.DbTableDefault}District\".\"Name\" as \"Name\" FROM \"{Prefix.DbTableDefault}District\" WHERE (\"{Prefix.DbTableDefault}District\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{Prefix.DbTableDefault}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{Prefix.DbTableDefault}District\".\"Name\" ORDER BY \"{Prefix.DbTableDefault}District\".\"Name\"", CascadeRelationField = "City", CascadeFilterOperator="=", CascadeParentFields = "Country,City", @@ -2320,7 +2328,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Street\" AS \"Key\", \"{DbTablePrefix}District\".\"Street\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) AND (\"{DbTablePrefix}District\".\"Name\" = @param2 OR @param2 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Street\" ORDER BY \"{DbTablePrefix}District\".\"Street\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}District\".\"Street\" AS \"Key\", \"{Prefix.DbTableDefault}District\".\"Street\" as \"Name\" FROM \"{Prefix.DbTableDefault}District\" WHERE (\"{Prefix.DbTableDefault}District\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{Prefix.DbTableDefault}District\".\"CityCode\" = @param1 OR @param1 IS NULL) AND (\"{Prefix.DbTableDefault}District\".\"Name\" = @param2 OR @param2 IS NULL) GROUP BY \"{Prefix.DbTableDefault}District\".\"Street\" ORDER BY \"{Prefix.DbTableDefault}District\".\"Street\"", CascadeRelationField = "District", CascadeFilterOperator="=", CascadeParentFields = "Country,City,District" @@ -3809,7 +3817,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Languages.Language + ".Export", I = AppCodes.Languages.Language + ".Import", }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Language\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Language\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -4169,7 +4177,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Languages.LanguageText + ".Export", I = AppCodes.Languages.LanguageText + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}LanguageText\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}LanguageText\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -4493,7 +4501,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Menus.Menu + ".Export", I = AppCodes.Menus.Menu + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Menu\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Menu\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -4781,7 +4789,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"Code\" AS \"Key\", \"DisplayName\" AS \"Name\" FROM \"{DbTablePrefix}Menu\" WHERE \"IsDeleted\" = 'false' AND \"IsDisabled\" = 'false' ORDER BY \"ParentCode\", \"Order\"" + LookupQuery = $"SELECT \"Code\" AS \"Key\", \"DisplayName\" AS \"Name\" FROM \"{Prefix.DbTableDefault}Menu\" WHERE \"IsDeleted\" = 'false' AND \"IsDisabled\" = 'false' ORDER BY \"ParentCode\", \"Order\"" }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { @@ -5009,7 +5017,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ColumnFixingEnabled = true, ColumnChooserEnabled = true }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}ListForm\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}ListForm\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", @@ -5909,7 +5917,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Settings.SettingDefinitions + ".Export", I = AppCodes.Settings.SettingDefinitions + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}SettingDefinition\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}SettingDefinition\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", @@ -6593,7 +6601,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Listforms.DataSource + ".Export", I = AppCodes.Listforms.DataSource + ".Import", }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}DataSource\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}DataSource\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", @@ -6883,7 +6891,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.BackgroundWorkers + ".Export", I = AppCodes.BackgroundWorkers + ".Import", }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}BackgroundWorker\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}BackgroundWorker\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -7273,7 +7281,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Notifications.NotificationRules + ".Export", I = AppCodes.Notifications.NotificationRules + ".Import", }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}NotificationRule\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}NotificationRule\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -7702,7 +7710,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Notifications.Notification + ".Export", I = AppCodes.Notifications.Notification + ".Import", }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Notification\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Notification\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -8056,7 +8064,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.IdentityManagement.IpRestrictions + ".Export", I = AppCodes.IdentityManagement.IpRestrictions + ".Import", }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}IpRestriction\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}IpRestriction\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -8334,7 +8342,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.CustomEndpoints + ".Export", I = AppCodes.CustomEndpoints + ".Import", }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}CustomEndpoint\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}CustomEndpoint\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", @@ -8580,7 +8588,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}DataSource\".\"Code\" AS \"Key\", \"{DbTablePrefix}DataSource\".\"Code\" AS \"Name\" FROM \"{DbTablePrefix}DataSource\"", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}DataSource\".\"Code\" AS \"Key\", \"{Prefix.DbTableDefault}DataSource\".\"Code\" AS \"Name\" FROM \"{Prefix.DbTableDefault}DataSource\"", }), PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { @@ -9693,5112 +9701,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion - #region Sector - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Sector)) - { - var listFormSector = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Sector, - Name = AppCodes.Definitions.Sector, - Title = AppCodes.Definitions.Sector, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.Sector, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Sector"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = false }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.Sector + ".Create", - R = AppCodes.Definitions.Sector, - U = AppCodes.Definitions.Sector + ".Update", - D = AppCodes.Definitions.Sector + ".Delete", - E = AppCodes.Definitions.Sector + ".Export", - I = AppCodes.Definitions.Sector + ".Import", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Sector\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] - { - new() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Sector Form", - Width = 400, - Height = 150 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto - { - Order = 1, - DataField = "Name", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] - { - new() - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new() - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region Sector Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormSector.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Sector + ".Create", - R = AppCodes.Definitions.Sector, - U = AppCodes.Definitions.Sector + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - new() - { - ListFormCode = listFormSector.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] - { - new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Sector + ".Create", - R = AppCodes.Definitions.Sector, - U = AppCodes.Definitions.Sector + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - } - ]); - #endregion - } - #endregion - - #region ContactTag - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ContactTag)) - { - var listFormContactTag = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.ContactTag, - Name = AppCodes.Definitions.ContactTag, - Title = AppCodes.Definitions.ContactTag, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.ContactTag, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("ContactTag"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = false }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.ContactTag + ".Create", - R = AppCodes.Definitions.ContactTag, - U = AppCodes.Definitions.ContactTag + ".Update", - D = AppCodes.Definitions.ContactTag + ".Delete", - E = AppCodes.Definitions.ContactTag + ".Export", - I = AppCodes.Definitions.ContactTag + ".Import", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}ContactTag\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] - { - new() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Contact Tag Form", - Width = 400, - Height = 200 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto - { - Order = 1, - DataField = "Name", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - }, - new EditingFormItemDto - { - Order = 2, - DataField = "Category", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] - { - new() - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new() - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region ContactTag Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormContactTag.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.ContactTag + ".Create", - R = AppCodes.Definitions.ContactTag, - U = AppCodes.Definitions.ContactTag + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - new() - { - ListFormCode = listFormContactTag.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] - { - new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.ContactTag + ".Create", - R = AppCodes.Definitions.ContactTag, - U = AppCodes.Definitions.ContactTag + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - new() - { - ListFormCode = listFormContactTag.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Category", - Width = 250, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] - { - new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.ContactTag + ".Create", - R = AppCodes.Definitions.ContactTag, - U = AppCodes.Definitions.ContactTag + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - } - ]); - #endregion - } - #endregion - - #region ContactTitle - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ContactTitle)) - { - var listFormContactTitle = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.ContactTitle, - Name = AppCodes.Definitions.ContactTitle, - Title = AppCodes.Definitions.ContactTitle, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.ContactTitle, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("ContactTitle"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = false }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.ContactTitle + ".Create", - R = AppCodes.Definitions.ContactTitle, - U = AppCodes.Definitions.ContactTitle + ".Update", - D = AppCodes.Definitions.ContactTitle + ".Delete", - E = AppCodes.Definitions.ContactTitle + ".Export", - I = AppCodes.Definitions.ContactTitle + ".Import", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}ContactTitle\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] - { - new() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Contact Title Form", - Width = 400, - Height = 200 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto - { - Order = 1, - DataField = "Title", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - }, - new EditingFormItemDto - { - Order = 2, - DataField = "Abbreviation", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] - { - new() - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new() - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region ContactTitle Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormContactTitle.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.ContactTitle + ".Create", - R = AppCodes.Definitions.ContactTitle, - U = AppCodes.Definitions.ContactTitle + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - new() - { - ListFormCode = listFormContactTitle.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Title", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] - { - new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.ContactTitle + ".Create", - R = AppCodes.Definitions.ContactTitle, - U = AppCodes.Definitions.ContactTitle + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - new() - { - ListFormCode = listFormContactTitle.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Abbreviation", - Width = 100, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] - { - new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.ContactTitle + ".Create", - R = AppCodes.Definitions.ContactTitle, - U = AppCodes.Definitions.ContactTitle + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - } - ]); - #endregion - } - #endregion - - #region Currency - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Currency)) - { - var listFormCurrency = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Currency, - Name = AppCodes.Definitions.Currency, - Title = AppCodes.Definitions.Currency, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.Currency, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Currency"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.Currency + ".Create", - R = AppCodes.Definitions.Currency, - U = AppCodes.Definitions.Currency + ".Update", - D = AppCodes.Definitions.Currency + ".Delete", - E = AppCodes.Definitions.Currency + ".Export", - I = AppCodes.Definitions.Currency + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Currency\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Currency Form", - Width = 500, - Height = 350 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto - { - Order = 1, - DataField = "Code", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - }, - new EditingFormItemDto - { - Order = 2, - DataField = "Symbol", - ColSpan = 2, - IsRequired = false, - EditorType2 = EditorTypes.dxTextBox - }, - new EditingFormItemDto - { - Order = 3, - DataField = "Name", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - }, - new EditingFormItemDto - { - Order = 4, - DataField = "Rate", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxNumberBox - }, - new EditingFormItemDto - { - Order = 5, - DataField = "IsActive", - ColSpan = 2, - IsRequired = false, - EditorType2 = EditorTypes.dxCheckBox - } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region Currency Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormCurrency.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Currency + ".Create", - R = AppCodes.Definitions.Currency, - U = AppCodes.Definitions.Currency + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCurrency.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Code", - Width = 120, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Currency + ".Create", - R = AppCodes.Definitions.Currency, - U = AppCodes.Definitions.Currency + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCurrency.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Symbol", - Width = 100, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Currency + ".Create", - R = AppCodes.Definitions.Currency, - U = AppCodes.Definitions.Currency + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCurrency.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Currency + ".Create", - R = AppCodes.Definitions.Currency, - U = AppCodes.Definitions.Currency + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCurrency.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Decimal, - FieldName = "Rate", - Width = 100, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Currency + ".Create", - R = AppCodes.Definitions.Currency, - U = AppCodes.Definitions.Currency + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCurrency.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "IsActive", - Width = 80, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Currency + ".Create", - R = AppCodes.Definitions.Currency, - U = AppCodes.Definitions.Currency + ".Update", - E = true, - I = true, - Deny = false - }) - } - ]); - #endregion - } - #endregion - - #region CountryGroup - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.CountryGroup)) - { - var listFormCountryGroup = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.CountryGroup, - Name = AppCodes.Definitions.CountryGroup, - Title = AppCodes.Definitions.CountryGroup, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.CountryGroup, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("CountryGroup"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.CountryGroup + ".Create", - R = AppCodes.Definitions.CountryGroup, - U = AppCodes.Definitions.CountryGroup + ".Update", - D = AppCodes.Definitions.CountryGroup + ".Delete", - E = AppCodes.Definitions.CountryGroup + ".Export", - I = AppCodes.Definitions.CountryGroup + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}CountryGroup\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Country Group Form", - Width = 400, - Height = 200 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto - { - Order = 1, - DataField = "Name", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region CountryGroup Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormCountryGroup.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.CountryGroup + ".Create", - R = AppCodes.Definitions.CountryGroup, - U = AppCodes.Definitions.CountryGroup + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountryGroup.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.CountryGroup + ".Create", - R = AppCodes.Definitions.CountryGroup, - U = AppCodes.Definitions.CountryGroup + ".Update", - E = true, - I = true, - Deny = false - }) - } - ]); - #endregion - } - #endregion - - #region Country - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Country)) - { - var listFormCountry = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Country, - Name = AppCodes.Definitions.Country, - Title = AppCodes.Definitions.Country, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.Country, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Country"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - D = AppCodes.Definitions.Country + ".Delete", - E = AppCodes.Definitions.Country + ".Export", - I = AppCodes.Definitions.Country + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Country\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Country Form", - Width = 600, - Height = 500 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto { Order = 1, DataField = "Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "GroupName", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 4, DataField = "CurrencyCode", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "PhoneCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 6, DataField = "TaxLabel", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 7, DataField = "ZipRequired", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 8, DataField = "StateRequired", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region Country Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Code", - Width = 100, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "GroupName", - Width = 150, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}CountryGroup\".\"Name\" AS \"Key\", \"{DbTablePrefix}CountryGroup\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}CountryGroup\" GROUP BY \"{DbTablePrefix}CountryGroup\".\"Name\" ORDER BY \"{DbTablePrefix}CountryGroup\".\"Name\"" - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "CurrencyCode", - Width = 100, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Int32, - FieldName = "PhoneCode", - Width = 80, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "TaxLabel", - Width = 120, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "ZipRequired", - Width = 80, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCountry.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "StateRequired", - Width = 80, - ListOrderNo = 9, - Visible = true, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Country + ".Create", - R = AppCodes.Definitions.Country, - U = AppCodes.Definitions.Country + ".Update", - E = true, - I = true, - Deny = false - }) - } - ]); - #endregion - - } - #endregion - - #region City - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.City)) - { - var listFormCity = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.City, - Name = AppCodes.Definitions.City, - Title = AppCodes.Definitions.City, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.City, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("City"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.City + ".Create", - R = AppCodes.Definitions.City, - U = AppCodes.Definitions.City + ".Update", - D = AppCodes.Definitions.City + ".Delete", - E = AppCodes.Definitions.City + ".Export", - I = AppCodes.Definitions.City + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}City\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "City Form", - Width = 500, - Height = 300 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto { Order = 1, DataField = "CountryCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "PlateCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region City Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormCity.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.City + ".Create", - R = AppCodes.Definitions.City, - U = AppCodes.Definitions.City + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCity.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "CountryCode", - Width = 400, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"" - }), - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.City + ".Create", - R = AppCodes.Definitions.City, - U = AppCodes.Definitions.City + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCity.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.City + ".Create", - R = AppCodes.Definitions.City, - U = AppCodes.Definitions.City + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCity.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Code", - Width = 120, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.City + ".Create", - R = AppCodes.Definitions.City, - U = AppCodes.Definitions.City + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormCity.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "PlateCode", - Width = 100, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.City + ".Create", - R = AppCodes.Definitions.City, - U = AppCodes.Definitions.City + ".Update", - E = true, - I = true, - Deny = false - }) - }, - ]); - #endregion - } - #endregion - - #region District - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.District)) - { - var listFormDistrict = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.District, - Name = AppCodes.Definitions.District, - Title = AppCodes.Definitions.District, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.District, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("District"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.City + ".Create", - R = AppCodes.Definitions.City, - U = AppCodes.Definitions.City + ".Update", - D = AppCodes.Definitions.City + ".Delete", - E = AppCodes.Definitions.City + ".Export", - I = AppCodes.Definitions.City + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}District\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "District Form", - Width = 600, - Height = 500 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto { Order = 1, DataField = "CountryCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 2, DataField = "CityCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "Township", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "Street", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 6, DataField = "ZipCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region City Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormDistrict.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.District + ".Create", - R = AppCodes.Definitions.District, - U = AppCodes.Definitions.District + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormDistrict.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "CountryCode", - Width = 120, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"", - CascadeEmptyFields = "CityCode" - }), - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.District + ".Create", - R = AppCodes.Definitions.District, - U = AppCodes.Definitions.District + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormDistrict.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "CityCode", - Width = 120, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"", - CascadeRelationField = "CountryCode", - CascadeFilterOperator="=", - CascadeParentFields = "CountryCode" - }), - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.District + ".Create", - R = AppCodes.Definitions.District, - U = AppCodes.Definitions.District + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormDistrict.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.District + ".Create", - R = AppCodes.Definitions.District, - U = AppCodes.Definitions.District + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormDistrict.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Township", - Width = 200, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.District + ".Create", - R = AppCodes.Definitions.District, - U = AppCodes.Definitions.District + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormDistrict.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Street", - Width = 400, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.District + ".Create", - R = AppCodes.Definitions.District, - U = AppCodes.Definitions.District + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormDistrict.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "ZipCode", - Width = 100, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.District + ".Create", - R = AppCodes.Definitions.District, - U = AppCodes.Definitions.District + ".Update", - E = true, - I = true, - Deny = false - }) - }, - ]); - #endregion - } - #endregion - - #region SkillType - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SkillType)) - { - var listFormSkillType = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.SkillType, - Name = AppCodes.Definitions.SkillType, - Title = AppCodes.Definitions.SkillType, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.SkillType, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("SkillType"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.SkillType + ".Create", - R = AppCodes.Definitions.SkillType, - U = AppCodes.Definitions.SkillType + ".Update", - D = AppCodes.Definitions.SkillType + ".Delete", - E = AppCodes.Definitions.SkillType + ".Export", - I = AppCodes.Definitions.SkillType + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}SkillType\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Skill Type Form", - Width = 400, - Height = 200 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto - { - Order = 1, - DataField = "Name", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { - new() { - Hint = "Manage", - Text ="Manage", - UrlTarget="_blank", - AuthName = AppCodes.Definitions.SkillType + ".Update", - Url=$"/admin/form/{ListFormCodes.Forms.FormSkillType}/@Id" - }, - }), - }); - - #region SkillType Fields - await _listFormFieldRepository.InsertManyAsync([ - new () - { - ListFormCode = listFormSkillType.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.SkillType + ".Create", - R = AppCodes.Definitions.SkillType, - U = AppCodes.Definitions.SkillType + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormSkillType.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.SkillType + ".Create", - R = AppCodes.Definitions.SkillType, - U = AppCodes.Definitions.SkillType + ".Update", - E = true, - I = true, - Deny = false - }) - } - ]); - #endregion - } - #endregion - - #region UomCategory - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.UomCategory)) - { - var listFormUomCategory = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.UomCategory, - Name = AppCodes.Definitions.UomCategory, - Title = AppCodes.Definitions.UomCategory, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.UomCategory, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("UomCategory"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.UomCategory + ".Create", - R = AppCodes.Definitions.UomCategory, - U = AppCodes.Definitions.UomCategory + ".Update", - D = AppCodes.Definitions.UomCategory + ".Delete", - E = AppCodes.Definitions.UomCategory + ".Export", - I = AppCodes.Definitions.UomCategory + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}UomCategory\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Uom Category Form", - Width = 400, - Height = 200 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto - { - Order = 1, - DataField = "Name", - ColSpan = 2, - IsRequired = true, - EditorType2 = EditorTypes.dxTextBox - } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { - new() { - Hint = "Manage", - Text ="Manage", - UrlTarget="_blank", - AuthName = AppCodes.Definitions.UomCategory + ".Update", - Url=$"/admin/form/{ListFormCodes.Forms.FormUomCategory}/@Id" - }, - }), - }); - - #region UomCategory Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormUomCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.UomCategory + ".Create", - R = AppCodes.Definitions.UomCategory, - U = AppCodes.Definitions.UomCategory + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormUomCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.UomCategory + ".Create", - R = AppCodes.Definitions.UomCategory, - U = AppCodes.Definitions.UomCategory + ".Update", - E = true, - I = true, - Deny = false - }) - } - ]); - #endregion - } - #endregion - - #region Uom - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Uom)) - { - var listFormUom = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Uom, - Name = AppCodes.Definitions.Uom, - Title = AppCodes.Definitions.Uom, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.Uom, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Uom"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto - { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.Uom + ".Create", - R = AppCodes.Definitions.Uom, - U = AppCodes.Definitions.Uom + ".Update", - D = AppCodes.Definitions.Uom + ".Delete", - E = AppCodes.Definitions.Uom + ".Export", - I = AppCodes.Definitions.Uom + ".Import", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Uom\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() - { - Title = "Uom Form", - Width = 600, - Height = 300 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { - new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= - [ - new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "Type", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 3, DataField = "Ratio", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 4, DataField = "Rounding", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 5, DataField = "IsActive", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 6, DataField = "UomCategoryId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "IsDeleted", - FieldDbType = DbType.Boolean, - Value = "false", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - } - ); - - #region Uom Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new ListFormField - { - ListFormCode = listFormUom.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - SortIndex = 0, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Uom + ".Create", - R = AppCodes.Definitions.Uom, - U = AppCodes.Definitions.Uom + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormUom.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Uom + ".Create", - R = AppCodes.Definitions.Uom, - U = AppCodes.Definitions.Uom + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormUom.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Type", - Width = 150, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.StaticData, - DisplayExpr = "name", - ValueExpr = "key", - LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key="Reference",Name="Reference" }, - new () { Key="SmallerThanReference",Name="Smaller Than Reference" }, - new () { Key="BiggerThanReference",Name="Bigger Than Reference" }, - }), - }), - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Uom + ".Create", - R = AppCodes.Definitions.Uom, - U = AppCodes.Definitions.Uom + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormUom.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Decimal, - FieldName = "Ratio", - Width = 150, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Uom + ".Create", - R = AppCodes.Definitions.Uom, - U = AppCodes.Definitions.Uom + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormUom.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Decimal, - FieldName = "Rounding", - Width = 150, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Uom + ".Create", - R = AppCodes.Definitions.Uom, - U = AppCodes.Definitions.Uom + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormUom.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "UomCategoryId", - Width = 150, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}UomCategory\".\"Id\" AS \"Key\", \"{DbTablePrefix}UomCategory\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}UomCategory\" ORDER BY \"{DbTablePrefix}UomCategory\".\"Name\"", - }), - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Uom + ".Create", - R = AppCodes.Definitions.Uom, - U = AppCodes.Definitions.Uom + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - }); - #endregion - } - #endregion - - #region Bank - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Bank)) - { - var listFormBank = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Bank, - Name = AppCodes.Definitions.Bank, - Title = AppCodes.Definitions.Bank, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.Bank, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Bank"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto - { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - D = AppCodes.Definitions.Bank + ".Delete", - E = AppCodes.Definitions.Bank + ".Export", - I = AppCodes.Definitions.Bank + ".Import", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Bank\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() - { - Title = "Bank Form", - Width = 600, - Height = 600 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { - new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= - [ - new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "IdentifierCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, - new EditingFormItemDto { Order = 3, DataField = "AddressLine1", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "AddressLine2", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 6, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 7, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 8, DataField = "PostalCode", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 9, DataField = "Phone", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 10, DataField = "Email", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "IsDeleted", - FieldDbType = DbType.Boolean, - Value = "false", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { - new() { - Hint = "Manage", - Text ="Manage", - UrlTarget="_blank", - AuthName = AppCodes.Definitions.Bank + ".Update", - Url=$"/admin/form/{ListFormCodes.Forms.FormBank}/@Id" - }, - }), - } - ); - - #region Bank Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - SortIndex = 0, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "IdentifierCode", - Width = 150, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "AddressLine1", - Width = 150, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "AddressLine2", - Width = 150, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Country", - Width = 100, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"", - CascadeEmptyFields = "City,District,Street" - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "City", - Width = 100, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"", - CascadeRelationField = "Country", - CascadeFilterOperator="=", - CascadeParentFields = "Country", - CascadeEmptyFields = "District,Street" - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "District", - Width = 100, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Name\" AS \"Key\", \"{DbTablePrefix}District\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Name\" ORDER BY \"{DbTablePrefix}District\".\"Name\"", - CascadeRelationField = "City", - CascadeFilterOperator="=", - CascadeParentFields = "Country,City", - CascadeEmptyFields = "Street", - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "PostalCode", - Width = 150, - ListOrderNo = 9, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Phone", - Width = 150, - ListOrderNo = 10, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Email", - Width = 150, - ListOrderNo = 11, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - }); - #endregion - } - #endregion - - #region BankAccount - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BankAccount)) - { - var listFormBankAccount = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.BankAccount, - Name = AppCodes.Definitions.BankAccount, - Title = AppCodes.Definitions.BankAccount, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.BankAccount, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("BankAccount"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto - { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - D = AppCodes.Definitions.BankAccount + ".Delete", - E = AppCodes.Definitions.BankAccount + ".Export", - I = AppCodes.Definitions.BankAccount + ".Import", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}BankAccount\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() - { - Title = "Bank Account Form", - Width = 600, - Height = 300 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { - new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= - [ - new EditingFormItemDto { Order = 1, DataField = "AccountNumber", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "BankId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 3, DataField = "AccountOwner", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "CurrencyId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 5, DataField = "CanTransferMoney", ColSpan = 2, EditorType2=EditorTypes.dxCheckBox }, - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "IsDeleted", - FieldDbType = DbType.Boolean, - Value = "false", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "CanTransferMoney", - FieldDbType = DbType.Boolean, - Value = "false", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - } - ); - - #region Bank Account Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - SortIndex = 0, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "AccountNumber", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "BankId", - Width = 250, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Bank\".\"Id\" AS \"Key\", \"{DbTablePrefix}Bank\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Bank\" ORDER BY \"{DbTablePrefix}Bank\".\"Name\"", - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "AccountOwner", - Width = 250, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "CurrencyId", - Width = 150, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Currency\".\"Id\" AS \"Key\", \"{DbTablePrefix}Currency\".\"Code\" as \"Name\" FROM \"{DbTablePrefix}Currency\" ORDER BY \"{DbTablePrefix}Currency\".\"Name\"", - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "CanTransferMoney", - Width = 50, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - }); - #endregion - } - #endregion - - #region Skill Level - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SkillLevel)) - { - var listFormSkillLevel = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.SkillLevel, - Name = AppCodes.Definitions.SkillLevel, - Title = AppCodes.Definitions.SkillLevel, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.SkillLevel, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("SkillLevel"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto - { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.SkillLevel + ".Create", - R = AppCodes.Definitions.SkillLevel, - U = AppCodes.Definitions.SkillLevel + ".Update", - D = AppCodes.Definitions.SkillLevel + ".Delete", - E = AppCodes.Definitions.SkillLevel + ".Export", - I = AppCodes.Definitions.SkillLevel + ".Import", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}SkillLevel\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() - { - Title = "Skill Level Form", - Width = 600, - Height = 300 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { - new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= - [ - new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "Progress", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 3, DataField = "IsDefault", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 4, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "IsDeleted", - FieldDbType = DbType.Boolean, - Value = "false", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "IsDefault", - FieldDbType = DbType.Boolean, - Value = "true", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - } - ); - - #region Skill Level Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new() { - ListFormCode = listFormSkillLevel.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - SortIndex = 0, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.SkillLevel + ".Create", - R = AppCodes.Definitions.SkillLevel, - U = AppCodes.Definitions.SkillLevel + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSkillLevel.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.SkillLevel + ".Create", - R = AppCodes.Definitions.SkillLevel, - U = AppCodes.Definitions.SkillLevel + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormSkillLevel.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Int32, - FieldName = "Progress", - Width = 150, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.SkillLevel + ".Create", - R = AppCodes.Definitions.SkillLevel, - U = AppCodes.Definitions.SkillLevel + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormSkillLevel.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "IsDefault", - Width = 150, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.SkillLevel + ".Create", - R = AppCodes.Definitions.SkillLevel, - U = AppCodes.Definitions.SkillLevel + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormSkillLevel.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "SkillTypeId", - Width = 150, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}SkillType\".\"Id\" AS \"Key\", \"{DbTablePrefix}SkillType\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}SkillType\" ORDER BY \"{DbTablePrefix}SkillType\".\"Name\"", - }), - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.SkillLevel + ".Create", - R = AppCodes.Definitions.SkillLevel, - U = AppCodes.Definitions.SkillLevel + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - }); - #endregion - } - #endregion - - #region Skill - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Skill)) - { - var listFormSkill = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Skill, - Name = AppCodes.Definitions.Skill, - Title = AppCodes.Definitions.Skill, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.Skill, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Skill"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto - { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Definitions.Skill + ".Create", - R = AppCodes.Definitions.Skill, - U = AppCodes.Definitions.Skill + ".Update", - D = AppCodes.Definitions.Skill + ".Delete", - E = AppCodes.Definitions.Skill + ".Export", - I = AppCodes.Definitions.Skill + ".Import", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Skill\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new FieldsDefaultValue() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new FieldsDefaultValue() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() - { - Title = "Skill Form", - Width = 600, - Height = 300 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { - new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= - [ - new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "IsDeleted", - FieldDbType = DbType.Boolean, - Value = "false", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - } - ); - - #region Skill Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new ListFormField - { - ListFormCode = listFormSkill.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - SortIndex = 0, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Skill + ".Create", - R = AppCodes.Definitions.Skill, - U = AppCodes.Definitions.Skill + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormSkill.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Skill + ".Create", - R = AppCodes.Definitions.Skill, - U = AppCodes.Definitions.Skill + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormSkill.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "SkillTypeId", - Width = 150, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}SkillType\".\"Id\" AS \"Key\", \"{DbTablePrefix}SkillType\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}SkillType\" ORDER BY \"{DbTablePrefix}SkillType\".\"Name\"", - }), - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.SkillLevel + ".Create", - R = AppCodes.Definitions.SkillLevel, - U = AppCodes.Definitions.SkillLevel + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - }); - #endregion - } - #endregion - - #region BlogCategory - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BlogCategory)) - { - var listFormBlogCategory = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.BlogCategory, - Name = AppCodes.BlogManagement.BlogCategory, - Title = AppCodes.BlogManagement.BlogCategory, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.BlogManagement.BlogCategory, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("BlogCategory"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = true }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.BlogManagement.BlogCategory + ".Create", - R = AppCodes.BlogManagement.BlogCategory, - U = AppCodes.BlogManagement.BlogCategory + ".Update", - D = AppCodes.BlogManagement.BlogCategory + ".Delete", - E = AppCodes.BlogManagement.BlogCategory + ".Export", - I = AppCodes.BlogManagement.BlogCategory + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}BlogCategory\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Blog Category Form", - Width = 600, - Height = 400 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 2, DataField = "Slug", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 4, DataField = "Icon", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "DisplayOrder", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 6, DataField = "IsActive", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "IsActive", - FieldDbType = DbType.Boolean, - Value = "true", - CustomValueType = FieldCustomValueTypeEnum.Value } - }) - }); - - #region BlogCategory Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormBlogCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogCategory + ".Create", - R = AppCodes.BlogManagement.BlogCategory, - U = AppCodes.BlogManagement.BlogCategory + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 400, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryLanguageKeyValues - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogCategory + ".Create", - R = AppCodes.BlogManagement.BlogCategory, - U = AppCodes.BlogManagement.BlogCategory + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Slug", - Width = 330, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogCategory + ".Create", - R = AppCodes.BlogManagement.BlogCategory, - U = AppCodes.BlogManagement.BlogCategory + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Description", - Width = 400, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryLanguageKeyValues - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogCategory + ".Create", - R = AppCodes.BlogManagement.BlogCategory, - U = AppCodes.BlogManagement.BlogCategory + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Icon", - Width = 200, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogCategory + ".Create", - R = AppCodes.BlogManagement.BlogCategory, - U = AppCodes.BlogManagement.BlogCategory + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "DisplayOrder", - Width = 100, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogCategory + ".Create", - R = AppCodes.BlogManagement.BlogCategory, - U = AppCodes.BlogManagement.BlogCategory + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogCategory.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "IsActive", - Width = 100, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogCategory + ".Create", - R = AppCodes.BlogManagement.BlogCategory, - U = AppCodes.BlogManagement.BlogCategory + ".Update", - E = true, - I = true, - Deny = false - }) - } - ]); - #endregion - } - #endregion - - #region BlogPost - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BlogPost)) - { - var listFormBlogPosts = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.BlogPost, - Name = AppCodes.BlogManagement.BlogPosts, - Title = AppCodes.BlogManagement.BlogPosts, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.BlogManagement.BlogPosts, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("BlogPost"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = true }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - D = AppCodes.BlogManagement.BlogPosts + ".Delete", - E = AppCodes.BlogManagement.BlogPosts + ".Export", - I = AppCodes.BlogManagement.BlogPosts + ".Import" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}BlogPosts\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Blog Post Form", - Width = 600, - Height = 600 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 2, DataField = "Slug", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "Summary", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 4, DataField = "CoverImage", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "ReadTime", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 6, DataField = "CategoryId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 7, DataField = "ViewCount", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 8, DataField = "LikeCount", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 9, DataField = "CommentCount", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 10, DataField = "IsPublished", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 11, DataField = "PublishedAt", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxDateBox }, - new EditingFormItemDto { Order = 12, DataField = "ContentTr", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxHtmlEditor, EditorOptions=htmlEditorOptions }, - new EditingFormItemDto { Order = 13, DataField = "ContentEn", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxHtmlEditor, EditorOptions=htmlEditorOptions } - ] - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "IsPublished", - FieldDbType = DbType.Boolean, - Value = "true", - CustomValueType = FieldCustomValueTypeEnum.Value }, - new() { - FieldName = "PublishedAt", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }) - }); - - #region BlogPosts Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Title", - Width = 400, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryLanguageKeyValues - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Slug", - Width = 350, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Summary", - Width = 400, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryLanguageKeyValues - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "CoverImage", - Width = 200, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "ReadTime", - Width = 80, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "CategoryId", - Width = 200, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}BlogCategory\".\"Id\" AS \"Key\", \"{DbTablePrefix}BlogCategory\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}BlogCategory\" ORDER BY \"{DbTablePrefix}BlogCategory\".\"Name\"" - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Int32, - FieldName = "ViewCount", - Width = 80, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Int32, - FieldName = "LikeCount", - Width = 80, - ListOrderNo = 9, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Int32, - FieldName = "CommentCount", - Width = 80, - ListOrderNo = 10, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "IsPublished", - Width = 80, - ListOrderNo = 10, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.DateTime, - FieldName = "PublishedAt", - Width = 120, - ListOrderNo = 11, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.DateTime, - FieldName = "ContentTr", - Width = 120, - ListOrderNo = 11, - Visible = false, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormBlogPosts.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.DateTime, - FieldName = "ContentEn", - Width = 120, - ListOrderNo = 12, - Visible = false, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.BlogManagement.BlogPosts + ".Create", - R = AppCodes.BlogManagement.BlogPosts, - U = AppCodes.BlogManagement.BlogPosts + ".Update", - E = true, - I = true, - Deny = false - }) - } - ]); - #endregion - } - #endregion - #region Route if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Route)) { @@ -14853,7 +9755,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Routes + ".Export", I = AppCodes.Routes + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Route\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Route\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] { new FieldsDefaultValue @@ -15100,6 +10002,798 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Report Categories + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ReportCategory)) + { + var listFormReportCatory = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.ReportCategory, + Name = AppCodes.Reports.Categories, + Title = AppCodes.Reports.Categories, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Reports.Categories, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("ReportCategory"), + KeyFieldName = "Id", + DefaultFilter = "\"IsDeleted\" = 'false'", + KeyFieldDbSourceType = DbType.Int32, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Reports.Categories + ".Create", + R = AppCodes.Reports.Categories, + U = AppCodes.Reports.Categories + ".Update", + D = AppCodes.Reports.Categories + ".Delete", + E = AppCodes.Reports.Categories + ".Export", + I = AppCodes.Reports.Categories + ".Import" + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Report Category Form", + Width = 500, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Id", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "Icon", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + ] + } + }), + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}ReportCategory\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region Report Categories Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormReportCatory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Reports.Categories + ".Create", + R = AppCodes.Reports.Categories, + U = AppCodes.Reports.Categories + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormReportCatory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Reports.Categories + ".Create", + R = AppCodes.Reports.Categories, + U = AppCodes.Reports.Categories + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormReportCatory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Reports.Categories + ".Create", + R = AppCodes.Reports.Categories, + U = AppCodes.Reports.Categories + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormReportCatory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Icon", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Reports.Categories + ".Create", + R = AppCodes.Reports.Categories, + U = AppCodes.Reports.Categories + ".Update", + E = true, + I = true, + Deny = false + }) + }, + ]); + #endregion + } + #endregion + + //Web Site + #region About Us + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.About)) + { + var listFormAbout = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.About, + Name = AppCodes.About, + Title = AppCodes.About, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.About, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("About"), + KeyFieldName = "Id", + DefaultFilter = "\"IsDeleted\" = 'false'", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.About + ".Create", + R = AppCodes.About, + U = AppCodes.About + ".Update", + D = AppCodes.About + ".Delete", + E = AppCodes.About + ".Export", + I = AppCodes.About + ".Import" + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "About Form", + Width = 800, + Height = 600 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "StatsJson", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, + new EditingFormItemDto { Order = 2, DataField = "DescriptionsJson", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, + new EditingFormItemDto { Order = 3, DataField = "SectionsJson", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, + ] + } + }), + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}About\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region About Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormAbout.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.About + ".Create", + R = AppCodes.About, + U = AppCodes.About + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormAbout.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "StatsJson", + Width = 400, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.About + ".Create", + R = AppCodes.About, + U = AppCodes.About + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormAbout.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "DescriptionsJson", + Width = 400, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.About + ".Create", + R = AppCodes.About, + U = AppCodes.About + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormAbout.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "SectionsJson", + Width = 400, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.About + ".Create", + R = AppCodes.About, + U = AppCodes.About + ".Update", + E = true, + I = true, + Deny = false + }) + }, + ]); + #endregion + } + #endregion + + #region Services + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Service)) + { + var listFormService = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Service, + Name = AppCodes.Services, + Title = AppCodes.Services, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Services, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Service"), + KeyFieldName = "Id", + DefaultFilter = "\"IsDeleted\" = 'false'", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Services + ".Create", + R = AppCodes.Services, + U = AppCodes.Services + ".Update", + D = AppCodes.Services + ".Delete", + E = AppCodes.Services + ".Export", + I = AppCodes.Services + ".Import" + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Service Form", + Width = 500, + Height = 450 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Icon", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 4, DataField = "Type", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 5, DataField = "Features", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, + ] + } + }), + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Service\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + }); + + #region Services Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormService.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Services + ".Create", + R = AppCodes.Services, + U = AppCodes.Services + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormService.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Title", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryLanguageKeyValues + }), + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Services + ".Create", + R = AppCodes.Services, + U = AppCodes.Services + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormService.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Icon", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Services + ".Create", + R = AppCodes.Services, + U = AppCodes.Services + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormService.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryLanguageKeyValues + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Demos + ".Create", + R = AppCodes.Demos, + U = AppCodes.Demos + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormService.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Type", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key="service",Name="Service" }, + new () { Key="support",Name="Support" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Services + ".Create", + R = AppCodes.Services, + U = AppCodes.Services + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormService.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Features", + Width = 200, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Services + ".Create", + R = AppCodes.Services, + U = AppCodes.Services + ".Update", + E = true, + I = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + #region Products if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Product)) { @@ -15154,7 +10848,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Orders.Products + ".Export", I = AppCodes.Orders.Products + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Product\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Product\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] { new FieldsDefaultValue @@ -15921,7 +11615,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency E = AppCodes.Orders.PurchaseOrders + ".Export", I = AppCodes.Orders.PurchaseOrders + ".Import" }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}SkillType\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] { new FieldsDefaultValue @@ -16016,6 +11710,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CustomValueType = FieldCustomValueTypeEnum.CustomKey } }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "Country", + FieldDbType = DbType.String, + Value = "TR", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) }); #region Purchase Order Fields @@ -16476,10 +12177,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion - #region Report Categories - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ReportCategory)) + #region BlogCategory + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BlogCategory)) { - var listFormReportCatory = await _listFormRepository.InsertAsync( + var listFormBlogCategory = await _listFormRepository.InsertAsync( new ListForm { ListFormType = ListFormTypeEnum.List, @@ -16494,24 +12195,24 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CardLayoutColumn = 4 }), CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.ReportCategory, - Name = AppCodes.Reports.Categories, - Title = AppCodes.Reports.Categories, + ListFormCode = ListFormCodes.Lists.BlogCategory, + Name = AppCodes.BlogManagement.BlogCategory, + Title = AppCodes.BlogManagement.BlogCategory, DataSourceCode = SeedConsts.DataSources.DefaultCode, IsTenant = false, IsBranch = false, IsOrganizationUnit = false, - Description = AppCodes.Reports.Categories, + Description = AppCodes.BlogManagement.BlogCategory, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("ReportCategory"), + SelectCommand = SelectCommandByTableName("BlogCategory"), KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", - KeyFieldDbSourceType = DbType.Int32, SortMode = GridOptions.SortModeSingle, FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = true }), SelectionJson = JsonSerializer.Serialize(new SelectionDto { Mode = GridOptions.SelectionModeSingle, @@ -16523,12 +12224,30 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto { - C = AppCodes.Reports.Categories + ".Create", - R = AppCodes.Reports.Categories, - U = AppCodes.Reports.Categories + ".Update", - D = AppCodes.Reports.Categories + ".Delete", - E = AppCodes.Reports.Categories + ".Export", - I = AppCodes.Reports.Categories + ".Import" + C = AppCodes.BlogManagement.BlogCategory + ".Create", + R = AppCodes.BlogManagement.BlogCategory, + U = AppCodes.BlogManagement.BlogCategory + ".Update", + D = AppCodes.BlogManagement.BlogCategory + ".Delete", + E = AppCodes.BlogManagement.BlogCategory + ".Export", + I = AppCodes.BlogManagement.BlogCategory + ".Import" + }), + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}BlogCategory\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } }), PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { @@ -16547,9 +12266,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency { Popup = new GridEditingPopupDto { - Title = "Report Category Form", - Width = 500, - Height = 300 + Title = "Blog Category Form", + Width = 600, + Height = 400 }, AllowDeleting = true, AllowAdding = true, @@ -16566,31 +12285,15 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ItemType = "group", Items = [ - new EditingFormItemDto { Order = 1, DataField = "Id", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Slug", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order = 4, DataField = "Icon", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "DisplayOrder", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 6, DataField = "IsActive", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox } ] } }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}ReportCategory\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] { new FieldsDefaultValue @@ -16607,14 +12310,21 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "IsActive", + FieldDbType = DbType.Boolean, + Value = "true", + CustomValueType = FieldCustomValueTypeEnum.Value } }) }); - #region Report Categories Fields + #region BlogCategory Fields await _listFormFieldRepository.InsertManyAsync([ new() { - ListFormCode = listFormReportCatory.ListFormCode, + ListFormCode = listFormBlogCategory.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.Guid, FieldName = "Id", @@ -16623,15 +12333,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Reports.Categories + ".Create", - R = AppCodes.Reports.Categories, - U = AppCodes.Reports.Categories + ".Update", + C = AppCodes.BlogManagement.BlogCategory + ".Create", + R = AppCodes.BlogManagement.BlogCategory, + U = AppCodes.BlogManagement.BlogCategory + ".Update", E = true, I = true, Deny = false @@ -16639,25 +12345,32 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }, new() { - ListFormCode = listFormReportCatory.ListFormCode, + ListFormCode = listFormBlogCategory.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Name", - Width = 200, + Width = 400, ListOrderNo = 2, Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, ValidationRuleJson = JsonSerializer.Serialize(new[] { new ValidationRuleDto { Type = "required" } }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryLanguageKeyValues + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Reports.Categories + ".Create", - R = AppCodes.Reports.Categories, - U = AppCodes.Reports.Categories + ".Update", + C = AppCodes.BlogManagement.BlogCategory + ".Create", + R = AppCodes.BlogManagement.BlogCategory, + U = AppCodes.BlogManagement.BlogCategory + ".Update", E = true, I = true, Deny = false @@ -16665,21 +12378,25 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }, new() { - ListFormCode = listFormReportCatory.ListFormCode, + ListFormCode = listFormBlogCategory.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "Description", - Width = 500, + FieldName = "Slug", + Width = 330, ListOrderNo = 3, Visible = true, IsActive = true, IsDeleted = false, AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Reports.Categories + ".Create", - R = AppCodes.Reports.Categories, - U = AppCodes.Reports.Categories + ".Update", + C = AppCodes.BlogManagement.BlogCategory + ".Create", + R = AppCodes.BlogManagement.BlogCategory, + U = AppCodes.BlogManagement.BlogCategory + ".Update", E = true, I = true, Deny = false @@ -16687,26 +12404,613 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }, new() { - ListFormCode = listFormReportCatory.ListFormCode, + ListFormCode = listFormBlogCategory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 400, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryLanguageKeyValues + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogCategory + ".Create", + R = AppCodes.BlogManagement.BlogCategory, + U = AppCodes.BlogManagement.BlogCategory + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogCategory.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Icon", Width = 200, - ListOrderNo = 4, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogCategory + ".Create", + R = AppCodes.BlogManagement.BlogCategory, + U = AppCodes.BlogManagement.BlogCategory + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogCategory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "DisplayOrder", + Width = 100, + ListOrderNo = 6, Visible = true, IsActive = true, IsDeleted = false, AllowSearch = true, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Reports.Categories + ".Create", - R = AppCodes.Reports.Categories, - U = AppCodes.Reports.Categories + ".Update", + C = AppCodes.BlogManagement.BlogCategory + ".Create", + R = AppCodes.BlogManagement.BlogCategory, + U = AppCodes.BlogManagement.BlogCategory + ".Update", E = true, I = true, Deny = false }) }, + new() + { + ListFormCode = listFormBlogCategory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogCategory + ".Create", + R = AppCodes.BlogManagement.BlogCategory, + U = AppCodes.BlogManagement.BlogCategory + ".Update", + E = true, + I = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region BlogPost + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BlogPost)) + { + var listFormBlogPosts = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.BlogPost, + Name = AppCodes.BlogManagement.BlogPosts, + Title = AppCodes.BlogManagement.BlogPosts, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.BlogManagement.BlogPosts, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("BlogPost"), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = true }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + D = AppCodes.BlogManagement.BlogPosts + ".Delete", + E = AppCodes.BlogManagement.BlogPosts + ".Export", + I = AppCodes.BlogManagement.BlogPosts + ".Import" + }), + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}BlogPosts\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Blog Post Form", + Width = 600, + Height = 600 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Slug", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Summary", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 4, DataField = "CoverImage", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "ReadTime", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "CategoryId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 7, DataField = "ViewCount", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 8, DataField = "LikeCount", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 9, DataField = "CommentCount", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 10, DataField = "IsPublished", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 11, DataField = "PublishedAt", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 12, DataField = "ContentTr", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxHtmlEditor, EditorOptions=htmlEditorOptions }, + new EditingFormItemDto { Order = 13, DataField = "ContentEn", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxHtmlEditor, EditorOptions=htmlEditorOptions } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "IsPublished", + FieldDbType = DbType.Boolean, + Value = "true", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "PublishedAt", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }) + }); + + #region BlogPosts Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Title", + Width = 400, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryLanguageKeyValues + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Slug", + Width = 350, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Summary", + Width = 400, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryLanguageKeyValues + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "CoverImage", + Width = 200, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ReadTime", + Width = 80, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "CategoryId", + Width = 200, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}BlogCategory\".\"Id\" AS \"Key\", \"{Prefix.DbTableDefault}BlogCategory\".\"Name\" as \"Name\" FROM \"{Prefix.DbTableDefault}BlogCategory\" ORDER BY \"{Prefix.DbTableDefault}BlogCategory\".\"Name\"" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "ViewCount", + Width = 80, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "LikeCount", + Width = 80, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "CommentCount", + Width = 80, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsPublished", + Width = 80, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "PublishedAt", + Width = 120, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "ContentTr", + Width = 120, + ListOrderNo = 11, + Visible = false, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormBlogPosts.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "ContentEn", + Width = 120, + ListOrderNo = 12, + Visible = false, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.BlogManagement.BlogPosts + ".Create", + R = AppCodes.BlogManagement.BlogPosts, + U = AppCodes.BlogManagement.BlogPosts + ".Update", + E = true, + I = true, + Deny = false + }) + } ]); #endregion } @@ -16813,7 +13117,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ] } }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Demo\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Demo\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] { new FieldsDefaultValue @@ -17063,561 +13367,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion - #region Services - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Service)) - { - var listFormService = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Service, - Name = AppCodes.Services, - Title = AppCodes.Services, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Services, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Service"), - KeyFieldName = "Id", - DefaultFilter = "\"IsDeleted\" = 'false'", - KeyFieldDbSourceType = DbType.Guid, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Services + ".Create", - R = AppCodes.Services, - U = AppCodes.Services + ".Update", - D = AppCodes.Services + ".Delete", - E = AppCodes.Services + ".Export", - I = AppCodes.Services + ".Import" - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "Service Form", - Width = 500, - Height = 450 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 2, DataField = "Icon", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 4, DataField = "Type", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 5, DataField = "Features", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, - ] - } - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Service\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "IsDeleted", - FieldDbType = DbType.Boolean, - Value = "false", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - }); - - #region Services Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormService.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Services + ".Create", - R = AppCodes.Services, - U = AppCodes.Services + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormService.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Title", - Width = 200, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryLanguageKeyValues - }), - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Services + ".Create", - R = AppCodes.Services, - U = AppCodes.Services + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormService.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Icon", - Width = 150, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Services + ".Create", - R = AppCodes.Services, - U = AppCodes.Services + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormService.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Description", - Width = 150, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = false, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryLanguageKeyValues - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Demos + ".Create", - R = AppCodes.Demos, - U = AppCodes.Demos + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormService.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Type", - Width = 100, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - LookupJson = JsonSerializer.Serialize(new LookupDto - { - - DataSourceType = UiLookupDataSourceTypeEnum.StaticData, - DisplayExpr = "name", - ValueExpr = "key", - LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key="service",Name="Service" }, - new () { Key="support",Name="Support" }, - }), - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Services + ".Create", - R = AppCodes.Services, - U = AppCodes.Services + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormService.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Features", - Width = 200, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Services + ".Create", - R = AppCodes.Services, - U = AppCodes.Services + ".Update", - E = true, - I = true, - Deny = false - }) - } - ]); - #endregion - } - #endregion - - #region About Us - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.About)) - { - var listFormAbout = await _listFormRepository.InsertAsync( - new ListForm - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.About, - Name = AppCodes.About, - Title = AppCodes.About, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.About, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("About"), - KeyFieldName = "Id", - DefaultFilter = "\"IsDeleted\" = 'false'", - KeyFieldDbSourceType = DbType.Guid, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), - HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), - SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), - GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.About + ".Create", - R = AppCodes.About, - U = AppCodes.About + ".Update", - D = AppCodes.About + ".Delete", - E = AppCodes.About + ".Export", - I = AppCodes.About + ".Import" - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto - { - Title = "About Form", - Width = 800, - Height = 600 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false - }), - EditingFormJson = JsonSerializer.Serialize(new List - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto { Order = 1, DataField = "StatsJson", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, - new EditingFormItemDto { Order = 2, DataField = "DescriptionsJson", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, - new EditingFormItemDto { Order = 3, DataField = "SectionsJson", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, - ] - } - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}About\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] - { - new FieldsDefaultValue - { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - }, - new FieldsDefaultValue - { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey - } - }) - }); - - #region About Fields - await _listFormFieldRepository.InsertManyAsync([ - new() - { - ListFormCode = listFormAbout.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.About + ".Create", - R = AppCodes.About, - U = AppCodes.About + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormAbout.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "StatsJson", - Width = 400, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.About + ".Create", - R = AppCodes.About, - U = AppCodes.About + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormAbout.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "DescriptionsJson", - Width = 400, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.About + ".Create", - R = AppCodes.About, - U = AppCodes.About + ".Update", - E = true, - I = true, - Deny = false - }) - }, - new() - { - ListFormCode = listFormAbout.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "SectionsJson", - Width = 400, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new[] - { - new ValidationRuleDto { Type = "required" } - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.About + ".Create", - R = AppCodes.About, - U = AppCodes.About + ".Update", - E = true, - I = true, - Deny = false - }) - }, - ]); - #endregion - } - #endregion - #region Contact if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Contact)) { @@ -17719,7 +13468,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ] } }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Contact\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteCommand = $"UPDATE \"{Prefix.DbTableDefault}Contact\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] { new FieldsDefaultValue @@ -17998,6 +13747,4295 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + //Definitions + #region Sector + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Sector)) + { + var listFormSector = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Sector, + Name = AppCodes.Definitions.Sector, + Title = AppCodes.Definitions.Sector, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Sector, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Sector", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = false }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Sector + ".Create", + R = AppCodes.Definitions.Sector, + U = AppCodes.Definitions.Sector + ".Update", + D = AppCodes.Definitions.Sector + ".Delete", + E = AppCodes.Definitions.Sector + ".Export", + I = AppCodes.Definitions.Sector + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Sector", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Sector Form", + Width = 400, + Height = 150 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto + { + Order = 1, + DataField = "Name", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new() + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region Sector Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormSector.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Sector + ".Create", + R = AppCodes.Definitions.Sector, + U = AppCodes.Definitions.Sector + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() + { + ListFormCode = listFormSector.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Sector + ".Create", + R = AppCodes.Definitions.Sector, + U = AppCodes.Definitions.Sector + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + ]); + #endregion + } + #endregion + + #region ContactTag + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ContactTag)) + { + var listFormContactTag = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.ContactTag, + Name = AppCodes.Definitions.ContactTag, + Title = AppCodes.Definitions.ContactTag, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.ContactTag, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("ContactTag", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = false }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.ContactTag + ".Create", + R = AppCodes.Definitions.ContactTag, + U = AppCodes.Definitions.ContactTag + ".Update", + D = AppCodes.Definitions.ContactTag + ".Delete", + E = AppCodes.Definitions.ContactTag + ".Export", + I = AppCodes.Definitions.ContactTag + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("ContactTag", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Contact Tag Form", + Width = 400, + Height = 200 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto + { + Order = 1, + DataField = "Name", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + }, + new EditingFormItemDto + { + Order = 2, + DataField = "Category", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new() + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region ContactTag Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormContactTag.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ContactTag + ".Create", + R = AppCodes.Definitions.ContactTag, + U = AppCodes.Definitions.ContactTag + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() + { + ListFormCode = listFormContactTag.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ContactTag + ".Create", + R = AppCodes.Definitions.ContactTag, + U = AppCodes.Definitions.ContactTag + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() + { + ListFormCode = listFormContactTag.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Category", + Width = 250, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ContactTag + ".Create", + R = AppCodes.Definitions.ContactTag, + U = AppCodes.Definitions.ContactTag + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + ]); + #endregion + } + #endregion + + #region ContactTitle + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ContactTitle)) + { + var listFormContactTitle = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.ContactTitle, + Name = AppCodes.Definitions.ContactTitle, + Title = AppCodes.Definitions.ContactTitle, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.ContactTitle, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("ContactTitle", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = false }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.ContactTitle + ".Create", + R = AppCodes.Definitions.ContactTitle, + U = AppCodes.Definitions.ContactTitle + ".Update", + D = AppCodes.Definitions.ContactTitle + ".Delete", + E = AppCodes.Definitions.ContactTitle + ".Export", + I = AppCodes.Definitions.ContactTitle + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("ContactTitle", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Contact Title Form", + Width = 400, + Height = 200 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto + { + Order = 1, + DataField = "Title", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + }, + new EditingFormItemDto + { + Order = 2, + DataField = "Abbreviation", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new() + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region ContactTitle Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormContactTitle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ContactTitle + ".Create", + R = AppCodes.Definitions.ContactTitle, + U = AppCodes.Definitions.ContactTitle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() + { + ListFormCode = listFormContactTitle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Title", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ContactTitle + ".Create", + R = AppCodes.Definitions.ContactTitle, + U = AppCodes.Definitions.ContactTitle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() + { + ListFormCode = listFormContactTitle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Abbreviation", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ContactTitle + ".Create", + R = AppCodes.Definitions.ContactTitle, + U = AppCodes.Definitions.ContactTitle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + ]); + #endregion + } + #endregion + + #region Currency + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Currency)) + { + var listFormCurrency = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Currency, + Name = AppCodes.Definitions.Currency, + Title = AppCodes.Definitions.Currency, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Currency, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Currency", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + D = AppCodes.Definitions.Currency + ".Delete", + E = AppCodes.Definitions.Currency + ".Export", + I = AppCodes.Definitions.Currency + ".Import" + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Currency", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Currency Form", + Width = 500, + Height = 350 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto + { + Order = 1, + DataField = "Code", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + }, + new EditingFormItemDto + { + Order = 2, + DataField = "Symbol", + ColSpan = 2, + IsRequired = false, + EditorType2 = EditorTypes.dxTextBox + }, + new EditingFormItemDto + { + Order = 3, + DataField = "Name", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + }, + new EditingFormItemDto + { + Order = 4, + DataField = "Rate", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxNumberBox + }, + new EditingFormItemDto + { + Order = 5, + DataField = "IsActive", + ColSpan = 2, + IsRequired = false, + EditorType2 = EditorTypes.dxCheckBox + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region Currency Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 120, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Symbol", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Rate", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 80, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + I = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region CountryGroup + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.CountryGroup)) + { + var listFormCountryGroup = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.CountryGroup, + Name = AppCodes.Definitions.CountryGroup, + Title = AppCodes.Definitions.CountryGroup, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.CountryGroup, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("CountryGroup", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.CountryGroup + ".Create", + R = AppCodes.Definitions.CountryGroup, + U = AppCodes.Definitions.CountryGroup + ".Update", + D = AppCodes.Definitions.CountryGroup + ".Delete", + E = AppCodes.Definitions.CountryGroup + ".Export", + I = AppCodes.Definitions.CountryGroup + ".Import" + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("CountryGroup", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Country Group Form", + Width = 400, + Height = 200 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto + { + Order = 1, + DataField = "Name", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region CountryGroup Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormCountryGroup.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.CountryGroup + ".Create", + R = AppCodes.Definitions.CountryGroup, + U = AppCodes.Definitions.CountryGroup + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountryGroup.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.CountryGroup + ".Create", + R = AppCodes.Definitions.CountryGroup, + U = AppCodes.Definitions.CountryGroup + ".Update", + E = true, + I = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region Country + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Country)) + { + var listFormCountry = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Country, + Name = AppCodes.Definitions.Country, + Title = AppCodes.Definitions.Country, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Country, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Country", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + D = AppCodes.Definitions.Country + ".Delete", + E = AppCodes.Definitions.Country + ".Export", + I = AppCodes.Definitions.Country + ".Import" + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Country Form", + Width = 600, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "GroupName", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 4, DataField = "CurrencyCode", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "PhoneCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 6, DataField = "TaxLabel", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField = "ZipRequired", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 8, DataField = "StateRequired", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region Country Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 100, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "GroupName", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("CountryGroup", Prefix.DbTableDefinition)}\".\"Name\" AS \"Key\", \"{SelectCommandByTableName("CountryGroup", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("CountryGroup", Prefix.DbTableDefinition)}\" GROUP BY \"{SelectCommandByTableName("CountryGroup", Prefix.DbTableDefinition)}\".\"Name\" ORDER BY \"{SelectCommandByTableName("CountryGroup", Prefix.DbTableDefinition)}\".\"Name\"" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "CurrencyCode", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "PhoneCode", + Width = 80, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "TaxLabel", + Width = 120, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "ZipRequired", + Width = 80, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "StateRequired", + Width = 80, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + I = true, + Deny = false + }) + } + ]); + #endregion + + } + #endregion + + #region City + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.City)) + { + var listFormCity = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.City, + Name = AppCodes.Definitions.City, + Title = AppCodes.Definitions.City, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.City, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("City", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.City + ".Create", + R = AppCodes.Definitions.City, + U = AppCodes.Definitions.City + ".Update", + D = AppCodes.Definitions.City + ".Delete", + E = AppCodes.Definitions.City + ".Export", + I = AppCodes.Definitions.City + ".Import" + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "City Form", + Width = 500, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "PlateCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "Country", + FieldDbType = DbType.String, + Value = "TR", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) + }); + + #region City Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormCity.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.City + ".Create", + R = AppCodes.Definitions.City, + U = AppCodes.Definitions.City + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCity.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Country", + Width = 400, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\"" + }), + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.City + ".Create", + R = AppCodes.Definitions.City, + U = AppCodes.Definitions.City + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCity.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.City + ".Create", + R = AppCodes.Definitions.City, + U = AppCodes.Definitions.City + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCity.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 120, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.City + ".Create", + R = AppCodes.Definitions.City, + U = AppCodes.Definitions.City + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCity.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PlateCode", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.City + ".Create", + R = AppCodes.Definitions.City, + U = AppCodes.Definitions.City + ".Update", + E = true, + I = true, + Deny = false + }) + }, + ]); + #endregion + } + #endregion + + #region District + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.District)) + { + var listFormDistrict = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.District, + Name = AppCodes.Definitions.District, + Title = AppCodes.Definitions.District, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.District, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("District", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.City + ".Create", + R = AppCodes.Definitions.City, + U = AppCodes.Definitions.City + ".Update", + D = AppCodes.Definitions.City + ".Delete", + E = AppCodes.Definitions.City + ".Export", + I = AppCodes.Definitions.City + ".Import" + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "District Form", + Width = 600, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 2, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Township", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "Street", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "ZipCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "Country", + FieldDbType = DbType.String, + Value = "TR", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) + }); + + #region City Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormDistrict.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.District + ".Create", + R = AppCodes.Definitions.District, + U = AppCodes.Definitions.District + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormDistrict.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Country", + Width = 120, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\"", + CascadeEmptyFields = "CityCode" + }), + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.District + ".Create", + R = AppCodes.Definitions.District, + U = AppCodes.Definitions.District + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormDistrict.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "CityCode", + Width = 120, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\" WHERE \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL ORDER BY \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\"", + CascadeRelationField = "Country", + CascadeFilterOperator="=", + CascadeParentFields = "Country" + }), + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.District + ".Create", + R = AppCodes.Definitions.District, + U = AppCodes.Definitions.District + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormDistrict.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.District + ".Create", + R = AppCodes.Definitions.District, + U = AppCodes.Definitions.District + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormDistrict.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Township", + Width = 200, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.District + ".Create", + R = AppCodes.Definitions.District, + U = AppCodes.Definitions.District + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormDistrict.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Street", + Width = 400, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.District + ".Create", + R = AppCodes.Definitions.District, + U = AppCodes.Definitions.District + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormDistrict.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ZipCode", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.District + ".Create", + R = AppCodes.Definitions.District, + U = AppCodes.Definitions.District + ".Update", + E = true, + I = true, + Deny = false + }) + }, + ]); + #endregion + } + #endregion + + #region SkillType + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SkillType)) + { + var listFormSkillType = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.SkillType, + Name = AppCodes.Definitions.SkillType, + Title = AppCodes.Definitions.SkillType, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.SkillType, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("SkillType", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.SkillType + ".Create", + R = AppCodes.Definitions.SkillType, + U = AppCodes.Definitions.SkillType + ".Update", + D = AppCodes.Definitions.SkillType + ".Delete", + E = AppCodes.Definitions.SkillType + ".Export", + I = AppCodes.Definitions.SkillType + ".Import" + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Skill Type Form", + Width = 400, + Height = 200 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto + { + Order = 1, + DataField = "Name", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Manage", + Text ="Manage", + UrlTarget="_blank", + AuthName = AppCodes.Definitions.SkillType + ".Update", + Url=$"/admin/form/{ListFormCodes.Forms.FormSkillType}/@Id" + }, + }), + }); + + #region SkillType Fields + await _listFormFieldRepository.InsertManyAsync([ + new () + { + ListFormCode = listFormSkillType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillType + ".Create", + R = AppCodes.Definitions.SkillType, + U = AppCodes.Definitions.SkillType + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormSkillType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillType + ".Create", + R = AppCodes.Definitions.SkillType, + U = AppCodes.Definitions.SkillType + ".Update", + E = true, + I = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region Skill Level + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SkillLevel)) + { + var listFormSkillLevel = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.SkillLevel, + Name = AppCodes.Definitions.SkillLevel, + Title = AppCodes.Definitions.SkillLevel, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.SkillLevel, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("SkillLevel", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.SkillLevel + ".Create", + R = AppCodes.Definitions.SkillLevel, + U = AppCodes.Definitions.SkillLevel + ".Update", + D = AppCodes.Definitions.SkillLevel + ".Delete", + E = AppCodes.Definitions.SkillLevel + ".Export", + I = AppCodes.Definitions.SkillLevel + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("SkillLevel", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Skill Level Form", + Width = 600, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Progress", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 3, DataField = "IsDefault", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 4, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "IsDefault", + FieldDbType = DbType.Boolean, + Value = "true", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Skill Level Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listFormSkillLevel.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillLevel + ".Create", + R = AppCodes.Definitions.SkillLevel, + U = AppCodes.Definitions.SkillLevel + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormSkillLevel.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillLevel + ".Create", + R = AppCodes.Definitions.SkillLevel, + U = AppCodes.Definitions.SkillLevel + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormSkillLevel.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Progress", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillLevel + ".Create", + R = AppCodes.Definitions.SkillLevel, + U = AppCodes.Definitions.SkillLevel + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormSkillLevel.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsDefault", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillLevel + ".Create", + R = AppCodes.Definitions.SkillLevel, + U = AppCodes.Definitions.SkillLevel + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormSkillLevel.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "SkillTypeId", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\".\"Name\"", + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillLevel + ".Create", + R = AppCodes.Definitions.SkillLevel, + U = AppCodes.Definitions.SkillLevel + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + + #region Skill + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Skill)) + { + var listFormSkill = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Skill, + Name = AppCodes.Definitions.Skill, + Title = AppCodes.Definitions.Skill, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Skill, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Skill", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Skill + ".Create", + R = AppCodes.Definitions.Skill, + U = AppCodes.Definitions.Skill + ".Update", + D = AppCodes.Definitions.Skill + ".Delete", + E = AppCodes.Definitions.Skill + ".Export", + I = AppCodes.Definitions.Skill + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Skill", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new FieldsDefaultValue() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new FieldsDefaultValue() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Skill Form", + Width = 600, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Skill Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new ListFormField + { + ListFormCode = listFormSkill.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Skill + ".Create", + R = AppCodes.Definitions.Skill, + U = AppCodes.Definitions.Skill + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormSkill.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Skill + ".Create", + R = AppCodes.Definitions.Skill, + U = AppCodes.Definitions.Skill + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormSkill.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "SkillTypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("SkillType", Prefix.DbTableDefinition)}\".\"Name\"", + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillLevel + ".Create", + R = AppCodes.Definitions.SkillLevel, + U = AppCodes.Definitions.SkillLevel + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + + #region UomCategory + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.UomCategory)) + { + var listFormUomCategory = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.UomCategory, + Name = AppCodes.Definitions.UomCategory, + Title = AppCodes.Definitions.UomCategory, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.UomCategory, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("UomCategory", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.UomCategory + ".Create", + R = AppCodes.Definitions.UomCategory, + U = AppCodes.Definitions.UomCategory + ".Update", + D = AppCodes.Definitions.UomCategory + ".Delete", + E = AppCodes.Definitions.UomCategory + ".Export", + I = AppCodes.Definitions.UomCategory + ".Import" + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("UomCategory", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto + { + Title = "Uom Category Form", + Width = 400, + Height = 200 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false + }), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto + { + Order = 1, + DataField = "Name", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Manage", + Text ="Manage", + UrlTarget="_blank", + AuthName = AppCodes.Definitions.UomCategory + ".Update", + Url=$"/admin/form/{ListFormCodes.Forms.FormUomCategory}/@Id" + }, + }), + }); + + #region UomCategory Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormUomCategory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.UomCategory + ".Create", + R = AppCodes.Definitions.UomCategory, + U = AppCodes.Definitions.UomCategory + ".Update", + E = true, + I = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormUomCategory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.UomCategory + ".Create", + R = AppCodes.Definitions.UomCategory, + U = AppCodes.Definitions.UomCategory + ".Update", + E = true, + I = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region Uom + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Uom)) + { + var listFormUom = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Uom, + Name = AppCodes.Definitions.Uom, + Title = AppCodes.Definitions.Uom, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Uom, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Uom", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Uom + ".Create", + R = AppCodes.Definitions.Uom, + U = AppCodes.Definitions.Uom + ".Update", + D = AppCodes.Definitions.Uom + ".Delete", + E = AppCodes.Definitions.Uom + ".Export", + I = AppCodes.Definitions.Uom + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Uom", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Uom Form", + Width = 600, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Type", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 3, DataField = "Ratio", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 4, DataField = "Rounding", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 5, DataField = "IsActive", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 6, DataField = "UomCategoryId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Uom Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new ListFormField + { + ListFormCode = listFormUom.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Uom + ".Create", + R = AppCodes.Definitions.Uom, + U = AppCodes.Definitions.Uom + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormUom.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Uom + ".Create", + R = AppCodes.Definitions.Uom, + U = AppCodes.Definitions.Uom + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormUom.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Type", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key="Reference",Name="Reference" }, + new () { Key="SmallerThanReference",Name="Smaller Than Reference" }, + new () { Key="BiggerThanReference",Name="Bigger Than Reference" }, + }), + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Uom + ".Create", + R = AppCodes.Definitions.Uom, + U = AppCodes.Definitions.Uom + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormUom.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Ratio", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Uom + ".Create", + R = AppCodes.Definitions.Uom, + U = AppCodes.Definitions.Uom + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormUom.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Rounding", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Uom + ".Create", + R = AppCodes.Definitions.Uom, + U = AppCodes.Definitions.Uom + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormUom.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "UomCategoryId", + Width = 150, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("UomCategory", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("UomCategory", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("UomCategory", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("UomCategory", Prefix.DbTableDefinition)}\".\"Name\"", + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Uom + ".Create", + R = AppCodes.Definitions.Uom, + U = AppCodes.Definitions.Uom + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + + #region Bank + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Bank)) + { + var listFormBank = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Bank, + Name = AppCodes.Definitions.Bank, + Title = AppCodes.Definitions.Bank, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Bank, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Bank", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + D = AppCodes.Definitions.Bank + ".Delete", + E = AppCodes.Definitions.Bank + ".Export", + I = AppCodes.Definitions.Bank + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Bank Form", + Width = 600, + Height = 600 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "IdentifierCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, + new EditingFormItemDto { Order = 3, DataField = "AddressLine1", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "AddressLine2", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 6, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 7, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 8, DataField = "PostalCode", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 9, DataField = "Phone", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 10, DataField = "Email", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Manage", + Text ="Manage", + UrlTarget="_blank", + AuthName = AppCodes.Definitions.Bank + ".Update", + Url=$"/admin/form/{ListFormCodes.Forms.FormBank}/@Id" + }, + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "Country", + FieldDbType = DbType.String, + Value = "TR", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) + } + ); + + #region Bank Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "IdentifierCode", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AddressLine1", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AddressLine2", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Country", + Width = 100, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\"", + CascadeEmptyFields = "City,District,Street" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "City", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\" WHERE \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL ORDER BY \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\"", + CascadeRelationField = "Country", + CascadeFilterOperator="=", + CascadeParentFields = "Country", + CascadeEmptyFields = "District,Street" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "District", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" AS \"Key\", \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" WHERE (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" ORDER BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\"", + CascadeRelationField = "City", + CascadeFilterOperator="=", + CascadeParentFields = "Country,City", + CascadeEmptyFields = "Street", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PostalCode", + Width = 150, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone", + Width = 150, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Email", + Width = 150, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + + #region BankAccount + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BankAccount)) + { + var listFormBankAccount = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.BankAccount, + Name = AppCodes.Definitions.BankAccount, + Title = AppCodes.Definitions.BankAccount, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.BankAccount, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("BankAccount", Prefix.DbTableDefinition), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + D = AppCodes.Definitions.BankAccount + ".Delete", + E = AppCodes.Definitions.BankAccount + ".Export", + I = AppCodes.Definitions.BankAccount + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("BankAccount", Prefix.DbTableDefinition)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Bank Account Form", + Width = 600, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= + [ + new EditingFormItemDto { Order = 1, DataField = "AccountNumber", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "BankId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 3, DataField = "AccountOwner", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "CurrencyId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 5, DataField = "CanTransferMoney", ColSpan = 2, EditorType2=EditorTypes.dxCheckBox }, + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CanTransferMoney", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Bank Account Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AccountNumber", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BankId", + Width = 250, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Name\"", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AccountOwner", + Width = 250, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "CurrencyId", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}Currency\".\"Id\" AS \"Key\", \"{Prefix.DbTableDefault}Currency\".\"Code\" as \"Name\" FROM \"{Prefix.DbTableDefault}Currency\" ORDER BY \"{Prefix.DbTableDefault}Currency\".\"Name\"", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "CanTransferMoney", + Width = 50, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + #endregion } } diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs index bfab4118..8a52acf0 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs @@ -298,12 +298,12 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency { if (item == null) continue; - var key = $"{item.CountryCode}.{item.Code}"; + var key = $"{item.Country}.{item.Code}"; if (existingSet.Contains(key)) continue; // duplicate kontrolü buffer.Add(new City( Guid.NewGuid(), - item.CountryCode, + item.Country, item.Name, key, item.PlateCode @@ -339,11 +339,11 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency // 1. Mevcut kayıtları çek (tek sorguda) var existingDistricts = await dbCtx.Set() - .Select(d => new { d.CountryCode, d.CityCode, d.Name, d.Township, d.Street, d.ZipCode }) + .Select(d => new { d.Country, d.City, d.Name, d.Township, d.Street, d.ZipCode }) .ToListAsync(); var existingSet = existingDistricts - .Select(d => $"{d.CountryCode}:{d.CityCode}:{d.Name}:{d.Township}:{d.Street}:{d.ZipCode}") + .Select(d => $"{d.Country}:{d.City}:{d.Name}:{d.Township}:{d.Street}:{d.ZipCode}") .ToHashSet(); var options = new JsonSerializerOptions @@ -359,13 +359,13 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency { if (item == null) continue; - var key = $"{item.CountryCode}:{item.CountryCode}.{item.CityCode}:{item.Name}:{item.Township}:{item.Street}:{item.ZipCode}"; - var cityCode = $"{item.CountryCode}.{item.CityCode}"; + var key = $"{item.Country}:{item.Country}.{item.City}:{item.Name}:{item.Township}:{item.Street}:{item.ZipCode}"; + var cityCode = $"{item.Country}.{item.City}"; if (existingSet.Contains(key)) continue; buffer.Add(new District( Guid.NewGuid(), - item.CountryCode, + item.Country, cityCode, item.Name, item.Township, diff --git a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs index 5d2b7725..de68a013 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -12,8 +12,6 @@ public static class PlatformConsts public const bool IsMultiTenant = true; public const string AppName = "Platform"; - public const string DbTablePrefix = "P"; - public const string DbSchema = null; public const string DefaultLanguage = LanguageCodes.En; public const string React = "UI"; public const char MultiValueDelimiter = '|'; @@ -22,6 +20,10 @@ public static class PlatformConsts { public const string App = "App"; public const string Abp = "Abp"; + public const string DbTableDefault = "P"; + public const string DbTableDefinition = "D"; + public const string DbTableCoordinator = "C"; + public const string DbSchema = null; } public static class Tenants @@ -1316,8 +1318,8 @@ public static class PlatformConsts } } - public static string SelectCommandByTableName(string TableName) + public static string SelectCommandByTableName(string TableName, string prefix = Prefix.DbTableDefault) { - return DbTablePrefix + TableName; + return prefix + TableName; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Bank.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/Bank.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/Bank.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/Bank.cs index ab371b32..7bbe8944 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/Bank.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/Bank.cs @@ -9,10 +9,10 @@ public class Bank : FullAuditedEntity public string IdentifierCode { get; set; } public string AddressLine1 { get; set; } public string AddressLine2 { get; set; } - public string District { get; set; } - public string City { get; set; } - public string PostalCode { get; set; } public string Country { get; set; } + public string City { get; set; } + public string District { get; set; } + public string PostalCode { get; set; } public string Phone { get; set; } public string Email { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/BankAccount.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/BankAccount.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/BankAccount.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/BankAccount.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/City.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/City.cs similarity index 69% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/City.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/City.cs index 3fe35e74..20d970ea 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/City.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/City.cs @@ -6,20 +6,19 @@ namespace Kurs.Platform.Entities; public class City : FullAuditedEntity { - public string CountryCode { get; set; } + public string Country { get; set; } public string Name { get; set; } public string Code { get; set; } public string PlateCode { get; set; } - public Country Country { get; set; } public ICollection Districts { get; set; } protected City() { } - public City(Guid id, string countryCode, string name, string code, string plateCode) + public City(Guid id, string country, string name, string code, string plateCode) : base(id) { - CountryCode = countryCode; + Country = country; Name = name; Code = code; PlateCode = plateCode; diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/ContactTag.cs similarity index 84% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/ContactTag.cs index 1fd321cb..54b26e90 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/ContactTag.cs @@ -1,6 +1,8 @@ using System; using Volo.Abp.Domain.Entities.Auditing; +namespace Kurs.Platform.Entities; + public class ContactTag : FullAuditedEntity { public string Name { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/ContactTitle.cs similarity index 84% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/ContactTitle.cs index da4e2a1b..489014d6 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/ContactTitle.cs @@ -1,6 +1,8 @@ using System; using Volo.Abp.Domain.Entities.Auditing; +namespace Kurs.Platform.Entities; + public class ContactTitle : FullAuditedEntity { public string Title { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Country.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/Country.cs similarity index 82% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/Country.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/Country.cs index efe3c3ad..efef1b27 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/Country.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/Country.cs @@ -42,17 +42,3 @@ public class Country : FullAuditedEntity } } -public class CountryGroup : FullAuditedEntity -{ - public string Name { get; set; } - - protected CountryGroup() { } - - public CountryGroup( - Guid id, - string name) - : base(id) - { - Name = name; - } -} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain/Entities/Administration/CountryGroup.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/CountryGroup.cs new file mode 100644 index 00000000..e4afcdc4 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/CountryGroup.cs @@ -0,0 +1,17 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Kurs.Platform.Entities; + +public class CountryGroup : FullAuditedEntity +{ + public string Name { get; set; } + + protected CountryGroup() { } + + public CountryGroup(Guid id, string name) + : base(id) + { + Name = name; + } +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/Currency.cs similarity index 91% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/Currency.cs index 8dddc967..4957024c 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/Currency.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.Platform.Entities; diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/District.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/District.cs similarity index 59% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/District.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/District.cs index 7cb67d5e..daa87bd0 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/District.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/District.cs @@ -5,21 +5,20 @@ namespace Kurs.Platform.Entities; public class District : FullAuditedEntity { - public string CountryCode { get; set; } - public string CityCode { get; set; } + public string Country { get; set; } + public string City { get; set; } public string Name { get; set; } public string Township { get; set; } public string Street { get; set; } public string ZipCode { get; set; } - public City City { get; set; } protected District() { } - public District(Guid id, string countryCode, string cityCode, string name, string township, string street, string zipCode) + public District(Guid id, string country, string city, string name, string township, string street, string zipCode) : base(id) { - CountryCode = countryCode; - CityCode = cityCode; + Country = country; + City = city; Name = name; Township = township; Street = street; diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Sector.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/Sector.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/Sector.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/Sector.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Skill.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/Skill.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/Skill.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/Skill.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillLevel.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/SkillLevel.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/SkillLevel.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/SkillLevel.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillType.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/SkillType.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/SkillType.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/SkillType.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Uom.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/Uom.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/Uom.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/Uom.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/UomCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/UomCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Definitions/UomCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Administration/UomCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Classroom/Classroom.cs b/api/src/Kurs.Platform.Domain/Entities/Coordinator/Classroom.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Classroom/Classroom.cs rename to api/src/Kurs.Platform.Domain/Entities/Coordinator/Classroom.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomAttandance.cs b/api/src/Kurs.Platform.Domain/Entities/Coordinator/ClassroomAttandance.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomAttandance.cs rename to api/src/Kurs.Platform.Domain/Entities/Coordinator/ClassroomAttandance.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomChat.cs b/api/src/Kurs.Platform.Domain/Entities/Coordinator/ClassroomChat.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomChat.cs rename to api/src/Kurs.Platform.Domain/Entities/Coordinator/ClassroomChat.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomParticipant.cs b/api/src/Kurs.Platform.Domain/Entities/Coordinator/ClassroomParticipant.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomParticipant.cs rename to api/src/Kurs.Platform.Domain/Entities/Coordinator/ClassroomParticipant.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Saas/Branch.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Branch.cs index d47adb88..aabb7713 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Saas/Branch.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Saas/Branch.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.Platform.Entities; @@ -23,4 +24,6 @@ public class Branch : FullAuditedEntity public string Email { get; set; } public string Website { get; set; } public bool? IsActive { get; set; } + + public virtual ICollection Users { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Saas/BranchUsers.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/BranchUsers.cs index 9629fc1b..24c142de 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Saas/BranchUsers.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Saas/BranchUsers.cs @@ -2,6 +2,7 @@ using System; using Volo.Abp.MultiTenancy; namespace Kurs.Platform.Entities; + using Volo.Abp.Domain.Entities; public class BranchUsers : Entity, IMultiTenant @@ -9,5 +10,8 @@ public class BranchUsers : Entity, IMultiTenant public Guid UserId { get; set; } public Guid BranchId { get; set; } public Guid? TenantId { get; set; } + Guid? IMultiTenant.TenantId => TenantId; + + public virtual Branch Branch { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/ApiEndpoint.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/ApiEndpoint.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/DeveloperKit/ApiEndpoint.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/ApiEndpoint.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/ApiMigration.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/ApiMigration.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/DeveloperKit/ApiMigration.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/ApiMigration.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomComponent.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/CustomComponent.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomComponent.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/CustomComponent.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomEndpoint.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/CustomEndpoint.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomEndpoint.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/CustomEndpoint.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomEntity.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/CustomEntity.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomEntity.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/DeveloperKit/CustomEntity.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Forum/ForumCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Forum/ForumCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Forum/ForumCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Forum/ForumCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Forum/ForumPost.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Forum/ForumPost.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Forum/ForumPost.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Forum/ForumPost.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Forum/ForumTopic.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Forum/ForumTopic.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Forum/ForumTopic.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Forum/ForumTopic.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListForm/ListForm.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListForm.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListForm/ListForm.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListForm.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormCustomization.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListFormCustomization.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormCustomization.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListFormCustomization.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormField.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListFormField.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormField.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListFormField.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormImport.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListFormImport.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormImport.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListFormImport.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormImportExecute.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListFormImportExecute.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormImportExecute.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/ListForm/ListFormImportExecute.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/About.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/About.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/About.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/About.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/BlogCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/BlogCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/BlogCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/BlogCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/BlogPost.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/BlogPost.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/BlogPost.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/BlogPost.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/Contact.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/Contact.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/Contact.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/Contact.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/Demo.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/Demo.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/Demo.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/Demo.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/InstallmentOption.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/InstallmentOption.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/InstallmentOption.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/InstallmentOption.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/Order.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/Order.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/Order.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/Order.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/PaymentMethod.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/PaymentMethod.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/PaymentMethod.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/PaymentMethod.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/Product.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/Product.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/Product.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/Product.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Public/Service.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Public/Service.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Public/Service.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Public/Service.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Report/ReportCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Report/ReportCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Report/ReportCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Report/ReportCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Report/ReportGenerated.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Report/ReportGenerated.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Report/ReportGenerated.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Report/ReportGenerated.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Report/ReportParameter.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Report/ReportParameter.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Report/ReportParameter.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Report/ReportParameter.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Report/ReportTemplate.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Report/ReportTemplate.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Report/ReportTemplate.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Report/ReportTemplate.cs diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index b5d4eefb..ba02cf55 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -17,13 +17,15 @@ using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement.EntityFrameworkCore; using Kurs.Notifications.EntityFrameworkCore; -using static Kurs.Settings.SettingsConsts; using Kurs.Platform.Forum; using Microsoft.EntityFrameworkCore.ChangeTracking; using System; using System.Linq; using System.Text.Json; +using static Kurs.Platform.PlatformConsts; +using static Kurs.Settings.SettingsConsts; + namespace Kurs.Platform.EntityFrameworkCore; [ReplaceDbContext(typeof(IIdentityDbContext))] @@ -167,7 +169,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListForm), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ListForm), Prefix.DbSchema); b.ConfigureByConvention(); // base class props // Anahtar @@ -192,66 +194,67 @@ public class PlatformDbContext : b.Property(a => a.ListFormType).HasMaxLength(20); // Uzun JSON alanları için nvarchar(max) - b.Property(a => a.SelectCommand).HasColumnType("nvarchar(max)"); - b.Property(a => a.SelectFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.DefaultFilter).HasColumnType("nvarchar(max)"); - b.Property(a => a.ColumnOptionJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.PivotOptionJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.FilterRowJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.HeaderFilterJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.FilterPanelJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.SearchPanelJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.GroupPanelJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.SelectionJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.PagerOptionJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.EditingOptionJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.EditingFormJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.PermissionJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.InsertFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.UpdateFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.DeleteFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.CommandColumnJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.StateStoringJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.DeleteCommand).HasColumnType("nvarchar(max)"); - b.Property(a => a.UpdateCommand).HasColumnType("nvarchar(max)"); - b.Property(a => a.InsertCommand).HasColumnType("nvarchar(max)"); - b.Property(a => a.CustomJsSourcesJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.CustomStyleSourcesJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.FormFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.SubFormsJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.WidgetsJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ExtraFilterJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.LayoutJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.CommonJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.DataSourceJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.AdaptiveLayoutJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.AnimationJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.AnnotationsJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ArgumentAxisJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.CommonAnnotationsSettingsJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.CommonAxisSettingsJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.CommonPaneSettingsJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.CommonSeriesSettingsJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.CrosshairJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ExportJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.LegendJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.MarginJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.PanesJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ScrollBarJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.SeriesJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.SizeJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.TitleJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.TooltipJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ValueAxisJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ZoomAndPanJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.SelectCommand).HasColumnType("text"); + b.Property(a => a.SelectFieldsDefaultValueJson).HasColumnType("text"); + b.Property(a => a.DefaultFilter).HasColumnType("text"); + b.Property(a => a.ColumnOptionJson).HasColumnType("text"); + b.Property(a => a.PivotOptionJson).HasColumnType("text"); + b.Property(a => a.FilterRowJson).HasColumnType("text"); + b.Property(a => a.HeaderFilterJson).HasColumnType("text"); + b.Property(a => a.FilterPanelJson).HasColumnType("text"); + b.Property(a => a.SearchPanelJson).HasColumnType("text"); + b.Property(a => a.GroupPanelJson).HasColumnType("text"); + b.Property(a => a.SelectionJson).HasColumnType("text"); + b.Property(a => a.PagerOptionJson).HasColumnType("text"); + b.Property(a => a.EditingOptionJson).HasColumnType("text"); + b.Property(a => a.EditingFormJson).HasColumnType("text"); + b.Property(a => a.PermissionJson).HasColumnType("text"); + b.Property(a => a.InsertFieldsDefaultValueJson).HasColumnType("text"); + b.Property(a => a.UpdateFieldsDefaultValueJson).HasColumnType("text"); + b.Property(a => a.DeleteFieldsDefaultValueJson).HasColumnType("text"); + b.Property(a => a.CommandColumnJson).HasColumnType("text"); + b.Property(a => a.StateStoringJson).HasColumnType("text"); + b.Property(a => a.DeleteCommand).HasColumnType("text"); + b.Property(a => a.UpdateCommand).HasColumnType("text"); + b.Property(a => a.InsertCommand).HasColumnType("text"); + b.Property(a => a.CustomJsSourcesJson).HasColumnType("text"); + b.Property(a => a.CustomStyleSourcesJson).HasColumnType("text"); + b.Property(a => a.FormFieldsDefaultValueJson).HasColumnType("text"); + b.Property(a => a.SubFormsJson).HasColumnType("text"); + b.Property(a => a.WidgetsJson).HasColumnType("text"); + b.Property(a => a.ExtraFilterJson).HasColumnType("text"); + b.Property(a => a.LayoutJson).HasColumnType("text"); + b.Property(a => a.CommonJson).HasColumnType("text"); + b.Property(a => a.DataSourceJson).HasColumnType("text"); + b.Property(a => a.AdaptiveLayoutJson).HasColumnType("text"); + b.Property(a => a.AnimationJson).HasColumnType("text"); + b.Property(a => a.AnnotationsJson).HasColumnType("text"); + b.Property(a => a.ArgumentAxisJson).HasColumnType("text"); + b.Property(a => a.CommonAnnotationsSettingsJson).HasColumnType("text"); + b.Property(a => a.CommonAxisSettingsJson).HasColumnType("text"); + b.Property(a => a.CommonPaneSettingsJson).HasColumnType("text"); + b.Property(a => a.CommonSeriesSettingsJson).HasColumnType("text"); + b.Property(a => a.CrosshairJson).HasColumnType("text"); + b.Property(a => a.ExportJson).HasColumnType("text"); + b.Property(a => a.LegendJson).HasColumnType("text"); + b.Property(a => a.MarginJson).HasColumnType("text"); + b.Property(a => a.PanesJson).HasColumnType("text"); + b.Property(a => a.ScrollBarJson).HasColumnType("text"); + b.Property(a => a.SeriesJson).HasColumnType("text"); + b.Property(a => a.SizeJson).HasColumnType("text"); + b.Property(a => a.TitleJson).HasColumnType("text"); + b.Property(a => a.TooltipJson).HasColumnType("text"); + b.Property(a => a.ValueAxisJson).HasColumnType("text"); + b.Property(a => a.ZoomAndPanJson).HasColumnType("text"); b.HasMany().WithOne().HasForeignKey(x => x.ListFormCode).HasPrincipalKey(x => x.ListFormCode).IsRequired(); b.HasMany().WithOne().HasForeignKey(x => x.ListFormCode).HasPrincipalKey(x => x.ListFormCode).IsRequired(); + b.HasMany().WithOne().HasForeignKey(x => x.ListFormCode).HasPrincipalKey(x => x.ListFormCode).IsRequired(); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormField), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ListFormField), Prefix.DbSchema); b.ConfigureByConvention(); // Anahtar @@ -275,44 +278,67 @@ public class PlatformDbContext : b.Property(a => a.BandName).HasMaxLength(128); // JSON alanlar - b.Property(a => a.ColumnFilterJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ColumnHeaderJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.GroupingJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ColumnCustomizationJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.TotalSummaryJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.GroupSummaryJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.JoinTableJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.EditingJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.LookupJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ValidationRuleJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.ColumnStylingJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.PermissionJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.PivotSettingsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ColumnFilterJson).HasColumnType("text"); + b.Property(a => a.ColumnHeaderJson).HasColumnType("text"); + b.Property(a => a.GroupingJson).HasColumnType("text"); + b.Property(a => a.ColumnCustomizationJson).HasColumnType("text"); + b.Property(a => a.TotalSummaryJson).HasColumnType("text"); + b.Property(a => a.GroupSummaryJson).HasColumnType("text"); + b.Property(a => a.JoinTableJson).HasColumnType("text"); + b.Property(a => a.EditingJson).HasColumnType("text"); + b.Property(a => a.LookupJson).HasColumnType("text"); + b.Property(a => a.ValidationRuleJson).HasColumnType("text"); + b.Property(a => a.ColumnStylingJson).HasColumnType("text"); + b.Property(a => a.PermissionJson).HasColumnType("text"); + b.Property(a => a.PivotSettingsJson).HasColumnType("text"); // Stil ve format b.Property(a => a.ColumnCssClass).HasMaxLength(100); b.Property(a => a.ColumnCssValue).HasMaxLength(256); b.Property(a => a.Alignment).HasMaxLength(20).HasDefaultValue("left"); b.Property(a => a.Format).HasMaxLength(100); - b.Property(a => a.EditorOptions).HasColumnType("nvarchar(max)"); + b.Property(a => a.EditorOptions).HasColumnType("text"); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormCustomization), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ListFormCustomization), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.ListFormCode).IsRequired().HasMaxLength(64); b.Property(a => a.UserId).HasMaxLength(256); b.Property(a => a.RoleId).HasMaxLength(256); b.Property(a => a.FilterName).HasMaxLength(128); - b.Property(a => a.CustomizationData).HasColumnType("nvarchar(max)"); + b.Property(a => a.CustomizationData).HasColumnType("text"); b.Property(a => a.CustomizationType).IsRequired(); }); + builder.Entity(b => + { + b.ToTable(Prefix.DbTableDefault + nameof(ListFormImport), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.ListFormCode).IsRequired().HasMaxLength(64); + b.Property(x => x.BlobName).IsRequired().HasMaxLength(256); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); + + builder.Entity(b => { b.HasMany().WithOne().HasForeignKey(x => x.ImportId).OnDelete(DeleteBehavior.Cascade); }); + }); + + builder.Entity(b => + { + b.ToTable(Prefix.DbTableDefault + nameof(ListFormImportExecute), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.ImportId).IsRequired(); + b.Property(x => x.BlobName).IsRequired().HasMaxLength(256); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); + b.Property(x => x.ErrorsJson).HasColumnType("text"); + }); + builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Menu), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Menu), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.Code).IsRequired().HasMaxLength(100); @@ -331,7 +357,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(IpRestriction), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(IpRestriction), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.ResourceType).IsRequired().HasMaxLength(10); @@ -341,7 +367,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(DataSource), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(DataSource), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.Code).IsRequired().HasMaxLength(100); @@ -351,7 +377,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(BackgroundWorker), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(BackgroundWorker), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.Name).IsRequired().HasMaxLength(100); @@ -361,12 +387,12 @@ public class PlatformDbContext : b.Property(a => a.DataSourceCode).HasMaxLength(50); b.Property(a => a.BeforeSp).HasMaxLength(100); b.Property(a => a.AfterSp).HasMaxLength(100); - b.Property(a => a.Options).HasColumnType("nvarchar(max)"); + b.Property(a => a.Options).HasColumnType("text"); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomEndpoint), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(CustomEndpoint), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.Name).IsRequired().HasMaxLength(128); @@ -375,13 +401,13 @@ public class PlatformDbContext : b.Property(a => a.Method).IsRequired().HasMaxLength(10); b.Property(a => a.DataSourceCode).IsRequired().HasMaxLength(100); b.Property(a => a.Sql).IsRequired(); - b.Property(a => a.ParametersJson).HasColumnType("nvarchar(max)"); - b.Property(a => a.PermissionsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ParametersJson).HasColumnType("text"); + b.Property(a => a.PermissionsJson).HasColumnType("text"); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(GlobalSearch), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(GlobalSearch), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.System).HasMaxLength(50); @@ -393,7 +419,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(AiBot), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(AiBot), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.BotName).IsRequired().HasMaxLength(128); @@ -401,7 +427,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Branch), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Branch), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(a => a.TenantId).IsRequired(); @@ -422,11 +448,16 @@ public class PlatformDbContext : b.Property(a => a.Email).HasMaxLength(128); b.Property(a => a.Website).HasMaxLength(128); b.Property(a => a.IsActive).HasDefaultValue(true); + + b.HasMany(x => x.Users) + .WithOne(x => x.Branch) + .HasForeignKey(x => x.BranchId) + .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(BranchUsers), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(BranchUsers), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => new { x.UserId, x.BranchId }); @@ -437,7 +468,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Sector), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(Sector), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -446,7 +477,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(UomCategory), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(UomCategory), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -456,7 +487,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Uom), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(Uom), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(64); @@ -474,7 +505,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Currency), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(Currency), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Code).IsRequired().HasMaxLength(8); @@ -487,7 +518,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Bank), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(Bank), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -504,7 +535,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(BankAccount), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(BankAccount), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.AccountNumber).IsRequired().HasMaxLength(64); @@ -529,7 +560,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(CountryGroup), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(CountryGroup), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -538,24 +569,23 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Country), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(Country), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Code).IsRequired().HasMaxLength(8); b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.GroupName).HasMaxLength(128); b.Property(x => x.CurrencyCode).HasMaxLength(8); - b.Property(x => x.PhoneCode).HasMaxLength(16); b.Property(x => x.TaxLabel).HasMaxLength(64); b.HasIndex(x => x.Code).IsUnique(); b.HasIndex(x => x.GroupName); - b.HasMany(x => x.Cities) - .WithOne(x => x.Country) - .HasForeignKey(x => x.CountryCode) - .HasPrincipalKey(x => x.Code) - .OnDelete(DeleteBehavior.Cascade); + // b.HasMany(x => x.Cities) + // .WithOne(x => x.Country) + // .HasForeignKey(x => x.CountryCode) + // .HasPrincipalKey(x => x.Code) + // .OnDelete(DeleteBehavior.Cascade); b.HasOne() .WithMany() @@ -566,41 +596,41 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(City), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(City), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.CountryCode).HasMaxLength(8); + b.Property(x => x.Country).HasMaxLength(8); b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Code).IsRequired().HasMaxLength(16); b.Property(x => x.PlateCode).HasMaxLength(20); - b.HasIndex(x => new { x.CountryCode, x.Code }).IsUnique(); + b.HasIndex(x => new { x.Country, x.Code }).IsUnique(); - b.HasMany(x => x.Districts) - .WithOne(x => x.City) - .HasForeignKey(x => new { x.CountryCode, x.CityCode }) - .HasPrincipalKey(x => new { x.CountryCode, x.Code }) - .OnDelete(DeleteBehavior.Cascade); + // b.HasMany(x => x.Districts) + // .WithOne(x => x.City) + // .HasForeignKey(x => new { x.CountryCode, x.CityCode }) + // .HasPrincipalKey(x => new { x.Country, x.Code }) + // .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(District), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(District), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.CountryCode).HasMaxLength(8); - b.Property(x => x.CityCode).IsRequired().HasMaxLength(16); + b.Property(x => x.Country).HasMaxLength(8); + b.Property(x => x.City).IsRequired().HasMaxLength(16); b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Township).HasMaxLength(128); b.Property(x => x.Street).HasMaxLength(256); b.Property(x => x.ZipCode).HasMaxLength(16); - b.HasIndex(x => new { x.CountryCode, x.CityCode, x.Name, x.Township, x.Street, x.ZipCode }).IsUnique(); + b.HasIndex(x => new { x.Country, x.City, x.Name, x.Township, x.Street, x.ZipCode }).IsUnique(); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(SkillType), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(SkillType), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -622,7 +652,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Skill), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(Skill), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -631,7 +661,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(SkillLevel), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(SkillLevel), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -642,7 +672,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ContactTag), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(ContactTag), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -651,7 +681,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ContactTitle), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefinition + nameof(ContactTitle), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Title).IsRequired().HasMaxLength(128); @@ -660,7 +690,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(BlogCategory), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(BlogCategory), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -673,7 +703,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(BlogPost), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(BlogPost), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Title).IsRequired().HasMaxLength(256); @@ -696,7 +726,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumCategory), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ForumCategory), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -714,7 +744,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumTopic), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ForumTopic), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Title).IsRequired().HasMaxLength(256); @@ -734,7 +764,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumPost), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ForumPost), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Content).IsRequired(); @@ -755,7 +785,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Route), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Route), Prefix.DbSchema); b.ConfigureByConvention(); b.HasIndex(x => x.Key).IsUnique(); @@ -779,7 +809,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomEntity), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(CustomEntity), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => x.Id); @@ -798,7 +828,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomEntityField), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(CustomEntityField), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => x.Id); @@ -810,7 +840,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ApiMigration), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ApiMigration), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => x.Id); @@ -828,7 +858,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ApiEndpoint), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ApiEndpoint), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => x.Id); @@ -846,7 +876,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomComponent), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(CustomComponent), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => x.Id); @@ -859,7 +889,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Product), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Product), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => x.Id); @@ -873,7 +903,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(PaymentMethod), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(PaymentMethod), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => x.Id); @@ -884,7 +914,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(InstallmentOption), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(InstallmentOption), Prefix.DbSchema); b.ConfigureByConvention(); b.HasKey(x => x.Id); @@ -894,7 +924,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Order), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Order), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(o => o.OrganizationName).HasMaxLength(128); @@ -925,7 +955,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(OrderItem), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(OrderItem), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(i => i.ProductName).IsRequired().HasMaxLength(128); @@ -933,30 +963,9 @@ public class PlatformDbContext : b.Property(i => i.TotalPrice).IsRequired().HasPrecision(18, 2); }); - builder.Entity(b => - { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormImport), PlatformConsts.DbSchema); - b.ConfigureByConvention(); - - b.Property(x => x.ListFormCode).IsRequired().HasMaxLength(128); - b.Property(x => x.BlobName).IsRequired().HasMaxLength(256); - b.Property(x => x.Status).IsRequired().HasMaxLength(64); - }); - - builder.Entity(b => - { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormImportExecute), PlatformConsts.DbSchema); - b.ConfigureByConvention(); - - b.Property(x => x.ImportId).IsRequired(); - b.Property(x => x.BlobName).IsRequired().HasMaxLength(256); - b.Property(x => x.Status).IsRequired().HasMaxLength(64); - b.Property(x => x.ErrorsJson).HasColumnType("nvarchar(max)"); - }); - builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportCategory), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ReportCategory), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(256); @@ -974,7 +983,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportTemplate), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ReportTemplate), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(256); @@ -991,7 +1000,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportParameter), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ReportParameter), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.ReportTemplateId).IsRequired(); @@ -1005,7 +1014,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportGenerated), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ReportGenerated), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.TemplateId).IsRequired(false); @@ -1023,7 +1032,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Demo), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Demo), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.OrganizationName).IsRequired().HasMaxLength(256); @@ -1038,7 +1047,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Service), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Service), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Title).IsRequired().HasMaxLength(128); @@ -1062,17 +1071,17 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(About), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(About), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.StatsJson).HasColumnType("nvarchar(max)"); - b.Property(x => x.DescriptionsJson).HasColumnType("nvarchar(max)"); - b.Property(x => x.SectionsJson).HasColumnType("nvarchar(max)"); + b.Property(x => x.StatsJson).HasColumnType("text"); + b.Property(x => x.DescriptionsJson).HasColumnType("text"); + b.Property(x => x.SectionsJson).HasColumnType("text"); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Contact), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Contact), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Address).HasMaxLength(500); @@ -1081,14 +1090,14 @@ public class PlatformDbContext : b.Property(x => x.Location).HasMaxLength(150); b.Property(x => x.TaxNumber).HasMaxLength(50); - b.Property(x => x.BankJson).HasColumnType("nvarchar(max)"); - b.Property(x => x.WorkHoursJson).HasColumnType("nvarchar(max)"); - b.Property(x => x.MapJson).HasColumnType("nvarchar(max)"); + b.Property(x => x.BankJson).HasColumnType("text"); + b.Property(x => x.WorkHoursJson).HasColumnType("text"); + b.Property(x => x.MapJson).HasColumnType("text"); }); builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(Classroom), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(Classroom), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(200); @@ -1117,7 +1126,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomParticipant), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ClassroomParticipant), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.UserName).IsRequired().HasMaxLength(100); @@ -1132,7 +1141,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomAttandance), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ClassroomAttandance), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.StudentName).IsRequired().HasMaxLength(100); @@ -1144,7 +1153,7 @@ public class PlatformDbContext : builder.Entity(b => { - b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomChat), PlatformConsts.DbSchema); + b.ToTable(Prefix.DbTableDefault + nameof(ClassroomChat), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.SenderName).IsRequired().HasMaxLength(100); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251003092426_Initial.Designer.cs similarity index 96% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251003092426_Initial.Designer.cs index 1a8259f2..581b5119 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251003092426_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251002115440_Initial")] + [Migration("20251003092426_Initial")] partial class Initial { /// @@ -73,7 +73,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PContactTag", (string)null); + b.ToTable("DContactTag", (string)null); }); modelBuilder.Entity("ContactTitle", b => @@ -122,7 +122,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PContactTitle", (string)null); + b.ToTable("DContactTitle", (string)null); }); modelBuilder.Entity("Kurs.Languages.Entities.Language", b => @@ -189,13 +189,9 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Languages.Entities.LanguageKey", b => { - b.Property("ResourceName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -213,15 +209,17 @@ namespace Kurs.Platform.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); - b.Property("Id") - .HasColumnType("uniqueidentifier"); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("bit") .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("Key") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -230,7 +228,15 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.HasKey("ResourceName", "Key"); + b.Property("ResourceName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ResourceName", "Key") + .IsUnique(); b.ToTable("PLanguageKey", (string)null); }); @@ -291,6 +297,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("CultureName"); + b.HasIndex("ResourceName", "Key"); b.ToTable("PLanguageText", (string)null); @@ -311,6 +319,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(500)"); b.Property("AwsMessageId") + .IsRequired() .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -363,7 +372,7 @@ namespace Kurs.Platform.Migrations b.Property("SendTime") .HasColumnType("datetime2"); - b.Property("Table") + b.Property("TableName") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -381,6 +390,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("TableName"); + b.ToTable("PBackgroundWorker_MailQueue", (string)null); }); @@ -441,6 +452,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("AwsMessageId"); + b.ToTable("PBackgroundWorker_MailQueueEvents", (string)null); }); @@ -503,8 +516,9 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.HasIndex(new[] { "TableName", "Order" }, "IX_MailQueueTableFormat") - .IsUnique(); + b.HasIndex("TableName", "Order") + .IsUnique() + .HasDatabaseName("IX_MailQueueTableFormat"); b.ToTable("PBackgroundWorker_MailQueueTableFormat", (string)null); }); @@ -533,7 +547,8 @@ namespace Kurs.Platform.Migrations b.Property("Identifier") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -557,14 +572,15 @@ namespace Kurs.Platform.Migrations b.Property("Message") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("NotificationChannel") .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); - b.Property("NotificationRuleId") + b.Property("NotificationRuleId") .HasColumnType("uniqueidentifier"); b.Property("NotificationType") @@ -580,6 +596,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("NotificationRuleId"); + b.ToTable("PNotification", (string)null); }); @@ -591,8 +609,8 @@ namespace Kurs.Platform.Migrations b.Property("Channel") .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -639,11 +657,13 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("RecipientId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("RecipientType") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.HasKey("Id"); @@ -672,7 +692,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("DescriptionsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -689,10 +709,10 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("SectionsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("StatsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -918,7 +938,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("Options") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("WorkerType") .HasColumnType("int"); @@ -1006,7 +1026,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PBank", (string)null); + b.ToTable("DBank", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b => @@ -1073,7 +1093,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("CurrencyId"); - b.ToTable("PBankAccount", (string)null); + b.ToTable("DBankAccount", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b => @@ -1383,6 +1403,8 @@ namespace Kurs.Platform.Migrations b.HasKey("UserId", "BranchId"); + b.HasIndex("BranchId"); + b.ToTable("PBranchUsers", (string)null); }); @@ -1445,7 +1467,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("CountryCode", "Code") .IsUnique(); - b.ToTable("PCity", (string)null); + b.ToTable("DCity", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.Classroom", b => @@ -1778,7 +1800,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(500)"); b.Property("BankJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -1819,7 +1841,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(150)"); b.Property("MapJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Phone") .HasMaxLength(50) @@ -1834,7 +1856,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("TenantId"); b.Property("WorkHoursJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -1895,7 +1917,6 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("PhoneCode") - .HasMaxLength(16) .HasColumnType("int"); b.Property("StateRequired") @@ -1915,7 +1936,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("GroupName"); - b.ToTable("PCountry", (string)null); + b.ToTable("DCountry", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.CountryGroup", b => @@ -1963,7 +1984,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("Name") .IsUnique(); - b.ToTable("PCountryGroup", (string)null); + b.ToTable("DCountryGroup", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.Currency", b => @@ -2029,7 +2050,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PCurrency", (string)null); + b.ToTable("DCurrency", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.CustomComponent", b => @@ -2155,10 +2176,10 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("ParametersJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PermissionsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Sql") .IsRequired() @@ -2534,7 +2555,7 @@ namespace Kurs.Platform.Migrations .IsUnique() .HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); - b.ToTable("PDistrict", (string)null); + b.ToTable("DDistrict", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.GlobalSearch", b => @@ -2661,37 +2682,37 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("AdaptiveLayoutJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("AnimationJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("AnnotationsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ArgumentAxisJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ColumnOptionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommandColumnJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonAnnotationsSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonAxisSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonPaneSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonSeriesSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -2702,33 +2723,33 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CrosshairJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CultureName") .HasMaxLength(10) .HasColumnType("nvarchar(10)"); b.Property("CustomJsSourcesJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CustomStyleSourcesJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DataSourceCode") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); b.Property("DataSourceJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DefaultFilter") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DeleteCommand") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DeleteFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DeleteServiceAddress") .HasMaxLength(256) @@ -2747,40 +2768,40 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(512)"); b.Property("EditingFormJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("EditingOptionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ExportJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ExtraFilterJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FilterPanelJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FilterRowJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FormFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("GroupPanelJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("HeaderFilterJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Height") .HasColumnType("int"); b.Property("InsertCommand") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("InsertFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("InsertServiceAddress") .HasMaxLength(256) @@ -2820,10 +2841,10 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("LayoutJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("LegendJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ListFormCode") .IsRequired() @@ -2835,7 +2856,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("MarginJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Name") .HasMaxLength(128) @@ -2847,54 +2868,54 @@ namespace Kurs.Platform.Migrations .HasDefaultValue(20); b.Property("PagerOptionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PanesJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PermissionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PivotOptionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RoleId") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("ScrollBarJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SearchPanelJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SelectCommand") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SelectCommandType") .HasColumnType("int"); b.Property("SelectFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SelectionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SeriesJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SizeJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SortMode") .HasMaxLength(20) .HasColumnType("nvarchar(20)"); b.Property("StateStoringJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SubFormsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TableName") .HasMaxLength(128) @@ -2905,16 +2926,16 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("TitleJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TooltipJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UpdateCommand") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UpdateFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UpdateServiceAddress") .HasMaxLength(256) @@ -2925,16 +2946,16 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("ValueAxisJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("WidgetsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Width") .HasColumnType("int"); b.Property("ZoomAndPanJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -2955,7 +2976,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CustomizationData") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CustomizationType") .HasColumnType("int"); @@ -3039,16 +3060,16 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("ColumnCustomizationJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ColumnFilterJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ColumnHeaderJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ColumnStylingJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -3071,10 +3092,10 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("EditingJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("EditorOptions") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FieldName") .IsRequired() @@ -3086,10 +3107,10 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("GroupSummaryJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("GroupingJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("IsActive") .ValueGeneratedOnAdd() @@ -3103,7 +3124,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("IsDeleted"); b.Property("JoinTableJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("LastModificationTime") .HasColumnType("datetime2") @@ -3124,13 +3145,13 @@ namespace Kurs.Platform.Migrations .HasDefaultValue(30); b.Property("LookupJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PermissionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PivotSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RoleId") .HasMaxLength(256) @@ -3147,14 +3168,14 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("TotalSummaryJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("ValidationRuleJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Visible") .ValueGeneratedOnAdd() @@ -3215,8 +3236,8 @@ namespace Kurs.Platform.Migrations b.Property("ListFormCode") .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("Status") .IsRequired() @@ -3228,6 +3249,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("ListFormCode"); + b.ToTable("PListFormImport", (string)null); }); @@ -3261,7 +3284,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("ErrorsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ExecRows") .HasColumnType("int"); @@ -3296,6 +3319,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("ImportId"); + b.ToTable("PListFormImportExecute", (string)null); }); @@ -4043,7 +4068,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PSector", (string)null); + b.ToTable("DSector", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.Service", b => @@ -4156,7 +4181,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("SkillTypeId"); - b.ToTable("PSkill", (string)null); + b.ToTable("DSkill", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.SkillLevel", b => @@ -4216,7 +4241,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("SkillTypeId"); - b.ToTable("PSkillLevel", (string)null); + b.ToTable("DSkillLevel", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.SkillType", b => @@ -4264,7 +4289,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("Name") .IsUnique(); - b.ToTable("PSkillType", (string)null); + b.ToTable("DSkillType", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.Uom", b => @@ -4330,7 +4355,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("UomCategoryId"); - b.ToTable("PUom", (string)null); + b.ToTable("DUom", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b => @@ -4378,7 +4403,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("Name") .IsUnique(); - b.ToTable("PUomCategory", (string)null); + b.ToTable("DUomCategory", (string)null); }); modelBuilder.Entity("Kurs.Platform.Forum.ForumCategory", b => @@ -6554,10 +6579,54 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Languages.Entities.LanguageText", b => { - b.HasOne("Kurs.Languages.Entities.LanguageKey", null) + b.HasOne("Kurs.Languages.Entities.Language", null) + .WithMany() + .HasForeignKey("CultureName") + .HasPrincipalKey("CultureName") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Languages.Entities.LanguageKey", "LanguageKey") .WithMany("Texts") .HasForeignKey("ResourceName", "Key") - .OnDelete(DeleteBehavior.SetNull); + .HasPrincipalKey("ResourceName", "Key") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("LanguageKey"); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b => + { + b.HasOne("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", "TableFormat") + .WithMany("MailQueues") + .HasForeignKey("TableName") + .HasPrincipalKey("TableName") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("TableFormat"); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueEvents", b => + { + b.HasOne("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", "MailQueue") + .WithMany("Events") + .HasForeignKey("AwsMessageId") + .HasPrincipalKey("AwsMessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MailQueue"); + }); + + modelBuilder.Entity("Kurs.Notifications.Entities.Notification", b => + { + b.HasOne("Kurs.Notifications.Entities.NotificationRule", "NotificationRule") + .WithMany("Notifications") + .HasForeignKey("NotificationRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationRule"); }); modelBuilder.Entity("Kurs.Platform.Entities.ApiEndpoint", b => @@ -6611,6 +6680,17 @@ namespace Kurs.Platform.Migrations b.Navigation("Category"); }); + modelBuilder.Entity("Kurs.Platform.Entities.BranchUsers", b => + { + b.HasOne("Kurs.Platform.Entities.Branch", "Branch") + .WithMany("Users") + .HasForeignKey("BranchId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Branch"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.HasOne("Kurs.Platform.Entities.Country", "Country") @@ -6707,6 +6787,25 @@ namespace Kurs.Platform.Migrations .IsRequired(); }); + modelBuilder.Entity("Kurs.Platform.Entities.ListFormImport", b => + { + b.HasOne("Kurs.Platform.Entities.ListForm", null) + .WithMany() + .HasForeignKey("ListFormCode") + .HasPrincipalKey("ListFormCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListFormImportExecute", b => + { + b.HasOne("Kurs.Platform.Entities.ListFormImport", null) + .WithMany() + .HasForeignKey("ImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Kurs.Platform.Entities.OrderItem", b => { b.HasOne("Kurs.Platform.Entities.Order", "Order") @@ -6959,11 +7058,31 @@ namespace Kurs.Platform.Migrations b.Navigation("Texts"); }); + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b => + { + b.Navigation("Events"); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", b => + { + b.Navigation("MailQueues"); + }); + + modelBuilder.Entity("Kurs.Notifications.Entities.NotificationRule", b => + { + b.Navigation("Notifications"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b => { b.Navigation("Posts"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Branch", b => + { + b.Navigation("Users"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.Navigation("Districts"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251003092426_Initial.cs similarity index 94% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251003092426_Initial.cs index ea87fbb5..d96f9e14 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251003092426_Initial.cs @@ -432,6 +432,176 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_AbpUsers", x => x.Id); }); + migrationBuilder.CreateTable( + name: "DBank", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + IdentifierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + AddressLine1 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + AddressLine2 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + PostalCode = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), + Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Phone = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Email = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DBank", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DContactTag", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Category = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DContactTag", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DContactTitle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Title = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Abbreviation = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DContactTitle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DCountryGroup", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DCountryGroup", x => x.Id); + table.UniqueConstraint("AK_DCountryGroup_Name", x => x.Name); + }); + + migrationBuilder.CreateTable( + name: "DCurrency", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Code = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), + Symbol = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: true), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Rate = table.Column(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + LastUpdated = table.Column(type: "datetime2", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DCurrency", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DSector", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + FullName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DSector", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DSkillType", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DSkillType", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DUomCategory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DUomCategory", x => x.Id); + }); + migrationBuilder.CreateTable( name: "OpenIddictApplications", columns: table => new @@ -501,9 +671,9 @@ namespace Kurs.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - StatsJson = table.Column(type: "nvarchar(max)", nullable: true), - DescriptionsJson = table.Column(type: "nvarchar(max)", nullable: true), - SectionsJson = table.Column(type: "nvarchar(max)", nullable: true), + StatsJson = table.Column(type: "text", nullable: true), + DescriptionsJson = table.Column(type: "text", nullable: true), + SectionsJson = table.Column(type: "text", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -541,7 +711,7 @@ namespace Kurs.Platform.Migrations DataSourceCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), BeforeSp = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), AfterSp = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - Options = table.Column(type: "nvarchar(max)", nullable: true), + Options = table.Column(type: "text", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -555,59 +725,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_PBackgroundWorker", x => x.Id); }); - migrationBuilder.CreateTable( - name: "PBackgroundWorker_MailQueue", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TemplateId = table.Column(type: "uniqueidentifier", nullable: false), - From = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - To = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - MailParameter = table.Column(type: "nvarchar(max)", maxLength: 8000, nullable: true), - Table = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - TableParameter = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), - Attachment = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - AttachmentParameter = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), - SendStatus = table.Column(type: "bit", nullable: false), - SendTime = table.Column(type: "datetime2", nullable: true), - AwsMessageId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - RelatedRecordId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PBackgroundWorker_MailQueue", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "PBackgroundWorker_MailQueueEvents", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - AwsMessageId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - EventDate = table.Column(type: "datetime2", nullable: true), - Event = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), - MailAddress = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - ResponseDescription = table.Column(type: "nvarchar(max)", nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PBackgroundWorker_MailQueueEvents", x => x.Id); - }); - migrationBuilder.CreateTable( name: "PBackgroundWorker_MailQueueTableFormat", columns: table => new @@ -631,34 +748,7 @@ namespace Kurs.Platform.Migrations constraints: table => { table.PrimaryKey("PK_PBackgroundWorker_MailQueueTableFormat", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "PBank", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - IdentifierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - AddressLine1 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - AddressLine2 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - PostalCode = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), - Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - Phone = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Email = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PBank", x => x.Id); + table.UniqueConstraint("AK_PBackgroundWorker_MailQueueTableFormat_TableName", x => x.TableName); }); migrationBuilder.CreateTable( @@ -723,20 +813,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_PBranch", x => x.Id); }); - migrationBuilder.CreateTable( - name: "PBranchUsers", - columns: table => new - { - UserId = table.Column(type: "uniqueidentifier", nullable: false), - BranchId = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Id = table.Column(type: "uniqueidentifier", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PBranchUsers", x => new { x.UserId, x.BranchId }); - }); - migrationBuilder.CreateTable( name: "PClassroom", columns: table => new @@ -779,9 +855,9 @@ namespace Kurs.Platform.Migrations Email = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), Location = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), TaxNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - BankJson = table.Column(type: "nvarchar(max)", nullable: true), - WorkHoursJson = table.Column(type: "nvarchar(max)", nullable: true), - MapJson = table.Column(type: "nvarchar(max)", nullable: true), + BankJson = table.Column(type: "text", nullable: true), + WorkHoursJson = table.Column(type: "text", nullable: true), + MapJson = table.Column(type: "text", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -795,90 +871,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_PContact", x => x.Id); }); - migrationBuilder.CreateTable( - name: "PContactTag", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Category = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PContactTag", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "PContactTitle", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Title = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Abbreviation = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PContactTitle", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "PCountryGroup", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PCountryGroup", x => x.Id); - table.UniqueConstraint("AK_PCountryGroup_Name", x => x.Name); - }); - - migrationBuilder.CreateTable( - name: "PCurrency", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Code = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), - Symbol = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: true), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Rate = table.Column(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), - IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), - LastUpdated = table.Column(type: "datetime2", nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PCurrency", x => x.Id); - }); - migrationBuilder.CreateTable( name: "PCustomComponent", columns: table => new @@ -916,8 +908,8 @@ namespace Kurs.Platform.Migrations Method = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), DataSourceCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Sql = table.Column(type: "nvarchar(max)", nullable: false), - ParametersJson = table.Column(type: "nvarchar(max)", nullable: true), - PermissionsJson = table.Column(type: "nvarchar(max)", nullable: true), + ParametersJson = table.Column(type: "text", nullable: true), + PermissionsJson = table.Column(type: "text", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1115,15 +1107,16 @@ namespace Kurs.Platform.Migrations constraints: table => { table.PrimaryKey("PK_PLanguage", x => x.Id); + table.UniqueConstraint("AK_PLanguage_CultureName", x => x.CultureName); }); migrationBuilder.CreateTable( name: "PLanguageKey", columns: table => new { + Id = table.Column(type: "uniqueidentifier", nullable: false), Key = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), ResourceName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - Id = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1134,7 +1127,8 @@ namespace Kurs.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_PLanguageKey", x => new { x.ResourceName, x.Key }); + table.PrimaryKey("PK_PLanguageKey", x => x.Id); + table.UniqueConstraint("AK_PLanguageKey_ResourceName_Key", x => new { x.ResourceName, x.Key }); }); migrationBuilder.CreateTable( @@ -1147,10 +1141,10 @@ namespace Kurs.Platform.Migrations DataSourceCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), SelectCommandType = table.Column(type: "int", nullable: false), TableName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - SelectCommand = table.Column(type: "nvarchar(max)", nullable: true), + SelectCommand = table.Column(type: "text", nullable: true), KeyFieldName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), KeyFieldDbSourceType = table.Column(type: "int", nullable: false), - SelectFieldsDefaultValueJson = table.Column(type: "nvarchar(max)", nullable: true), + SelectFieldsDefaultValueJson = table.Column(type: "text", nullable: true), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), Title = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), @@ -1158,66 +1152,66 @@ namespace Kurs.Platform.Migrations PageSize = table.Column(type: "int", nullable: false, defaultValue: 20), Width = table.Column(type: "int", nullable: true), Height = table.Column(type: "int", nullable: true), - DefaultFilter = table.Column(type: "nvarchar(max)", nullable: true), - ColumnOptionJson = table.Column(type: "nvarchar(max)", nullable: true), - PivotOptionJson = table.Column(type: "nvarchar(max)", nullable: true), - FilterRowJson = table.Column(type: "nvarchar(max)", nullable: true), - HeaderFilterJson = table.Column(type: "nvarchar(max)", nullable: true), - FilterPanelJson = table.Column(type: "nvarchar(max)", nullable: true), - SearchPanelJson = table.Column(type: "nvarchar(max)", nullable: true), - GroupPanelJson = table.Column(type: "nvarchar(max)", nullable: true), - SelectionJson = table.Column(type: "nvarchar(max)", nullable: true), - PagerOptionJson = table.Column(type: "nvarchar(max)", nullable: true), - EditingOptionJson = table.Column(type: "nvarchar(max)", nullable: true), - EditingFormJson = table.Column(type: "nvarchar(max)", nullable: true), - PermissionJson = table.Column(type: "nvarchar(max)", nullable: true), - InsertFieldsDefaultValueJson = table.Column(type: "nvarchar(max)", nullable: true), - UpdateFieldsDefaultValueJson = table.Column(type: "nvarchar(max)", nullable: true), - DeleteFieldsDefaultValueJson = table.Column(type: "nvarchar(max)", nullable: true), - CommandColumnJson = table.Column(type: "nvarchar(max)", nullable: true), - StateStoringJson = table.Column(type: "nvarchar(max)", nullable: true), - DeleteCommand = table.Column(type: "nvarchar(max)", nullable: true), - UpdateCommand = table.Column(type: "nvarchar(max)", nullable: true), - InsertCommand = table.Column(type: "nvarchar(max)", nullable: true), + DefaultFilter = table.Column(type: "text", nullable: true), + ColumnOptionJson = table.Column(type: "text", nullable: true), + PivotOptionJson = table.Column(type: "text", nullable: true), + FilterRowJson = table.Column(type: "text", nullable: true), + HeaderFilterJson = table.Column(type: "text", nullable: true), + FilterPanelJson = table.Column(type: "text", nullable: true), + SearchPanelJson = table.Column(type: "text", nullable: true), + GroupPanelJson = table.Column(type: "text", nullable: true), + SelectionJson = table.Column(type: "text", nullable: true), + PagerOptionJson = table.Column(type: "text", nullable: true), + EditingOptionJson = table.Column(type: "text", nullable: true), + EditingFormJson = table.Column(type: "text", nullable: true), + PermissionJson = table.Column(type: "text", nullable: true), + InsertFieldsDefaultValueJson = table.Column(type: "text", nullable: true), + UpdateFieldsDefaultValueJson = table.Column(type: "text", nullable: true), + DeleteFieldsDefaultValueJson = table.Column(type: "text", nullable: true), + CommandColumnJson = table.Column(type: "text", nullable: true), + StateStoringJson = table.Column(type: "text", nullable: true), + DeleteCommand = table.Column(type: "text", nullable: true), + UpdateCommand = table.Column(type: "text", nullable: true), + InsertCommand = table.Column(type: "text", nullable: true), UpdateServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), InsertServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), DeleteServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - CustomJsSourcesJson = table.Column(type: "nvarchar(max)", nullable: true), - CustomStyleSourcesJson = table.Column(type: "nvarchar(max)", nullable: true), - FormFieldsDefaultValueJson = table.Column(type: "nvarchar(max)", nullable: true), + CustomJsSourcesJson = table.Column(type: "text", nullable: true), + CustomStyleSourcesJson = table.Column(type: "text", nullable: true), + FormFieldsDefaultValueJson = table.Column(type: "text", nullable: true), IsTenant = table.Column(type: "bit", nullable: false), IsBranch = table.Column(type: "bit", nullable: false), IsOrganizationUnit = table.Column(type: "bit", nullable: false), ListFormType = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), IsSubForm = table.Column(type: "bit", nullable: false), - SubFormsJson = table.Column(type: "nvarchar(max)", nullable: true), - WidgetsJson = table.Column(type: "nvarchar(max)", nullable: true), - ExtraFilterJson = table.Column(type: "nvarchar(max)", nullable: true), - LayoutJson = table.Column(type: "nvarchar(max)", nullable: true), + SubFormsJson = table.Column(type: "text", nullable: true), + WidgetsJson = table.Column(type: "text", nullable: true), + ExtraFilterJson = table.Column(type: "text", nullable: true), + LayoutJson = table.Column(type: "text", nullable: true), UserId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), RoleId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - CommonJson = table.Column(type: "nvarchar(max)", nullable: true), - DataSourceJson = table.Column(type: "nvarchar(max)", nullable: true), - AdaptiveLayoutJson = table.Column(type: "nvarchar(max)", nullable: true), - AnimationJson = table.Column(type: "nvarchar(max)", nullable: true), - AnnotationsJson = table.Column(type: "nvarchar(max)", nullable: true), - ArgumentAxisJson = table.Column(type: "nvarchar(max)", nullable: true), - CommonAnnotationsSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - CommonAxisSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - CommonPaneSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - CommonSeriesSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - CrosshairJson = table.Column(type: "nvarchar(max)", nullable: true), - ExportJson = table.Column(type: "nvarchar(max)", nullable: true), - LegendJson = table.Column(type: "nvarchar(max)", nullable: true), - MarginJson = table.Column(type: "nvarchar(max)", nullable: true), - PanesJson = table.Column(type: "nvarchar(max)", nullable: true), - ScrollBarJson = table.Column(type: "nvarchar(max)", nullable: true), - SeriesJson = table.Column(type: "nvarchar(max)", nullable: true), - SizeJson = table.Column(type: "nvarchar(max)", nullable: true), - TitleJson = table.Column(type: "nvarchar(max)", nullable: true), - TooltipJson = table.Column(type: "nvarchar(max)", nullable: true), - ValueAxisJson = table.Column(type: "nvarchar(max)", nullable: true), - ZoomAndPanJson = table.Column(type: "nvarchar(max)", nullable: true), + CommonJson = table.Column(type: "text", nullable: true), + DataSourceJson = table.Column(type: "text", nullable: true), + AdaptiveLayoutJson = table.Column(type: "text", nullable: true), + AnimationJson = table.Column(type: "text", nullable: true), + AnnotationsJson = table.Column(type: "text", nullable: true), + ArgumentAxisJson = table.Column(type: "text", nullable: true), + CommonAnnotationsSettingsJson = table.Column(type: "text", nullable: true), + CommonAxisSettingsJson = table.Column(type: "text", nullable: true), + CommonPaneSettingsJson = table.Column(type: "text", nullable: true), + CommonSeriesSettingsJson = table.Column(type: "text", nullable: true), + CrosshairJson = table.Column(type: "text", nullable: true), + ExportJson = table.Column(type: "text", nullable: true), + LegendJson = table.Column(type: "text", nullable: true), + MarginJson = table.Column(type: "text", nullable: true), + PanesJson = table.Column(type: "text", nullable: true), + ScrollBarJson = table.Column(type: "text", nullable: true), + SeriesJson = table.Column(type: "text", nullable: true), + SizeJson = table.Column(type: "text", nullable: true), + TitleJson = table.Column(type: "text", nullable: true), + TooltipJson = table.Column(type: "text", nullable: true), + ValueAxisJson = table.Column(type: "text", nullable: true), + ZoomAndPanJson = table.Column(type: "text", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1232,54 +1226,6 @@ namespace Kurs.Platform.Migrations table.UniqueConstraint("AK_PListForm_ListFormCode", x => x.ListFormCode); }); - migrationBuilder.CreateTable( - name: "PListFormImport", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ListFormCode = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - BlobName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - TotalRows = table.Column(type: "int", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PListFormImport", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "PListFormImportExecute", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ImportId = table.Column(type: "uniqueidentifier", nullable: false), - BlobName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - ExecRows = table.Column(type: "int", nullable: false), - ValidRows = table.Column(type: "int", nullable: false), - ErrorRows = table.Column(type: "int", nullable: false), - Progress = table.Column(type: "float", nullable: false), - ErrorsJson = table.Column(type: "nvarchar(max)", nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PListFormImportExecute", x => x.Id); - }); - migrationBuilder.CreateTable( name: "PMenu", columns: table => new @@ -1312,42 +1258,15 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_PMenu", x => x.Id); }); - migrationBuilder.CreateTable( - name: "PNotification", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - NotificationRuleId = table.Column(type: "uniqueidentifier", nullable: true), - NotificationChannel = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), - NotificationType = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Identifier = table.Column(type: "nvarchar(max)", nullable: false), - UserId = table.Column(type: "uniqueidentifier", nullable: true), - Message = table.Column(type: "nvarchar(max)", nullable: false), - IsSent = table.Column(type: "bit", nullable: false), - IsRead = table.Column(type: "bit", nullable: false), - ReadTime = table.Column(type: "datetime2", nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PNotification", x => x.Id); - }); - migrationBuilder.CreateTable( name: "PNotificationRule", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), NotificationType = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - RecipientType = table.Column(type: "nvarchar(max)", nullable: false), - RecipientId = table.Column(type: "nvarchar(max)", nullable: true), - Channel = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + RecipientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + RecipientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Channel = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), IsActive = table.Column(type: "bit", nullable: false), IsFixed = table.Column(type: "bit", nullable: false), IsCustomized = table.Column(type: "bit", nullable: false), @@ -1490,26 +1409,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_PRoute", x => x.Id); }); - migrationBuilder.CreateTable( - name: "PSector", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - FullName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PSector", x => x.Id); - }); - migrationBuilder.CreateTable( name: "PService", columns: table => new @@ -1566,44 +1465,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_PSettingDefinition", x => x.Id); }); - migrationBuilder.CreateTable( - name: "PSkillType", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PSkillType", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "PUomCategory", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PUomCategory", x => x.Id); - }); - migrationBuilder.CreateTable( name: "AbpAuditLogActions", columns: table => new @@ -1836,6 +1697,159 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "DCountry", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Code = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + CurrencyCode = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: true), + PhoneCode = table.Column(type: "int", nullable: false), + TaxLabel = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ZipRequired = table.Column(type: "bit", nullable: false), + StateRequired = table.Column(type: "bit", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DCountry", x => x.Id); + table.UniqueConstraint("AK_DCountry_Code", x => x.Code); + table.ForeignKey( + name: "FK_DCountry_DCountryGroup_GroupName", + column: x => x.GroupName, + principalTable: "DCountryGroup", + principalColumn: "Name", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "DBankAccount", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + AccountNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + BankId = table.Column(type: "uniqueidentifier", nullable: false), + AccountOwner = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + CurrencyId = table.Column(type: "uniqueidentifier", nullable: true), + CanTransferMoney = table.Column(type: "bit", nullable: false), + Company = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DBankAccount", x => x.Id); + table.ForeignKey( + name: "FK_DBankAccount_DBank_BankId", + column: x => x.BankId, + principalTable: "DBank", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_DBankAccount_DCurrency_CurrencyId", + column: x => x.CurrencyId, + principalTable: "DCurrency", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "DSkill", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + SkillTypeId = table.Column(type: "uniqueidentifier", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DSkill", x => x.Id); + table.ForeignKey( + name: "FK_DSkill_DSkillType_SkillTypeId", + column: x => x.SkillTypeId, + principalTable: "DSkillType", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DSkillLevel", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Progress = table.Column(type: "int", nullable: false, defaultValue: 0), + IsDefault = table.Column(type: "bit", nullable: false, defaultValue: false), + SkillTypeId = table.Column(type: "uniqueidentifier", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DSkillLevel", x => x.Id); + table.ForeignKey( + name: "FK_DSkillLevel_DSkillType_SkillTypeId", + column: x => x.SkillTypeId, + principalTable: "DSkillType", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DUom", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Type = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: false), + Ratio = table.Column(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), + IsActive = table.Column(type: "bit", nullable: false), + Rounding = table.Column(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), + UomCategoryId = table.Column(type: "uniqueidentifier", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DUom", x => x.Id); + table.ForeignKey( + name: "FK_DUom_DUomCategory_UomCategoryId", + column: x => x.UomCategoryId, + principalTable: "DUomCategory", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "OpenIddictAuthorizations", columns: table => new @@ -1861,6 +1875,43 @@ namespace Kurs.Platform.Migrations principalColumn: "Id"); }); + migrationBuilder.CreateTable( + name: "PBackgroundWorker_MailQueue", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TemplateId = table.Column(type: "uniqueidentifier", nullable: false), + From = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + To = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + MailParameter = table.Column(type: "nvarchar(max)", maxLength: 8000, nullable: true), + TableName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + TableParameter = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + Attachment = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + AttachmentParameter = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + SendStatus = table.Column(type: "bit", nullable: false), + SendTime = table.Column(type: "datetime2", nullable: true), + AwsMessageId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + RelatedRecordId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PBackgroundWorker_MailQueue", x => x.Id); + table.UniqueConstraint("AK_PBackgroundWorker_MailQueue_AwsMessageId", x => x.AwsMessageId); + table.ForeignKey( + name: "FK_PBackgroundWorker_MailQueue_PBackgroundWorker_MailQueueTableFormat_TableName", + column: x => x.TableName, + principalTable: "PBackgroundWorker_MailQueueTableFormat", + principalColumn: "TableName", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "PBlogPost", columns: table => new @@ -1900,6 +1951,26 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "PBranchUsers", + columns: table => new + { + UserId = table.Column(type: "uniqueidentifier", nullable: false), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Id = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PBranchUsers", x => new { x.UserId, x.BranchId }); + table.ForeignKey( + name: "FK_PBranchUsers_PBranch_BranchId", + column: x => x.BranchId, + principalTable: "PBranch", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "PClassroomAttandance", columns: table => new @@ -1998,75 +2069,6 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "PCountry", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Code = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - CurrencyCode = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: true), - PhoneCode = table.Column(type: "int", maxLength: 16, nullable: false), - TaxLabel = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - ZipRequired = table.Column(type: "bit", nullable: false), - StateRequired = table.Column(type: "bit", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PCountry", x => x.Id); - table.UniqueConstraint("AK_PCountry_Code", x => x.Code); - table.ForeignKey( - name: "FK_PCountry_PCountryGroup_GroupName", - column: x => x.GroupName, - principalTable: "PCountryGroup", - principalColumn: "Name", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "PBankAccount", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - AccountNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - BankId = table.Column(type: "uniqueidentifier", nullable: false), - AccountOwner = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - CurrencyId = table.Column(type: "uniqueidentifier", nullable: true), - CanTransferMoney = table.Column(type: "bit", nullable: false), - Company = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PBankAccount", x => x.Id); - table.ForeignKey( - name: "FK_PBankAccount_PBank_BankId", - column: x => x.BankId, - principalTable: "PBank", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_PBankAccount_PCurrency_CurrencyId", - column: x => x.CurrencyId, - principalTable: "PCurrency", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - migrationBuilder.CreateTable( name: "PApiEndpoint", columns: table => new @@ -2207,8 +2209,8 @@ namespace Kurs.Platform.Migrations Id = table.Column(type: "uniqueidentifier", nullable: false), CultureName = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), Key = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - Value = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: false), ResourceName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Value = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -2225,7 +2227,13 @@ namespace Kurs.Platform.Migrations columns: x => new { x.ResourceName, x.Key }, principalTable: "PLanguageKey", principalColumns: new[] { "ResourceName", "Key" }, - onDelete: ReferentialAction.SetNull); + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_PLanguageText_PLanguage_CultureName", + column: x => x.CultureName, + principalTable: "PLanguage", + principalColumn: "CultureName", + onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( @@ -2237,7 +2245,7 @@ namespace Kurs.Platform.Migrations UserId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), RoleId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), FilterName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - CustomizationData = table.Column(type: "nvarchar(max)", nullable: true), + CustomizationData = table.Column(type: "text", nullable: true), CustomizationType = table.Column(type: "int", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -2278,24 +2286,24 @@ namespace Kurs.Platform.Migrations SortDirection = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), AllowSearch = table.Column(type: "bit", nullable: true, defaultValue: false), BandName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - ColumnFilterJson = table.Column(type: "nvarchar(max)", nullable: true), - ColumnHeaderJson = table.Column(type: "nvarchar(max)", nullable: true), - GroupingJson = table.Column(type: "nvarchar(max)", nullable: true), - ColumnCustomizationJson = table.Column(type: "nvarchar(max)", nullable: true), - TotalSummaryJson = table.Column(type: "nvarchar(max)", nullable: true), - GroupSummaryJson = table.Column(type: "nvarchar(max)", nullable: true), + ColumnFilterJson = table.Column(type: "text", nullable: true), + ColumnHeaderJson = table.Column(type: "text", nullable: true), + GroupingJson = table.Column(type: "text", nullable: true), + ColumnCustomizationJson = table.Column(type: "text", nullable: true), + TotalSummaryJson = table.Column(type: "text", nullable: true), + GroupSummaryJson = table.Column(type: "text", nullable: true), ColumnCssClass = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), ColumnCssValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - JoinTableJson = table.Column(type: "nvarchar(max)", nullable: true), - EditingJson = table.Column(type: "nvarchar(max)", nullable: true), - LookupJson = table.Column(type: "nvarchar(max)", nullable: true), - ValidationRuleJson = table.Column(type: "nvarchar(max)", nullable: true), - ColumnStylingJson = table.Column(type: "nvarchar(max)", nullable: true), - PermissionJson = table.Column(type: "nvarchar(max)", nullable: true), - PivotSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), + JoinTableJson = table.Column(type: "text", nullable: true), + EditingJson = table.Column(type: "text", nullable: true), + LookupJson = table.Column(type: "text", nullable: true), + ValidationRuleJson = table.Column(type: "text", nullable: true), + ColumnStylingJson = table.Column(type: "text", nullable: true), + PermissionJson = table.Column(type: "text", nullable: true), + PivotSettingsJson = table.Column(type: "text", nullable: true), Alignment = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, defaultValue: "left"), Format = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - EditorOptions = table.Column(type: "nvarchar(max)", nullable: true), + EditorOptions = table.Column(type: "text", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -2315,6 +2323,67 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "PListFormImport", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ListFormCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + BlobName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + TotalRows = table.Column(type: "int", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PListFormImport", x => x.Id); + table.ForeignKey( + name: "FK_PListFormImport_PListForm_ListFormCode", + column: x => x.ListFormCode, + principalTable: "PListForm", + principalColumn: "ListFormCode", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "PNotification", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + NotificationRuleId = table.Column(type: "uniqueidentifier", nullable: false), + NotificationChannel = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + NotificationType = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Identifier = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + UserId = table.Column(type: "uniqueidentifier", nullable: true), + Message = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false), + IsSent = table.Column(type: "bit", nullable: false), + IsRead = table.Column(type: "bit", nullable: false), + ReadTime = table.Column(type: "datetime2", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PNotification", x => x.Id); + table.ForeignKey( + name: "FK_PNotification_PNotificationRule_NotificationRuleId", + column: x => x.NotificationRuleId, + principalTable: "PNotificationRule", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "POrderItem", columns: table => new @@ -2374,90 +2443,6 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.SetNull); }); - migrationBuilder.CreateTable( - name: "PSkill", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - SkillTypeId = table.Column(type: "uniqueidentifier", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PSkill", x => x.Id); - table.ForeignKey( - name: "FK_PSkill_PSkillType_SkillTypeId", - column: x => x.SkillTypeId, - principalTable: "PSkillType", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "PSkillLevel", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Progress = table.Column(type: "int", nullable: false, defaultValue: 0), - IsDefault = table.Column(type: "bit", nullable: false, defaultValue: false), - SkillTypeId = table.Column(type: "uniqueidentifier", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PSkillLevel", x => x.Id); - table.ForeignKey( - name: "FK_PSkillLevel_PSkillType_SkillTypeId", - column: x => x.SkillTypeId, - principalTable: "PSkillType", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "PUom", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Type = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: false), - Ratio = table.Column(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), - IsActive = table.Column(type: "bit", nullable: false), - Rounding = table.Column(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), - UomCategoryId = table.Column(type: "uniqueidentifier", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PUom", x => x.Id); - table.ForeignKey( - name: "FK_PUom_PUomCategory_UomCategoryId", - column: x => x.UomCategoryId, - principalTable: "PUomCategory", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - migrationBuilder.CreateTable( name: "AbpEntityPropertyChanges", columns: table => new @@ -2481,6 +2466,35 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "DCity", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CountryCode = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Code = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: false), + PlateCode = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_DCity", x => x.Id); + table.UniqueConstraint("AK_DCity_CountryCode_Code", x => new { x.CountryCode, x.Code }); + table.ForeignKey( + name: "FK_DCity_DCountry_CountryCode", + column: x => x.CountryCode, + principalTable: "DCountry", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "OpenIddictTokens", columns: table => new @@ -2516,14 +2530,15 @@ namespace Kurs.Platform.Migrations }); migrationBuilder.CreateTable( - name: "PCity", + name: "PBackgroundWorker_MailQueueEvents", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - CountryCode = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Code = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: false), - PlateCode = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + AwsMessageId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + EventDate = table.Column(type: "datetime2", nullable: true), + Event = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + MailAddress = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + ResponseDescription = table.Column(type: "nvarchar(max)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -2534,13 +2549,12 @@ namespace Kurs.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_PCity", x => x.Id); - table.UniqueConstraint("AK_PCity_CountryCode_Code", x => new { x.CountryCode, x.Code }); + table.PrimaryKey("PK_PBackgroundWorker_MailQueueEvents", x => x.Id); table.ForeignKey( - name: "FK_PCity_PCountry_CountryCode", - column: x => x.CountryCode, - principalTable: "PCountry", - principalColumn: "Code", + name: "FK_PBackgroundWorker_MailQueueEvents_PBackgroundWorker_MailQueue_AwsMessageId", + column: x => x.AwsMessageId, + principalTable: "PBackgroundWorker_MailQueue", + principalColumn: "AwsMessageId", onDelete: ReferentialAction.Cascade); }); @@ -2582,6 +2596,38 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "PListFormImportExecute", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ImportId = table.Column(type: "uniqueidentifier", nullable: false), + BlobName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ExecRows = table.Column(type: "int", nullable: false), + ValidRows = table.Column(type: "int", nullable: false), + ErrorRows = table.Column(type: "int", nullable: false), + Progress = table.Column(type: "float", nullable: false), + ErrorsJson = table.Column(type: "text", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PListFormImportExecute", x => x.Id); + table.ForeignKey( + name: "FK_PListFormImportExecute_PListFormImport_ImportId", + column: x => x.ImportId, + principalTable: "PListFormImport", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "PReportGenerated", columns: table => new @@ -2643,7 +2689,7 @@ namespace Kurs.Platform.Migrations }); migrationBuilder.CreateTable( - name: "PDistrict", + name: "DDistrict", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), @@ -2663,11 +2709,11 @@ namespace Kurs.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_PDistrict", x => x.Id); + table.PrimaryKey("PK_DDistrict", x => x.Id); table.ForeignKey( - name: "FK_PDistrict_PCity_CountryCode_CityCode", + name: "FK_DDistrict_DCity_CountryCode_CityCode", columns: x => new { x.CountryCode, x.CityCode }, - principalTable: "PCity", + principalTable: "DCity", principalColumns: new[] { "CountryCode", "Code" }, onDelete: ReferentialAction.Cascade); }); @@ -2890,6 +2936,73 @@ namespace Kurs.Platform.Migrations table: "AbpUsers", column: "UserName"); + migrationBuilder.CreateIndex( + name: "IX_DBankAccount_BankId", + table: "DBankAccount", + column: "BankId"); + + migrationBuilder.CreateIndex( + name: "IX_DBankAccount_CurrencyId", + table: "DBankAccount", + column: "CurrencyId"); + + migrationBuilder.CreateIndex( + name: "IX_DCity_CountryCode_Code", + table: "DCity", + columns: new[] { "CountryCode", "Code" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_DCountry_Code", + table: "DCountry", + column: "Code", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_DCountry_GroupName", + table: "DCountry", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_DCountryGroup_Name", + table: "DCountryGroup", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_DDistrict_CountryCode_CityCode_Name_Township_Street_ZipCode", + table: "DDistrict", + columns: new[] { "CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode" }, + unique: true, + filter: "[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_DSkill_SkillTypeId", + table: "DSkill", + column: "SkillTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_DSkillLevel_SkillTypeId", + table: "DSkillLevel", + column: "SkillTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_DSkillType_Name", + table: "DSkillType", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_DUom_UomCategoryId", + table: "DUom", + column: "UomCategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_DUomCategory_Name", + table: "DUomCategory", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_OpenIddictApplications_ClientId", table: "OpenIddictApplications", @@ -2930,22 +3043,22 @@ namespace Kurs.Platform.Migrations table: "PApiMigration", column: "EntityId"); + migrationBuilder.CreateIndex( + name: "IX_PBackgroundWorker_MailQueue_TableName", + table: "PBackgroundWorker_MailQueue", + column: "TableName"); + + migrationBuilder.CreateIndex( + name: "IX_PBackgroundWorker_MailQueueEvents_AwsMessageId", + table: "PBackgroundWorker_MailQueueEvents", + column: "AwsMessageId"); + migrationBuilder.CreateIndex( name: "IX_MailQueueTableFormat", table: "PBackgroundWorker_MailQueueTableFormat", columns: new[] { "TableName", "Order" }, unique: true); - migrationBuilder.CreateIndex( - name: "IX_PBankAccount_BankId", - table: "PBankAccount", - column: "BankId"); - - migrationBuilder.CreateIndex( - name: "IX_PBankAccount_CurrencyId", - table: "PBankAccount", - column: "CurrencyId"); - migrationBuilder.CreateIndex( name: "IX_PBlogCategory_Slug", table: "PBlogCategory", @@ -2972,10 +3085,9 @@ namespace Kurs.Platform.Migrations column: "Slug"); migrationBuilder.CreateIndex( - name: "IX_PCity_CountryCode_Code", - table: "PCity", - columns: new[] { "CountryCode", "Code" }, - unique: true); + name: "IX_PBranchUsers_BranchId", + table: "PBranchUsers", + column: "BranchId"); migrationBuilder.CreateIndex( name: "IX_PClassroom_ScheduledStartTime", @@ -3034,35 +3146,11 @@ namespace Kurs.Platform.Migrations table: "PClassroomParticipant", column: "UserId"); - migrationBuilder.CreateIndex( - name: "IX_PCountry_Code", - table: "PCountry", - column: "Code", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_PCountry_GroupName", - table: "PCountry", - column: "GroupName"); - - migrationBuilder.CreateIndex( - name: "IX_PCountryGroup_Name", - table: "PCountryGroup", - column: "Name", - unique: true); - migrationBuilder.CreateIndex( name: "IX_PCustomEntityField_EntityId", table: "PCustomEntityField", column: "EntityId"); - migrationBuilder.CreateIndex( - name: "IX_PDistrict_CountryCode_CityCode_Name_Township_Street_ZipCode", - table: "PDistrict", - columns: new[] { "CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode" }, - unique: true, - filter: "[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); - migrationBuilder.CreateIndex( name: "IX_PForumCategory_DisplayOrder", table: "PForumCategory", @@ -3093,6 +3181,17 @@ namespace Kurs.Platform.Migrations table: "PForumTopic", column: "LastPostDate"); + migrationBuilder.CreateIndex( + name: "IX_PLanguageKey_ResourceName_Key", + table: "PLanguageKey", + columns: new[] { "ResourceName", "Key" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_PLanguageText_CultureName", + table: "PLanguageText", + column: "CultureName"); + migrationBuilder.CreateIndex( name: "IX_PLanguageText_ResourceName_Key", table: "PLanguageText", @@ -3108,6 +3207,21 @@ namespace Kurs.Platform.Migrations table: "PListFormField", column: "ListFormCode"); + migrationBuilder.CreateIndex( + name: "IX_PListFormImport_ListFormCode", + table: "PListFormImport", + column: "ListFormCode"); + + migrationBuilder.CreateIndex( + name: "IX_PListFormImportExecute_ImportId", + table: "PListFormImportExecute", + column: "ImportId"); + + migrationBuilder.CreateIndex( + name: "IX_PNotification_NotificationRuleId", + table: "PNotification", + column: "NotificationRuleId"); + migrationBuilder.CreateIndex( name: "IX_POrderItem_OrderId", table: "POrderItem", @@ -3139,33 +3253,6 @@ namespace Kurs.Platform.Migrations table: "PRoute", column: "Key", unique: true); - - migrationBuilder.CreateIndex( - name: "IX_PSkill_SkillTypeId", - table: "PSkill", - column: "SkillTypeId"); - - migrationBuilder.CreateIndex( - name: "IX_PSkillLevel_SkillTypeId", - table: "PSkillLevel", - column: "SkillTypeId"); - - migrationBuilder.CreateIndex( - name: "IX_PSkillType_Name", - table: "PSkillType", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_PUom_UomCategoryId", - table: "PUom", - column: "UomCategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_PUomCategory_Name", - table: "PUomCategory", - column: "Name", - unique: true); } /// @@ -3243,6 +3330,30 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "AbpUserTokens"); + migrationBuilder.DropTable( + name: "DBankAccount"); + + migrationBuilder.DropTable( + name: "DContactTag"); + + migrationBuilder.DropTable( + name: "DContactTitle"); + + migrationBuilder.DropTable( + name: "DDistrict"); + + migrationBuilder.DropTable( + name: "DSector"); + + migrationBuilder.DropTable( + name: "DSkill"); + + migrationBuilder.DropTable( + name: "DSkillLevel"); + + migrationBuilder.DropTable( + name: "DUom"); + migrationBuilder.DropTable( name: "OpenIddictScopes"); @@ -3264,24 +3375,12 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PBackgroundWorker"); - migrationBuilder.DropTable( - name: "PBackgroundWorker_MailQueue"); - migrationBuilder.DropTable( name: "PBackgroundWorker_MailQueueEvents"); - migrationBuilder.DropTable( - name: "PBackgroundWorker_MailQueueTableFormat"); - - migrationBuilder.DropTable( - name: "PBankAccount"); - migrationBuilder.DropTable( name: "PBlogPost"); - migrationBuilder.DropTable( - name: "PBranch"); - migrationBuilder.DropTable( name: "PBranchUsers"); @@ -3297,12 +3396,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PContact"); - migrationBuilder.DropTable( - name: "PContactTag"); - - migrationBuilder.DropTable( - name: "PContactTitle"); - migrationBuilder.DropTable( name: "PCustomComponent"); @@ -3318,9 +3411,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PDemo"); - migrationBuilder.DropTable( - name: "PDistrict"); - migrationBuilder.DropTable( name: "PForumPost"); @@ -3333,9 +3423,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PIpRestriction"); - migrationBuilder.DropTable( - name: "PLanguage"); - migrationBuilder.DropTable( name: "PLanguageText"); @@ -3345,9 +3432,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PListFormField"); - migrationBuilder.DropTable( - name: "PListFormImport"); - migrationBuilder.DropTable( name: "PListFormImportExecute"); @@ -3357,9 +3441,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PNotification"); - migrationBuilder.DropTable( - name: "PNotificationRule"); - migrationBuilder.DropTable( name: "POrderItem"); @@ -3378,24 +3459,12 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PRoute"); - migrationBuilder.DropTable( - name: "PSector"); - migrationBuilder.DropTable( name: "PService"); migrationBuilder.DropTable( name: "PSettingDefinition"); - migrationBuilder.DropTable( - name: "PSkill"); - - migrationBuilder.DropTable( - name: "PSkillLevel"); - - migrationBuilder.DropTable( - name: "PUom"); - migrationBuilder.DropTable( name: "AbpEntityChanges"); @@ -3411,27 +3480,39 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "AbpUsers"); + migrationBuilder.DropTable( + name: "DBank"); + + migrationBuilder.DropTable( + name: "DCurrency"); + + migrationBuilder.DropTable( + name: "DCity"); + + migrationBuilder.DropTable( + name: "DSkillType"); + + migrationBuilder.DropTable( + name: "DUomCategory"); + migrationBuilder.DropTable( name: "OpenIddictAuthorizations"); migrationBuilder.DropTable( - name: "PBank"); - - migrationBuilder.DropTable( - name: "PCurrency"); + name: "PBackgroundWorker_MailQueue"); migrationBuilder.DropTable( name: "PBlogCategory"); + migrationBuilder.DropTable( + name: "PBranch"); + migrationBuilder.DropTable( name: "PClassroom"); migrationBuilder.DropTable( name: "PCustomEntity"); - migrationBuilder.DropTable( - name: "PCity"); - migrationBuilder.DropTable( name: "PForumTopic"); @@ -3439,7 +3520,13 @@ namespace Kurs.Platform.Migrations name: "PLanguageKey"); migrationBuilder.DropTable( - name: "PListForm"); + name: "PLanguage"); + + migrationBuilder.DropTable( + name: "PListFormImport"); + + migrationBuilder.DropTable( + name: "PNotificationRule"); migrationBuilder.DropTable( name: "POrder"); @@ -3447,29 +3534,29 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PReportTemplate"); - migrationBuilder.DropTable( - name: "PSkillType"); - - migrationBuilder.DropTable( - name: "PUomCategory"); - migrationBuilder.DropTable( name: "AbpAuditLogs"); + migrationBuilder.DropTable( + name: "DCountry"); + migrationBuilder.DropTable( name: "OpenIddictApplications"); migrationBuilder.DropTable( - name: "PCountry"); + name: "PBackgroundWorker_MailQueueTableFormat"); migrationBuilder.DropTable( name: "PForumCategory"); + migrationBuilder.DropTable( + name: "PListForm"); + migrationBuilder.DropTable( name: "PReportCategory"); migrationBuilder.DropTable( - name: "PCountryGroup"); + name: "DCountryGroup"); } } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 7320e2e9..c4f58a72 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -70,7 +70,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PContactTag", (string)null); + b.ToTable("DContactTag", (string)null); }); modelBuilder.Entity("ContactTitle", b => @@ -119,7 +119,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PContactTitle", (string)null); + b.ToTable("DContactTitle", (string)null); }); modelBuilder.Entity("Kurs.Languages.Entities.Language", b => @@ -186,13 +186,9 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Languages.Entities.LanguageKey", b => { - b.Property("ResourceName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -210,15 +206,17 @@ namespace Kurs.Platform.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); - b.Property("Id") - .HasColumnType("uniqueidentifier"); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("bit") .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("Key") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -227,7 +225,15 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.HasKey("ResourceName", "Key"); + b.Property("ResourceName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ResourceName", "Key") + .IsUnique(); b.ToTable("PLanguageKey", (string)null); }); @@ -288,6 +294,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("CultureName"); + b.HasIndex("ResourceName", "Key"); b.ToTable("PLanguageText", (string)null); @@ -308,6 +316,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(500)"); b.Property("AwsMessageId") + .IsRequired() .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -360,7 +369,7 @@ namespace Kurs.Platform.Migrations b.Property("SendTime") .HasColumnType("datetime2"); - b.Property("Table") + b.Property("TableName") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -378,6 +387,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("TableName"); + b.ToTable("PBackgroundWorker_MailQueue", (string)null); }); @@ -438,6 +449,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("AwsMessageId"); + b.ToTable("PBackgroundWorker_MailQueueEvents", (string)null); }); @@ -500,8 +513,9 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.HasIndex(new[] { "TableName", "Order" }, "IX_MailQueueTableFormat") - .IsUnique(); + b.HasIndex("TableName", "Order") + .IsUnique() + .HasDatabaseName("IX_MailQueueTableFormat"); b.ToTable("PBackgroundWorker_MailQueueTableFormat", (string)null); }); @@ -530,7 +544,8 @@ namespace Kurs.Platform.Migrations b.Property("Identifier") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -554,14 +569,15 @@ namespace Kurs.Platform.Migrations b.Property("Message") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("NotificationChannel") .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); - b.Property("NotificationRuleId") + b.Property("NotificationRuleId") .HasColumnType("uniqueidentifier"); b.Property("NotificationType") @@ -577,6 +593,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("NotificationRuleId"); + b.ToTable("PNotification", (string)null); }); @@ -588,8 +606,8 @@ namespace Kurs.Platform.Migrations b.Property("Channel") .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -636,11 +654,13 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("RecipientId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("RecipientType") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.HasKey("Id"); @@ -669,7 +689,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("DescriptionsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -686,10 +706,10 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("SectionsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("StatsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -915,7 +935,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("Options") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("WorkerType") .HasColumnType("int"); @@ -1003,7 +1023,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PBank", (string)null); + b.ToTable("DBank", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b => @@ -1070,7 +1090,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("CurrencyId"); - b.ToTable("PBankAccount", (string)null); + b.ToTable("DBankAccount", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b => @@ -1380,6 +1400,8 @@ namespace Kurs.Platform.Migrations b.HasKey("UserId", "BranchId"); + b.HasIndex("BranchId"); + b.ToTable("PBranchUsers", (string)null); }); @@ -1442,7 +1464,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("CountryCode", "Code") .IsUnique(); - b.ToTable("PCity", (string)null); + b.ToTable("DCity", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.Classroom", b => @@ -1775,7 +1797,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(500)"); b.Property("BankJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -1816,7 +1838,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(150)"); b.Property("MapJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Phone") .HasMaxLength(50) @@ -1831,7 +1853,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("TenantId"); b.Property("WorkHoursJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -1892,7 +1914,6 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("PhoneCode") - .HasMaxLength(16) .HasColumnType("int"); b.Property("StateRequired") @@ -1912,7 +1933,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("GroupName"); - b.ToTable("PCountry", (string)null); + b.ToTable("DCountry", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.CountryGroup", b => @@ -1960,7 +1981,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("Name") .IsUnique(); - b.ToTable("PCountryGroup", (string)null); + b.ToTable("DCountryGroup", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.Currency", b => @@ -2026,7 +2047,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PCurrency", (string)null); + b.ToTable("DCurrency", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.CustomComponent", b => @@ -2152,10 +2173,10 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("ParametersJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PermissionsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Sql") .IsRequired() @@ -2531,7 +2552,7 @@ namespace Kurs.Platform.Migrations .IsUnique() .HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); - b.ToTable("PDistrict", (string)null); + b.ToTable("DDistrict", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.GlobalSearch", b => @@ -2658,37 +2679,37 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("AdaptiveLayoutJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("AnimationJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("AnnotationsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ArgumentAxisJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ColumnOptionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommandColumnJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonAnnotationsSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonAxisSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonPaneSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CommonSeriesSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -2699,33 +2720,33 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CrosshairJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CultureName") .HasMaxLength(10) .HasColumnType("nvarchar(10)"); b.Property("CustomJsSourcesJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CustomStyleSourcesJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DataSourceCode") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); b.Property("DataSourceJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DefaultFilter") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DeleteCommand") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DeleteFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("DeleteServiceAddress") .HasMaxLength(256) @@ -2744,40 +2765,40 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(512)"); b.Property("EditingFormJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("EditingOptionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ExportJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ExtraFilterJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FilterPanelJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FilterRowJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FormFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("GroupPanelJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("HeaderFilterJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Height") .HasColumnType("int"); b.Property("InsertCommand") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("InsertFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("InsertServiceAddress") .HasMaxLength(256) @@ -2817,10 +2838,10 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("LayoutJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("LegendJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ListFormCode") .IsRequired() @@ -2832,7 +2853,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("MarginJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Name") .HasMaxLength(128) @@ -2844,54 +2865,54 @@ namespace Kurs.Platform.Migrations .HasDefaultValue(20); b.Property("PagerOptionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PanesJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PermissionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PivotOptionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RoleId") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("ScrollBarJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SearchPanelJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SelectCommand") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SelectCommandType") .HasColumnType("int"); b.Property("SelectFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SelectionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SeriesJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SizeJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SortMode") .HasMaxLength(20) .HasColumnType("nvarchar(20)"); b.Property("StateStoringJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SubFormsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TableName") .HasMaxLength(128) @@ -2902,16 +2923,16 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("TitleJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TooltipJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UpdateCommand") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UpdateFieldsDefaultValueJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UpdateServiceAddress") .HasMaxLength(256) @@ -2922,16 +2943,16 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("ValueAxisJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("WidgetsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Width") .HasColumnType("int"); b.Property("ZoomAndPanJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -2952,7 +2973,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CustomizationData") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CustomizationType") .HasColumnType("int"); @@ -3036,16 +3057,16 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("ColumnCustomizationJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ColumnFilterJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ColumnHeaderJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ColumnStylingJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -3068,10 +3089,10 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("EditingJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("EditorOptions") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FieldName") .IsRequired() @@ -3083,10 +3104,10 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("GroupSummaryJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("GroupingJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("IsActive") .ValueGeneratedOnAdd() @@ -3100,7 +3121,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("IsDeleted"); b.Property("JoinTableJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("LastModificationTime") .HasColumnType("datetime2") @@ -3121,13 +3142,13 @@ namespace Kurs.Platform.Migrations .HasDefaultValue(30); b.Property("LookupJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PermissionJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PivotSettingsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RoleId") .HasMaxLength(256) @@ -3144,14 +3165,14 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("TotalSummaryJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("ValidationRuleJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Visible") .ValueGeneratedOnAdd() @@ -3212,8 +3233,8 @@ namespace Kurs.Platform.Migrations b.Property("ListFormCode") .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("Status") .IsRequired() @@ -3225,6 +3246,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("ListFormCode"); + b.ToTable("PListFormImport", (string)null); }); @@ -3258,7 +3281,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("ErrorsJson") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ExecRows") .HasColumnType("int"); @@ -3293,6 +3316,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("ImportId"); + b.ToTable("PListFormImportExecute", (string)null); }); @@ -4040,7 +4065,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("PSector", (string)null); + b.ToTable("DSector", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.Service", b => @@ -4153,7 +4178,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("SkillTypeId"); - b.ToTable("PSkill", (string)null); + b.ToTable("DSkill", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.SkillLevel", b => @@ -4213,7 +4238,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("SkillTypeId"); - b.ToTable("PSkillLevel", (string)null); + b.ToTable("DSkillLevel", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.SkillType", b => @@ -4261,7 +4286,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("Name") .IsUnique(); - b.ToTable("PSkillType", (string)null); + b.ToTable("DSkillType", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.Uom", b => @@ -4327,7 +4352,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("UomCategoryId"); - b.ToTable("PUom", (string)null); + b.ToTable("DUom", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b => @@ -4375,7 +4400,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("Name") .IsUnique(); - b.ToTable("PUomCategory", (string)null); + b.ToTable("DUomCategory", (string)null); }); modelBuilder.Entity("Kurs.Platform.Forum.ForumCategory", b => @@ -6551,10 +6576,54 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Languages.Entities.LanguageText", b => { - b.HasOne("Kurs.Languages.Entities.LanguageKey", null) + b.HasOne("Kurs.Languages.Entities.Language", null) + .WithMany() + .HasForeignKey("CultureName") + .HasPrincipalKey("CultureName") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Languages.Entities.LanguageKey", "LanguageKey") .WithMany("Texts") .HasForeignKey("ResourceName", "Key") - .OnDelete(DeleteBehavior.SetNull); + .HasPrincipalKey("ResourceName", "Key") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("LanguageKey"); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b => + { + b.HasOne("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", "TableFormat") + .WithMany("MailQueues") + .HasForeignKey("TableName") + .HasPrincipalKey("TableName") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("TableFormat"); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueEvents", b => + { + b.HasOne("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", "MailQueue") + .WithMany("Events") + .HasForeignKey("AwsMessageId") + .HasPrincipalKey("AwsMessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MailQueue"); + }); + + modelBuilder.Entity("Kurs.Notifications.Entities.Notification", b => + { + b.HasOne("Kurs.Notifications.Entities.NotificationRule", "NotificationRule") + .WithMany("Notifications") + .HasForeignKey("NotificationRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationRule"); }); modelBuilder.Entity("Kurs.Platform.Entities.ApiEndpoint", b => @@ -6608,6 +6677,17 @@ namespace Kurs.Platform.Migrations b.Navigation("Category"); }); + modelBuilder.Entity("Kurs.Platform.Entities.BranchUsers", b => + { + b.HasOne("Kurs.Platform.Entities.Branch", "Branch") + .WithMany("Users") + .HasForeignKey("BranchId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Branch"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.HasOne("Kurs.Platform.Entities.Country", "Country") @@ -6704,6 +6784,25 @@ namespace Kurs.Platform.Migrations .IsRequired(); }); + modelBuilder.Entity("Kurs.Platform.Entities.ListFormImport", b => + { + b.HasOne("Kurs.Platform.Entities.ListForm", null) + .WithMany() + .HasForeignKey("ListFormCode") + .HasPrincipalKey("ListFormCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListFormImportExecute", b => + { + b.HasOne("Kurs.Platform.Entities.ListFormImport", null) + .WithMany() + .HasForeignKey("ImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Kurs.Platform.Entities.OrderItem", b => { b.HasOne("Kurs.Platform.Entities.Order", "Order") @@ -6956,11 +7055,31 @@ namespace Kurs.Platform.Migrations b.Navigation("Texts"); }); + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b => + { + b.Navigation("Events"); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", b => + { + b.Navigation("MailQueues"); + }); + + modelBuilder.Entity("Kurs.Notifications.Entities.NotificationRule", b => + { + b.Navigation("Notifications"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b => { b.Navigation("Posts"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Branch", b => + { + b.Navigation("Users"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.Navigation("Districts");