diff --git a/api/modules/Erp.Languages/Erp.Languages.EntityFrameworkCore/EntityFrameworkCore/LanguagesDbContextModelCreatingExtensions.cs b/api/modules/Erp.Languages/Erp.Languages.EntityFrameworkCore/EntityFrameworkCore/LanguagesDbContextModelCreatingExtensions.cs index b693ec3d..a4ab589b 100644 --- a/api/modules/Erp.Languages/Erp.Languages.EntityFrameworkCore/EntityFrameworkCore/LanguagesDbContextModelCreatingExtensions.cs +++ b/api/modules/Erp.Languages/Erp.Languages.EntityFrameworkCore/EntityFrameworkCore/LanguagesDbContextModelCreatingExtensions.cs @@ -19,7 +19,8 @@ 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(); + b.Property(a => a.DisplayName).HasMaxLength(64).IsRequired(); + b.Property(a => a.TwoLetterISOLanguageName).HasMaxLength(2).IsRequired(); // Language → LanguageText (CultureName üzerinden) b.HasMany() @@ -34,8 +35,8 @@ public static class LanguagesDbContextModelCreatingExtensions b.ToTable(TablePrefix.ByName(nameof(LanguageKey)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.Key).HasMaxLength(100).IsRequired(); - b.Property(a => a.ResourceName).HasMaxLength(50).IsRequired(); + b.Property(a => a.Key).HasMaxLength(128).IsRequired(); + b.Property(a => a.ResourceName).HasMaxLength(64).IsRequired(); b.HasMany(a => a.Texts) .WithOne(t => t.LanguageKey) @@ -53,9 +54,9 @@ public static class LanguagesDbContextModelCreatingExtensions b.ConfigureByConvention(); b.Property(a => a.CultureName).HasMaxLength(10).IsRequired(); - b.Property(a => a.ResourceName).HasMaxLength(50); - b.Property(a => a.Key).HasMaxLength(100); - b.Property(a => a.Value).HasMaxLength(4000).IsRequired(); + b.Property(a => a.ResourceName).HasMaxLength(64); + b.Property(a => a.Key).HasMaxLength(128); + b.Property(a => a.Value).HasMaxLength(4096).IsRequired(); }); } } diff --git a/api/modules/Erp.MailQueue/EntityFrameworkCore/MailQueueDbContextModelCreatingExtensions.cs b/api/modules/Erp.MailQueue/EntityFrameworkCore/MailQueueDbContextModelCreatingExtensions.cs index 6b07b885..a78ab09d 100644 --- a/api/modules/Erp.MailQueue/EntityFrameworkCore/MailQueueDbContextModelCreatingExtensions.cs +++ b/api/modules/Erp.MailQueue/EntityFrameworkCore/MailQueueDbContextModelCreatingExtensions.cs @@ -17,15 +17,15 @@ public static class MailQueueDbContextModelCreatingExtensions b.ToTable(TablePrefix.ByName(nameof(BackgroundWorker_MailQueue)), Prefix.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); + b.Property(x => x.From).IsRequired().HasMaxLength(128); + b.Property(x => x.To).IsRequired().HasMaxLength(128); + b.Property(x => x.MailParameter).HasMaxLength(8192); + b.Property(x => x.TableName).HasMaxLength(128); + b.Property(x => x.TableParameter).HasMaxLength(512); + b.Property(x => x.Attachment).HasMaxLength(128); + b.Property(x => x.AttachmentParameter).HasMaxLength(512); + b.Property(x => x.AwsMessageId).HasMaxLength(128); + b.Property(x => x.RelatedRecordId).HasMaxLength(128); // 🔗 İlişki: MailQueue ↔ MailQueueEvents (AwsMessageId) b.HasMany(x => x.Events) @@ -47,9 +47,9 @@ public static class MailQueueDbContextModelCreatingExtensions b.ToTable(TablePrefix.ByName(nameof(BackgroundWorker_MailQueueEvents)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.AwsMessageId).IsRequired().HasMaxLength(100); + b.Property(x => x.AwsMessageId).IsRequired().HasMaxLength(128); b.Property(x => x.Event).HasMaxLength(20); - b.Property(x => x.MailAddress).HasMaxLength(100); + b.Property(x => x.MailAddress).HasMaxLength(128); }); builder.Entity(b => @@ -57,15 +57,15 @@ public static class MailQueueDbContextModelCreatingExtensions b.ToTable(TablePrefix.ByName(nameof(BackgroundWorker_MailQueueTableFormat)), Prefix.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); + b.Property(x => x.TableName).IsRequired().HasMaxLength(128); + b.Property(x => x.ColumnName).HasMaxLength(64); + b.Property(x => x.Caption).HasMaxLength(64); + b.Property(x => x.HeaderCss).HasMaxLength(1024); + b.Property(x => x.Css).HasMaxLength(1024); + b.Property(x => x.FooterCss).HasMaxLength(1024); + b.Property(x => x.DataType).HasMaxLength(64); + b.Property(x => x.DataFormat).HasMaxLength(64); + b.Property(x => x.SubTotal).HasMaxLength(64); // Unique index (TableName + Order) b.HasIndex(x => new { x.TableName, x.Order }) diff --git a/api/modules/Erp.Notifications/Erp.Notifications.EntityFrameworkCore/EntityFrameworkCore/NotificationDbContextModelCreatingExtensions.cs b/api/modules/Erp.Notifications/Erp.Notifications.EntityFrameworkCore/EntityFrameworkCore/NotificationDbContextModelCreatingExtensions.cs index f949d451..8bd7781e 100644 --- a/api/modules/Erp.Notifications/Erp.Notifications.EntityFrameworkCore/EntityFrameworkCore/NotificationDbContextModelCreatingExtensions.cs +++ b/api/modules/Erp.Notifications/Erp.Notifications.EntityFrameworkCore/EntityFrameworkCore/NotificationDbContextModelCreatingExtensions.cs @@ -18,10 +18,10 @@ public static class NotificationDbContextModelCreatingExtensions b.ToTable(TablePrefix.ByName(nameof(NotificationRule)), Prefix.DbSchema); b.ConfigureByConvention(); - 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); + b.Property(x => x.NotificationType).IsRequired().HasMaxLength(128); + b.Property(x => x.RecipientType).IsRequired().HasMaxLength(64); + b.Property(x => x.RecipientId).HasMaxLength(256); + b.Property(x => x.Channel).IsRequired().HasMaxLength(64); // 1:N ilişki NotificationRule -> Notifications b.HasMany(x => x.Notifications) @@ -35,10 +35,10 @@ public static class NotificationDbContextModelCreatingExtensions b.ToTable(TablePrefix.ByName(nameof(Notification)), Prefix.DbSchema); b.ConfigureByConvention(); - 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); + b.Property(x => x.NotificationChannel).IsRequired().HasMaxLength(64); + b.Property(x => x.NotificationType).IsRequired().HasMaxLength(128); + b.Property(x => x.Identifier).IsRequired().HasMaxLength(256); + b.Property(x => x.Message).IsRequired().HasMaxLength(2048); }); } } diff --git a/api/modules/Erp.Settings/Erp.Settings.EntityFrameworkCore/EntityFrameworkCore/SettingsDbContextModelCreatingExtensions.cs b/api/modules/Erp.Settings/Erp.Settings.EntityFrameworkCore/EntityFrameworkCore/SettingsDbContextModelCreatingExtensions.cs index fd9e8c82..5a1f185c 100644 --- a/api/modules/Erp.Settings/Erp.Settings.EntityFrameworkCore/EntityFrameworkCore/SettingsDbContextModelCreatingExtensions.cs +++ b/api/modules/Erp.Settings/Erp.Settings.EntityFrameworkCore/EntityFrameworkCore/SettingsDbContextModelCreatingExtensions.cs @@ -37,7 +37,7 @@ public static class SettingsDbContextModelCreatingExtensions b.Property(a => a.Code).HasMaxLength(128).IsRequired(); b.Property(a => a.NameKey).HasMaxLength(128).IsRequired(); b.Property(a => a.DescriptionKey).HasMaxLength(512); - b.Property(a => a.DefaultValue).HasMaxLength(2048); + b.Property(a => a.DefaultValue).HasMaxLength(1024); b.Property(a => a.MainGroupKey).HasMaxLength(128).IsRequired(); b.Property(a => a.SubGroupKey).HasMaxLength(128); b.Property(a => a.RequiredPermissionName).HasMaxLength(128).IsRequired(); diff --git a/api/modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/SqlQueryManagerDbContextModelCreatingExtensions.cs b/api/modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/SqlQueryManagerDbContextModelCreatingExtensions.cs index 938f1be2..a561692b 100644 --- a/api/modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/SqlQueryManagerDbContextModelCreatingExtensions.cs +++ b/api/modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/SqlQueryManagerDbContextModelCreatingExtensions.cs @@ -19,13 +19,13 @@ public static class SqlQueryManagerDbContextModelCreatingExtensions b.Property(x => x.Code).IsRequired().HasMaxLength(128); b.Property(x => x.Name).IsRequired().HasMaxLength(256); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.QueryText).IsRequired(); b.Property(x => x.DataSourceCode).IsRequired().HasMaxLength(128); b.Property(x => x.Status).IsRequired(); b.Property(x => x.Category).HasMaxLength(128); - b.Property(x => x.Tags).HasMaxLength(500); - b.Property(x => x.Parameters).HasMaxLength(4000); + b.Property(x => x.Tags).HasMaxLength(512); + b.Property(x => x.Parameters).HasMaxLength(4096); b.HasIndex(x => x.Code); b.HasIndex(x => x.DataSourceCode); @@ -42,12 +42,12 @@ public static class SqlQueryManagerDbContextModelCreatingExtensions b.Property(x => x.ProcedureName).IsRequired().HasMaxLength(128); b.Property(x => x.SchemaName).IsRequired().HasMaxLength(128); b.Property(x => x.DisplayName).IsRequired().HasMaxLength(256); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.ProcedureBody).IsRequired(); b.Property(x => x.DataSourceCode).IsRequired().HasMaxLength(128); b.Property(x => x.Status).IsRequired(); b.Property(x => x.Category).HasMaxLength(128); - b.Property(x => x.Parameters).HasMaxLength(4000); + b.Property(x => x.Parameters).HasMaxLength(4096); b.HasIndex(x => new { x.SchemaName, x.ProcedureName }); b.HasIndex(x => x.DataSourceCode); @@ -64,7 +64,7 @@ public static class SqlQueryManagerDbContextModelCreatingExtensions b.Property(x => x.ViewName).IsRequired().HasMaxLength(128); b.Property(x => x.SchemaName).IsRequired().HasMaxLength(128); b.Property(x => x.DisplayName).IsRequired().HasMaxLength(256); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.ViewDefinition).IsRequired(); b.Property(x => x.DataSourceCode).IsRequired().HasMaxLength(128); b.Property(x => x.Status).IsRequired(); @@ -85,14 +85,14 @@ public static class SqlQueryManagerDbContextModelCreatingExtensions b.Property(x => x.FunctionName).IsRequired().HasMaxLength(128); b.Property(x => x.SchemaName).IsRequired().HasMaxLength(128); b.Property(x => x.DisplayName).IsRequired().HasMaxLength(256); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.FunctionType).IsRequired(); b.Property(x => x.FunctionBody).IsRequired(); b.Property(x => x.ReturnType).IsRequired().HasMaxLength(256); b.Property(x => x.DataSourceCode).IsRequired().HasMaxLength(128); b.Property(x => x.Status).IsRequired(); b.Property(x => x.Category).HasMaxLength(128); - b.Property(x => x.Parameters).HasMaxLength(4000); + b.Property(x => x.Parameters).HasMaxLength(4096); b.HasIndex(x => new { x.SchemaName, x.FunctionName }); b.HasIndex(x => x.DataSourceCode); diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs index ddb9736a..6470a38d 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs @@ -3860,8 +3860,8 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group", Items =[ new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "StartHour", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.TimeSpanOptions }, - new EditingFormItemDto { Order = 3, DataField = "EndHour", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.TimeSpanOptions }, + new EditingFormItemDto { Order = 2, DataField = "StartTime", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.TimeSpanOptions }, + new EditingFormItemDto { Order = 3, DataField = "EndTime", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.TimeSpanOptions }, new EditingFormItemDto { Order = 4, DataField = "Monday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, new EditingFormItemDto { Order = 5, DataField = "Tuesday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, new EditingFormItemDto { Order = 6, DataField = "Wednesday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, @@ -3925,7 +3925,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.Date, - FieldName = "StartHour", + FieldName = "StartTime", Width = 150, ListOrderNo = 3, Visible = true, @@ -3940,7 +3940,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.Date, - FieldName = "EndHour", + FieldName = "EndTime", Width = 150, ListOrderNo = 4, Visible = true, diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/WorkHour.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/WorkHour.cs index fde90111..a8d23b4a 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/WorkHour.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/WorkHour.cs @@ -9,8 +9,8 @@ public class WorkHour : FullAuditedEntity, IMultiTenant public Guid? TenantId { get; set; } public string Name { get; set; } - public DateTime StartHour { get; set; } - public DateTime EndHour { get; set; } + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } public bool? Monday { get; set; } public bool? Tuesday { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/PlanWizard.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/PlanWizard.cs index 8cb3f581..88b58be6 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/PlanWizard.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/PlanWizard.cs @@ -28,5 +28,5 @@ public class PlanWizard : FullAuditedEntity, IMultiTenant // Collections public string RequiredSkillsJson { get; set; } public List Materials { get; set; } - public List Employees { get; set; } + public List Employees { get; set; } } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/PlanWizardEmployee.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/PlanWizardEmployee.cs index 9d4f7da2..a437611d 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/PlanWizardEmployee.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/PlanWizardEmployee.cs @@ -4,7 +4,7 @@ using Volo.Abp.MultiTenancy; namespace Erp.Platform.Entities; -public class PlanEmployee : FullAuditedEntity, IMultiTenant +public class PlanWizardEmployee : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/WorkorderType.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/WorkorderType.cs index 69359db8..cb081193 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/WorkorderType.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/WorkorderType.cs @@ -9,7 +9,6 @@ public class WorkorderType : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } - public string Code { get; set; } public string Name { get; set; } public string Description { get; set; } public bool IsActive { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Quotation.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Quotation.cs index 54afe697..3f533aa5 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Quotation.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Quotation.cs @@ -11,7 +11,10 @@ public class Quotation : FullAuditedEntity, IMultiTenant public Guid? TenantId { get; set; } public string QuotationNumber { get; set; } - public string RequestId { get; set; } + + public Guid RequestId { get; set; } + public Request Request { get; set; } + public string RequestTitle { get; set; } public string RequestTypeId { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Request.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Request.cs index 64b6238c..223b2ae1 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Request.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Request.cs @@ -30,5 +30,6 @@ public class Request : FullAuditedEntity, IMultiTenant public List Items { get; set; } = []; public ICollection PurchaseOrders { get; set; } + public ICollection Quotations { get; set; } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 76e20a97..f64586bd 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -359,6 +359,8 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(a => a.Name).IsRequired().HasMaxLength(128); + b.Property(a => a.Description).HasMaxLength(256); + b.Property(a => a.ApiUrl).HasMaxLength(256); }); builder.Entity(b => @@ -406,10 +408,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.GlobalSearch)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.System).HasMaxLength(50); - b.Property(a => a.Group).HasMaxLength(50); + b.Property(a => a.System).HasMaxLength(64); + b.Property(a => a.Group).HasMaxLength(64); b.Property(a => a.Term).IsRequired().HasMaxLength(256); - b.Property(a => a.Weight).HasMaxLength(50); + b.Property(a => a.Weight).HasMaxLength(64); b.Property(a => a.Url).HasMaxLength(512); }); @@ -442,18 +444,18 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Menu)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.Code).IsRequired().HasMaxLength(100); - b.Property(a => a.DisplayName).IsRequired().HasMaxLength(100); - b.Property(a => a.Url).HasMaxLength(250); - b.Property(a => a.Icon).HasMaxLength(50); - b.Property(a => a.ParentCode).HasMaxLength(50); + b.Property(a => a.Code).IsRequired().HasMaxLength(128); + b.Property(a => a.DisplayName).IsRequired().HasMaxLength(128); + b.Property(a => a.Url).HasMaxLength(256); + b.Property(a => a.Icon).HasMaxLength(64); + b.Property(a => a.ParentCode).HasMaxLength(64); b.Property(a => a.CssClass).HasMaxLength(128); b.Property(a => a.RequiredPermissionName).HasMaxLength(128); - b.Property(a => a.Target).HasMaxLength(50); - b.Property(a => a.ElementId).HasMaxLength(50); + b.Property(a => a.Target).HasMaxLength(64); + b.Property(a => a.ElementId).HasMaxLength(64); b.Property(a => a.UserId).HasMaxLength(256); b.Property(a => a.RoleId).HasMaxLength(256); - b.Property(a => a.CultureName).HasMaxLength(50); + b.Property(a => a.CultureName).HasMaxLength(64); }); builder.Entity(b => @@ -461,7 +463,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.DataSource)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.Code).IsRequired().HasMaxLength(100); + b.Property(a => a.Code).IsRequired().HasMaxLength(128); b.Property(a => a.ConnectionString).HasMaxLength(256); b.Property(a => a.DataSourceType).IsRequired(); }); @@ -476,10 +478,10 @@ public class PlatformDbContext : // Özellikler b.Property(a => a.ListFormCode).IsRequired().HasMaxLength(64); - b.Property(a => a.CultureName).HasMaxLength(10); - b.Property(a => a.DataSourceCode).HasMaxLength(100); + b.Property(a => a.CultureName).HasMaxLength(10).IsRequired(); + b.Property(a => a.DataSourceCode).HasMaxLength(128); b.Property(a => a.TableName).HasMaxLength(128); - b.Property(a => a.KeyFieldName).HasMaxLength(50); + b.Property(a => a.KeyFieldName).HasMaxLength(64); b.Property(a => a.Name).HasMaxLength(128); b.Property(a => a.Description).HasMaxLength(512); b.Property(a => a.Title).HasMaxLength(256); @@ -563,9 +565,9 @@ public class PlatformDbContext : 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.CultureName).HasMaxLength(10); - b.Property(a => a.FieldName).IsRequired().HasMaxLength(100); - b.Property(a => a.CaptionName).HasMaxLength(200); + b.Property(a => a.CultureName).HasMaxLength(10).IsRequired(); + b.Property(a => a.FieldName).IsRequired().HasMaxLength(128); + b.Property(a => a.CaptionName).HasMaxLength(256); // Varsayılan değerler b.Property(a => a.AllowSearch).HasDefaultValue(false); @@ -592,10 +594,10 @@ public class PlatformDbContext : b.Property(a => a.PivotSettingsJson).HasColumnType("text"); // Stil ve format - b.Property(a => a.ColumnCssClass).HasMaxLength(100); + b.Property(a => a.ColumnCssClass).HasMaxLength(128); 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.Format).HasMaxLength(128); b.Property(a => a.EditorOptions).HasColumnType("text"); }); @@ -640,9 +642,11 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Note)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Type).IsRequired(); + b.Property(x => x.Type).IsRequired().HasMaxLength(64); b.Property(x => x.Subject).IsRequired().HasMaxLength(256); - b.Property(x => x.Content).IsRequired().HasMaxLength(2000); + b.Property(x => x.Content).IsRequired().HasMaxLength(2048); + b.Property(x => x.EntityName).IsRequired().HasMaxLength(128); + b.Property(x => x.EntityId).IsRequired().HasMaxLength(64); }); builder.Entity(b => @@ -650,13 +654,13 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.BackgroundWorker)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.Name).IsRequired().HasMaxLength(100); - b.Property(a => a.Cron).IsRequired().HasMaxLength(50); + b.Property(a => a.Name).IsRequired().HasMaxLength(128); + b.Property(a => a.Cron).IsRequired().HasMaxLength(64); b.Property(a => a.WorkerType).IsRequired(); b.Property(a => a.IsActive).HasDefaultValue(true); - 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.DataSourceCode).HasMaxLength(64); + b.Property(a => a.BeforeSp).HasMaxLength(128); + b.Property(a => a.AfterSp).HasMaxLength(128); b.Property(a => a.Options).HasColumnType("text"); }); @@ -669,6 +673,7 @@ public class PlatformDbContext : b.Property(x => x.Slug).IsRequired().HasMaxLength(128); b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Icon).HasMaxLength(64); + b.Property(x => x.LastPostUserName).HasMaxLength(256); b.HasIndex(x => x.DisplayOrder); @@ -725,12 +730,13 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.HasKey(x => x.Id); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.DisplayName).IsRequired().HasMaxLength(100); - b.Property(x => x.TableName).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.MigrationStatus).IsRequired().HasMaxLength(50); - b.Property(x => x.EndpointStatus).IsRequired().HasMaxLength(50); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.DisplayName).IsRequired().HasMaxLength(128); + b.Property(x => x.TableName).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.MigrationStatus).IsRequired().HasMaxLength(64); + b.Property(x => x.EndpointStatus).IsRequired().HasMaxLength(64); + b.Property(x => x.Menu).IsRequired().HasMaxLength(128); b.HasMany(x => x.Fields) .WithOne(x => x.Entity) @@ -744,9 +750,9 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.HasKey(x => x.Id); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Type).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Type).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.DefaultValue).HasMaxLength(256); }); @@ -756,11 +762,11 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.HasKey(x => x.Id); - b.Property(x => x.EntityName).IsRequired().HasMaxLength(100); - b.Property(x => x.FileName).IsRequired().HasMaxLength(200); + b.Property(x => x.EntityName).IsRequired().HasMaxLength(128); + b.Property(x => x.FileName).IsRequired().HasMaxLength(256); b.Property(x => x.SqlScript).IsRequired(); - b.Property(x => x.Status).IsRequired().HasMaxLength(50); - b.Property(x => x.ErrorMessage).HasMaxLength(1000); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); + b.Property(x => x.ErrorMessage).HasMaxLength(1024); b.HasOne(x => x.Entity) .WithMany() @@ -774,10 +780,10 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.HasKey(x => x.Id); - b.Property(x => x.EntityName).IsRequired().HasMaxLength(100); + b.Property(x => x.EntityName).IsRequired().HasMaxLength(128); b.Property(x => x.Method).IsRequired().HasMaxLength(10); - b.Property(x => x.Path).IsRequired().HasMaxLength(200); - b.Property(x => x.OperationType).IsRequired().HasMaxLength(50); + b.Property(x => x.Path).IsRequired().HasMaxLength(256); + b.Property(x => x.OperationType).IsRequired().HasMaxLength(64); b.Property(x => x.CsharpCode).IsRequired(); b.HasOne(x => x.Entity) @@ -795,7 +801,7 @@ public class PlatformDbContext : b.Property(a => a.Description).HasMaxLength(512); b.Property(a => a.Url).IsRequired().HasMaxLength(256); b.Property(a => a.Method).IsRequired().HasMaxLength(10); - b.Property(a => a.DataSourceCode).IsRequired().HasMaxLength(100); + b.Property(a => a.DataSourceCode).IsRequired().HasMaxLength(128); b.Property(a => a.Sql).IsRequired(); b.Property(a => a.ParametersJson).HasColumnType("text"); b.Property(a => a.PermissionsJson).HasColumnType("text"); @@ -807,11 +813,11 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.HasKey(x => x.Id); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Code).IsRequired(); - b.Property(x => x.Props).HasMaxLength(1000); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.Dependencies).HasMaxLength(2000); + b.Property(x => x.Props).HasMaxLength(1024); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Dependencies).HasMaxLength(2048); }); builder.Entity(b => @@ -820,7 +826,7 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(256); - b.Property(x => x.Description).HasMaxLength(4000); // JSON string + b.Property(x => x.Description).HasMaxLength(4096); // JSON string b.Property(x => x.Icon).HasMaxLength(64); b.HasMany(x => x.ReportTemplates) @@ -836,9 +842,9 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(256); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.HtmlContent).IsRequired(); - b.Property(x => x.Tags).HasMaxLength(2000); + b.Property(x => x.Tags).HasMaxLength(2048); b.HasMany(t => t.Parameters) .WithOne(p => p.ReportTemplate) @@ -857,12 +863,12 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.TemplateId).IsRequired(); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Placeholder).HasMaxLength(200); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Placeholder).HasMaxLength(256); b.Property(x => x.Type).IsRequired(); - b.Property(x => x.DefaultValue).HasMaxLength(500); + b.Property(x => x.DefaultValue).HasMaxLength(512); b.Property(x => x.Required).IsRequired(); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); }); builder.Entity(b => @@ -873,7 +879,7 @@ public class PlatformDbContext : b.Property(x => x.TemplateId).IsRequired(false); b.Property(x => x.TemplateName).IsRequired().HasMaxLength(256); b.Property(x => x.GeneratedContent).IsRequired(); - b.Property(x => x.Parameters).HasMaxLength(4000); // JSON string + b.Property(x => x.Parameters).HasMaxLength(4096); // JSON string }); //Administration @@ -920,7 +926,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Currency)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); + b.Property(x => x.Id).HasMaxLength(64); b.Property(x => x.Symbol).HasMaxLength(8); b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Rate).HasPrecision(18, 6); @@ -1064,8 +1070,8 @@ public class PlatformDbContext : b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Status).HasMaxLength(20); - b.Property(x => x.StartTime).HasMaxLength(5); - b.Property(x => x.EndTime).HasMaxLength(5); + b.Property(x => x.StartTime).HasMaxLength(8); + b.Property(x => x.EndTime).HasMaxLength(8); b.Property(x => x.LunchTime).HasMaxLength(5); @@ -1088,8 +1094,8 @@ public class PlatformDbContext : // Properties b.Property(x => x.Day).HasMaxLength(20); - b.Property(x => x.StartTime).HasMaxLength(5); - b.Property(x => x.EndTime).HasMaxLength(5); + b.Property(x => x.StartTime).HasMaxLength(8); + b.Property(x => x.EndTime).HasMaxLength(8); }); builder.Entity(b => @@ -1097,8 +1103,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Program)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(100).IsRequired(); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Name).HasMaxLength(128).IsRequired(); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -1106,8 +1112,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.RegistrationType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); + b.Property(x => x.Status).HasMaxLength(20); // RegistrationType -> Methods (1 - N) b.HasMany(x => x.Methods) @@ -1132,8 +1138,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.RegistrationMethod)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Name).HasMaxLength(64); + b.Property(x => x.Status).HasMaxLength(20); b.HasOne(x => x.Branch) .WithMany(x => x.RegistrationMethods) @@ -1187,8 +1193,8 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.LevelType).HasMaxLength(15); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); + b.Property(x => x.Status).HasMaxLength(20); b.Property(x => x.MonthlyPaymentRate).HasPrecision(18, 4); b.HasOne(x => x.Branch) @@ -1202,8 +1208,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Interesting)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -1211,8 +1217,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Source)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -1220,7 +1226,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.NoteType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); }); builder.Entity(b => @@ -1236,8 +1242,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EducationStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50).IsRequired(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); + b.Property(x => x.Id).HasMaxLength(64).IsRequired(); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); }); builder.Entity(b => @@ -1261,9 +1267,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Event)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Place).HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Place).HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.Status).HasMaxLength(20); b.Property(x => x.isPublished).HasDefaultValue(false); @@ -1288,7 +1294,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventPhoto)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Url).HasMaxLength(500); + b.Property(x => x.Url).HasMaxLength(512); // Event -> EventPhoto (1 - N) b.HasOne(x => x.Event) @@ -1302,7 +1308,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventComment)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Content).HasMaxLength(500); + b.Property(x => x.Content).HasMaxLength(512); b.Property(x => x.Likes).HasDefaultValue(0); // Event -> EventComment (1 - N) @@ -1317,9 +1323,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesRejectionReason)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); - b.Property(x => x.Category).HasMaxLength(50); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); + b.Property(x => x.Category).HasMaxLength(64); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -1327,8 +1333,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ClassCancellationReason)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -1336,7 +1342,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.LessonPeriod)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); b.Property(x => x.Day).HasMaxLength(10); b.Property(x => x.Lesson1).HasMaxLength(10); @@ -1355,9 +1361,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.MeetingMethod)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); - b.Property(x => x.Type).HasMaxLength(50).IsRequired(); - b.Property(x => x.Status).HasMaxLength(10).IsRequired(); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); + b.Property(x => x.Type).HasMaxLength(64).IsRequired(); + b.Property(x => x.Status).HasMaxLength(20).IsRequired(); }); builder.Entity(b => @@ -1365,9 +1371,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.MeetingResult)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); b.Property(x => x.Order); - b.Property(x => x.Status).HasMaxLength(10).IsRequired(); + b.Property(x => x.Status).HasMaxLength(20).IsRequired(); }); builder.Entity(b => @@ -1383,11 +1389,11 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Psychologist)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(100).IsRequired(); + b.Property(x => x.Name).HasMaxLength(128).IsRequired(); b.Property(x => x.PhoneNumber).HasMaxLength(20); - b.Property(x => x.Email).HasMaxLength(100); - b.Property(x => x.Address).HasMaxLength(250); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Email).HasMaxLength(128); + b.Property(x => x.Address).HasMaxLength(256); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -1395,7 +1401,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Vaccine)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(100).IsRequired(); + b.Property(x => x.Name).HasMaxLength(128).IsRequired(); }); builder.Entity(b => @@ -1403,17 +1409,17 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Lawyer)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(100).IsRequired(); - b.Property(x => x.Email).HasMaxLength(100); - b.Property(x => x.Address).HasMaxLength(250); - b.Property(x => x.TaxOffice).HasMaxLength(50); + b.Property(x => x.Name).HasMaxLength(128).IsRequired(); + b.Property(x => x.Email).HasMaxLength(128); + b.Property(x => x.Address).HasMaxLength(256); + b.Property(x => x.TaxOffice).HasMaxLength(64); b.Property(x => x.PhoneNumber).HasMaxLength(20); b.Property(x => x.MobileNumber).HasMaxLength(20); b.Property(x => x.FaxNumber).HasMaxLength(20); - b.Property(x => x.Description).HasMaxLength(1000); - b.Property(x => x.Status).HasMaxLength(10); + b.Property(x => x.Description).HasMaxLength(1024); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -1424,7 +1430,7 @@ public class PlatformDbContext : b.Property(x => x.Date).IsRequired(); b.Property(x => x.Type).HasMaxLength(20); b.Property(x => x.TotalCalorie).HasPrecision(9, 2); - b.Property(x => x.Materials).HasMaxLength(500); + b.Property(x => x.Materials).HasMaxLength(512); b.HasOne(x => x.Branch) .WithMany(x => x.Meals) @@ -1446,20 +1452,20 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Plate).HasMaxLength(10).IsRequired(); - b.Property(x => x.Brand).HasMaxLength(50); + b.Property(x => x.Brand).HasMaxLength(64); b.Property(x => x.ModelYear); b.Property(x => x.DriverNationalId).HasMaxLength(11); - b.Property(x => x.DriverName).HasMaxLength(50); + b.Property(x => x.DriverName).HasMaxLength(64); b.Property(x => x.DriverPhone1).HasMaxLength(20); b.Property(x => x.DriverPhone2).HasMaxLength(20); b.Property(x => x.AssistantDriverNationalId).HasMaxLength(11); - b.Property(x => x.AssistantDriverName).HasMaxLength(50); + b.Property(x => x.AssistantDriverName).HasMaxLength(64); b.Property(x => x.AssistantDriverPhone1).HasMaxLength(20); b.Property(x => x.AssistantDriverPhone2).HasMaxLength(20); - b.Property(x => x.Status).HasMaxLength(5); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -1467,9 +1473,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WorkHour)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(50).IsRequired(); - b.Property(x => x.StartHour).HasMaxLength(8).IsRequired(); - b.Property(x => x.EndHour).HasMaxLength(8).IsRequired(); + b.Property(x => x.Name).HasMaxLength(64).IsRequired(); + b.Property(x => x.StartTime).HasMaxLength(8).IsRequired(); + b.Property(x => x.EndTime).HasMaxLength(8).IsRequired(); b.Property(x => x.Monday); b.Property(x => x.Tuesday); @@ -1499,6 +1505,7 @@ public class PlatformDbContext : b.Property(x => x.Title).IsRequired().HasMaxLength(128); b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Icon).HasMaxLength(64); + b.Property(x => x.Type).HasMaxLength(64); b.Property(x => x.Features) .HasConversion( @@ -1522,11 +1529,11 @@ public class PlatformDbContext : b.HasKey(x => x.Id); b.Property(x => x.Name).IsRequired().HasMaxLength(128); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.Category).IsRequired().HasMaxLength(64); b.Property(x => x.MonthlyPrice).HasPrecision(18, 2); b.Property(x => x.YearlyPrice).HasPrecision(18, 2); - b.Property(x => x.ImageUrl).HasMaxLength(300); + b.Property(x => x.ImageUrl).HasMaxLength(512); }); builder.Entity(b => @@ -1576,7 +1583,7 @@ public class PlatformDbContext : b.Property(o => o.Commission).IsRequired().HasPrecision(18, 2); b.Property(o => o.Total).IsRequired().HasPrecision(18, 2); - b.Property(o => o.PaymentDataJson).HasMaxLength(4000); + b.Property(o => o.PaymentDataJson).HasMaxLength(4096); b.HasMany(o => o.Items) .WithOne(i => i.Order) @@ -1618,6 +1625,7 @@ public class PlatformDbContext : b.Property(x => x.ContentTr).IsRequired(); b.Property(x => x.ContentEn).IsRequired(); b.Property(x => x.CoverImage).HasMaxLength(512); + b.Property(x => x.ReadTime).HasMaxLength(64); b.HasIndex(x => x.Slug); b.HasIndex(x => x.IsPublished); @@ -1646,7 +1654,7 @@ public class PlatformDbContext : b.Property(x => x.Address).IsRequired().HasMaxLength(512); b.Property(x => x.NumberOfBranches).IsRequired(); b.Property(x => x.NumberOfUsers).IsRequired(); - b.Property(x => x.Message).IsRequired().HasMaxLength(2000); + b.Property(x => x.Message).IsRequired().HasMaxLength(2048); }); builder.Entity(b => @@ -1654,10 +1662,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Contact)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Address).HasMaxLength(500); + b.Property(x => x.Address).HasMaxLength(512); b.Property(x => x.PhoneNumber).HasMaxLength(20); - b.Property(x => x.Email).HasMaxLength(150); - b.Property(x => x.Location).HasMaxLength(150); + b.Property(x => x.Email).HasMaxLength(128); + b.Property(x => x.Location).HasMaxLength(256); b.Property(x => x.BankJson).HasColumnType("text"); b.Property(x => x.WorkHoursJson).HasColumnType("text"); @@ -1670,10 +1678,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Classroom)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(1000); - b.Property(x => x.Subject).HasMaxLength(100); - b.Property(x => x.TeacherName).IsRequired().HasMaxLength(100); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(1024); + b.Property(x => x.Subject).HasMaxLength(128); + b.Property(x => x.TeacherName).IsRequired().HasMaxLength(128); b.HasIndex(x => x.TeacherId); b.HasIndex(x => x.ScheduledStartTime); @@ -1699,8 +1707,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ClassroomParticipant)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.UserName).IsRequired().HasMaxLength(100); - b.Property(x => x.ConnectionId).HasMaxLength(100); + b.Property(x => x.UserName).IsRequired().HasMaxLength(128); + b.Property(x => x.ConnectionId).HasMaxLength(128); b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.IsKicked).HasDefaultValue(false); @@ -1714,7 +1722,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ClassroomAttandance)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.StudentName).IsRequired().HasMaxLength(100); + b.Property(x => x.StudentName).IsRequired().HasMaxLength(128); b.HasIndex(x => x.SessionId); b.HasIndex(x => x.StudentId); @@ -1726,8 +1734,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ClassroomChat)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.SenderName).IsRequired().HasMaxLength(100); - b.Property(x => x.Message).IsRequired().HasMaxLength(2000); + b.Property(x => x.SenderName).IsRequired().HasMaxLength(128); + b.Property(x => x.Message).IsRequired().HasMaxLength(2048); + b.Property(x => x.MessageType).HasMaxLength(64); + b.Property(x => x.RecipientName).HasMaxLength(256); b.HasIndex(x => x.SessionId); b.HasIndex(x => x.SenderId); @@ -1739,9 +1749,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuestionTag)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.Color).HasMaxLength(7); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Color).HasMaxLength(10); b.Property(x => x.UsageCount).HasDefaultValue(0); }); @@ -1750,9 +1760,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuestionPool)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.Tags).HasMaxLength(500); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Tags).HasMaxLength(512); }); builder.Entity(b => @@ -1760,16 +1770,16 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Question)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.QuestionType).IsRequired().HasMaxLength(100); + b.Property(x => x.QuestionType).IsRequired().HasMaxLength(128); b.Property(x => x.Points).HasDefaultValue(0); - b.Property(x => x.Title).IsRequired().HasMaxLength(500); - b.Property(x => x.Content).HasMaxLength(500); - b.Property(x => x.MediaUrl).HasMaxLength(500); + b.Property(x => x.Title).IsRequired().HasMaxLength(512); + b.Property(x => x.Content).HasMaxLength(512); + b.Property(x => x.MediaUrl).HasMaxLength(512); b.Property(x => x.MediaType).HasMaxLength(10); - b.Property(x => x.CorrectAnswer).HasMaxLength(500); + b.Property(x => x.CorrectAnswer).HasMaxLength(512); b.Property(x => x.Difficulty).HasMaxLength(10); b.Property(x => x.TimeLimit).HasDefaultValue(0); - b.Property(x => x.Explanation).HasMaxLength(500); + b.Property(x => x.Explanation).HasMaxLength(512); }); builder.Entity(b => @@ -1777,7 +1787,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuestionOption)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Text).HasMaxLength(100); + b.Property(x => x.Text).HasMaxLength(128); b.Property(x => x.IsCorrect).HasDefaultValue(false); }); @@ -1822,10 +1832,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Cash)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.Currency).IsRequired().HasMaxLength(10); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Currency).IsRequired().HasMaxLength(8); b.Property(x => x.Balance).HasPrecision(18, 4).HasDefaultValue(0); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -1835,9 +1845,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CurrentAccount)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(p => p.Code).IsRequired().HasMaxLength(50); - b.Property(p => p.Name).IsRequired().HasMaxLength(100); - b.Property(p => p.Description).HasMaxLength(500); + b.Property(p => p.Code).IsRequired().HasMaxLength(64); + b.Property(p => p.Name).IsRequired().HasMaxLength(128); + b.Property(p => p.Description).HasMaxLength(512); b.Property(p => p.TaxOffice).HasMaxLength(128); b.Property(p => p.CreditLimit).HasPrecision(18, 4).HasDefaultValue(0); b.Property(p => p.Balance).HasPrecision(18, 4).HasDefaultValue(0); @@ -1851,7 +1861,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EmploymentType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); }); builder.Entity(b => @@ -1859,10 +1869,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.JobPosition)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); b.Property(x => x.Name).IsRequired().HasMaxLength(150); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.Level).HasMaxLength(50); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Level).HasMaxLength(64); b.Property(x => x.RequiredSkills).HasColumnType("text"); b.Property(x => x.Responsibilities).HasColumnType("text"); b.Property(x => x.Qualifications).HasColumnType("text"); @@ -1882,15 +1892,15 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Badge)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); b.Property(x => x.Name).IsRequired().HasMaxLength(150); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Icon).HasMaxLength(10); - b.Property(x => x.Color).HasMaxLength(20); + b.Property(x => x.Color).HasMaxLength(10); b.Property(x => x.BackgroundColor).HasMaxLength(20); - b.Property(x => x.Category).HasMaxLength(100); - b.Property(x => x.Criteria).HasMaxLength(500); - b.Property(x => x.Rarity).HasMaxLength(50); + b.Property(x => x.Category).HasMaxLength(128); + b.Property(x => x.Criteria).HasMaxLength(512); + b.Property(x => x.Rarity).HasMaxLength(64); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -1900,8 +1910,8 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Code).IsRequired().HasMaxLength(20); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Budget).HasDefaultValue(0); b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.Budget).HasPrecision(18, 4); @@ -1927,14 +1937,15 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CostCenter)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.FiscalYear).HasMaxLength(10); b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.ActualAmount).HasPrecision(18, 4); b.Property(x => x.BudgetedAmount).HasPrecision(18, 4); b.Property(x => x.Currency).IsRequired().HasMaxLength(8); + b.Property(x => x.CostCenterType).HasMaxLength(64); b.HasOne(x => x.ParentCostCenter) .WithMany(x => x.SubCostCenters) @@ -1956,19 +1967,32 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Employee)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Email).HasMaxLength(150); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Email).HasMaxLength(128); b.Property(x => x.PhoneNumber).HasMaxLength(20); b.Property(x => x.MobileNumber).HasMaxLength(20); - b.Property(x => x.Avatar).HasMaxLength(250); - b.Property(x => x.NationalId).HasMaxLength(20); - b.Property(x => x.IbanNumber).HasMaxLength(50); - b.Property(x => x.PayrollGroup).HasMaxLength(50); - b.Property(x => x.WorkLocation).HasMaxLength(150); + b.Property(x => x.Avatar).HasMaxLength(256); + b.Property(x => x.NationalId).HasMaxLength(11); + b.Property(x => x.IbanNumber).HasMaxLength(64); + b.Property(x => x.PayrollGroup).HasMaxLength(64); + b.Property(x => x.WorkLocation).HasMaxLength(128); b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.BaseSalary).HasPrecision(18, 2); b.Property(x => x.Currency).IsRequired().HasMaxLength(8); + b.Property(x => x.Gender).HasMaxLength(10); + b.Property(x => x.MaritalStatus).HasMaxLength(20); + b.Property(x => x.Country).HasMaxLength(8); + b.Property(x => x.City).HasMaxLength(16); + b.Property(x => x.District).HasMaxLength(128); + b.Property(x => x.Township).HasMaxLength(128); + b.Property(x => x.PostalCode).HasMaxLength(16); + b.Property(x => x.Address1).HasMaxLength(1024); + b.Property(x => x.Address2).HasMaxLength(1024); + b.Property(x => x.EmployeeStatus).HasMaxLength(20); + b.Property(x => x.EmergencyContactName).HasMaxLength(256); + b.Property(x => x.EmergencyContactRelationship).HasMaxLength(128); + b.Property(x => x.EmergencyContactPhoneNumber).HasMaxLength(20); b.HasOne(x => x.JobPosition) .WithMany() @@ -1996,14 +2020,14 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.EmployeeId).IsRequired(); - b.Property(x => x.LeaveType).IsRequired(); + b.Property(x => x.LeaveType).IsRequired().HasMaxLength(128); b.Property(x => x.StartDate).IsRequired(); b.Property(x => x.EndDate).IsRequired(); b.Property(x => x.TotalDays).HasPrecision(18, 2); - b.Property(x => x.Reason).HasMaxLength(500); + b.Property(x => x.Reason).HasMaxLength(1024); b.Property(x => x.Status).IsRequired().HasMaxLength(20); - b.Property(x => x.RejectionReason).HasMaxLength(500); - b.Property(x => x.Attachments).HasMaxLength(2000); + b.Property(x => x.RejectionReason).HasMaxLength(1024); + b.Property(x => x.Attachments).HasMaxLength(2048); b.HasOne(x => x.Employee) .WithMany(e => e.Leaves) @@ -2019,11 +2043,12 @@ public class PlatformDbContext : b.Property(x => x.EmployeeId).IsRequired(); b.Property(x => x.Date).IsRequired(); - b.Property(x => x.StartTime).IsRequired().HasMaxLength(10); - b.Property(x => x.EndTime).IsRequired().HasMaxLength(10); + b.Property(x => x.StartTime).IsRequired().HasMaxLength(8); + b.Property(x => x.EndTime).IsRequired().HasMaxLength(8); b.Property(x => x.TotalHours).IsRequired().HasPrecision(18, 2); - b.Property(x => x.Reason).HasMaxLength(1000); - b.Property(x => x.Status).IsRequired(); + b.Property(x => x.Reason).HasMaxLength(1024); + b.Property(x => x.RejectionReason).HasMaxLength(1024); + b.Property(x => x.Status).IsRequired().HasMaxLength(20); b.Property(x => x.Rate).IsRequired().HasPrecision(18, 2); b.Property(x => x.Amount).HasPrecision(18, 2); @@ -2047,6 +2072,7 @@ public class PlatformDbContext : b.Property(x => x.GrossSalary).HasPrecision(18, 2); b.Property(x => x.NetSalary).HasPrecision(18, 2); b.Property(x => x.SocialSecurity).HasPrecision(18, 2); + b.Property(x => x.Status).HasMaxLength(20); }); builder.Entity(b => @@ -2054,7 +2080,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PayrollItem)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Amount).HasPrecision(18, 2); b.Property(x => x.ItemType).IsRequired().HasMaxLength(20); b.Property(x => x.Taxable).HasDefaultValue(false); @@ -2072,10 +2098,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Template360)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); - b.Property(x => x.AssessorTypes).HasMaxLength(500); + b.Property(x => x.AssessorTypes).HasMaxLength(512); b.Property(x => x.QuestionGroupsJson).HasColumnType("text"); }); @@ -2085,10 +2111,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Performance360)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.Status).HasMaxLength(10); - b.Property(x => x.TargetEmployees).HasMaxLength(4000); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Status).HasMaxLength(20); + b.Property(x => x.TargetEmployees).HasMaxLength(4096); b.HasOne(x => x.Template) .WithMany(e => e.Performans360s) @@ -2108,14 +2134,14 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Training)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Title).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(1000); - b.Property(x => x.Instructor).IsRequired().HasMaxLength(100); - b.Property(x => x.Category).IsRequired().HasMaxLength(50); - b.Property(x => x.Type).IsRequired().HasMaxLength(50); - b.Property(x => x.Status).IsRequired().HasMaxLength(50); - b.Property(x => x.Location).IsRequired().HasMaxLength(200); - b.Property(x => x.Thumbnail).HasMaxLength(500); + b.Property(x => x.Title).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(1024); + b.Property(x => x.Instructor).IsRequired().HasMaxLength(128); + b.Property(x => x.Category).IsRequired().HasMaxLength(64); + b.Property(x => x.Type).IsRequired().HasMaxLength(64); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); + b.Property(x => x.Location).IsRequired().HasMaxLength(256); + b.Property(x => x.Thumbnail).HasMaxLength(512); b.Property(x => x.Duration).HasDefaultValue(0); b.Property(x => x.MaxParticipants).HasDefaultValue(0); b.Property(x => x.Enrolled).HasDefaultValue(0); @@ -2128,7 +2154,7 @@ public class PlatformDbContext : b.Property(x => x.EmployeeId).IsRequired(); b.Property(x => x.IssueDate).IsRequired(); - b.Property(x => x.CertificateUrl).HasMaxLength(300); + b.Property(x => x.CertificateUrl).HasMaxLength(512); b.HasOne(x => x.Training) .WithMany(e => e.Certificates) @@ -2148,12 +2174,12 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Reservation)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Type).IsRequired().HasMaxLength(50); + b.Property(x => x.Type).IsRequired().HasMaxLength(64); b.Property(x => x.EmployeeId).IsRequired(); - b.Property(x => x.ResourceName).IsRequired().HasMaxLength(200); - b.Property(x => x.Purpose).IsRequired().HasMaxLength(500); - b.Property(x => x.Notes).HasMaxLength(1000); - b.Property(x => x.Status).IsRequired().HasMaxLength(50); + b.Property(x => x.ResourceName).IsRequired().HasMaxLength(256); + b.Property(x => x.Purpose).IsRequired().HasMaxLength(512); + b.Property(x => x.Notes).HasMaxLength(1024); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); b.HasOne(x => x.Employee) .WithMany(e => e.Reservations) @@ -2174,6 +2200,7 @@ public class PlatformDbContext : b.Property(x => x.Type).HasMaxLength(20); b.Property(x => x.Capacity).HasDefaultValue(0); b.Property(x => x.Available).HasDefaultValue(0); + b.Property(x => x.Route).HasMaxLength(128); }); builder.Entity(b => @@ -2181,14 +2208,14 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Announcement)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Title).IsRequired().HasMaxLength(200); - b.Property(x => x.Excerpt).IsRequired().HasMaxLength(500); - b.Property(x => x.Content).IsRequired().HasMaxLength(4000); - b.Property(x => x.ImageUrl).HasMaxLength(500); - b.Property(x => x.Category).IsRequired().HasMaxLength(50); + b.Property(x => x.Title).IsRequired().HasMaxLength(256); + b.Property(x => x.Excerpt).IsRequired().HasMaxLength(512); + b.Property(x => x.Content).IsRequired().HasMaxLength(4096); + b.Property(x => x.ImageUrl).HasMaxLength(512); + b.Property(x => x.Category).IsRequired().HasMaxLength(64); b.Property(x => x.PublishDate).IsRequired(); - b.Property(x => x.Departments).HasMaxLength(1000); - b.Property(x => x.Attachments).HasMaxLength(2000); + b.Property(x => x.Departments).HasMaxLength(1024); + b.Property(x => x.Attachments).HasMaxLength(2048); b.Property(x => x.ViewCount).HasDefaultValue(0); b.HasOne(x => x.Employee) @@ -2203,12 +2230,14 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Visitor)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.CompanyName).HasMaxLength(150); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.CompanyName).HasMaxLength(256); b.Property(a => a.PhoneNumber).IsRequired().HasMaxLength(20); - b.Property(x => x.Email).HasMaxLength(150); - b.Property(x => x.Purpose).HasMaxLength(250); + b.Property(x => x.Email).HasMaxLength(128); + b.Property(x => x.Purpose).HasMaxLength(256); b.Property(x => x.Status).IsRequired().HasMaxLength(20); + b.Property(x => x.BadgeNumber).HasMaxLength(64); + b.Property(x => x.Photo).HasMaxLength(256); b.HasOne(x => x.Employee) .WithMany(e => e.Visitors) @@ -2223,14 +2252,14 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.EmployeeId).IsRequired(); - b.Property(x => x.Category).IsRequired().HasMaxLength(50); + b.Property(x => x.Category).IsRequired().HasMaxLength(64); b.Property(x => x.Amount).IsRequired().HasPrecision(18, 2); b.Property(x => x.RequestDate).IsRequired(); - b.Property(x => x.Description).HasMaxLength(1000); - b.Property(x => x.Project).HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(1024); + b.Property(x => x.Project).HasMaxLength(256); b.Property(x => x.Status).IsRequired().HasMaxLength(20); - b.Property(x => x.RejectionReason).HasMaxLength(300); - b.Property(x => x.Notes).HasMaxLength(1000); + b.Property(x => x.RejectionReason).HasMaxLength(1024); + b.Property(x => x.Notes).HasMaxLength(1024); b.Property(x => x.Currency).IsRequired().HasMaxLength(8); b.HasOne(x => x.Employee) @@ -2245,8 +2274,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Survey)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Title).IsRequired().HasMaxLength(250); - b.Property(x => x.Description).HasMaxLength(2000); + b.Property(x => x.Title).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(2048); b.Property(x => x.Deadline).IsRequired(); b.Property(x => x.Responses).HasDefaultValue(0); b.Property(x => x.Status).IsRequired().HasMaxLength(10); @@ -2257,8 +2286,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SurveyQuestion)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.QuestionText).IsRequired().HasMaxLength(1000); - b.Property(x => x.Type).IsRequired().HasMaxLength(50); + b.Property(x => x.QuestionText).IsRequired().HasMaxLength(1024); + b.Property(x => x.Type).IsRequired().HasMaxLength(64); b.HasOne(x => x.Survey) .WithMany(x => x.Questions) @@ -2271,7 +2300,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SurveyQuestionOption)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Text).IsRequired().HasMaxLength(500); + b.Property(x => x.Text).IsRequired().HasMaxLength(512); b.Property(x => x.Order).IsRequired(); b.HasOne(x => x.Question) @@ -2303,8 +2332,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SurveyAnswer)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.QuestionType).IsRequired().HasMaxLength(50); - b.Property(x => x.Value).IsRequired(); + b.Property(x => x.QuestionType).IsRequired().HasMaxLength(64); + b.Property(x => x.Value).IsRequired().HasMaxLength(1024); b.HasOne(x => x.Response) .WithMany(x => x.Answers) @@ -2322,7 +2351,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPost)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Content).IsRequired().HasMaxLength(4000); + b.Property(x => x.Content).IsRequired().HasMaxLength(4096); b.Property(x => x.LikeCount).HasDefaultValue(0); b.Property(x => x.IsOwnPost).HasDefaultValue(false); b.Property(x => x.IsLiked).HasDefaultValue(false); @@ -2354,7 +2383,9 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Type).IsRequired().HasMaxLength(64); - b.Property(x => x.Urls).HasMaxLength(2000); + b.Property(x => x.Urls).HasMaxLength(2048); + b.Property(x => x.PollQuestion).HasMaxLength(512); + b.Property(x => x.PollUserVoteId).HasMaxLength(128); b.HasOne(x => x.SocialPost) .WithOne(p => p.Media) @@ -2380,7 +2411,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialComment)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Content).IsRequired().HasMaxLength(8000); + b.Property(x => x.Content).IsRequired().HasMaxLength(8192); b.HasOne(x => x.SocialPost) .WithMany(x => x.Comments) @@ -2415,9 +2446,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.MaterialType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2426,9 +2457,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.MaterialGroup)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); b.HasOne(x => x.ParentGroup) @@ -2442,9 +2473,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PaymentTerm)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).IsRequired().HasMaxLength(100); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).IsRequired().HasMaxLength(500); + b.Property(x => x.Id).IsRequired().HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).IsRequired().HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2453,9 +2484,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SupplyType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2464,9 +2495,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SupplyCardType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2475,9 +2506,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.RequestType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2486,9 +2517,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CustomerType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2497,9 +2528,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CustomerSegment)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2514,7 +2545,7 @@ public class PlatformDbContext : b.Property(p => p.SectorId).IsRequired().HasMaxLength(128); b.Property(p => p.TaxNumber).IsRequired(); b.Property(p => p.TaxOffice).HasMaxLength(128); - b.Property(p => p.PaymentTermId).IsRequired().HasMaxLength(100); + b.Property(p => p.PaymentTermId).IsRequired().HasMaxLength(128); b.Property(p => p.Country).IsRequired().HasMaxLength(128); b.Property(p => p.City).IsRequired().HasMaxLength(128); b.Property(p => p.District).HasMaxLength(128); @@ -2581,7 +2612,7 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(pb => pb.BankName).IsRequired().HasMaxLength(128); - b.Property(pb => pb.AccountNumber).IsRequired().HasMaxLength(50); + b.Property(pb => pb.AccountNumber).IsRequired().HasMaxLength(64); b.Property(pb => pb.Iban).IsRequired().HasMaxLength(34); b.Property(pb => pb.SwiftCode).HasMaxLength(11); b.Property(pb => pb.AccountOwner).IsRequired().HasMaxLength(128); @@ -2605,8 +2636,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PartnerCertificate)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Certificate).IsRequired().HasMaxLength(50); - b.Property(x => x.Issuer).HasMaxLength(500); + b.Property(x => x.Certificate).IsRequired().HasMaxLength(64); + b.Property(x => x.Issuer).HasMaxLength(512); b.HasOne(x => x.Partner) .WithMany(x => x.Certificates) @@ -2647,7 +2678,7 @@ public class PlatformDbContext : b.Property(x => x.Name).IsRequired().HasMaxLength(256); b.Property(x => x.DisplayName).HasMaxLength(512); - b.Property(x => x.Description).HasMaxLength(2000); + b.Property(x => x.Description).HasMaxLength(2048); b.Property(x => x.Code).IsRequired().HasColumnType("text"); // Uzun C# kod metni için b.Property(x => x.IsActive).IsRequired().HasDefaultValue(true); b.Property(x => x.CompilationStatus).IsRequired().HasConversion().HasMaxLength(20); @@ -2664,11 +2695,11 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Material)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Barcode).HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.TrackingType).HasMaxLength(50); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Barcode).HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.TrackingType).HasMaxLength(64); b.Property(x => x.CostPrice).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.SalesPrice).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.TotalStock).HasPrecision(18, 2).HasDefaultValue(0); @@ -2696,8 +2727,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.MaterialSpecification)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.SpecificationName).IsRequired().HasMaxLength(100); - b.Property(x => x.SpecificationValue).IsRequired().HasMaxLength(200); + b.Property(x => x.SpecificationName).IsRequired().HasMaxLength(128); + b.Property(x => x.SpecificationValue).IsRequired().HasMaxLength(256); b.Property(x => x.IsRequired).HasDefaultValue(false); b.HasOne(x => x.Material) @@ -2716,7 +2747,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Approval)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); b.Property(x => x.DepartmentId).IsRequired(); b.Property(x => x.MaterialTypeId).IsRequired(); b.Property(x => x.AmountThreshold).HasPrecision(18, 2).HasDefaultValue(0); @@ -2738,7 +2769,7 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Level).IsRequired(); - b.Property(x => x.EmployeeIds).IsRequired().HasMaxLength(1000); + b.Property(x => x.EmployeeIds).IsRequired().HasMaxLength(1024); b.Property(x => x.TimeoutDays).IsRequired().HasDefaultValue(0); b.HasOne(x => x.Approval) @@ -2752,10 +2783,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.LossReason)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.Category).HasMaxLength(50).IsRequired(); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Category).HasMaxLength(64).IsRequired(); }); builder.Entity(b => @@ -2763,17 +2794,17 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Opportunity)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Title).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Title).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.PartnerId).IsRequired(); - b.Property(x => x.Stage).IsRequired().HasMaxLength(50); + b.Property(x => x.Stage).IsRequired().HasMaxLength(64); b.Property(x => x.Probability).HasDefaultValue(0); b.Property(x => x.EstimatedValue).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.ExpectedCloseDate).IsRequired(); - b.Property(x => x.Currency).IsRequired(); - b.Property(x => x.SourceId).IsRequired(); - b.Property(x => x.Status).IsRequired().HasMaxLength(50); b.Property(x => x.Currency).IsRequired().HasMaxLength(8); + b.Property(x => x.SourceId).IsRequired(); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); + b.Property(x => x.TeamCode).HasMaxLength(95); b.HasOne(x => x.Employee) .WithMany(x => x.Opportunities) @@ -2786,11 +2817,14 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Activity)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.ActivityType).IsRequired().HasMaxLength(50); - b.Property(x => x.Subject).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.ActivityType).IsRequired().HasMaxLength(64); + b.Property(x => x.Subject).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.EmployeeId).IsRequired(); b.Property(x => x.ActivityDate).IsRequired(); + b.Property(x => x.FollowUpActivity).HasMaxLength(2048); + b.Property(x => x.Outcome).HasMaxLength(2048); + b.Property(x => x.NextSteps).HasMaxLength(2048); b.HasOne(x => x.Opportunity) .WithMany(x => x.Activities) @@ -2803,10 +2837,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Competitor)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Website).HasMaxLength(300); - b.Property(x => x.Strengths).HasMaxLength(2000); - b.Property(x => x.Weaknesses).HasMaxLength(2000); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Website).HasMaxLength(256); + b.Property(x => x.Strengths).HasMaxLength(2048); + b.Property(x => x.Weaknesses).HasMaxLength(2048); b.HasOne(x => x.Opportunity) .WithMany(x => x.Competitors) @@ -2819,13 +2853,14 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Request)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.RequestTypeId).IsRequired().HasMaxLength(50); + b.Property(x => x.RequestNumber).IsRequired().HasMaxLength(64); + b.Property(x => x.RequestTypeId).IsRequired().HasMaxLength(64); b.Property(x => x.DepartmentId).IsRequired(); b.Property(x => x.EmployeeId).IsRequired(); b.Property(x => x.RequestDate).IsRequired(); b.Property(x => x.Priority).IsRequired().HasMaxLength(20); b.Property(x => x.Status).IsRequired().HasMaxLength(20); - b.Property(x => x.Description).HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(256); b.HasOne(x => x.Employee) .WithMany(x => x.Requests) @@ -2842,8 +2877,8 @@ public class PlatformDbContext : b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.UomId).IsRequired().HasMaxLength(64); b.Property(x => x.EstimatedPrice).HasPrecision(18, 2).HasDefaultValue(0); - b.Property(x => x.Specification).HasMaxLength(500); - b.Property(x => x.Justification).HasMaxLength(500); + b.Property(x => x.Specification).HasMaxLength(512); + b.Property(x => x.Justification).HasMaxLength(512); b.HasOne(x => x.Material) .WithMany(x => x.RequestItems) @@ -2866,9 +2901,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WorkcenterType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2877,9 +2912,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WorkcenterStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -2888,16 +2923,16 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Workcenter)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).IsRequired().HasMaxLength(100); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.WorkcenterTypeId).IsRequired().HasMaxLength(50); - b.Property(x => x.Manufacturer).HasMaxLength(200); - b.Property(x => x.Model).HasMaxLength(100); - b.Property(x => x.SerialNumber).HasMaxLength(100); + b.Property(x => x.Id).IsRequired().HasMaxLength(128); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.WorkcenterTypeId).IsRequired().HasMaxLength(64); + b.Property(x => x.Manufacturer).HasMaxLength(256); + b.Property(x => x.Model).HasMaxLength(128); + b.Property(x => x.SerialNumber).HasMaxLength(128); b.Property(x => x.InstallationDate).IsRequired(); - b.Property(x => x.Location).HasMaxLength(250); + b.Property(x => x.Location).HasMaxLength(256); b.Property(x => x.DepartmentId).IsRequired(); b.Property(x => x.Status).IsRequired().HasMaxLength(20); @@ -2924,8 +2959,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WorkcenterSpecification)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.SpecificationName).IsRequired().HasMaxLength(200); - b.Property(x => x.SpecificationValue).IsRequired().HasMaxLength(200); + b.Property(x => x.SpecificationName).IsRequired().HasMaxLength(256); + b.Property(x => x.SpecificationValue).IsRequired().HasMaxLength(256); b.Property(x => x.UomId).IsRequired().HasMaxLength(64); b.Property(x => x.IsRequired).HasDefaultValue(false); @@ -2945,16 +2980,16 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PlanWizard)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(100); - b.Property(x => x.PlanType).IsRequired().HasMaxLength(50); - b.Property(x => x.Priority).HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(128); + b.Property(x => x.PlanType).IsRequired().HasMaxLength(64); + b.Property(x => x.Priority).HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.Frequency).IsRequired(); - b.Property(x => x.FrequencyUnit).IsRequired().HasMaxLength(50); + b.Property(x => x.FrequencyUnit).IsRequired().HasMaxLength(64); b.Property(x => x.EstimatedDuration).IsRequired(); - b.Property(x => x.Instructions).IsRequired().HasMaxLength(2000); - b.Property(x => x.RequiredSkillsJson).HasMaxLength(1000); + b.Property(x => x.Instructions).IsRequired().HasMaxLength(2048); + b.Property(x => x.RequiredSkillsJson).HasMaxLength(1024); b.Property(x => x.NextDue).IsRequired(); b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.LastExecuted).IsRequired(); @@ -2980,13 +3015,14 @@ public class PlatformDbContext : .OnDelete(DeleteBehavior.Cascade); }); - builder.Entity(b => + builder.Entity(b => { b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PlanWizardEmployee)), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.PlanWizardId).IsRequired(); b.Property(x => x.EmployeeId).IsRequired(); + b.Property(x => x.Description).HasMaxLength(1024); b.HasOne(x => x.PlanWizard) .WithMany(x => x.Employees) @@ -2999,19 +3035,19 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Fault)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(100); - b.Property(x => x.Location).HasMaxLength(250); - b.Property(x => x.FaultTypeId).IsRequired().HasMaxLength(50); - b.Property(x => x.Priority).HasMaxLength(50); - b.Property(x => x.Severity).HasMaxLength(50); - b.Property(x => x.Title).HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(1000); - b.Property(x => x.AssignedTo).HasMaxLength(150); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(128); + b.Property(x => x.Location).HasMaxLength(256); + b.Property(x => x.FaultTypeId).IsRequired().HasMaxLength(64); + b.Property(x => x.Priority).HasMaxLength(64); + b.Property(x => x.Severity).HasMaxLength(64); + b.Property(x => x.Title).HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(1024); + b.Property(x => x.AssignedTo).HasMaxLength(128); b.Property(x => x.Status).IsRequired().HasMaxLength(20); - b.Property(x => x.ResolutionNotes).HasMaxLength(2000); - b.Property(x => x.ClosedBy).HasMaxLength(150); - b.Property(x => x.WorkorderId).HasMaxLength(100); + b.Property(x => x.ResolutionNotes).HasMaxLength(2048); + b.Property(x => x.ClosedBy).HasMaxLength(128); + b.Property(x => x.WorkorderId).HasMaxLength(128); b.HasOne(x => x.Workcenter) .WithMany(x => x.Faults) @@ -3024,9 +3060,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.FaultStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3035,9 +3071,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.FaultType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3046,9 +3082,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WorkorderType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3057,9 +3093,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WorkorderStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3068,10 +3104,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WarehouseType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3080,18 +3116,18 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Warehouse)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).IsRequired().HasMaxLength(50); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).IsRequired().HasMaxLength(64); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.EmployeeId).IsRequired(); - b.Property(x => x.WarehouseTypeId).IsRequired().HasMaxLength(50); + b.Property(x => x.WarehouseTypeId).IsRequired().HasMaxLength(64); b.Property(x => x.Country).HasMaxLength(128); b.Property(x => x.City).HasMaxLength(128); b.Property(x => x.District).HasMaxLength(128); b.Property(x => x.Township).HasMaxLength(128); - b.Property(x => x.PostalCode).HasMaxLength(20); + b.Property(x => x.PostalCode).HasMaxLength(16); b.Property(x => x.IsMainWarehouse).HasDefaultValue(false); b.Property(x => x.Capacity).HasPrecision(18, 2).HasDefaultValue(0); @@ -3115,10 +3151,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ZoneType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3127,12 +3163,12 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Zone)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(50); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.ZoneTypeId).IsRequired().HasMaxLength(50); + b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(64); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.ZoneTypeId).IsRequired().HasMaxLength(64); b.Property(x => x.Temperature).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.Humidity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.IsActive).HasDefaultValue(true); @@ -3153,10 +3189,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.LocationType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3165,13 +3201,13 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Location)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(50); - b.Property(x => x.ZoneId).IsRequired().HasMaxLength(50); - b.Property(x => x.Code).IsRequired().HasMaxLength(50); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.LocationTypeId).IsRequired().HasMaxLength(50); + b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(64); + b.Property(x => x.ZoneId).IsRequired().HasMaxLength(64); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.LocationTypeId).IsRequired().HasMaxLength(64); b.Property(x => x.Capacity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.CurrentStock).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.IsActive).HasDefaultValue(true); @@ -3202,13 +3238,15 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Putaway)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(50); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(64); b.Property(x => x.Priority).IsRequired().HasDefaultValue(1); - b.Property(x => x.Strategy).IsRequired(); + b.Property(x => x.Strategy).IsRequired().HasMaxLength(64); b.Property(x => x.IsActive).HasDefaultValue(true); + b.Property(x => x.TargetZoneId).HasMaxLength(64); + b.Property(x => x.TargetLocationId).HasMaxLength(64); b.HasMany(x => x.Conditions) .WithOne(x => x.Rule) @@ -3222,9 +3260,9 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.RuleId).IsRequired(); - b.Property(x => x.ConditionType).IsRequired().HasMaxLength(50); + b.Property(x => x.ConditionType).IsRequired().HasMaxLength(64); b.Property(x => x.Operator).IsRequired().HasMaxLength(20); - b.Property(x => x.Value).HasMaxLength(200); + b.Property(x => x.Value).HasMaxLength(256); }); builder.Entity(b => @@ -3232,8 +3270,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.OperationCategory)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3242,9 +3280,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.OperationType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.CategoryId).IsRequired(); b.Property(x => x.DefaultDuration).HasDefaultValue(0); b.Property(x => x.RequiresSetup).HasDefaultValue(false); @@ -3263,17 +3301,17 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Operation)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.OperationTypeId).IsRequired(); - b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(100); + b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(128); b.Property(x => x.StandardTime).HasDefaultValue(0); b.Property(x => x.SetupTime).HasDefaultValue(0); b.Property(x => x.LaborCost).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.MachineCost).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.OverheadCost).HasPrecision(18, 2).HasDefaultValue(0); - b.Property(x => x.Instructions).HasMaxLength(1000); + b.Property(x => x.Instructions).HasMaxLength(1024); b.Property(x => x.QualityCheckRequired).HasDefaultValue(false); b.Property(x => x.IsActive).HasDefaultValue(true); @@ -3295,8 +3333,8 @@ public class PlatformDbContext : b.Property(x => x.MaterialId).IsRequired(); b.Property(x => x.BomTypeId).IsRequired(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.Version).IsRequired().HasMaxLength(50); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.Version).IsRequired().HasMaxLength(64); b.Property(x => x.BaseQuantity).HasPrecision(18, 2).HasDefaultValue(1); b.Property(x => x.IsActive).HasDefaultValue(true); @@ -3344,7 +3382,7 @@ public class PlatformDbContext : b.Property(x => x.BomId).IsRequired(); b.Property(x => x.OperationId).IsRequired(); - b.Property(x => x.WorkcenterId).HasMaxLength(100); + b.Property(x => x.WorkcenterId).HasMaxLength(128); b.Property(x => x.Sequence).IsRequired(); b.Property(x => x.SetupTime).HasDefaultValue(0); b.Property(x => x.RunTime).HasDefaultValue(0); @@ -3376,9 +3414,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.BomType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3387,9 +3425,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Type)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3398,9 +3436,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Status)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3409,9 +3447,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.TaskType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3420,9 +3458,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Risk)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3431,9 +3469,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Category)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3442,9 +3480,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WorkType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3453,15 +3491,15 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Projects)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); - b.Property(x => x.ProjectTypeId).IsRequired().HasMaxLength(50); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); - b.Property(x => x.Priority).IsRequired().HasMaxLength(50); + b.Property(x => x.ProjectTypeId).IsRequired().HasMaxLength(64); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); + b.Property(x => x.Priority).IsRequired().HasMaxLength(64); - b.Property(x => x.Currency).HasMaxLength(10); + b.Property(x => x.Currency).IsRequired().HasMaxLength(8); b.Property(x => x.Budget).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.ActualCost).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.Progress).HasDefaultValue(0); @@ -3486,9 +3524,9 @@ public class PlatformDbContext : b.Property(x => x.ProjectId).IsRequired(); b.Property(x => x.CategoryId).IsRequired(); - b.Property(x => x.Code).IsRequired().HasMaxLength(100); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Code).IsRequired().HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Sequence).IsRequired().HasDefaultValue(1); b.Property(x => x.StartDate).IsRequired(); @@ -3496,8 +3534,8 @@ public class PlatformDbContext : b.Property(x => x.Budget).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.ActualCost).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.Progress).HasDefaultValue(0); - b.Property(x => x.Risks).HasMaxLength(500); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); + b.Property(x => x.Risks).HasMaxLength(512); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); b.Property(x => x.IsActive).HasDefaultValue(true); @@ -3519,11 +3557,11 @@ public class PlatformDbContext : b.Property(x => x.ProjectId).IsRequired(); b.Property(x => x.PhaseId).IsRequired(); - b.Property(x => x.Name).IsRequired().HasMaxLength(200); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(512); - b.Property(x => x.Priority).IsRequired().HasMaxLength(50); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); + b.Property(x => x.Priority).IsRequired().HasMaxLength(64); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); b.Property(x => x.EmployeeId).IsRequired(); @@ -3557,14 +3595,14 @@ public class PlatformDbContext : b.Property(x => x.EmployeeId).IsRequired(); b.Property(x => x.TaskId).IsRequired(); b.Property(x => x.Date).IsRequired(); - b.Property(x => x.WorkedTypeId).IsRequired().HasMaxLength(50); + b.Property(x => x.WorkedTypeId).IsRequired().HasMaxLength(64); b.Property(x => x.HoursWorked).HasDefaultValue(0); b.Property(x => x.Progress).HasDefaultValue(0); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); - b.Property(x => x.Description).HasMaxLength(500); - b.Property(x => x.Challenges).HasMaxLength(500); - b.Property(x => x.NextSteps).HasMaxLength(500); + b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Challenges).HasMaxLength(512); + b.Property(x => x.NextSteps).HasMaxLength(512); b.HasOne(x => x.Task) .WithMany(x => x.DailyLogs) @@ -3615,9 +3653,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuotationStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3626,9 +3664,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.DeliveryTerm)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3637,26 +3675,26 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Quotation)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.QuotationNumber).IsRequired().HasMaxLength(50); - b.Property(x => x.RequestTitle).IsRequired().HasMaxLength(200); - b.Property(x => x.RequestTypeId).IsRequired().HasMaxLength(50); + b.Property(x => x.QuotationNumber).IsRequired().HasMaxLength(64); + b.Property(x => x.RequestTitle).IsRequired().HasMaxLength(256); + b.Property(x => x.RequestTypeId).IsRequired().HasMaxLength(64); b.Property(x => x.SupplierId).IsRequired(); b.Property(x => x.QuotationDate).IsRequired(); b.Property(x => x.ValidUntil).IsRequired(); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); - b.Property(x => x.Notes).HasMaxLength(1000); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); + b.Property(x => x.Notes).HasMaxLength(1024); b.Property(x => x.TotalAmount).HasPrecision(18, 2).IsRequired(); - b.Property(x => x.Currency).IsRequired().HasMaxLength(10); - b.Property(x => x.PaymentTermId).IsRequired().HasMaxLength(100); - b.Property(x => x.DeliveryTermId).IsRequired().HasMaxLength(50); + b.Property(x => x.Currency).IsRequired().HasMaxLength(8); + b.Property(x => x.PaymentTermId).IsRequired().HasMaxLength(128); + b.Property(x => x.DeliveryTermId).IsRequired().HasMaxLength(64); b.Property(x => x.DeliveryTime).HasDefaultValue(0); - b.Property(x => x.SubmittedBy).HasMaxLength(100); + b.Property(x => x.SubmittedBy).HasMaxLength(128); b.Property(x => x.SubmittedAt).IsRequired(false); b.Property(x => x.EvaluationScore).HasDefaultValue(0); - b.Property(x => x.EvaluationComments).HasMaxLength(1000); - b.Property(x => x.EvaluationNotes).HasMaxLength(1000); + b.Property(x => x.EvaluationComments).HasMaxLength(1024); + b.Property(x => x.EvaluationNotes).HasMaxLength(1024); b.HasOne(x => x.Status) .WithMany(x => x.Quotations) @@ -3677,6 +3715,11 @@ public class PlatformDbContext : .WithMany(x => x.Quotations) .HasForeignKey(x => x.EmployeeId) .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Request) + .WithMany(x => x.Quotations) + .HasForeignKey(x => x.RequestId) + .OnDelete(DeleteBehavior.Restrict); }); builder.Entity(b => @@ -3691,7 +3734,7 @@ public class PlatformDbContext : b.Property(x => x.UnitPrice).HasPrecision(18, 2).IsRequired(); b.Property(x => x.TotalPrice).HasPrecision(18, 2).IsRequired(); b.Property(x => x.LeadTime).HasDefaultValue(0); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Description).HasMaxLength(512); b.HasOne(x => x.Material) .WithMany(x => x.QuotationItems) @@ -3714,18 +3757,18 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Workorder)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.WorkorderNumber).HasMaxLength(50); - b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(100); - b.Property(x => x.WorkorderTypeId).IsRequired().HasMaxLength(50); - b.Property(x => x.Priority).IsRequired().HasMaxLength(50); - b.Property(x => x.Status).IsRequired().HasMaxLength(50); - b.Property(x => x.Subject).HasMaxLength(500); + b.Property(x => x.WorkorderNumber).HasMaxLength(64); + b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(128); + b.Property(x => x.WorkorderTypeId).IsRequired().HasMaxLength(64); + b.Property(x => x.Priority).IsRequired().HasMaxLength(64); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); + b.Property(x => x.Subject).HasMaxLength(512); b.Property(x => x.EstimatedCost).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.ActualCost).HasPrecision(18, 2).HasDefaultValue(0); - b.Property(x => x.Description).HasMaxLength(1000); - b.Property(x => x.Notes).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); + b.Property(x => x.Notes).HasMaxLength(1024); b.HasOne(x => x.WorkorderType) .WithMany(x => x.Workorders) @@ -3773,7 +3816,7 @@ public class PlatformDbContext : b.Property(x => x.WorkorderId).IsRequired(); b.Property(x => x.EmployeeId).IsRequired(); b.Property(x => x.Duration).HasDefaultValue(0); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.HasOne(x => x.Workorder) .WithMany(x => x.Activities) @@ -3791,9 +3834,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.OrderStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3802,10 +3845,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PurchaseOrder)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.OrderNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.OrderNumber).IsRequired().HasMaxLength(64); b.Property(x => x.SupplierId).IsRequired(); b.Property(x => x.OrderDate).IsRequired(); - b.Property(x => x.PaymentTermId).IsRequired().HasMaxLength(100); + b.Property(x => x.PaymentTermId).IsRequired().HasMaxLength(128); b.Property(x => x.Status).IsRequired().HasMaxLength(64); b.Property(x => x.Currency).IsRequired().HasMaxLength(8); @@ -3814,8 +3857,8 @@ public class PlatformDbContext : b.Property(x => x.TaxAmount).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.TotalAmount).HasPrecision(18, 2).HasDefaultValue(0); - b.Property(x => x.Notes).HasMaxLength(1000); - b.Property(x => x.Terms).HasMaxLength(1000); + b.Property(x => x.Notes).HasMaxLength(1024); + b.Property(x => x.Terms).HasMaxLength(1024); b.HasOne(x => x.PaymentTerm) .WithMany(x => x.PurchaseOrders) @@ -3856,7 +3899,7 @@ public class PlatformDbContext : b.Property(x => x.DeliveredQuantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.RemainingQuantity).HasPrecision(18, 2).HasDefaultValue(0); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.HasOne(x => x.Material) .WithMany(x => x.PurchaseOrderItems) @@ -3879,9 +3922,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesOrderStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3890,20 +3933,20 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesOrder)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.OrderNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.OrderNumber).IsRequired().HasMaxLength(64); b.Property(x => x.CustomerId).IsRequired(); b.Property(x => x.OrderDate).IsRequired(); b.Property(x => x.RequestedDeliveryDate).IsRequired(); b.Property(x => x.Status).IsRequired().HasMaxLength(64); b.Property(x => x.Currency).IsRequired().HasMaxLength(8); - b.Property(x => x.PaymentTermId).IsRequired().HasMaxLength(100); - b.Property(x => x.DeliveryTermId).IsRequired().HasMaxLength(50); + b.Property(x => x.PaymentTermId).IsRequired().HasMaxLength(128); + b.Property(x => x.DeliveryTermId).IsRequired().HasMaxLength(64); b.Property(x => x.Subtotal).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.TaxAmount).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.TotalAmount).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.DiscountAmount).HasPrecision(18, 2).HasDefaultValue(0); - b.Property(x => x.Notes).HasMaxLength(1000); - b.Property(x => x.SpecialInstructions).HasMaxLength(1000); + b.Property(x => x.Notes).HasMaxLength(1024); + b.Property(x => x.SpecialInstructions).HasMaxLength(1024); b.Property(x => x.ExchangeRate).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.DiscountRate).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.TaxRate).HasPrecision(18, 2).HasDefaultValue(0); @@ -3926,7 +3969,7 @@ public class PlatformDbContext : b.Property(x => x.SalesOrderId).IsRequired(); b.Property(x => x.MaterialId).IsRequired(); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.DeliveredQuantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.UnitPrice).HasPrecision(18, 2).HasDefaultValue(0); @@ -3936,8 +3979,8 @@ public class PlatformDbContext : b.Property(x => x.DiscountAmount).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.TaxRate).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.TaxAmount).HasPrecision(18, 2).HasDefaultValue(0); - b.Property(x => x.Notes).HasMaxLength(1000); - b.Property(x => x.Status).HasMaxLength(64); + b.Property(x => x.Notes).HasMaxLength(1024); + b.Property(x => x.Status).HasMaxLength(20); b.HasOne(x => x.Material) .WithMany(x => x.SalesOrderItems) @@ -3961,17 +4004,17 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.MaterialId).IsRequired(); - b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(50); - b.Property(x => x.ZoneId).IsRequired().HasMaxLength(50); - b.Property(x => x.LocationId).IsRequired().HasMaxLength(50); + b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(64); + b.Property(x => x.ZoneId).IsRequired().HasMaxLength(64); + b.Property(x => x.LocationId).IsRequired().HasMaxLength(64); b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.ReservedQuantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.AvailableQuantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.UomId).IsRequired().HasMaxLength(64); - b.Property(x => x.LotNumber).HasMaxLength(100); - b.Property(x => x.SerialNumber).HasMaxLength(100); + b.Property(x => x.LotNumber).HasMaxLength(128); + b.Property(x => x.SerialNumber).HasMaxLength(128); b.HasOne(x => x.Uom) .WithMany(x => x.Inventories) @@ -3984,9 +4027,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.MovementType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -3995,9 +4038,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.MovementType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4006,10 +4049,10 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ReferenceType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.MovementTypeName).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.MovementTypeName).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4018,12 +4061,12 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Movement)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.MovementNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.MovementNumber).IsRequired().HasMaxLength(64); b.Property(x => x.MovementDate).IsRequired(); - b.Property(x => x.MovementType).HasMaxLength(50); - b.Property(x => x.ReferenceTypeId).IsRequired().HasMaxLength(50); - b.Property(x => x.ReferenceDocument).HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.MovementType).HasMaxLength(64); + b.Property(x => x.ReferenceTypeId).IsRequired().HasMaxLength(64); + b.Property(x => x.ReferenceDocument).HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(1024); b.HasOne(x => x.Partner) .WithMany(x => x.Movements) @@ -4039,13 +4082,13 @@ public class PlatformDbContext : b.Property(x => x.MovementId).IsRequired(); b.Property(x => x.MaterialId).IsRequired(); - b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(50); - b.Property(x => x.ZoneId).IsRequired().HasMaxLength(50); - b.Property(x => x.LocationId).IsRequired().HasMaxLength(50); + b.Property(x => x.WarehouseId).IsRequired().HasMaxLength(64); + b.Property(x => x.ZoneId).IsRequired().HasMaxLength(64); + b.Property(x => x.LocationId).IsRequired().HasMaxLength(64); b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.UomId).IsRequired().HasMaxLength(64); - b.Property(x => x.LotNumber).HasMaxLength(100); - b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.LotNumber).HasMaxLength(128); + b.Property(x => x.Description).HasMaxLength(1024); b.HasOne(x => x.Warehouse) .WithMany(x => x.MovementItems) @@ -4083,9 +4126,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WaybillStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4094,9 +4137,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WaybillType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4105,8 +4148,8 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Waybill)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.WaybillNumber).IsRequired().HasMaxLength(50); - b.Property(x => x.WaybillTypeId).IsRequired().HasMaxLength(50); + b.Property(x => x.WaybillNumber).IsRequired().HasMaxLength(64); + b.Property(x => x.WaybillTypeId).IsRequired().HasMaxLength(64); b.Property(x => x.WaybillDate).IsRequired(); @@ -4115,17 +4158,17 @@ public class PlatformDbContext : b.Property(x => x.DiscountAmount).HasDefaultValue(0).HasPrecision(18, 2); b.Property(x => x.TotalAmount).HasDefaultValue(0).HasPrecision(18, 2); - b.Property(x => x.Currency).IsRequired().HasMaxLength(10); - b.Property(x => x.WaybillStatusId).IsRequired().HasMaxLength(50); + b.Property(x => x.Currency).IsRequired().HasMaxLength(8); + b.Property(x => x.WaybillStatusId).IsRequired().HasMaxLength(64); b.Property(x => x.IsInvoiced).HasDefaultValue(false); - b.Property(x => x.DeliveryAddress).HasMaxLength(500); - b.Property(x => x.ReceiverName).HasMaxLength(200); - b.Property(x => x.ReceiverPhone).HasMaxLength(50); - b.Property(x => x.CarrierCompany).HasMaxLength(100); - b.Property(x => x.TrackingNumber).HasMaxLength(100); - b.Property(x => x.Notes).HasMaxLength(1000); + b.Property(x => x.DeliveryAddress).HasMaxLength(512); + b.Property(x => x.ReceiverName).HasMaxLength(256); + b.Property(x => x.ReceiverPhone).HasMaxLength(64); + b.Property(x => x.CarrierCompany).HasMaxLength(128); + b.Property(x => x.TrackingNumber).HasMaxLength(128); + b.Property(x => x.Notes).HasMaxLength(1024); b.HasOne(x => x.CurrentAccount) .WithMany(ca => ca.Waybills) @@ -4153,7 +4196,7 @@ public class PlatformDbContext : b.Property(x => x.MaterialId).IsRequired(); b.Property(x => x.UomId).HasMaxLength(64); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.UnitPrice).HasPrecision(18, 2).HasDefaultValue(0); @@ -4185,9 +4228,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4196,9 +4239,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4207,9 +4250,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PaymentStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4218,7 +4261,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Invoice)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.InvoiceNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.InvoiceNumber).IsRequired().HasMaxLength(64); b.Property(x => x.InvoiceTypeId).IsRequired(); b.Property(x => x.InvoiceDate).IsRequired(); b.Property(x => x.DueDate).IsRequired(); @@ -4229,10 +4272,10 @@ public class PlatformDbContext : b.Property(x => x.TotalAmount).HasDefaultValue(0).HasPrecision(18, 2); b.Property(x => x.PaidAmount).HasDefaultValue(0).HasPrecision(18, 2); b.Property(x => x.RemainingAmount).HasDefaultValue(0).HasPrecision(18, 2); - b.Property(x => x.Currency).IsRequired().HasMaxLength(10); + b.Property(x => x.Currency).IsRequired().HasMaxLength(8); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); - b.Property(x => x.Notes).HasMaxLength(1000); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); + b.Property(x => x.Notes).HasMaxLength(1024); b.HasOne(x => x.CurrentAccount) .WithMany(ca => ca.Invoices) @@ -4265,7 +4308,7 @@ public class PlatformDbContext : b.Property(x => x.MaterialId).IsRequired(); b.Property(x => x.UomId).IsRequired().HasMaxLength(64); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Quantity).HasDefaultValue(0).HasPrecision(18, 2); b.Property(x => x.UnitPrice).HasDefaultValue(0).HasPrecision(18, 2); @@ -4299,9 +4342,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4310,9 +4353,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4321,25 +4364,25 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckNote)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.CheckNumber).IsRequired().HasMaxLength(50); - b.Property(x => x.BankName).HasMaxLength(200); - b.Property(x => x.BranchName).HasMaxLength(200); - b.Property(x => x.AccountNumber).HasMaxLength(100); + b.Property(x => x.CheckNumber).IsRequired().HasMaxLength(64); + b.Property(x => x.BankName).HasMaxLength(256); + b.Property(x => x.BranchName).HasMaxLength(256); + b.Property(x => x.AccountNumber).HasMaxLength(128); - b.Property(x => x.DrawerName).HasMaxLength(200); - b.Property(x => x.PayeeName).HasMaxLength(200); + b.Property(x => x.DrawerName).HasMaxLength(256); + b.Property(x => x.PayeeName).HasMaxLength(256); b.Property(x => x.IssueDate).IsRequired(); b.Property(x => x.DueDate).IsRequired(); b.Property(x => x.Amount).HasDefaultValue(0).HasPrecision(18, 2); - b.Property(x => x.Currency).HasMaxLength(10).IsRequired(); + b.Property(x => x.Currency).IsRequired().HasMaxLength(8); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); - b.Property(x => x.TypeId).IsRequired().HasMaxLength(50); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); + b.Property(x => x.TypeId).IsRequired().HasMaxLength(64); - b.Property(x => x.EndorsedTo).HasMaxLength(200); - b.Property(x => x.Notes).HasMaxLength(1000); + b.Property(x => x.EndorsedTo).HasMaxLength(256); + b.Property(x => x.Notes).HasMaxLength(1024); b.HasOne(x => x.CurrentAccount) .WithMany(ca => ca.Checks) @@ -4363,9 +4406,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionOrderType)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4374,9 +4417,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionOrderStatus)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Id).HasMaxLength(50); - b.Property(x => x.Name).IsRequired().HasMaxLength(50); - b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Id).HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.IsActive).HasDefaultValue(true); }); @@ -4385,13 +4428,13 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionOrder)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.OrderNumber).IsRequired().HasMaxLength(50); - b.Property(x => x.OrderTypeId).IsRequired().HasMaxLength(50); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); - b.Property(x => x.Priority).IsRequired().HasMaxLength(50); + b.Property(x => x.OrderNumber).IsRequired().HasMaxLength(64); + b.Property(x => x.OrderTypeId).IsRequired().HasMaxLength(64); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); + b.Property(x => x.Priority).IsRequired().HasMaxLength(64); b.Property(x => x.UomId).HasMaxLength(64); - b.Property(x => x.Currency).HasMaxLength(10); - b.Property(x => x.CustomerRequirement).HasMaxLength(1000); + b.Property(x => x.Currency).IsRequired().HasMaxLength(8); + b.Property(x => x.CustomerRequirement).HasMaxLength(1024); b.Property(x => x.PlannedQuantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.ConfirmedQuantity).HasPrecision(18, 2).HasDefaultValue(0); b.Property(x => x.RequiredQuantity).HasPrecision(18, 2).HasDefaultValue(0); @@ -4450,7 +4493,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionWorkorder)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.WorkorderNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.WorkorderNumber).IsRequired().HasMaxLength(64); b.Property(x => x.ProductionOrderId).IsRequired(); b.Property(x => x.OperationId).IsRequired(); b.Property(x => x.MaterialId).IsRequired(); @@ -4458,12 +4501,12 @@ public class PlatformDbContext : b.Property(x => x.PlannedQuantity).HasDefaultValue(0).HasPrecision(18, 2); b.Property(x => x.ConfirmedQuantity).HasDefaultValue(0).HasPrecision(18, 2); b.Property(x => x.ScrapQuantity).HasDefaultValue(0).HasPrecision(18, 2); - b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(100); + b.Property(x => x.WorkcenterId).IsRequired().HasMaxLength(128); b.Property(x => x.SetupTime).HasDefaultValue(0); b.Property(x => x.ProcessTime).HasDefaultValue(0); b.Property(x => x.ActualSetupTime).HasDefaultValue(0); b.Property(x => x.ActualProcessTime).HasDefaultValue(0); - b.Property(x => x.StatusId).IsRequired().HasMaxLength(50); + b.Property(x => x.StatusId).IsRequired().HasMaxLength(64); b.HasOne(x => x.ProductionOrder) .WithMany(po => po.Workorders) diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211144929_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211184247_Initial.Designer.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211144929_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211184247_Initial.Designer.cs index a2723cdb..78d079d9 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211144929_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211184247_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251211144929_Initial")] + [Migration("20251211184247_Initial")] partial class Initial { /// @@ -77,7 +77,9 @@ namespace Erp.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("TwoLetterISOLanguageName") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); b.Property("UiCultureName") .IsRequired() @@ -668,7 +670,8 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("FollowUpActivity") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("FollowUpDate") .HasColumnType("datetime2"); @@ -688,13 +691,15 @@ namespace Erp.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("NextSteps") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("OpportunityId") .HasColumnType("uniqueidentifier"); b.Property("Outcome") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("StartTime") .HasColumnType("datetime2"); @@ -721,10 +726,12 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("ApiUrl") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("Description") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("IsActive") .HasColumnType("bit"); @@ -1480,7 +1487,8 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("ReadTime") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("Slug") .IsRequired() @@ -2916,13 +2924,15 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(2000)"); b.Property("MessageType") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("RecipientId") .HasColumnType("uniqueidentifier"); b.Property("RecipientName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("SenderId") .HasColumnType("uniqueidentifier"); @@ -3306,7 +3316,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(50)"); b.Property("CostCenterType") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -4019,7 +4030,9 @@ namespace Erp.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Menu") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("MigrationId") .HasColumnType("uniqueidentifier"); @@ -4834,10 +4847,12 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Address1") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("Address2") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("Avatar") .HasMaxLength(250) @@ -4857,7 +4872,8 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("City") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); b.Property("Code") .IsRequired() @@ -4865,7 +4881,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(50)"); b.Property("Country") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -4892,29 +4909,35 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("District") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Email") .HasMaxLength(150) .HasColumnType("nvarchar(150)"); b.Property("EmergencyContactName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("EmergencyContactPhoneNumber") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("EmergencyContactRelationship") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("EmployeeStatus") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("EmploymentTypeId") .HasColumnType("uniqueidentifier"); b.Property("Gender") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("HireDate") .HasColumnType("datetime2"); @@ -4949,7 +4972,8 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("MaritalStatus") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("MobileNumber") .HasMaxLength(20) @@ -4973,7 +4997,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("PostalCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -4983,7 +5008,8 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("Township") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("WorkLocation") .HasMaxLength(150) @@ -6600,7 +6626,8 @@ namespace Erp.Platform.Migrations b.Property("LeaveType") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("Reason") .HasMaxLength(500) @@ -8581,10 +8608,14 @@ namespace Erp.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("EntityId") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("EntityName") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("FilesJson") .HasColumnType("nvarchar(max)"); @@ -8614,7 +8645,8 @@ namespace Erp.Platform.Migrations b.Property("Type") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.HasKey("Id"); @@ -9015,7 +9047,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(50)"); b.Property("TeamCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(95) + .HasColumnType("nvarchar(95)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -9357,11 +9390,12 @@ namespace Erp.Platform.Migrations .HasColumnType("decimal(18,2)"); b.Property("Reason") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("RejectionReason") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("StartTime") .HasMaxLength(10) @@ -9369,7 +9403,8 @@ namespace Erp.Platform.Migrations b.Property("Status") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -10125,7 +10160,8 @@ namespace Erp.Platform.Migrations .HasColumnType("decimal(18,2)"); b.Property("Status") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("TaxNumber") .HasColumnType("bigint"); @@ -10289,67 +10325,6 @@ namespace Erp.Platform.Migrations b.ToTable("Hr_T_Performance360", (string)null); }); - modelBuilder.Entity("Erp.Platform.Entities.PlanEmployee", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("EmployeeId") - .HasColumnType("uniqueidentifier"); - - b.Property("EndDate") - .HasColumnType("datetime2"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("PlanWizardId") - .HasColumnType("uniqueidentifier"); - - b.Property("StartDate") - .HasColumnType("datetime2"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("PlanWizardId"); - - b.ToTable("Mnt_T_PlanWizardEmployee", (string)null); - }); - modelBuilder.Entity("Erp.Platform.Entities.PlanWizard", b => { b.Property("Id") @@ -10450,6 +10425,68 @@ namespace Erp.Platform.Migrations b.ToTable("Mnt_T_PlanWizard", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.PlanWizardEmployee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PlanWizardId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("PlanWizardId"); + + b.ToTable("Mnt_T_PlanWizardEmployee", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.PlanWizardMaterial", b => { b.Property("Id") @@ -12027,13 +12064,16 @@ namespace Erp.Platform.Migrations b.Property("Strategy") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("TargetLocationId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("TargetZoneId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -12474,8 +12514,8 @@ namespace Erp.Platform.Migrations .HasMaxLength(50) .HasColumnType("nvarchar(50)"); - b.Property("RequestId") - .HasColumnType("nvarchar(max)"); + b.Property("RequestId") + .HasColumnType("uniqueidentifier"); b.Property("RequestTitle") .IsRequired() @@ -12523,6 +12563,8 @@ namespace Erp.Platform.Migrations b.HasIndex("PaymentTermId"); + b.HasIndex("RequestId"); + b.HasIndex("RequestTypeId"); b.HasIndex("StatusId"); @@ -13169,7 +13211,9 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("RequestNumber") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("RequestTypeId") .IsRequired() @@ -14212,7 +14256,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Type") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.HasKey("Id"); @@ -14279,7 +14324,8 @@ namespace Erp.Platform.Migrations b.Property("Route") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -14682,13 +14728,15 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("PollQuestion") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("PollTotalVotes") .HasColumnType("int"); b.Property("PollUserVoteId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("SocialPostId") .HasColumnType("uniqueidentifier"); @@ -15191,7 +15239,8 @@ namespace Erp.Platform.Migrations b.Property("Value") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.HasKey("Id"); @@ -15942,7 +15991,8 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("BadgeNumber") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("CheckIn") .HasColumnType("datetime2"); @@ -16002,7 +16052,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("Photo") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); b.Property("Purpose") .HasMaxLength(250) @@ -17349,9 +17400,6 @@ namespace Erp.Platform.Migrations .HasMaxLength(50) .HasColumnType("nvarchar(50)"); - b.Property("Code") - .HasColumnType("nvarchar(max)"); - b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -17621,7 +17669,8 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("LastPostUserName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("Name") .IsRequired() @@ -21256,17 +21305,6 @@ namespace Erp.Platform.Migrations b.Navigation("Template"); }); - modelBuilder.Entity("Erp.Platform.Entities.PlanEmployee", b => - { - b.HasOne("Erp.Platform.Entities.PlanWizard", "PlanWizard") - .WithMany("Employees") - .HasForeignKey("PlanWizardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PlanWizard"); - }); - modelBuilder.Entity("Erp.Platform.Entities.PlanWizard", b => { b.HasOne("Erp.Platform.Entities.Workcenter", "Workcenter") @@ -21278,6 +21316,17 @@ namespace Erp.Platform.Migrations b.Navigation("Workcenter"); }); + modelBuilder.Entity("Erp.Platform.Entities.PlanWizardEmployee", b => + { + b.HasOne("Erp.Platform.Entities.PlanWizard", "PlanWizard") + .WithMany("Employees") + .HasForeignKey("PlanWizardId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PlanWizard"); + }); + modelBuilder.Entity("Erp.Platform.Entities.PlanWizardMaterial", b => { b.HasOne("Erp.Platform.Entities.PlanWizard", "PlanWizard") @@ -21699,6 +21748,12 @@ namespace Erp.Platform.Migrations .OnDelete(DeleteBehavior.Restrict) .IsRequired(); + b.HasOne("Erp.Platform.Entities.Request", "Request") + .WithMany("Quotations") + .HasForeignKey("RequestId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + b.HasOne("Erp.Platform.Entities.RequestType", "RequestType") .WithMany() .HasForeignKey("RequestTypeId") @@ -21723,6 +21778,8 @@ namespace Erp.Platform.Migrations b.Navigation("PaymentTerm"); + b.Navigation("Request"); + b.Navigation("RequestType"); b.Navigation("Status"); @@ -23007,6 +23064,8 @@ namespace Erp.Platform.Migrations b.Navigation("Items"); b.Navigation("PurchaseOrders"); + + b.Navigation("Quotations"); }); modelBuilder.Entity("Erp.Platform.Entities.RequestType", b => diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211144929_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211184247_Initial.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211144929_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211184247_Initial.cs index b3b9faa2..f4154f1e 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211144929_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251211184247_Initial.cs @@ -1003,7 +1003,7 @@ namespace Erp.Platform.Migrations Icon = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), Title = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), - Type = table.Column(type: "nvarchar(max)", nullable: true), + Type = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), Features = table.Column(type: "nvarchar(max)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -1414,7 +1414,7 @@ namespace Erp.Platform.Migrations NetSalary = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), TaxNumber = table.Column(type: "bigint", nullable: true), SocialSecurity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), - Status = table.Column(type: "nvarchar(max)", nullable: true), + Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), PaymentDate = table.Column(type: "datetime2", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -1594,7 +1594,6 @@ namespace Erp.Platform.Migrations { Id = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Code = table.Column(type: "nvarchar(max)", nullable: true), Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), @@ -1751,7 +1750,7 @@ namespace Erp.Platform.Migrations ArrivalTime = table.Column(type: "datetime2", maxLength: 10, nullable: false), Capacity = table.Column(type: "int", nullable: false, defaultValue: 0), Available = table.Column(type: "int", nullable: false, defaultValue: 0), - Route = table.Column(type: "nvarchar(max)", nullable: false), + Route = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1866,8 +1865,8 @@ namespace Erp.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), - ApiUrl = table.Column(type: "nvarchar(max)", nullable: true), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ApiUrl = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), IsActive = table.Column(type: "bit", nullable: false) }, constraints: table => @@ -1936,7 +1935,7 @@ namespace Erp.Platform.Migrations UiCultureName = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), DisplayName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), IsEnabled = table.Column(type: "bit", nullable: false), - TwoLetterISOLanguageName = table.Column(type: "nvarchar(max)", nullable: true), + TwoLetterISOLanguageName = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -2428,7 +2427,7 @@ namespace Erp.Platform.Migrations LastPostId = table.Column(type: "uniqueidentifier", nullable: true), LastPostDate = table.Column(type: "datetime2", nullable: true), LastPostUserId = table.Column(type: "uniqueidentifier", nullable: true), - LastPostUserName = table.Column(type: "nvarchar(max)", nullable: true), + LastPostUserName = 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), @@ -2698,7 +2697,7 @@ namespace Erp.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Menu = table.Column(type: "nvarchar(max)", nullable: true), + Menu = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), DisplayName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), TableName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), @@ -2799,9 +2798,9 @@ namespace Erp.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - EntityName = table.Column(type: "nvarchar(max)", nullable: true), - EntityId = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(max)", nullable: false), + EntityName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + EntityId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), Subject = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Content = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false), FilesJson = table.Column(type: "nvarchar(max)", nullable: true), @@ -3245,13 +3244,13 @@ namespace Erp.Platform.Migrations Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), Priority = table.Column(type: "int", nullable: false, defaultValue: 1), - Strategy = table.Column(type: "nvarchar(max)", nullable: false), + Strategy = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), MaterialTypeId = table.Column(type: "uniqueidentifier", nullable: true), MaterialGroupId = table.Column(type: "uniqueidentifier", nullable: true), WarehouseId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - TargetZoneId = table.Column(type: "nvarchar(max)", nullable: true), - TargetLocationId = table.Column(type: "nvarchar(max)", nullable: true), + TargetZoneId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + TargetLocationId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -3728,9 +3727,9 @@ namespace Erp.Platform.Migrations Message = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false), Timestamp = table.Column(type: "datetime2", nullable: false), RecipientId = table.Column(type: "uniqueidentifier", nullable: true), - RecipientName = table.Column(type: "nvarchar(max)", nullable: true), + RecipientName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), IsTeacher = table.Column(type: "bit", nullable: false), - MessageType = table.Column(type: "nvarchar(max)", nullable: true), + MessageType = 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), @@ -5339,7 +5338,7 @@ namespace Erp.Platform.Migrations ContentEn = table.Column(type: "nvarchar(max)", nullable: false), Summary = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), CoverImage = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), - ReadTime = table.Column(type: "nvarchar(max)", nullable: true), + ReadTime = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), CategoryId = table.Column(type: "uniqueidentifier", nullable: false), EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), ViewCount = table.Column(type: "int", nullable: true), @@ -6030,9 +6029,9 @@ namespace Erp.Platform.Migrations EndTime = table.Column(type: "datetime2", nullable: true), Duration = table.Column(type: "int", nullable: true), FollowUpDate = table.Column(type: "datetime2", nullable: true), - FollowUpActivity = table.Column(type: "nvarchar(max)", nullable: true), - Outcome = table.Column(type: "nvarchar(max)", nullable: true), - NextSteps = table.Column(type: "nvarchar(max)", nullable: true), + FollowUpActivity = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + Outcome = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + NextSteps = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -6088,7 +6087,7 @@ namespace Erp.Platform.Migrations ExpectedCloseDate = table.Column(type: "datetime2", nullable: false), ActualCloseDate = table.Column(type: "datetime2", nullable: true), EmployeeId = table.Column(type: "uniqueidentifier", nullable: true), - TeamCode = table.Column(type: "nvarchar(max)", nullable: true), + TeamCode = table.Column(type: "nvarchar(95)", maxLength: 95, nullable: true), SourceId = table.Column(type: "uniqueidentifier", nullable: false), LossReasonId = table.Column(type: "uniqueidentifier", nullable: true), Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), @@ -6128,7 +6127,7 @@ namespace Erp.Platform.Migrations ParentCostCenterId = table.Column(type: "uniqueidentifier", nullable: true), ResponsibleEmployeeId = table.Column(type: "uniqueidentifier", nullable: true), DepartmentId = table.Column(type: "uniqueidentifier", nullable: true), - CostCenterType = table.Column(type: "nvarchar(max)", nullable: true), + CostCenterType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), BudgetedAmount = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false), ActualAmount = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false), Currency = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), @@ -6368,21 +6367,21 @@ namespace Erp.Platform.Migrations Avatar = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), NationalId = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), BirthDate = table.Column(type: "datetime2", nullable: false), - Gender = table.Column(type: "nvarchar(max)", nullable: true), - MaritalStatus = table.Column(type: "nvarchar(max)", nullable: true), - Country = table.Column(type: "nvarchar(max)", nullable: true), - City = table.Column(type: "nvarchar(max)", nullable: true), - District = table.Column(type: "nvarchar(max)", nullable: true), - Township = table.Column(type: "nvarchar(max)", nullable: true), - PostalCode = table.Column(type: "nvarchar(max)", nullable: true), + Gender = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + MaritalStatus = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + Country = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: true), + City = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), + District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Township = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + PostalCode = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), MobileNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), PhoneNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), Email = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), - Address1 = table.Column(type: "nvarchar(max)", nullable: true), - Address2 = table.Column(type: "nvarchar(max)", nullable: true), - EmergencyContactName = table.Column(type: "nvarchar(max)", nullable: true), - EmergencyContactRelationship = table.Column(type: "nvarchar(max)", nullable: true), - EmergencyContactPhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), + Address1 = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Address2 = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + EmergencyContactName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + EmergencyContactRelationship = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + EmergencyContactPhoneNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), HireDate = table.Column(type: "datetime2", nullable: false), TerminationDate = table.Column(type: "datetime2", nullable: true), EmploymentTypeId = table.Column(type: "uniqueidentifier", nullable: true), @@ -6396,7 +6395,7 @@ namespace Erp.Platform.Migrations BankId = table.Column(type: "uniqueidentifier", nullable: true), IbanNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), BadgeId = table.Column(type: "uniqueidentifier", nullable: true), - EmployeeStatus = table.Column(type: "nvarchar(max)", nullable: true), + EmployeeStatus = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -6696,7 +6695,7 @@ namespace Erp.Platform.Migrations Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), - LeaveType = table.Column(type: "nvarchar(max)", nullable: false), + LeaveType = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), StartDate = table.Column(type: "datetime2", nullable: false), EndDate = table.Column(type: "datetime2", nullable: false), TotalDays = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), @@ -6738,11 +6737,11 @@ namespace Erp.Platform.Migrations StartTime = table.Column(type: "datetime2", maxLength: 10, nullable: false), EndTime = table.Column(type: "datetime2", maxLength: 10, nullable: false), TotalHours = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), - Reason = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - Status = table.Column(type: "nvarchar(max)", nullable: false), + Reason = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), ApprovedById = table.Column(type: "uniqueidentifier", nullable: true), ApprovedDate = table.Column(type: "datetime2", nullable: true), - RejectionReason = table.Column(type: "nvarchar(max)", nullable: true), + RejectionReason = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), Rate = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), Amount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), @@ -7000,8 +6999,8 @@ namespace Erp.Platform.Migrations CheckOut = table.Column(type: "datetime2", nullable: true), EmployeeId = table.Column(type: "uniqueidentifier", nullable: true), Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), - BadgeNumber = table.Column(type: "nvarchar(max)", nullable: true), - Photo = table.Column(type: "nvarchar(max)", nullable: true), + BadgeNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Photo = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -7021,95 +7020,13 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); - migrationBuilder.CreateTable( - name: "Scp_T_Quotation", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - QuotationNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - RequestId = table.Column(type: "nvarchar(max)", nullable: true), - RequestTitle = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - RequestTypeId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - SupplierId = table.Column(type: "uniqueidentifier", nullable: false), - QuotationDate = table.Column(type: "datetime2", nullable: false), - ValidUntil = table.Column(type: "datetime2", nullable: false), - StatusId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - TotalAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), - Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), - PaymentTermId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - DeliveryTermId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - DeliveryTime = table.Column(type: "int", nullable: true, defaultValue: 0), - EvaluationScore = table.Column(type: "int", nullable: true, defaultValue: 0), - EvaluationComments = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - EvaluationNotes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - SubmittedBy = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - SubmittedAt = table.Column(type: "datetime2", nullable: true), - EmployeeId = table.Column(type: "uniqueidentifier", nullable: true), - EvaluatedAt = table.Column(type: "datetime2", nullable: true), - PaymentMethodId = table.Column(type: "nvarchar(450)", 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_Scp_T_Quotation", x => x.Id); - table.ForeignKey( - name: "FK_Scp_T_Quotation_Adm_T_Partner_SupplierId", - column: x => x.SupplierId, - principalTable: "Adm_T_Partner", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Scp_T_Quotation_Adm_T_PaymentMethod_PaymentMethodId", - column: x => x.PaymentMethodId, - principalTable: "Adm_T_PaymentMethod", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Scp_T_Quotation_Hr_T_Employee_EmployeeId", - column: x => x.EmployeeId, - principalTable: "Hr_T_Employee", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Scp_T_Quotation_Scp_T_DeliveryTerm_DeliveryTermId", - column: x => x.DeliveryTermId, - principalTable: "Scp_T_DeliveryTerm", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Scp_T_Quotation_Scp_T_PaymentTerm_PaymentTermId", - column: x => x.PaymentTermId, - principalTable: "Scp_T_PaymentTerm", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Scp_T_Quotation_Scp_T_QuotationStatus_StatusId", - column: x => x.StatusId, - principalTable: "Scp_T_QuotationStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Scp_T_Quotation_Scp_T_RequestType_RequestTypeId", - column: x => x.RequestTypeId, - principalTable: "Scp_T_RequestType", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateTable( name: "Scp_T_Request", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - RequestNumber = table.Column(type: "nvarchar(max)", nullable: true), + RequestNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), RequestTypeId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), DepartmentId = table.Column(type: "uniqueidentifier", nullable: false), EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), @@ -7205,7 +7122,7 @@ namespace Erp.Platform.Migrations EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), StartDate = table.Column(type: "datetime2", nullable: false), EndDate = table.Column(type: "datetime2", nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -7499,7 +7416,7 @@ namespace Erp.Platform.Migrations ResponseId = table.Column(type: "uniqueidentifier", nullable: false), QuestionId = table.Column(type: "uniqueidentifier", nullable: false), QuestionType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - Value = table.Column(type: "nvarchar(max)", nullable: false), + Value = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -7688,10 +7605,10 @@ namespace Erp.Platform.Migrations SocialPostId = table.Column(type: "uniqueidentifier", nullable: false), Type = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), Urls = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - PollQuestion = table.Column(type: "nvarchar(max)", nullable: true), + PollQuestion = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), PollTotalVotes = table.Column(type: "int", nullable: true), PollEndsAt = table.Column(type: "datetime2", nullable: true), - PollUserVoteId = table.Column(type: "nvarchar(max)", nullable: true), + PollUserVoteId = 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), @@ -7712,71 +7629,33 @@ namespace Erp.Platform.Migrations }); migrationBuilder.CreateTable( - name: "Scp_T_QuotationItem", + name: "Scp_T_Quotation", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - QuotationId = table.Column(type: "uniqueidentifier", nullable: false), - MaterialId = table.Column(type: "uniqueidentifier", nullable: false), - Quantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), - UomId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - UnitPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), - TotalPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), - LeadTime = table.Column(type: "int", nullable: true, defaultValue: 0), - Description = table.Column(type: "nvarchar(500)", maxLength: 500, 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_Scp_T_QuotationItem", x => x.Id); - table.ForeignKey( - name: "FK_Scp_T_QuotationItem_Adm_T_Uom_UomId", - column: x => x.UomId, - principalTable: "Adm_T_Uom", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Scp_T_QuotationItem_Scp_T_Material_MaterialId", - column: x => x.MaterialId, - principalTable: "Scp_T_Material", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Scp_T_QuotationItem_Scp_T_Quotation_QuotationId", - column: x => x.QuotationId, - principalTable: "Scp_T_Quotation", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Scp_T_PurchaseOrder", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - OrderNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + QuotationNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + RequestId = table.Column(type: "uniqueidentifier", nullable: false), + RequestTitle = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + RequestTypeId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), SupplierId = table.Column(type: "uniqueidentifier", nullable: false), - OrderDate = table.Column(type: "datetime2", nullable: false), - DeliveryDate = table.Column(type: "datetime2", nullable: true), + QuotationDate = table.Column(type: "datetime2", nullable: false), + ValidUntil = table.Column(type: "datetime2", nullable: false), + StatusId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + TotalAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), PaymentTermId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Terms = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + DeliveryTermId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + DeliveryTime = table.Column(type: "int", nullable: true, defaultValue: 0), + EvaluationScore = table.Column(type: "int", nullable: true, defaultValue: 0), + EvaluationComments = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + EvaluationNotes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - RequestId = table.Column(type: "uniqueidentifier", nullable: true), - QuotationId = table.Column(type: "uniqueidentifier", nullable: true), - Currency = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), - ExchangeRate = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - Subtotal = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - TaxAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - TotalAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + SubmittedBy = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + SubmittedAt = table.Column(type: "datetime2", nullable: true), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: true), + EvaluatedAt = table.Column(type: "datetime2", nullable: true), + PaymentMethodId = table.Column(type: "nvarchar(450)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -7787,27 +7666,50 @@ namespace Erp.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_Scp_T_PurchaseOrder", x => x.Id); + table.PrimaryKey("PK_Scp_T_Quotation", x => x.Id); table.ForeignKey( - name: "FK_Scp_T_PurchaseOrder_Adm_T_Partner_SupplierId", + name: "FK_Scp_T_Quotation_Adm_T_Partner_SupplierId", column: x => x.SupplierId, principalTable: "Adm_T_Partner", principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Adm_T_PaymentMethod_PaymentMethodId", + column: x => x.PaymentMethodId, + principalTable: "Adm_T_PaymentMethod", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Hr_T_Employee_EmployeeId", + column: x => x.EmployeeId, + principalTable: "Hr_T_Employee", + principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_Scp_T_PurchaseOrder_Scp_T_PaymentTerm_PaymentTermId", + name: "FK_Scp_T_Quotation_Scp_T_DeliveryTerm_DeliveryTermId", + column: x => x.DeliveryTermId, + principalTable: "Scp_T_DeliveryTerm", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Scp_T_PaymentTerm_PaymentTermId", column: x => x.PaymentTermId, principalTable: "Scp_T_PaymentTerm", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_Scp_T_PurchaseOrder_Scp_T_Quotation_QuotationId", - column: x => x.QuotationId, - principalTable: "Scp_T_Quotation", + name: "FK_Scp_T_Quotation_Scp_T_QuotationStatus_StatusId", + column: x => x.StatusId, + principalTable: "Scp_T_QuotationStatus", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_Scp_T_PurchaseOrder_Scp_T_Request_RequestId", + name: "FK_Scp_T_Quotation_Scp_T_RequestType_RequestTypeId", + column: x => x.RequestTypeId, + principalTable: "Scp_T_RequestType", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Scp_T_Request_RequestId", column: x => x.RequestId, principalTable: "Scp_T_Request", principalColumn: "Id", @@ -7998,21 +7900,26 @@ namespace Erp.Platform.Migrations }); migrationBuilder.CreateTable( - name: "Scp_T_PurchaseOrderItem", + name: "Scp_T_PurchaseOrder", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - PurchaseOrderId = table.Column(type: "uniqueidentifier", nullable: false), - MaterialId = table.Column(type: "uniqueidentifier", nullable: false), - UnitPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - Quantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - UomId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - TotalPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - ReceivedQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - DeliveredQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - RemainingQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + OrderNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + SupplierId = table.Column(type: "uniqueidentifier", nullable: false), + OrderDate = table.Column(type: "datetime2", nullable: false), + DeliveryDate = table.Column(type: "datetime2", nullable: true), + PaymentTermId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Terms = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + RequestId = table.Column(type: "uniqueidentifier", nullable: true), + QuotationId = table.Column(type: "uniqueidentifier", nullable: true), + Currency = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), + ExchangeRate = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Subtotal = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TaxAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TotalAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -8023,25 +7930,76 @@ namespace Erp.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_Scp_T_PurchaseOrderItem", x => x.Id); + table.PrimaryKey("PK_Scp_T_PurchaseOrder", x => x.Id); table.ForeignKey( - name: "FK_Scp_T_PurchaseOrderItem_Adm_T_Uom_UomId", + name: "FK_Scp_T_PurchaseOrder_Adm_T_Partner_SupplierId", + column: x => x.SupplierId, + principalTable: "Adm_T_Partner", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_PurchaseOrder_Scp_T_PaymentTerm_PaymentTermId", + column: x => x.PaymentTermId, + principalTable: "Scp_T_PaymentTerm", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_PurchaseOrder_Scp_T_Quotation_QuotationId", + column: x => x.QuotationId, + principalTable: "Scp_T_Quotation", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_PurchaseOrder_Scp_T_Request_RequestId", + column: x => x.RequestId, + principalTable: "Scp_T_Request", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Scp_T_QuotationItem", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + QuotationId = table.Column(type: "uniqueidentifier", nullable: false), + MaterialId = table.Column(type: "uniqueidentifier", nullable: false), + Quantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + UomId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + UnitPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + TotalPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + LeadTime = table.Column(type: "int", nullable: true, defaultValue: 0), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, 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_Scp_T_QuotationItem", x => x.Id); + table.ForeignKey( + name: "FK_Scp_T_QuotationItem_Adm_T_Uom_UomId", column: x => x.UomId, principalTable: "Adm_T_Uom", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_Scp_T_PurchaseOrderItem_Scp_T_Material_MaterialId", + name: "FK_Scp_T_QuotationItem_Scp_T_Material_MaterialId", column: x => x.MaterialId, principalTable: "Scp_T_Material", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_Scp_T_PurchaseOrderItem_Scp_T_PurchaseOrder_PurchaseOrderId", - column: x => x.PurchaseOrderId, - principalTable: "Scp_T_PurchaseOrder", + name: "FK_Scp_T_QuotationItem_Scp_T_Quotation_QuotationId", + column: x => x.QuotationId, + principalTable: "Scp_T_Quotation", principalColumn: "Id", - onDelete: ReferentialAction.Restrict); + onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( @@ -8098,6 +8056,53 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Scp_T_PurchaseOrderItem", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + PurchaseOrderId = table.Column(type: "uniqueidentifier", nullable: false), + MaterialId = table.Column(type: "uniqueidentifier", nullable: false), + UnitPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Quantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + UomId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + TotalPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + ReceivedQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + DeliveredQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + RemainingQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, 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_Scp_T_PurchaseOrderItem", x => x.Id); + table.ForeignKey( + name: "FK_Scp_T_PurchaseOrderItem_Adm_T_Uom_UomId", + column: x => x.UomId, + principalTable: "Adm_T_Uom", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_PurchaseOrderItem_Scp_T_Material_MaterialId", + column: x => x.MaterialId, + principalTable: "Scp_T_Material", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_PurchaseOrderItem_Scp_T_PurchaseOrder_PurchaseOrderId", + column: x => x.PurchaseOrderId, + principalTable: "Scp_T_PurchaseOrder", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "Str_T_MovementItem", columns: table => new @@ -9946,6 +9951,11 @@ namespace Erp.Platform.Migrations table: "Scp_T_Quotation", column: "PaymentTermId"); + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Quotation_RequestId", + table: "Scp_T_Quotation", + column: "RequestId"); + migrationBuilder.CreateIndex( name: "IX_Scp_T_Quotation_RequestTypeId", table: "Scp_T_Quotation", @@ -11035,9 +11045,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Scp_T_Quotation"); - migrationBuilder.DropTable( - name: "Scp_T_Request"); - migrationBuilder.DropTable( name: "Str_T_LocationType"); @@ -11069,7 +11076,7 @@ namespace Erp.Platform.Migrations name: "Scp_T_QuotationStatus"); migrationBuilder.DropTable( - name: "Scp_T_RequestType"); + name: "Scp_T_Request"); migrationBuilder.DropTable( name: "Str_T_Warehouse"); @@ -11083,6 +11090,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Mnt_T_WorkcenterType"); + migrationBuilder.DropTable( + name: "Scp_T_RequestType"); + migrationBuilder.DropTable( name: "Str_T_WarehouseType"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 5f69fa3c..30a61867 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -74,7 +74,9 @@ namespace Erp.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("TwoLetterISOLanguageName") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); b.Property("UiCultureName") .IsRequired() @@ -665,7 +667,8 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("FollowUpActivity") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("FollowUpDate") .HasColumnType("datetime2"); @@ -685,13 +688,15 @@ namespace Erp.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("NextSteps") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("OpportunityId") .HasColumnType("uniqueidentifier"); b.Property("Outcome") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("StartTime") .HasColumnType("datetime2"); @@ -718,10 +723,12 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("ApiUrl") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("Description") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("IsActive") .HasColumnType("bit"); @@ -1477,7 +1484,8 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("ReadTime") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("Slug") .IsRequired() @@ -2913,13 +2921,15 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(2000)"); b.Property("MessageType") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("RecipientId") .HasColumnType("uniqueidentifier"); b.Property("RecipientName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("SenderId") .HasColumnType("uniqueidentifier"); @@ -3303,7 +3313,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(50)"); b.Property("CostCenterType") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -4016,7 +4027,9 @@ namespace Erp.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Menu") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("MigrationId") .HasColumnType("uniqueidentifier"); @@ -4831,10 +4844,12 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Address1") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("Address2") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("Avatar") .HasMaxLength(250) @@ -4854,7 +4869,8 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("City") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); b.Property("Code") .IsRequired() @@ -4862,7 +4878,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(50)"); b.Property("Country") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -4889,29 +4906,35 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("District") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Email") .HasMaxLength(150) .HasColumnType("nvarchar(150)"); b.Property("EmergencyContactName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("EmergencyContactPhoneNumber") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("EmergencyContactRelationship") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("EmployeeStatus") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("EmploymentTypeId") .HasColumnType("uniqueidentifier"); b.Property("Gender") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("HireDate") .HasColumnType("datetime2"); @@ -4946,7 +4969,8 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("MaritalStatus") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("MobileNumber") .HasMaxLength(20) @@ -4970,7 +4994,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("PostalCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -4980,7 +5005,8 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("Township") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("WorkLocation") .HasMaxLength(150) @@ -6597,7 +6623,8 @@ namespace Erp.Platform.Migrations b.Property("LeaveType") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("Reason") .HasMaxLength(500) @@ -8578,10 +8605,14 @@ namespace Erp.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("EntityId") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("EntityName") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("FilesJson") .HasColumnType("nvarchar(max)"); @@ -8611,7 +8642,8 @@ namespace Erp.Platform.Migrations b.Property("Type") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.HasKey("Id"); @@ -9012,7 +9044,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(50)"); b.Property("TeamCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(95) + .HasColumnType("nvarchar(95)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -9354,11 +9387,12 @@ namespace Erp.Platform.Migrations .HasColumnType("decimal(18,2)"); b.Property("Reason") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("RejectionReason") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("StartTime") .HasMaxLength(10) @@ -9366,7 +9400,8 @@ namespace Erp.Platform.Migrations b.Property("Status") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -10122,7 +10157,8 @@ namespace Erp.Platform.Migrations .HasColumnType("decimal(18,2)"); b.Property("Status") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("TaxNumber") .HasColumnType("bigint"); @@ -10286,67 +10322,6 @@ namespace Erp.Platform.Migrations b.ToTable("Hr_T_Performance360", (string)null); }); - modelBuilder.Entity("Erp.Platform.Entities.PlanEmployee", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("EmployeeId") - .HasColumnType("uniqueidentifier"); - - b.Property("EndDate") - .HasColumnType("datetime2"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("PlanWizardId") - .HasColumnType("uniqueidentifier"); - - b.Property("StartDate") - .HasColumnType("datetime2"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("PlanWizardId"); - - b.ToTable("Mnt_T_PlanWizardEmployee", (string)null); - }); - modelBuilder.Entity("Erp.Platform.Entities.PlanWizard", b => { b.Property("Id") @@ -10447,6 +10422,68 @@ namespace Erp.Platform.Migrations b.ToTable("Mnt_T_PlanWizard", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.PlanWizardEmployee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PlanWizardId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("PlanWizardId"); + + b.ToTable("Mnt_T_PlanWizardEmployee", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.PlanWizardMaterial", b => { b.Property("Id") @@ -12024,13 +12061,16 @@ namespace Erp.Platform.Migrations b.Property("Strategy") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("TargetLocationId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("TargetZoneId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -12471,8 +12511,8 @@ namespace Erp.Platform.Migrations .HasMaxLength(50) .HasColumnType("nvarchar(50)"); - b.Property("RequestId") - .HasColumnType("nvarchar(max)"); + b.Property("RequestId") + .HasColumnType("uniqueidentifier"); b.Property("RequestTitle") .IsRequired() @@ -12520,6 +12560,8 @@ namespace Erp.Platform.Migrations b.HasIndex("PaymentTermId"); + b.HasIndex("RequestId"); + b.HasIndex("RequestTypeId"); b.HasIndex("StatusId"); @@ -13166,7 +13208,9 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("RequestNumber") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("RequestTypeId") .IsRequired() @@ -14209,7 +14253,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Type") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.HasKey("Id"); @@ -14276,7 +14321,8 @@ namespace Erp.Platform.Migrations b.Property("Route") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -14679,13 +14725,15 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2"); b.Property("PollQuestion") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("PollTotalVotes") .HasColumnType("int"); b.Property("PollUserVoteId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("SocialPostId") .HasColumnType("uniqueidentifier"); @@ -15188,7 +15236,8 @@ namespace Erp.Platform.Migrations b.Property("Value") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.HasKey("Id"); @@ -15939,7 +15988,8 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("BadgeNumber") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("CheckIn") .HasColumnType("datetime2"); @@ -15999,7 +16049,8 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("Photo") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); b.Property("Purpose") .HasMaxLength(250) @@ -17346,9 +17397,6 @@ namespace Erp.Platform.Migrations .HasMaxLength(50) .HasColumnType("nvarchar(50)"); - b.Property("Code") - .HasColumnType("nvarchar(max)"); - b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -17618,7 +17666,8 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("LastPostUserName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("Name") .IsRequired() @@ -21253,17 +21302,6 @@ namespace Erp.Platform.Migrations b.Navigation("Template"); }); - modelBuilder.Entity("Erp.Platform.Entities.PlanEmployee", b => - { - b.HasOne("Erp.Platform.Entities.PlanWizard", "PlanWizard") - .WithMany("Employees") - .HasForeignKey("PlanWizardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PlanWizard"); - }); - modelBuilder.Entity("Erp.Platform.Entities.PlanWizard", b => { b.HasOne("Erp.Platform.Entities.Workcenter", "Workcenter") @@ -21275,6 +21313,17 @@ namespace Erp.Platform.Migrations b.Navigation("Workcenter"); }); + modelBuilder.Entity("Erp.Platform.Entities.PlanWizardEmployee", b => + { + b.HasOne("Erp.Platform.Entities.PlanWizard", "PlanWizard") + .WithMany("Employees") + .HasForeignKey("PlanWizardId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PlanWizard"); + }); + modelBuilder.Entity("Erp.Platform.Entities.PlanWizardMaterial", b => { b.HasOne("Erp.Platform.Entities.PlanWizard", "PlanWizard") @@ -21696,6 +21745,12 @@ namespace Erp.Platform.Migrations .OnDelete(DeleteBehavior.Restrict) .IsRequired(); + b.HasOne("Erp.Platform.Entities.Request", "Request") + .WithMany("Quotations") + .HasForeignKey("RequestId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + b.HasOne("Erp.Platform.Entities.RequestType", "RequestType") .WithMany() .HasForeignKey("RequestTypeId") @@ -21720,6 +21775,8 @@ namespace Erp.Platform.Migrations b.Navigation("PaymentTerm"); + b.Navigation("Request"); + b.Navigation("RequestType"); b.Navigation("Status"); @@ -23004,6 +23061,8 @@ namespace Erp.Platform.Migrations b.Navigation("Items"); b.Navigation("PurchaseOrders"); + + b.Navigation("Quotations"); }); modelBuilder.Entity("Erp.Platform.Entities.RequestType", b => diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index b4221b00..44393aea 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -2133,8 +2133,8 @@ "WorkHours": [ { "Name": "00:00-23:59", - "StartHour": "1970-01-01T00:00:00", - "EndHour": "1970-01-01T23:59:59", + "StartTime": "1970-01-01T00:00:00", + "EndTime": "1970-01-01T23:59:59", "IsFixed": false, "Monday": true, "Tuesday": true, diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index ed392601..aef8cd68 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -835,8 +835,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency await _workHourRepository.InsertAsync(new() { Name = item.Name, - StartHour = item.StartHour, - EndHour = item.EndHour, + StartTime = item.StartTime, + EndTime = item.EndTime, Monday = item.Monday, Tuesday = item.Tuesday, Wednesday = item.Wednesday, diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index d9c02c2f..fc197194 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -1434,8 +1434,8 @@ public class VaccineSeedDto public class WorkHourSeedDto { public string Name { get; set; } - public DateTime StartHour { get; set; } - public DateTime EndHour { get; set; } + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } public bool? IsFixed { get; set; } public bool? Monday { get; set; } public bool? Tuesday { get; set; }