AiBots NotificationTypes NotificationRules ContactTitles Currencies
This commit is contained in:
parent
c76bcb3283
commit
ca80c9d2f5
10 changed files with 1314 additions and 1333 deletions
|
|
@ -1616,6 +1616,8 @@ configs/seeds/
|
||||||
│ │ # App.Menus.{Routes,Module,Menu}.json — route/modül/menü ağacı
|
│ │ # App.Menus.{Routes,Module,Menu}.json — route/modül/menü ağacı
|
||||||
│ │ # Abp.Identity.Permission{Groups,s}.json — yetki tanımları
|
│ │ # Abp.Identity.Permission{Groups,s}.json — yetki tanımları
|
||||||
│ │ # App.Definitions.{CountryGroup,Country,City,District}.json — adres zinciri
|
│ │ # App.Definitions.{CountryGroup,Country,City,District}.json — adres zinciri
|
||||||
|
│ │ # App.Definitions.{Currency,ContactTitle,AiBot}.json — para birimi, hitap, AI bot
|
||||||
|
│ │ # App.Notifications.Notification{Types,Rules}.json — bildirim tipi → kuralı
|
||||||
│ ├── sql/{object,execute}/ # .sql (SQL Server)
|
│ ├── sql/{object,execute}/ # .sql (SQL Server)
|
||||||
│ └── postgres/{object,execute}/
|
│ └── postgres/{object,execute}/
|
||||||
├── tenants/{tenantId}/… # aynı düzen, tenant kapsamı
|
├── tenants/{tenantId}/… # aynı düzen, tenant kapsamı
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -15,14 +15,6 @@ using static Sozsoft.Settings.SettingsConsts;
|
||||||
namespace Sozsoft.Platform.Data.Seeds;
|
namespace Sozsoft.Platform.Data.Seeds;
|
||||||
|
|
||||||
#region SeedDtos
|
#region SeedDtos
|
||||||
public class AiBotSeedDto
|
|
||||||
{
|
|
||||||
public string Name { get; set; }
|
|
||||||
public string Description { get; set; }
|
|
||||||
public string ApiUrl { get; set; }
|
|
||||||
public bool IsActive { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class LanguageTextsSeedDto
|
public class LanguageTextsSeedDto
|
||||||
{
|
{
|
||||||
public string ResourceName { get; set; }
|
public string ResourceName { get; set; }
|
||||||
|
|
@ -42,68 +34,30 @@ public class BackgroundWorkerSeedDto
|
||||||
public string AfterSp { get; set; }
|
public string AfterSp { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NotificationRuleSeedDto
|
|
||||||
{
|
|
||||||
public string NotificationType { get; set; }
|
|
||||||
public string RecipientType { get; set; }
|
|
||||||
public string RecipientId { get; set; }
|
|
||||||
public string Channel { get; set; }
|
|
||||||
public bool IsActive { get; set; }
|
|
||||||
public bool IsFixed { get; set; }
|
|
||||||
public bool IsCustomized { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CurrencySeedDto
|
|
||||||
{
|
|
||||||
public string Id { get; set; }
|
|
||||||
public string Symbol { get; set; }
|
|
||||||
public string Name { get; set; }
|
|
||||||
public bool IsActive { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ContactTitleSeedDto
|
|
||||||
{
|
|
||||||
public string Title { get; set; }
|
|
||||||
public string Abbreviation { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class HostSeederDto
|
public class HostSeederDto
|
||||||
{
|
{
|
||||||
public List<AiBotSeedDto> AiBots { get; set; }
|
|
||||||
public List<DataSource> DataSources { get; set; }
|
public List<DataSource> DataSources { get; set; }
|
||||||
public List<SettingDefinition> Settings { get; set; }
|
public List<SettingDefinition> Settings { get; set; }
|
||||||
public List<BackgroundWorkerSeedDto> BackgroundWorkers { get; set; }
|
public List<BackgroundWorkerSeedDto> BackgroundWorkers { get; set; }
|
||||||
public List<NotificationRuleSeedDto> NotificationRules { get; set; }
|
|
||||||
public List<CurrencySeedDto> Currencies { get; set; }
|
|
||||||
public List<ContactTitleSeedDto> ContactTitles { get; set; }
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public class HostDataSeeder : IDataSeedContributor, ITransientDependency
|
public class HostDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
{
|
{
|
||||||
private readonly IRepository<AiBot, Guid> _aiBotRepository;
|
|
||||||
private readonly IRepository<DataSource, Guid> _dataSources;
|
private readonly IRepository<DataSource, Guid> _dataSources;
|
||||||
private readonly IRepository<SettingDefinition, Guid> _settings;
|
private readonly IRepository<SettingDefinition, Guid> _settings;
|
||||||
private readonly IRepository<BackgroundWorker, Guid> _backgroundWorkerRepository;
|
private readonly IRepository<BackgroundWorker, Guid> _backgroundWorkerRepository;
|
||||||
private readonly IRepository<Currency, string> _currencyRepository;
|
|
||||||
private readonly IRepository<ContactTitle, Guid> _contactTitleRepository;
|
|
||||||
|
|
||||||
public HostDataSeeder(
|
public HostDataSeeder(
|
||||||
IRepository<AiBot, Guid> aiBotRepository,
|
|
||||||
IRepository<DataSource, Guid> dataSource,
|
IRepository<DataSource, Guid> dataSource,
|
||||||
IRepository<SettingDefinition, Guid> settings,
|
IRepository<SettingDefinition, Guid> settings,
|
||||||
IRepository<BackgroundWorker, Guid> backgroundWorkerRepository,
|
IRepository<BackgroundWorker, Guid> backgroundWorkerRepository,
|
||||||
IRepository<Currency, string> currencyRepository,
|
|
||||||
IRepository<ContactTitle, Guid> contactTitleRepository,
|
|
||||||
IRepository<Route, Guid> routeRepository
|
IRepository<Route, Guid> routeRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_aiBotRepository = aiBotRepository;
|
|
||||||
_dataSources = dataSource;
|
_dataSources = dataSource;
|
||||||
_settings = settings;
|
_settings = settings;
|
||||||
_backgroundWorkerRepository = backgroundWorkerRepository;
|
_backgroundWorkerRepository = backgroundWorkerRepository;
|
||||||
_currencyRepository = currencyRepository;
|
|
||||||
_contactTitleRepository = contactTitleRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IConfigurationRoot BuildConfiguration()
|
private static IConfigurationRoot BuildConfiguration()
|
||||||
|
|
@ -179,51 +133,6 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in items.Currencies)
|
|
||||||
{
|
|
||||||
var exists = await _currencyRepository.AnyAsync(x => x.Id == item.Id);
|
|
||||||
|
|
||||||
if (!exists)
|
|
||||||
{
|
|
||||||
await _currencyRepository.InsertAsync(new Currency(item.Id)
|
|
||||||
{
|
|
||||||
Symbol = item.Symbol,
|
|
||||||
Name = item.Name,
|
|
||||||
IsActive = item.IsActive
|
|
||||||
}, autoSave: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in items.ContactTitles)
|
|
||||||
{
|
|
||||||
var exists = await _contactTitleRepository.AnyAsync(x => x.Title == item.Title);
|
|
||||||
|
|
||||||
if (!exists)
|
|
||||||
{
|
|
||||||
await _contactTitleRepository.InsertAsync(new ContactTitle
|
|
||||||
{
|
|
||||||
Title = item.Title,
|
|
||||||
Abbreviation = item.Abbreviation,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in items.AiBots)
|
|
||||||
{
|
|
||||||
var exists = await _aiBotRepository.AnyAsync(x => x.Name == item.Name);
|
|
||||||
|
|
||||||
if (!exists)
|
|
||||||
{
|
|
||||||
await _aiBotRepository.InsertAsync(new AiBot
|
|
||||||
{
|
|
||||||
Name = item.Name,
|
|
||||||
Description = item.Description,
|
|
||||||
ApiUrl = item.ApiUrl,
|
|
||||||
IsActive = item.IsActive
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1335,6 +1335,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.AiBot)),
|
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.AiBot)),
|
||||||
KeyFieldName = "Id",
|
KeyFieldName = "Id",
|
||||||
KeyFieldDbSourceType = DbType.Guid,
|
KeyFieldDbSourceType = DbType.Guid,
|
||||||
|
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||||
|
SeedSyncInsert = true,
|
||||||
|
SeedSyncUpdate = true,
|
||||||
|
SeedSyncDelete = true,
|
||||||
SortMode = GridOptions.SortModeSingle,
|
SortMode = GridOptions.SortModeSingle,
|
||||||
FilterRowJson = DefaultFilterRowJson(),
|
FilterRowJson = DefaultFilterRowJson(),
|
||||||
HeaderFilterJson = DefaultHeaderFilterJson(),
|
HeaderFilterJson = DefaultHeaderFilterJson(),
|
||||||
|
|
@ -1518,6 +1522,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ContactTitle)),
|
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ContactTitle)),
|
||||||
KeyFieldName = "Id",
|
KeyFieldName = "Id",
|
||||||
KeyFieldDbSourceType = DbType.Guid,
|
KeyFieldDbSourceType = DbType.Guid,
|
||||||
|
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||||
|
SeedSyncInsert = false,
|
||||||
|
SeedSyncUpdate = false,
|
||||||
|
SeedSyncDelete = false,
|
||||||
DefaultFilter = DefaultFilterJson,
|
DefaultFilter = DefaultFilterJson,
|
||||||
SortMode = GridOptions.SortModeSingle,
|
SortMode = GridOptions.SortModeSingle,
|
||||||
FilterRowJson = DefaultFilterRowJson(),
|
FilterRowJson = DefaultFilterRowJson(),
|
||||||
|
|
@ -1631,6 +1639,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Currency)),
|
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Currency)),
|
||||||
KeyFieldName = "Id",
|
KeyFieldName = "Id",
|
||||||
KeyFieldDbSourceType = DbType.String,
|
KeyFieldDbSourceType = DbType.String,
|
||||||
|
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||||
|
SeedSyncInsert = false,
|
||||||
|
SeedSyncUpdate = false,
|
||||||
|
SeedSyncDelete = false,
|
||||||
DefaultFilter = DefaultFilterJson,
|
DefaultFilter = DefaultFilterJson,
|
||||||
SortMode = GridOptions.SortModeSingle,
|
SortMode = GridOptions.SortModeSingle,
|
||||||
FilterRowJson = DefaultFilterRowJson(),
|
FilterRowJson = DefaultFilterRowJson(),
|
||||||
|
|
@ -5185,6 +5197,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.NotificationType)),
|
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.NotificationType)),
|
||||||
KeyFieldName = "Id",
|
KeyFieldName = "Id",
|
||||||
KeyFieldDbSourceType = DbType.Guid,
|
KeyFieldDbSourceType = DbType.Guid,
|
||||||
|
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||||
|
SeedSyncInsert = true,
|
||||||
|
SeedSyncUpdate = true,
|
||||||
|
SeedSyncDelete = true,
|
||||||
DefaultFilter = DefaultFilterJson,
|
DefaultFilter = DefaultFilterJson,
|
||||||
SortMode = GridOptions.SortModeSingle,
|
SortMode = GridOptions.SortModeSingle,
|
||||||
FilterRowJson = DefaultFilterRowJson(),
|
FilterRowJson = DefaultFilterRowJson(),
|
||||||
|
|
@ -5274,6 +5290,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.NotificationRule)),
|
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.NotificationRule)),
|
||||||
KeyFieldName = "Id",
|
KeyFieldName = "Id",
|
||||||
KeyFieldDbSourceType = DbType.Guid,
|
KeyFieldDbSourceType = DbType.Guid,
|
||||||
|
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||||
|
SeedSyncInsert = true,
|
||||||
|
SeedSyncUpdate = true,
|
||||||
|
SeedSyncDelete = true,
|
||||||
DefaultFilter = DefaultFilterJson,
|
DefaultFilter = DefaultFilterJson,
|
||||||
SortMode = GridOptions.SortModeSingle,
|
SortMode = GridOptions.SortModeSingle,
|
||||||
FilterRowJson = DefaultFilterRowJson(),
|
FilterRowJson = DefaultFilterRowJson(),
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,9 @@ Bir çelişki varsa sıra: `ai.instructions.md` → `dotnet.instructions.md` →
|
||||||
`Abp.Identity.Permission{Groups,s}.json`; platformun kendi menü/yetki kayıtları da diğer liste
|
`Abp.Identity.Permission{Groups,s}.json`; platformun kendi menü/yetki kayıtları da diğer liste
|
||||||
verisiyle aynı mekanizmadan (`ListFormSeedDataApplier`) geçer, ayrı bir seeder yoktur. `Order`
|
verisiyle aynı mekanizmadan (`ListFormSeedDataApplier`) geçer, ayrı bir seeder yoktur. `Order`
|
||||||
alanı bağımlılık sırasını kurar: route → modül → menü, yetki grubu → yetki, ülke grubu → ülke →
|
alanı bağımlılık sırasını kurar: route → modül → menü, yetki grubu → yetki, ülke grubu → ülke →
|
||||||
şehir → ilçe (`App.Definitions.{CountryGroup,Country,City,District}.json`). Dosyalar ekranın
|
şehir → ilçe (`App.Definitions.{CountryGroup,Country,City,District}.json`); para birimi ve hitap
|
||||||
|
(`App.Definitions.{Currency,ContactTitle,AiBot}.json`) ile bildirim tipi → kuralı
|
||||||
|
(`App.Notifications.Notification{Types,Rules}.json`) da `HostData.json` yerine buradadır. Dosyalar ekranın
|
||||||
anahtarını (`KeyFieldName`) kullanır; `Guid` anahtarlı satırın `Id`'si iş anahtarından türetilmiş
|
anahtarını (`KeyFieldName`) kullanır; `Guid` anahtarlı satırın `Id`'si iş anahtarından türetilmiş
|
||||||
sabit bir GUID'dir, satır eklerken aynı kuralla üret. `App.Menus.Routes.json` dosyasına dokunma.
|
sabit bir GUID'dir, satır eklerken aynı kuralla üret. `App.Menus.Routes.json` dosyasına dokunma.
|
||||||
- **Public site** → menü `Menu` tablosunda `ModuleId = "Pub"` altında (`PlatformConsts.PublicSite`);
|
- **Public site** → menü `Menu` tablosunda `ModuleId = "Pub"` altında (`PlatformConsts.PublicSite`);
|
||||||
|
|
|
||||||
14
configs/seeds/host/data/App.Definitions.AiBot.json
Normal file
14
configs/seeds/host/data/App.Definitions.AiBot.json
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"ListFormCode": "App.Definitions.AiBot",
|
||||||
|
"KeyFieldName": "Id",
|
||||||
|
"GeneratedAt": "2026-09-18T06:14:13.472162Z",
|
||||||
|
"Rows": [
|
||||||
|
{
|
||||||
|
"Id": "202293da-f672-5f0a-bed6-91302eca0b0c",
|
||||||
|
"Name": "Chat",
|
||||||
|
"Description": "Sözsoft Chat Bot",
|
||||||
|
"ApiUrl": "https://ai.sozsoft.com/webhook/chat",
|
||||||
|
"IsActive": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
27
configs/seeds/host/data/App.Definitions.ContactTitle.json
Normal file
27
configs/seeds/host/data/App.Definitions.ContactTitle.json
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"ListFormCode": "App.Definitions.ContactTitle",
|
||||||
|
"KeyFieldName": "Id",
|
||||||
|
"GeneratedAt": "2026-09-18T06:08:33.370233Z",
|
||||||
|
"Rows": [
|
||||||
|
{
|
||||||
|
"Id": "e90decb0-f975-5a88-807b-068fb43894d5",
|
||||||
|
"Title": "Bay",
|
||||||
|
"Abbreviation": "Bay."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "d1d104e0-ddc4-5487-a432-dcf422a7b8d6",
|
||||||
|
"Title": "Bayan",
|
||||||
|
"Abbreviation": "Bayan"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "574dc78a-87ce-5db2-920c-ae112db75cc1",
|
||||||
|
"Title": "Doktora",
|
||||||
|
"Abbreviation": "Dr."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "aa59c340-7577-5647-8f2c-593bfdf2d10e",
|
||||||
|
"Title": "Profesör",
|
||||||
|
"Abbreviation": "Prof."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
1190
configs/seeds/host/data/App.Definitions.Currency.json
Normal file
1190
configs/seeds/host/data/App.Definitions.Currency.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"ListFormCode": "App.Notifications.NotificationRules",
|
||||||
|
"KeyFieldName": "Id",
|
||||||
|
"GeneratedAt": "2026-09-18T06:12:57.546144Z",
|
||||||
|
"Order": 2,
|
||||||
|
"Rows": [
|
||||||
|
{
|
||||||
|
"Id": "a6dec106-16eb-5386-ae07-dfc4e456165b",
|
||||||
|
"NotificationTypeId": "095dcdb5-7c4a-5668-81bb-abc7b01b2158",
|
||||||
|
"RecipientType": "Role",
|
||||||
|
"RecipientId": "admin",
|
||||||
|
"Channel": "UiActivity",
|
||||||
|
"IsActive": true,
|
||||||
|
"IsFixed": false,
|
||||||
|
"IsCustomized": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "49cbe5aa-1848-5277-9ec1-d26d474c8f0e",
|
||||||
|
"NotificationTypeId": "c58237f7-edd6-55a3-9bc9-aab82f63ca3e",
|
||||||
|
"RecipientType": "Role",
|
||||||
|
"RecipientId": "admin",
|
||||||
|
"Channel": "Desktop",
|
||||||
|
"IsActive": true,
|
||||||
|
"IsFixed": false,
|
||||||
|
"IsCustomized": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "859b287f-24aa-5ee8-9146-e5249cd195af",
|
||||||
|
"NotificationTypeId": "78a4b82b-de80-5826-bf9b-e49a2436cd43",
|
||||||
|
"RecipientType": "Role",
|
||||||
|
"RecipientId": "admin",
|
||||||
|
"Channel": "Rocket",
|
||||||
|
"IsActive": true,
|
||||||
|
"IsFixed": false,
|
||||||
|
"IsCustomized": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"ListFormCode": "App.Notifications.NotificationTypes",
|
||||||
|
"KeyFieldName": "Id",
|
||||||
|
"GeneratedAt": "2026-09-18T06:12:57.546144Z",
|
||||||
|
"Order": 1,
|
||||||
|
"Rows": [
|
||||||
|
{
|
||||||
|
"Id": "095dcdb5-7c4a-5668-81bb-abc7b01b2158",
|
||||||
|
"Name": "YeniSiparis"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "c58237f7-edd6-55a3-9bc9-aab82f63ca3e",
|
||||||
|
"Name": "SiparisPasla"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "78a4b82b-de80-5826-bf9b-e49a2436cd43",
|
||||||
|
"Name": "YeniKullanici"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue