From ddc8054bb4757e5a147ef4f34ad3a5b22ae6e141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Wed, 3 Dec 2025 17:52:02 +0300 Subject: [PATCH] AiBot ListformSeeder --- .../Seeds/HostData.json | 5 +- .../Seeds/HostDataSeeder.cs | 6 + .../Seeds/LanguagesData.json | 6 + .../Seeds/ListFormSeeder_Saas.cs | 201 ++++++++++++++++-- .../Seeds/MenusData.json | 26 ++- .../Seeds/PermissionsData.json | 84 ++++++-- .../Erp.Platform.Domain/Data/SeedConsts.cs | 1 + .../Entities/Host/AiBot.cs | 5 +- ....cs => 20251203145036_Initial.Designer.cs} | 11 +- ...8_Initial.cs => 20251203145036_Initial.cs} | 5 +- .../PlatformDbContextModelSnapshot.cs | 9 + 11 files changed, 312 insertions(+), 47 deletions(-) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251202182338_Initial.Designer.cs => 20251203145036_Initial.Designer.cs} (99%) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251202182338_Initial.cs => 20251203145036_Initial.cs} (99%) diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/HostData.json b/api/src/Erp.Platform.DbMigrator/Seeds/HostData.json index 69b014ff..ad2ed79c 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/HostData.json @@ -1,7 +1,10 @@ { "AiBots": [ { - "BotName": "Chat Bot" + "BotName": "Chat Bot", + "Description": "A general purpose chat bot that can answer questions and have conversations.", + "ApiUrl": "https://api.openai.com/v1/chat/completions", + "IsActive": true } ], "Settings": [ diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/HostDataSeeder.cs b/api/src/Erp.Platform.DbMigrator/Seeds/HostDataSeeder.cs index 03ab5641..5b3689d3 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/HostDataSeeder.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/HostDataSeeder.cs @@ -27,6 +27,9 @@ namespace Erp.Platform.Data.Seeds; public class AiBotSeedDto { public string BotName { get; set; } + public string Description { get; set; } + public string ApiUrl { get; set; } + public bool IsActive { get; set; } } public class LanguageTextsSeedDto @@ -674,6 +677,9 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency await _aiBotRepository.InsertAsync(new AiBot { BotName = item.BotName, + Description = item.Description, + ApiUrl = item.ApiUrl, + IsActive = item.IsActive }); } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index d7358dd0..b9ab5b31 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -3151,6 +3151,12 @@ "en": "Access Failed Count", "tr": "Başarısız Erişim Sayısı" }, + { + "resourceName": "Platform", + "key": "App.AiBot", + "en": "AI Bots", + "tr": "Yapay Zeka Botları" + }, { "resourceName": "Platform", "key": "Abp.Identity.Ai", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs index 70b918c8..c73e06a0 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs @@ -56,7 +56,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -528,7 +529,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -989,7 +991,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1361,7 +1364,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1506,6 +1510,147 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency } #endregion + #region AiBot + listFormName = AppCodes.AiBot; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.AiBot)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Int32, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + PagerOptionJson = DefaultPagerOptionJson, + DeleteCommand = $"DELETE FROM \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.AiBot))}\" WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Id", FieldDbType = DbType.Int32, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 350, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = [ + new EditingFormItemDto { Order=1, DataField="BotName", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=2, DataField="Description", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=3, DataField="ApiUrl", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=4, DataField="IsActive", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxCheckBox } + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }) + } + ); + + #region AiBot Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "BotName", + Width = 100, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 400, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ApiUrl", + Width = 400, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ]); + #endregion + } + #endregion + #region Language listFormName = AppCodes.Languages.Language; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) @@ -1513,7 +1658,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1663,7 +1809,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1843,7 +1990,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2017,7 +2165,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2298,7 +2447,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2429,7 +2579,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2900,7 +3051,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -3131,7 +3283,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -3322,7 +3475,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -3548,7 +3702,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -3656,7 +3811,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -3764,7 +3920,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -3919,7 +4076,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -4005,7 +4163,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -4208,7 +4367,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -4355,7 +4515,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index a6118ad7..f33c656c 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -1022,7 +1022,7 @@ "ParentCode": null, "Code": "App.Platform", "DisplayName": "App.Platform", - "Order": 100, + "Order": 100000, "Url": null, "Icon": "FcTabletAndroid", "RequiredPermissionName": null, @@ -1088,11 +1088,21 @@ "RequiredPermissionName": "App.Settings.GlobalSearch", "IsDisabled": false }, + { + "ParentCode": "App.Saas", + "Code": "App.AiBot", + "DisplayName": "App.AiBot", + "Order": 4, + "Url": "/admin/list/App.AiBot", + "Icon": "FcDepartment", + "RequiredPermissionName": "App.AiBot", + "IsDisabled": false + }, { "ParentCode": "App.Saas", "Code": "App.Languages", "DisplayName": "App.Languages", - "Order": 4, + "Order": 5, "Url": null, "Icon": "FcGlobe", "RequiredPermissionName": null, @@ -1122,7 +1132,7 @@ "ParentCode": "App.Saas", "Code": "App.Routes", "DisplayName": "App.Routes", - "Order": 5, + "Order": 6, "Url": "/admin/list/App.Routes", "Icon": "FaSynagogue", "RequiredPermissionName": "App.Routes", @@ -1132,7 +1142,7 @@ "ParentCode": "App.Saas", "Code": "App.Menus", "DisplayName": "App.Menus", - "Order": 6, + "Order": 7, "Url": null, "Icon": "FaSchlix", "RequiredPermissionName": null, @@ -1162,7 +1172,7 @@ "ParentCode": "App.Saas", "Code": "App.Listforms", "DisplayName": "App.Listforms", - "Order": 7, + "Order": 8, "Url": null, "Icon": "FcList", "RequiredPermissionName": null, @@ -1202,7 +1212,7 @@ "ParentCode": "App.Saas", "Code": "App.Notifications", "DisplayName": "App.Notifications", - "Order": 8, + "Order": 9, "Url": null, "Icon": "FcWorkflow", "RequiredPermissionName": null, @@ -1232,7 +1242,7 @@ "ParentCode": "App.Saas", "Code": "App.BackgroundWorkers", "DisplayName": "App.BackgroundWorkers", - "Order": 9, + "Order": 10, "Url": "/admin/list/App.BackgroundWorkers", "Icon": "FcScatterPlot", "RequiredPermissionName": "App.BackgroundWorkers", @@ -1242,7 +1252,7 @@ "ParentCode": "App.Saas", "Code": "App.ForumManagement", "DisplayName": "App.ForumManagement", - "Order": 10, + "Order": 11, "Url": "/admin/forumManagement", "Icon": "FcReading", "RequiredPermissionName": "App.ForumManagement", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index 60c6f1cb..0f18ec22 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -1,9 +1,5 @@ { "PermissionGroupDefinitionRecords": [ - { - "Name": "App.Platform", - "DisplayName": "App.Platform" - }, { "Name": "App.Saas", "DisplayName": "App.Saas" @@ -55,6 +51,10 @@ { "Name": "App.Accounting", "DisplayName": "App.Accounting" + }, + { + "Name": "App.Platform", + "DisplayName": "App.Platform" } ], "PermissionDefinitionRecords": [ @@ -67,15 +67,6 @@ "MultiTenancySide": 3, "MenuGroup": "Erp|Kurs" }, - { - "GroupName": "App.Platform", - "Name": "App.Product.ListComponent", - "ParentName": null, - "DisplayName": "App.Product.ListComponent", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Erp|Kurs" - }, { "GroupName": "App.Saas", "Name": "AbpTenantManagement.Tenants", @@ -220,6 +211,71 @@ "MultiTenancySide": 2, "MenuGroup": "Erp|Kurs" }, + + { + "GroupName": "App.Saas", + "Name": "App.AiBot", + "ParentName": null, + "DisplayName": "App.AiBot", + "IsEnabled": true, + "MultiTenancySide": 2, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Saas", + "Name": "App.AiBot.Create", + "ParentName": "App.AiBot", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 2, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Saas", + "Name": "App.AiBot.Delete", + "ParentName": "App.AiBot", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 2, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Saas", + "Name": "App.AiBot.Export", + "ParentName": "App.AiBot", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 2, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Saas", + "Name": "App.AiBot.Import", + "ParentName": "App.AiBot", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 2, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Saas", + "Name": "App.AiBot.Note", + "ParentName": "App.AiBot", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 2, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Saas", + "Name": "App.AiBot.Update", + "ParentName": "App.AiBot", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 2, + "MenuGroup": "Erp|Kurs" + }, + { "GroupName": "App.Saas", "Name": "App.Settings.SettingDefinitions", @@ -13037,4 +13093,4 @@ "MenuGroup": "Erp" } ] -} \ No newline at end of file +} diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index 044b39da..c1d457fe 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -329,6 +329,7 @@ public static class SeedConsts public const string GlobalSearch = Default + ".GlobalSearch"; public const string SettingDefinitions = Default + ".SettingDefinitions"; } + public const string AiBot = Prefix.App + ".AiBot"; public static class Languages { public const string Default = Prefix.App + ".Languages"; diff --git a/api/src/Erp.Platform.Domain/Entities/Host/AiBot.cs b/api/src/Erp.Platform.Domain/Entities/Host/AiBot.cs index 9024ba73..0ab8e589 100644 --- a/api/src/Erp.Platform.Domain/Entities/Host/AiBot.cs +++ b/api/src/Erp.Platform.Domain/Entities/Host/AiBot.cs @@ -6,6 +6,7 @@ namespace Erp.Platform.Entities; public class AiBot : Entity { public string BotName { get; set; } + public string Description { get; set; } + public string ApiUrl { get; set; } + public bool IsActive { get; set; } } - - diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251202182338_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251203145036_Initial.Designer.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251202182338_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251203145036_Initial.Designer.cs index 8a96d82e..ec2f53f9 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251202182338_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251203145036_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251202182338_Initial")] + [Migration("20251203145036_Initial")] partial class Initial { /// @@ -720,11 +720,20 @@ namespace Erp.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); + b.Property("ApiUrl") + .HasColumnType("nvarchar(max)"); + b.Property("BotName") .IsRequired() .HasMaxLength(128) .HasColumnType("nvarchar(128)"); + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + b.HasKey("Id"); b.ToTable("Plat_H_AiBot", (string)null); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251202182338_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251203145036_Initial.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251202182338_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251203145036_Initial.cs index 8d57c5f2..9c5ff032 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251202182338_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251203145036_Initial.cs @@ -1645,7 +1645,10 @@ namespace Erp.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - BotName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false) + BotName = 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), + IsActive = table.Column(type: "bit", nullable: false) }, constraints: table => { diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index ab1f9953..878f8122 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -717,11 +717,20 @@ namespace Erp.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); + b.Property("ApiUrl") + .HasColumnType("nvarchar(max)"); + b.Property("BotName") .IsRequired() .HasMaxLength(128) .HasColumnType("nvarchar(128)"); + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + b.HasKey("Id"); b.ToTable("Plat_H_AiBot", (string)null);