diff --git a/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Administration.cs b/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Administration.cs index 773fb215..6a285076 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Administration.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Administration.cs @@ -3466,6 +3466,10 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep Description = $"{listFormName}.Description", SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Survey)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = DefaultFilterJson, @@ -3625,6 +3629,25 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + EditGroupOrderNo = 1, + EditOrderNo = 5, + EditorType2 = EditorTypes.dxTextArea, + ColSpan = 3, + CaptionName = "App.Listform.ListformField.Description", + Width = 0, + ListOrderNo = 7, + Visible = false, + IsActive = true, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, @@ -3673,6 +3696,10 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep Description = $"{listFormName}.Description", SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SurveyQuestion)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = DefaultFilterJson, @@ -3870,6 +3897,10 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep Description = $"{listFormName}.Description", SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SurveyQuestionOption)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = DefaultFilterJson, diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json index 269c1660..4370c1e3 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json @@ -391,171 +391,6 @@ } } ], - "Surveys": [ - { - "Title": "Çalışan Memnuniyet Anketi 2024", - "Description": "Yıllık çalışan memnuniyeti ve bağlılık araştırması", - "Deadline": "2024-10-31T00:00:00", - "Responses": 0, - "Status": "active", - "IsAnonymous": true - }, - { - "Title": "Eğitim İhtiyaç Analizi", - "Description": "2025 yılı eğitim planlaması için ihtiyaç tespiti", - "Deadline": "2024-11-15T00:00:00", - "Responses": 0, - "Status": "active", - "IsAnonymous": false - }, - { - "Title": "Kafeterya Memnuniyet Anketi", - "Description": "Yemek kalitesi ve servis değerlendirmesi", - "Deadline": "2024-09-30T00:00:00", - "Responses": 0, - "Status": "passive", - "IsAnonymous": true - } - ], - "SurveyQuestions": [ - { - "SurveyTitle": "Çalışan Memnuniyet Anketi 2024", - "QuestionText": "Genel memnuniyet düzeyiniz nedir?", - "Type": "rating", - "Order": 1, - "IsRequired": true - }, - { - "SurveyTitle": "Çalışan Memnuniyet Anketi 2024", - "QuestionText": "Hangi departmanda çalışıyorsunuz?", - "Type": "multiple-choice", - "Order": 2, - "IsRequired": true - }, - { - "SurveyTitle": "Çalışan Memnuniyet Anketi 2024", - "QuestionText": "Görüş ve önerileriniz", - "Type": "textarea", - "Order": 3, - "IsRequired": false - }, - { - "SurveyTitle": "Çalışan Memnuniyet Anketi 2024", - "QuestionText": "Çalışma ortamından memnun musunuz?", - "Type": "yes-no", - "Order": 4, - "IsRequired": true - }, - { - "SurveyTitle": "Eğitim İhtiyaç Analizi", - "QuestionText": "Hangi teknoloji konularında eğitim almak istiyorsunuz?", - "Type": "multiple-choice", - "Order": 1, - "IsRequired": true - }, - { - "SurveyTitle": "Eğitim İhtiyaç Analizi", - "QuestionText": "Eğitim formatı tercihiniz nedir?", - "Type": "multiple-choice", - "Order": 2, - "IsRequired": true - }, - { - "SurveyTitle": "Eğitim İhtiyaç Analizi", - "QuestionText": "Eğitim için haftalık ne kadar zaman ayırabilirsiniz?", - "Type": "rating", - "Order": 3, - "IsRequired": true - }, - { - "SurveyTitle": "Kafeterya Memnuniyet Anketi", - "QuestionText": "Yemek kalitesini nasıl değerlendiriyorsunuz?", - "Type": "rating", - "Order": 1, - "IsRequired": true - }, - { - "SurveyTitle": "Kafeterya Memnuniyet Anketi", - "QuestionText": "Hangi yemekleri daha sık görmek istiyorsunuz?", - "Type": "textarea", - "Order": 2, - "IsRequired": false - }, - { - "SurveyTitle": "Kafeterya Memnuniyet Anketi", - "QuestionText": "Servis hızından memnun musunuz?", - "Type": "yes-no", - "Order": 3, - "IsRequired": true - } - ], - "SurveyQuestionOptions": [ - { - "QuestionText": "Hangi departmanda çalışıyorsunuz?", - "Text": "Bilgi Teknolojileri", - "Order": 1 - }, - { - "QuestionText": "Hangi departmanda çalışıyorsunuz?", - "Text": "İnsan Kaynakları", - "Order": 2 - }, - { - "QuestionText": "Hangi departmanda çalışıyorsunuz?", - "Text": "Finans", - "Order": 3 - }, - { - "QuestionText": "Hangi departmanda çalışıyorsunuz?", - "Text": "Satış", - "Order": 4 - }, - { - "QuestionText": "Hangi departmanda çalışıyorsunuz?", - "Text": "Pazarlama", - "Order": 5 - }, - { - "QuestionText": "Hangi teknoloji konularında eğitim almak istiyorsunuz?", - "Text": "React / Frontend", - "Order": 1 - }, - { - "QuestionText": "Hangi teknoloji konularında eğitim almak istiyorsunuz?", - "Text": "Node.js / Backend", - "Order": 2 - }, - { - "QuestionText": "Hangi teknoloji konularında eğitim almak istiyorsunuz?", - "Text": "Database / SQL", - "Order": 3 - }, - { - "QuestionText": "Hangi teknoloji konularında eğitim almak istiyorsunuz?", - "Text": "DevOps / Cloud", - "Order": 4 - }, - { - "QuestionText": "Hangi teknoloji konularında eğitim almak istiyorsunuz?", - "Text": "Mobile Development", - "Order": 5 - }, - { - "QuestionText": "Eğitim formatı tercihiniz nedir?", - "Text": "Online Eğitim", - "Order": 1 - }, - { - "QuestionText": "Eğitim formatı tercihiniz nedir?", - "Text": "Yüz Yüze Eğitim", - "Order": 2 - }, - { - "QuestionText": "Eğitim formatı tercihiniz nedir?", - "Text": "Hibrit (Karma)", - "Order": 3 - } - ], "SocialPosts": [ { "content": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs index ee261902..a6056b18 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs @@ -36,9 +36,6 @@ public class TenantSeederDto public List ForumCategories { get; set; } //Intranet - public List Surveys { get; set; } - public List SurveyQuestions { get; set; } - public List SurveyQuestionOptions { get; set; } public List SocialPosts { get; set; } public List SocialMedias { get; set; } public List SocialPollOptions { get; set; } @@ -149,32 +146,6 @@ public class EventPhotoSeedDto public string Url { get; set; } } -public class SurveySeedDto -{ - public string Title { get; set; } - public string Description { get; set; } - public DateTime Deadline { get; set; } - public int Responses { get; set; } - public string Status { get; set; } - public bool IsAnonymous { get; set; } -} - -public class SurveyQuestionSeedDto -{ - public string QuestionText { get; set; } - public string SurveyTitle { get; set; } - public string Type { get; set; } - public int Order { get; set; } - public bool IsRequired { get; set; } -} - -public class SurveyQuestionOptionSeedDto -{ - public string QuestionText { get; set; } - public string Text { get; set; } - public int Order { get; set; } -} - public class ForumCategorySeedDto { public string Name { get; set; } @@ -273,9 +244,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _contactRepository; private readonly IRepository _forumCategoryRepository; private readonly IIdentityUserRepository _repositoryUser; - private readonly IRepository _surveyRepository; - private readonly IRepository _surveyQuestionRepository; - private readonly IRepository _surveyQuestionOptionRepository; private readonly IRepository _socialPostRepository; private readonly IRepository _socialMediaRepository; private readonly IRepository _socialPollOptionRepository; @@ -298,9 +266,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository contactRepository, IRepository forumCategoryRepository, - IRepository surveyRepository, - IRepository surveyQuestionRepository, - IRepository surveyQuestionOptionRepository, IRepository socialPostRepository, IRepository socialMediaRepository, IRepository socialPollOptionRepository, @@ -320,9 +285,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _aboutRepository = aboutRepository; _contactRepository = contactRepository; _forumCategoryRepository = forumCategoryRepository; - _surveyRepository = surveyRepository; - _surveyQuestionRepository = surveyQuestionRepository; - _surveyQuestionOptionRepository = surveyQuestionOptionRepository; _socialPostRepository = socialPostRepository; _socialMediaRepository = socialMediaRepository; _socialPollOptionRepository = socialPollOptionRepository; @@ -441,58 +403,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency } } - foreach (var item in items.Surveys) - { - var exists = await _surveyRepository.AnyAsync(x => x.Title == item.Title); - if (exists) - continue; - - await _surveyRepository.InsertAsync(new Survey - { - Title = item.Title, - Description = item.Description, - Deadline = item.Deadline, - Responses = item.Responses, - Status = item.Status, - IsAnonymous = item.IsAnonymous - }, autoSave: true); - } - - foreach (var item in items.SurveyQuestions) - { - var exists = await _surveyQuestionRepository.AnyAsync(x => x.QuestionText == item.QuestionText); - if (exists) - continue; - - var survey = await _surveyRepository.FirstOrDefaultAsync(x => x.Title == item.SurveyTitle); - await _surveyQuestionRepository.InsertAsync(new SurveyQuestion - { - SurveyId = survey != null ? survey.Id : Guid.Empty, - QuestionText = item.QuestionText, - Type = item.Type, - Order = item.Order, - IsRequired = item.IsRequired - }, autoSave: true); - } - - foreach (var item in items.SurveyQuestionOptions) - { - var surveyQuestion = await _surveyQuestionRepository.FirstOrDefaultAsync(x => x.QuestionText == item.QuestionText); - if (surveyQuestion == null) - continue; - - var exists = await _surveyQuestionOptionRepository.AnyAsync(x => x.QuestionId == surveyQuestion.Id && x.Text == item.Text); - if (exists) - continue; - - await _surveyQuestionOptionRepository.InsertAsync(new SurveyQuestionOption - { - QuestionId = surveyQuestion.Id, - Text = item.Text, - Order = item.Order - }, autoSave: true); - } - foreach (var item in items.SocialPosts) { var exists = await _socialPostRepository.AnyAsync(x => x.Content == item.Content); diff --git a/configs/seeds/host/data/App.Intranet.Survey.json b/configs/seeds/host/data/App.Intranet.Survey.json new file mode 100644 index 00000000..841a22a6 --- /dev/null +++ b/configs/seeds/host/data/App.Intranet.Survey.json @@ -0,0 +1,35 @@ +{ + "ListFormCode": "App.Intranet.Survey", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 10, + "Rows": [ + { + "Id": "2bd94538-1f3a-5bf4-8b9d-6d6cd48eb647", + "Title": "Çalışan Memnuniyet Anketi 2024", + "Description": "Yıllık çalışan memnuniyeti ve bağlılık araştırması", + "Deadline": "2024-10-31T00:00:00", + "Responses": 0, + "Status": "active", + "IsAnonymous": true + }, + { + "Id": "66382e36-4b20-516c-93e5-55189dd21307", + "Title": "Eğitim İhtiyaç Analizi", + "Description": "2025 yılı eğitim planlaması için ihtiyaç tespiti", + "Deadline": "2024-11-15T00:00:00", + "Responses": 0, + "Status": "active", + "IsAnonymous": false + }, + { + "Id": "cad56365-949f-5456-b07a-4d119170179b", + "Title": "Kafeterya Memnuniyet Anketi", + "Description": "Yemek kalitesi ve servis değerlendirmesi", + "Deadline": "2024-09-30T00:00:00", + "Responses": 0, + "Status": "passive", + "IsAnonymous": true + } + ] +} diff --git a/configs/seeds/host/data/App.Intranet.SurveyQuestion.json b/configs/seeds/host/data/App.Intranet.SurveyQuestion.json new file mode 100644 index 00000000..d9669f8f --- /dev/null +++ b/configs/seeds/host/data/App.Intranet.SurveyQuestion.json @@ -0,0 +1,88 @@ +{ + "ListFormCode": "App.Intranet.SurveyQuestion", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 20, + "Rows": [ + { + "Id": "e55d7b86-705f-5c36-ab46-2155a0e50878", + "SurveyId": "2bd94538-1f3a-5bf4-8b9d-6d6cd48eb647", + "QuestionText": "Genel memnuniyet düzeyiniz nedir?", + "Type": "rating", + "Order": 1, + "IsRequired": true + }, + { + "Id": "70ae758e-e783-57e9-af83-2af32d589655", + "SurveyId": "2bd94538-1f3a-5bf4-8b9d-6d6cd48eb647", + "QuestionText": "Hangi departmanda çalışıyorsunuz?", + "Type": "multiple-choice", + "Order": 2, + "IsRequired": true + }, + { + "Id": "0d68b29b-f748-5817-807b-a8dfaae7098d", + "SurveyId": "2bd94538-1f3a-5bf4-8b9d-6d6cd48eb647", + "QuestionText": "Görüş ve önerileriniz", + "Type": "textarea", + "Order": 3, + "IsRequired": false + }, + { + "Id": "4e5221dc-6f77-577d-8775-09ce35ef98d0", + "SurveyId": "2bd94538-1f3a-5bf4-8b9d-6d6cd48eb647", + "QuestionText": "Çalışma ortamından memnun musunuz?", + "Type": "yes-no", + "Order": 4, + "IsRequired": true + }, + { + "Id": "1bba7321-b814-5230-904b-547ab45ce0c8", + "SurveyId": "66382e36-4b20-516c-93e5-55189dd21307", + "QuestionText": "Hangi teknoloji konularında eğitim almak istiyorsunuz?", + "Type": "multiple-choice", + "Order": 1, + "IsRequired": true + }, + { + "Id": "f18df269-722c-5065-b92f-4c3a362f11a8", + "SurveyId": "66382e36-4b20-516c-93e5-55189dd21307", + "QuestionText": "Eğitim formatı tercihiniz nedir?", + "Type": "multiple-choice", + "Order": 2, + "IsRequired": true + }, + { + "Id": "f17ea50a-4aa9-5856-b25d-01f5ace973b1", + "SurveyId": "66382e36-4b20-516c-93e5-55189dd21307", + "QuestionText": "Eğitim için haftalık ne kadar zaman ayırabilirsiniz?", + "Type": "rating", + "Order": 3, + "IsRequired": true + }, + { + "Id": "53e67e61-5984-52b3-9733-6f42cf9b0252", + "SurveyId": "cad56365-949f-5456-b07a-4d119170179b", + "QuestionText": "Yemek kalitesini nasıl değerlendiriyorsunuz?", + "Type": "rating", + "Order": 1, + "IsRequired": true + }, + { + "Id": "d00a8dae-b1ee-55ca-aa79-6337ca212e9d", + "SurveyId": "cad56365-949f-5456-b07a-4d119170179b", + "QuestionText": "Hangi yemekleri daha sık görmek istiyorsunuz?", + "Type": "textarea", + "Order": 2, + "IsRequired": false + }, + { + "Id": "a1e1b3f2-e7e9-548f-875b-6abbab9977f0", + "SurveyId": "cad56365-949f-5456-b07a-4d119170179b", + "QuestionText": "Servis hızından memnun musunuz?", + "Type": "yes-no", + "Order": 3, + "IsRequired": true + } + ] +} diff --git a/configs/seeds/host/data/App.Intranet.SurveyQuestionOption.json b/configs/seeds/host/data/App.Intranet.SurveyQuestionOption.json new file mode 100644 index 00000000..d2d479d0 --- /dev/null +++ b/configs/seeds/host/data/App.Intranet.SurveyQuestionOption.json @@ -0,0 +1,86 @@ +{ + "ListFormCode": "App.Intranet.SurveyQuestionOption", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 30, + "Rows": [ + { + "Id": "b4ef9e54-193b-52a3-bdc3-27d0b3e7b532", + "QuestionId": "70ae758e-e783-57e9-af83-2af32d589655", + "Text": "Bilgi Teknolojileri", + "Order": 1 + }, + { + "Id": "ad0eb943-a816-5861-9ded-edc6b6b1270c", + "QuestionId": "70ae758e-e783-57e9-af83-2af32d589655", + "Text": "İnsan Kaynakları", + "Order": 2 + }, + { + "Id": "3cb6ad3d-e726-5ae6-92e8-e5b914e5c48c", + "QuestionId": "70ae758e-e783-57e9-af83-2af32d589655", + "Text": "Finans", + "Order": 3 + }, + { + "Id": "2ef023ce-7e27-51e6-aefe-2d170a40164e", + "QuestionId": "70ae758e-e783-57e9-af83-2af32d589655", + "Text": "Satış", + "Order": 4 + }, + { + "Id": "7c5c232f-62f5-539e-92fd-02a5aa6d4244", + "QuestionId": "70ae758e-e783-57e9-af83-2af32d589655", + "Text": "Pazarlama", + "Order": 5 + }, + { + "Id": "fa5376ab-0134-59a1-80c7-173c5e2b67b9", + "QuestionId": "1bba7321-b814-5230-904b-547ab45ce0c8", + "Text": "React / Frontend", + "Order": 1 + }, + { + "Id": "e8546587-e6f4-527a-a571-fbc9933297da", + "QuestionId": "1bba7321-b814-5230-904b-547ab45ce0c8", + "Text": "Node.js / Backend", + "Order": 2 + }, + { + "Id": "87bac524-9751-5d92-b415-08af9f47b85b", + "QuestionId": "1bba7321-b814-5230-904b-547ab45ce0c8", + "Text": "Database / SQL", + "Order": 3 + }, + { + "Id": "cc9cb0b0-6b8f-5f8c-8810-74ff3e7e8e25", + "QuestionId": "1bba7321-b814-5230-904b-547ab45ce0c8", + "Text": "DevOps / Cloud", + "Order": 4 + }, + { + "Id": "b62e5f62-643d-5933-b876-b059f7d57cfb", + "QuestionId": "1bba7321-b814-5230-904b-547ab45ce0c8", + "Text": "Mobile Development", + "Order": 5 + }, + { + "Id": "0be71f54-dcc6-5d97-bb38-a8d1925d8dc3", + "QuestionId": "f18df269-722c-5065-b92f-4c3a362f11a8", + "Text": "Online Eğitim", + "Order": 1 + }, + { + "Id": "11098114-cce3-5582-a34f-8567a9b37bdc", + "QuestionId": "f18df269-722c-5065-b92f-4c3a362f11a8", + "Text": "Yüz Yüze Eğitim", + "Order": 2 + }, + { + "Id": "805b2f1e-b1fd-5ce5-8051-d1ab233e62b8", + "QuestionId": "f18df269-722c-5065-b92f-4c3a362f11a8", + "Text": "Hibrit (Karma)", + "Order": 3 + } + ] +}