Seeder
This commit is contained in:
parent
b16391468c
commit
3c0971f38f
2 changed files with 94 additions and 94 deletions
|
|
@ -2112,6 +2112,73 @@
|
|||
"Explanation": ""
|
||||
}
|
||||
],
|
||||
"Badges": [
|
||||
{
|
||||
"code": "STAR_PERFORMER",
|
||||
"name": "Yıldız Performans",
|
||||
"description": "Üstün performans sergileyen çalışanlara verilen prestijli rozet",
|
||||
"icon": "⭐",
|
||||
"color": "#FFD700",
|
||||
"backgroundColor": "#FFF8DC",
|
||||
"category": "Performance",
|
||||
"criteria": "3 çeyrek üst üste hedefleri %110 üzerinde tamamlama",
|
||||
"points": 100,
|
||||
"rarity": "Epic",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"code": "TEAM_LEADER",
|
||||
"name": "Takım Lideri",
|
||||
"description": "Takım arkadaşlarına öncülük eden ve onları motive eden çalışanlar için",
|
||||
"icon": "👑",
|
||||
"color": "#4B0082",
|
||||
"backgroundColor": "#E6E6FA",
|
||||
"category": "Leadership",
|
||||
"criteria": "Takım projelerinde liderlik gösterme ve ekip başarısına katkı",
|
||||
"points": 75,
|
||||
"rarity": "Rare",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"code": "INNOVATOR",
|
||||
"name": "İnovatör",
|
||||
"description": "Yaratıcı çözümler üreten ve yenilikçi yaklaşımlar sergileyen çalışanlar",
|
||||
"icon": "💡",
|
||||
"color": "#FF6B35",
|
||||
"backgroundColor": "#FFF0E6",
|
||||
"category": "Innovation",
|
||||
"criteria": "Şirkete değer katan yenilikçi fikirler sunma",
|
||||
"points": 80,
|
||||
"rarity": "Rare",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"code": "PERFECT_ATTENDANCE",
|
||||
"name": "Mükemmel Devam",
|
||||
"description": "Düzenli ve zamanında işe gelen, devamsızlık yapmayan çalışanlar",
|
||||
"icon": "📅",
|
||||
"color": "#28A745",
|
||||
"backgroundColor": "#E8F5E8",
|
||||
"category": "Attendance",
|
||||
"criteria": "6 ay boyunca devamsızlık yapmama",
|
||||
"points": 50,
|
||||
"rarity": "Uncommon",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"code": "CUSTOMER_CHAMPION",
|
||||
"name": "Müşteri Şampiyonu",
|
||||
"description": "Müşteri memnuniyetinde üstün başarı gösteren çalışanlar",
|
||||
"icon": "🏆",
|
||||
"color": "#DC3545",
|
||||
"backgroundColor": "#FFEBEE",
|
||||
"category": "Customer",
|
||||
"criteria": "Müşteri memnuniyet puanı %95 üzerinde alma",
|
||||
"points": 90,
|
||||
"rarity": "Epic",
|
||||
"isActive": true
|
||||
}
|
||||
],
|
||||
"EmployeeTypes": [
|
||||
{
|
||||
"name": "FULL_TIME"
|
||||
|
|
@ -2468,73 +2535,6 @@
|
|||
"isActive": true
|
||||
}
|
||||
],
|
||||
"Badges": [
|
||||
{
|
||||
"code": "STAR_PERFORMER",
|
||||
"name": "Yıldız Performans",
|
||||
"description": "Üstün performans sergileyen çalışanlara verilen prestijli rozet",
|
||||
"icon": "⭐",
|
||||
"color": "#FFD700",
|
||||
"backgroundColor": "#FFF8DC",
|
||||
"category": "Performance",
|
||||
"criteria": "3 çeyrek üst üste hedefleri %110 üzerinde tamamlama",
|
||||
"points": 100,
|
||||
"rarity": "Epic",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"code": "TEAM_LEADER",
|
||||
"name": "Takım Lideri",
|
||||
"description": "Takım arkadaşlarına öncülük eden ve onları motive eden çalışanlar için",
|
||||
"icon": "👑",
|
||||
"color": "#4B0082",
|
||||
"backgroundColor": "#E6E6FA",
|
||||
"category": "Leadership",
|
||||
"criteria": "Takım projelerinde liderlik gösterme ve ekip başarısına katkı",
|
||||
"points": 75,
|
||||
"rarity": "Rare",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"code": "INNOVATOR",
|
||||
"name": "İnovatör",
|
||||
"description": "Yaratıcı çözümler üreten ve yenilikçi yaklaşımlar sergileyen çalışanlar",
|
||||
"icon": "💡",
|
||||
"color": "#FF6B35",
|
||||
"backgroundColor": "#FFF0E6",
|
||||
"category": "Innovation",
|
||||
"criteria": "Şirkete değer katan yenilikçi fikirler sunma",
|
||||
"points": 80,
|
||||
"rarity": "Rare",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"code": "PERFECT_ATTENDANCE",
|
||||
"name": "Mükemmel Devam",
|
||||
"description": "Düzenli ve zamanında işe gelen, devamsızlık yapmayan çalışanlar",
|
||||
"icon": "📅",
|
||||
"color": "#28A745",
|
||||
"backgroundColor": "#E8F5E8",
|
||||
"category": "Attendance",
|
||||
"criteria": "6 ay boyunca devamsızlık yapmama",
|
||||
"points": 50,
|
||||
"rarity": "Uncommon",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"code": "CUSTOMER_CHAMPION",
|
||||
"name": "Müşteri Şampiyonu",
|
||||
"description": "Müşteri memnuniyetinde üstün başarı gösteren çalışanlar",
|
||||
"icon": "🏆",
|
||||
"color": "#DC3545",
|
||||
"backgroundColor": "#FFEBEE",
|
||||
"category": "Customer",
|
||||
"criteria": "Müşteri memnuniyet puanı %95 üzerinde alma",
|
||||
"points": 90,
|
||||
"rarity": "Epic",
|
||||
"isActive": true
|
||||
}
|
||||
],
|
||||
"CostCenters": [
|
||||
{
|
||||
"code": "CC-ADM-001",
|
||||
|
|
|
|||
|
|
@ -908,6 +908,32 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
}, autoSave: true);
|
||||
}
|
||||
|
||||
foreach (var item in items.Departments)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(item.Name) || string.IsNullOrWhiteSpace(item.Code))
|
||||
continue;
|
||||
|
||||
var parentDepartment = await _departmentRepository.FirstOrDefaultAsync(x => x.Code == item.ParentDepartmentCode);
|
||||
var costCenter = await _costCenterRepository.FirstOrDefaultAsync(x => x.Code == item.CostCenterCode);
|
||||
var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.ManagerCode);
|
||||
|
||||
var exists = await _departmentRepository.AnyAsync(x => x.Code == item.Code);
|
||||
if (exists)
|
||||
continue;
|
||||
|
||||
await _departmentRepository.InsertAsync(new Department
|
||||
{
|
||||
Code = item.Code,
|
||||
Name = item.Name,
|
||||
Description = item.Description,
|
||||
ParentDepartmentId = parentDepartment != null ? parentDepartment.Id : null,
|
||||
ManagerId = employee != null ? employee.Id : null,
|
||||
CostCenterId = costCenter != null ? costCenter.Id : null,
|
||||
Budget = item.Budget,
|
||||
IsActive = item.IsActive
|
||||
}, autoSave: true);
|
||||
}
|
||||
|
||||
foreach (var item in items.CostCenters)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(item.Code) || string.IsNullOrWhiteSpace(item.Name))
|
||||
|
|
@ -968,32 +994,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
}, autoSave: true);
|
||||
}
|
||||
|
||||
foreach (var item in items.Departments)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(item.Name) || string.IsNullOrWhiteSpace(item.Code))
|
||||
continue;
|
||||
|
||||
var parentDepartment = await _departmentRepository.FirstOrDefaultAsync(x => x.Code == item.ParentDepartmentCode);
|
||||
var costCenter = await _costCenterRepository.FirstOrDefaultAsync(x => x.Code == item.CostCenterCode);
|
||||
var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.ManagerCode);
|
||||
|
||||
var exists = await _departmentRepository.AnyAsync(x => x.Code == item.Code);
|
||||
if (exists)
|
||||
continue;
|
||||
|
||||
await _departmentRepository.InsertAsync(new Department
|
||||
{
|
||||
Code = item.Code,
|
||||
Name = item.Name,
|
||||
Description = item.Description,
|
||||
ParentDepartmentId = parentDepartment != null ? parentDepartment.Id : null,
|
||||
ManagerId = employee != null ? employee.Id : null,
|
||||
CostCenterId = costCenter != null ? costCenter.Id : null,
|
||||
Budget = item.Budget,
|
||||
IsActive = item.IsActive
|
||||
}, autoSave: true);
|
||||
}
|
||||
|
||||
foreach (var item in items.Employees)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(item.Code) || string.IsNullOrWhiteSpace(item.FullName))
|
||||
|
|
@ -1003,9 +1003,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
if (exists)
|
||||
continue;
|
||||
|
||||
var employmentType = await _employeeTypeRepository.FirstOrDefaultAsync(x => x.Name == item.EmploymentTypeName);
|
||||
var department = await _departmentRepository.FirstOrDefaultAsync(x => x.Code == item.DepartmentCode);
|
||||
var jobPosition = await _jobPositionRepository.FirstOrDefaultAsync(x => x.Code == item.JobPositionCode);
|
||||
var employmentType = await _employeeTypeRepository.FirstOrDefaultAsync(x => x.Name == item.EmploymentTypeName);
|
||||
var currency = await _currencyRepository.FirstOrDefaultAsync(x => x.Code == item.CurrencyCode);
|
||||
var manager = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.ManagerCode);
|
||||
var bankAccount = await _bankAccountRepository.FirstOrDefaultAsync(x => x.AccountNumber == item.BankAccountNumber);
|
||||
|
|
|
|||
Loading…
Reference in a new issue