diff --git a/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Saas.cs b/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Saas.cs index d9eb0165..ea4e4ea9 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Saas.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Saas.cs @@ -2497,6 +2497,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency Description = $"{listFormName}.Description", SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.UomCategory)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, KeyFieldName = "Id", KeyFieldDbSourceType = DbType.String, DefaultFilter = DefaultFilterJson, @@ -2602,6 +2606,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency Description = $"{listFormName}.Description", SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Uom)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, KeyFieldName = "Id", KeyFieldDbSourceType = DbType.String, DefaultFilter = DefaultFilterJson, diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json index 4bf89cac..24e858d0 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json @@ -391,252 +391,6 @@ } } ], - "UomCategories": [ - { - "Name": "Adet" - }, - { - "Name": "Ağırlık" - }, - { - "Name": "Çalışma Süresi" - }, - { - "Name": "Uzunluk / Mesafe" - }, - { - "Name": "Yüzey" - }, - { - "Name": "Hacim" - } - ], - "Uoms": [ - { - "Name": "Adet", - "Type": "Reference", - "Ratio": 1.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Adet" - }, - { - "Name": "Deste", - "Type": "SmallerThanReference", - "Ratio": 10.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Adet" - }, - { - "Name": "Düzine", - "Type": "BiggerThanReference", - "Ratio": 12.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Adet" - }, - { - "Name": "g", - "Type": "SmallerThanReference", - "Ratio": 1000.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Ağırlık" - }, - { - "Name": "ons", - "Type": "SmallerThanReference", - "Ratio": 35.274, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Ağırlık" - }, - { - "Name": "pound", - "Type": "SmallerThanReference", - "Ratio": 2.20462, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Ağırlık" - }, - { - "Name": "kg", - "Type": "Reference", - "Ratio": 1.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Ağırlık" - }, - { - "Name": "t", - "Type": "BiggerThanReference", - "Ratio": 1000.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Ağırlık" - }, - { - "Name": "Saat", - "Type": "SmallerThanReference", - "Ratio": 8.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Çalışma Süresi" - }, - { - "Name": "Gün", - "Type": "Reference", - "Ratio": 1.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Çalışma Süresi" - }, - { - "Name": "mm", - "Type": "SmallerThanReference", - "Ratio": 1000.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "cm", - "Type": "SmallerThanReference", - "Ratio": 100.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "inç", - "Type": "SmallerThanReference", - "Ratio": 39.3701, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "ayak", - "Type": "SmallerThanReference", - "Ratio": 3.28084, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "yd", - "Type": "SmallerThanReference", - "Ratio": 1.09361, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "m", - "Type": "Reference", - "Ratio": 1.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "MT", - "Type": "SmallerThanReference", - "Ratio": 1.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "km", - "Type": "BiggerThanReference", - "Ratio": 1000.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "mil", - "Type": "BiggerThanReference", - "Ratio": 1609.34, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Uzunluk / Mesafe" - }, - { - "Name": "ft²", - "Type": "SmallerThanReference", - "Ratio": 10.76391, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Yüzey" - }, - { - "Name": "m²", - "Type": "Reference", - "Ratio": 1.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Yüzey" - }, - { - "Name": "inç³", - "Type": "SmallerThanReference", - "Ratio": 61.0237, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Hacim" - }, - { - "Name": "sıvı ons (Amerikan)", - "Type": "SmallerThanReference", - "Ratio": 33.814, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Hacim" - }, - { - "Name": "çeyrek(Amerikan)", - "Type": "SmallerThanReference", - "Ratio": 1.05669, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Hacim" - }, - { - "Name": "L", - "Type": "Reference", - "Ratio": 1.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Hacim" - }, - { - "Name": "galon (Amerikan)", - "Type": "BiggerThanReference", - "Ratio": 3.78541, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Hacim" - }, - { - "Name": "ayak³", - "Type": "BiggerThanReference", - "Ratio": 28.3168, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Hacim" - }, - { - "Name": "m³", - "Type": "BiggerThanReference", - "Ratio": 1000.0, - "IsActive": true, - "Rounding": 0.01, - "UomCategoryName": "Hacim" - } - ], "ReportCategories": [ { "name": "Raporlar", diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs index 96f7ed21..49610786 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs @@ -25,8 +25,6 @@ public class TenantSeederDto //Definitions public List WorkHours { get; set; } - public List UomCategories { get; set; } - public List Uoms { get; set; } public List Departments { get; set; } public List JobPositions { get; set; } @@ -216,23 +214,6 @@ public class DepartmentSeedDto public string ParentName { get; set; } } -public class UomCategorySeedDto -{ - public Guid Id { get; set; } - - public string Name { get; set; } -} - -public class UomSeedDto -{ - public string Name { get; set; } - public string Type { get; set; } - public decimal Ratio { get; set; } - public bool IsActive { get; set; } - public decimal Rounding { get; set; } - public string UomCategoryName { get; set; } -} - public class ForumCategorySeedDto { public string Name { get; set; } @@ -362,8 +343,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _aboutRepository; private readonly IRepository _servicesRepository; private readonly IRepository _contactRepository; - private readonly IRepository _uomCategoryRepository; - private readonly IRepository _uomRepository; private readonly IRepository _forumCategoryRepository; private readonly IRepository _workHourRepository; private readonly IIdentityUserRepository _repositoryUser; @@ -389,8 +368,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency ILookupNormalizer lookupNormalizer, IIdentityUserRepository repositoryUser, IRepository branchRepository, - IRepository uomCategoryRepository, - IRepository uomRepository, IRepository reportCategoriesRepository, IRepository reportTemplatesRepository, IRepository homeRepository, @@ -420,8 +397,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _lookupNormalizer = lookupNormalizer; _repositoryUser = repositoryUser; _branchRepository = branchRepository; - _uomCategoryRepository = uomCategoryRepository; - _uomRepository = uomRepository; _reportCategoriesRepository = reportCategoriesRepository; _reportTemplatesRepository = reportTemplatesRepository; _homeRepository = homeRepository; @@ -461,39 +436,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }; - foreach (var item in items.UomCategories) - { - var exists = await _uomCategoryRepository.AnyAsync(x => x.Name == item.Name); - - if (!exists) - { - await _uomCategoryRepository.InsertAsync(new UomCategory(item.Name) { Name = item.Name }, autoSave: true); - } - } - - foreach (var item in items.Uoms) - { - var exists = await _uomRepository.AnyAsync(x => x.Name == item.Name); - - if (!exists) - { - var category = await _uomCategoryRepository.FirstOrDefaultAsync(x => x.Name == item.UomCategoryName); - if (category != null) - { - - await _uomRepository.InsertAsync(new Uom(item.Name) - { - Name = item.Name, - Type = item.Type, - Ratio = item.Ratio, - IsActive = item.IsActive, - Rounding = item.Rounding, - UomCategoryId = category.Id - }); - } - } - } - foreach (var item in items.ForumCategories) { var exists = await _forumCategoryRepository.AnyAsync(x => x.Name == item.Name); diff --git a/configs/seeds/host/data/App.Definitions.Uom.json b/configs/seeds/host/data/App.Definitions.Uom.json new file mode 100644 index 00000000..b0840857 --- /dev/null +++ b/configs/seeds/host/data/App.Definitions.Uom.json @@ -0,0 +1,260 @@ +{ + "ListFormCode": "App.Definitions.Uom", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 20, + "Rows": [ + { + "Id": "Adet", + "Name": "Adet", + "Type": "Reference", + "Ratio": 1.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Adet" + }, + { + "Id": "Deste", + "Name": "Deste", + "Type": "SmallerThanReference", + "Ratio": 10.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Adet" + }, + { + "Id": "Düzine", + "Name": "Düzine", + "Type": "BiggerThanReference", + "Ratio": 12.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Adet" + }, + { + "Id": "g", + "Name": "g", + "Type": "SmallerThanReference", + "Ratio": 1000.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Ağırlık" + }, + { + "Id": "ons", + "Name": "ons", + "Type": "SmallerThanReference", + "Ratio": 35.274, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Ağırlık" + }, + { + "Id": "pound", + "Name": "pound", + "Type": "SmallerThanReference", + "Ratio": 2.20462, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Ağırlık" + }, + { + "Id": "kg", + "Name": "kg", + "Type": "Reference", + "Ratio": 1.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Ağırlık" + }, + { + "Id": "t", + "Name": "t", + "Type": "BiggerThanReference", + "Ratio": 1000.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Ağırlık" + }, + { + "Id": "Saat", + "Name": "Saat", + "Type": "SmallerThanReference", + "Ratio": 8.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Çalışma Süresi" + }, + { + "Id": "Gün", + "Name": "Gün", + "Type": "Reference", + "Ratio": 1.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Çalışma Süresi" + }, + { + "Id": "mm", + "Name": "mm", + "Type": "SmallerThanReference", + "Ratio": 1000.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "cm", + "Name": "cm", + "Type": "SmallerThanReference", + "Ratio": 100.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "inç", + "Name": "inç", + "Type": "SmallerThanReference", + "Ratio": 39.3701, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "ayak", + "Name": "ayak", + "Type": "SmallerThanReference", + "Ratio": 3.28084, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "yd", + "Name": "yd", + "Type": "SmallerThanReference", + "Ratio": 1.09361, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "m", + "Name": "m", + "Type": "Reference", + "Ratio": 1.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "MT", + "Name": "MT", + "Type": "SmallerThanReference", + "Ratio": 1.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "km", + "Name": "km", + "Type": "BiggerThanReference", + "Ratio": 1000.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "mil", + "Name": "mil", + "Type": "BiggerThanReference", + "Ratio": 1609.34, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Uzunluk / Mesafe" + }, + { + "Id": "ft²", + "Name": "ft²", + "Type": "SmallerThanReference", + "Ratio": 10.76391, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Yüzey" + }, + { + "Id": "m²", + "Name": "m²", + "Type": "Reference", + "Ratio": 1.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Yüzey" + }, + { + "Id": "inç³", + "Name": "inç³", + "Type": "SmallerThanReference", + "Ratio": 61.0237, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Hacim" + }, + { + "Id": "sıvı ons (Amerikan)", + "Name": "sıvı ons (Amerikan)", + "Type": "SmallerThanReference", + "Ratio": 33.814, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Hacim" + }, + { + "Id": "çeyrek(Amerikan)", + "Name": "çeyrek(Amerikan)", + "Type": "SmallerThanReference", + "Ratio": 1.05669, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Hacim" + }, + { + "Id": "L", + "Name": "L", + "Type": "Reference", + "Ratio": 1.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Hacim" + }, + { + "Id": "galon (Amerikan)", + "Name": "galon (Amerikan)", + "Type": "BiggerThanReference", + "Ratio": 3.78541, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Hacim" + }, + { + "Id": "ayak³", + "Name": "ayak³", + "Type": "BiggerThanReference", + "Ratio": 28.3168, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Hacim" + }, + { + "Id": "m³", + "Name": "m³", + "Type": "BiggerThanReference", + "Ratio": 1000.0, + "Rounding": 0.01, + "IsActive": true, + "UomCategoryId": "Hacim" + } + ] +} diff --git a/configs/seeds/host/data/App.Definitions.UomCategory.json b/configs/seeds/host/data/App.Definitions.UomCategory.json new file mode 100644 index 00000000..6f61f5a0 --- /dev/null +++ b/configs/seeds/host/data/App.Definitions.UomCategory.json @@ -0,0 +1,32 @@ +{ + "ListFormCode": "App.Definitions.UomCategory", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 10, + "Rows": [ + { + "Id": "Adet", + "Name": "Adet" + }, + { + "Id": "Ağırlık", + "Name": "Ağırlık" + }, + { + "Id": "Çalışma Süresi", + "Name": "Çalışma Süresi" + }, + { + "Id": "Uzunluk / Mesafe", + "Name": "Uzunluk / Mesafe" + }, + { + "Id": "Yüzey", + "Name": "Yüzey" + }, + { + "Id": "Hacim", + "Name": "Hacim" + } + ] +}