Hr EmploymenTypes, JobPositions, Department, Badge, CostCenters

This commit is contained in:
Sedat ÖZTÜRK 2025-10-22 11:20:11 +03:00
parent e6a6ad2fe6
commit b16391468c
22 changed files with 1782 additions and 298 deletions

View file

@ -34130,7 +34130,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 2, DataField="TerminationDate", ColSpan = 2, EditorType2 = EditorTypes.dxDateBox }, new EditingFormItemDto { Order = 2, DataField="TerminationDate", ColSpan = 2, EditorType2 = EditorTypes.dxDateBox },
new EditingFormItemDto { Order = 3, DataField="EmploymentTypeId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, new EditingFormItemDto { Order = 3, DataField="EmploymentTypeId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 4, DataField="JobPositionId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, new EditingFormItemDto { Order = 4, DataField="JobPositionId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 5, DataField="DepartmantId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, new EditingFormItemDto { Order = 5, DataField="DepartmentId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 6, DataField="WorkLocation", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 6, DataField="WorkLocation", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 7, DataField="ManagerId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, new EditingFormItemDto { Order = 7, DataField="ManagerId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 8, DataField="BaseSalary", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 8, DataField="BaseSalary", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
@ -34991,7 +34991,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
UserId = null, UserId = null,
CultureName = LanguageCodes.En, CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid, SourceDbType = DbType.Guid,
FieldName = "DepartmantId", FieldName = "DepartmentId",
Width = 100, Width = 100,
ListOrderNo = 25, ListOrderNo = 25,
Visible = true, Visible = true,

View file

@ -24,9 +24,10 @@ public class CostCenter : FullAuditedEntity<Guid>, IMultiTenant
public Department Department { get; set; } public Department Department { get; set; }
public string CostCenterType { get; set; } public string CostCenterType { get; set; }
public int BudgetedAmount { get; set; } public decimal BudgetedAmount { get; set; }
public int ActualAmount { get; set; } public decimal ActualAmount { get; set; }
public Guid CurrencyId { get; set; } public Guid? CurrencyId { get; set; }
public Currency Currency { get; set; }
public string FiscalYear { get; set; } public string FiscalYear { get; set; }
public bool IsActive { get; set; } public bool IsActive { get; set; }
} }

View file

@ -24,7 +24,7 @@ public class Department : FullAuditedEntity<Guid>, IMultiTenant
public Guid? CostCenterId { get; set; } public Guid? CostCenterId { get; set; }
public CostCenter CostCenter { get; set; } public CostCenter CostCenter { get; set; }
public int Budget { get; set; } public decimal Budget { get; set; }
public bool IsActive { get; set; } public bool IsActive { get; set; }
public Department() public Department()

View file

@ -35,25 +35,31 @@ public class Employee : FullAuditedEntity<Guid>, IMultiTenant
public DateTime HireDate { get; set; } public DateTime HireDate { get; set; }
public DateTime? TerminationDate { get; set; } public DateTime? TerminationDate { get; set; }
public Guid EmploymentTypeId { get; set; }
public Guid JobPositionId { get; set; } public Guid? EmploymentTypeId { get; set; }
public EmploymentType EmploymentType { get; set; }
public Guid? JobPositionId { get; set; }
public JobPosition JobPosition { get; set; } public JobPosition JobPosition { get; set; }
public Guid DepartmantId { get; set; } public Guid? DepartmentId { get; set; }
public Department Department { get; set; } public Department Department { get; set; }
public string WorkLocation { get; set; } public string WorkLocation { get; set; }
public Guid? ManagerId { get; set; } public Guid? ManagerId { get; set; }
public Employee Manager { get; set; } public Employee Manager { get; set; }
public int BaseSalary { get; set; } public decimal BaseSalary { get; set; }
public Guid CurrencyId { get; set; } public Guid? CurrencyId { get; set; }
public string PayrollGroup { get; set; } public Currency Currency { get; set; }
public string PayrollGroup { get; set; } // e.g., Monthly, Biweekly, Weekly
public Guid BankAccountId { get; set; } public Guid? BankAccountId { get; set; }
public BankAccount BankAccount { get; set; } public BankAccount BankAccount { get; set; }
public Guid BadgeId { get; set; } public Guid? BadgeId { get; set; }
public Badge Badge { get; set; } public Badge Badge { get; set; }
public string EmployeeStatus { get; set; } public string EmployeeStatus { get; set; }

View file

@ -11,11 +11,13 @@ public class JobPosition : FullAuditedEntity<Guid>, IMultiTenant
public string Code { get; set; } public string Code { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string Description { get; set; } public string Description { get; set; }
public Guid DepartmentId { get; set; } public Guid? DepartmentId { get; set; }
public Department Department { get; set; }
public string Level { get; set; } public string Level { get; set; }
public int MinSalary { get; set; } public decimal MinSalary { get; set; }
public int MaxSalary { get; set; } public decimal MaxSalary { get; set; }
public Guid CurrencyId { get; set; } public Guid? CurrencyId { get; set; }
public Currency Currency { get; set; }
public string RequiredSkills { get; set; } public string RequiredSkills { get; set; }
public string Responsibilities { get; set; } public string Responsibilities { get; set; }
public string Qualifications { get; set; } public string Qualifications { get; set; }

View file

@ -148,6 +148,15 @@ public class PlatformDbContext :
public DbSet<Question> Questions { get; set; } public DbSet<Question> Questions { get; set; }
public DbSet<QuestionOption> QuestionOptions { get; set; } public DbSet<QuestionOption> QuestionOptions { get; set; }
#region Hr
public DbSet<Employee> Employees { get; set; }
public DbSet<Department> Departments { get; set; }
public DbSet<JobPosition> JobPositions { get; set; }
public DbSet<EmploymentType> EmploymentTypes { get; set; }
public DbSet<Badge> Badges { get; set; }
public DbSet<CostCenter> CostCenters { get; set; }
#endregion
#endregion #endregion
#region Entities from the modules #region Entities from the modules
@ -1655,6 +1664,8 @@ public class PlatformDbContext :
b.Property(x => x.Responsibilities).HasColumnType("text"); b.Property(x => x.Responsibilities).HasColumnType("text");
b.Property(x => x.Qualifications).HasColumnType("text"); b.Property(x => x.Qualifications).HasColumnType("text");
b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.IsActive).HasDefaultValue(true);
b.Property(x => x.MinSalary).HasPrecision(18, 2);
b.Property(x => x.MaxSalary).HasPrecision(18, 2);
}); });
builder.Entity<Badge>(b => builder.Entity<Badge>(b =>
@ -1684,6 +1695,7 @@ public class PlatformDbContext :
b.Property(x => x.Description).HasMaxLength(500); b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.Budget).HasDefaultValue(0); b.Property(x => x.Budget).HasDefaultValue(0);
b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.IsActive).HasDefaultValue(true);
b.Property(x => x.Budget).HasPrecision(18, 4);
b.HasOne(x => x.ParentDepartment) b.HasOne(x => x.ParentDepartment)
.WithMany(x => x.SubDepartments) .WithMany(x => x.SubDepartments)
@ -1711,6 +1723,8 @@ public class PlatformDbContext :
b.Property(x => x.Description).HasMaxLength(500); b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.FiscalYear).HasMaxLength(10); b.Property(x => x.FiscalYear).HasMaxLength(10);
b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.IsActive).HasDefaultValue(true);
b.Property(x => x.ActualAmount).HasPrecision(18, 4);
b.Property(x => x.BudgetedAmount).HasPrecision(18, 4);
b.HasOne(x => x.ParentCostCenter) b.HasOne(x => x.ParentCostCenter)
.WithMany(x => x.SubCostCenters) .WithMany(x => x.SubCostCenters)
@ -1740,6 +1754,7 @@ public class PlatformDbContext :
b.Property(x => x.PayrollGroup).HasMaxLength(50); b.Property(x => x.PayrollGroup).HasMaxLength(50);
b.Property(x => x.WorkLocation).HasMaxLength(150); b.Property(x => x.WorkLocation).HasMaxLength(150);
b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.IsActive).HasDefaultValue(true);
b.Property(x => x.BaseSalary).HasPrecision(18, 2);
b.HasOne(x => x.JobPosition) b.HasOne(x => x.JobPosition)
.WithMany() .WithMany()
@ -1747,7 +1762,7 @@ public class PlatformDbContext :
b.HasOne(x => x.Department) b.HasOne(x => x.Department)
.WithMany() .WithMany()
.HasForeignKey(x => x.DepartmantId); .HasForeignKey(x => x.DepartmentId);
b.HasOne(x => x.Manager) b.HasOne(x => x.Manager)
.WithMany() .WithMany()

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Kurs.Platform.Migrations namespace Kurs.Platform.Migrations
{ {
[DbContext(typeof(PlatformDbContext))] [DbContext(typeof(PlatformDbContext))]
[Migration("20251021144156_Initial")] [Migration("20251022080448_Initial")]
partial class Initial partial class Initial
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -920,7 +920,6 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.Badge", b => modelBuilder.Entity("Kurs.Platform.Entities.Badge", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("BackgroundColor") b.Property<string>("BackgroundColor")
@ -2300,14 +2299,15 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("ActualAmount") b.Property<decimal>("ActualAmount")
.HasColumnType("int"); .HasPrecision(18, 4)
.HasColumnType("decimal(18,4)");
b.Property<int>("BudgetedAmount") b.Property<decimal>("BudgetedAmount")
.HasColumnType("int"); .HasPrecision(18, 4)
.HasColumnType("decimal(18,4)");
b.Property<string>("Code") b.Property<string>("Code")
.IsRequired() .IsRequired()
@ -2325,7 +2325,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<Guid>("CurrencyId") b.Property<Guid?>("CurrencyId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
@ -2383,6 +2383,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CurrencyId");
b.HasIndex("DepartmentId"); b.HasIndex("DepartmentId");
b.HasIndex("ParentCostCenterId"); b.HasIndex("ParentCostCenterId");
@ -3020,13 +3022,13 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.Department", b => modelBuilder.Entity("Kurs.Platform.Entities.Department", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("Budget") b.Property<decimal>("Budget")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int") .HasPrecision(18, 4)
.HasDefaultValue(0); .HasColumnType("decimal(18,4)")
.HasDefaultValue(0m);
b.Property<string>("Code") b.Property<string>("Code")
.IsRequired() .IsRequired()
@ -3329,7 +3331,6 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.Employee", b => modelBuilder.Entity("Kurs.Platform.Entities.Employee", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Address1") b.Property<string>("Address1")
@ -3342,14 +3343,15 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(250) .HasMaxLength(250)
.HasColumnType("nvarchar(250)"); .HasColumnType("nvarchar(250)");
b.Property<Guid>("BadgeId") b.Property<Guid?>("BadgeId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<Guid>("BankAccountId") b.Property<Guid?>("BankAccountId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("BaseSalary") b.Property<decimal>("BaseSalary")
.HasColumnType("int"); .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<DateTime>("BirthDate") b.Property<DateTime>("BirthDate")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
@ -3373,7 +3375,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<Guid>("CurrencyId") b.Property<Guid?>("CurrencyId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
@ -3384,7 +3386,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<Guid>("DepartmantId") b.Property<Guid?>("DepartmentId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("District") b.Property<string>("District")
@ -3406,7 +3408,7 @@ namespace Kurs.Platform.Migrations
b.Property<string>("EmployeeStatus") b.Property<string>("EmployeeStatus")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<Guid>("EmploymentTypeId") b.Property<Guid?>("EmploymentTypeId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("FullName") b.Property<string>("FullName")
@ -3430,7 +3432,7 @@ namespace Kurs.Platform.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<Guid>("JobPositionId") b.Property<Guid?>("JobPositionId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
@ -3486,7 +3488,11 @@ namespace Kurs.Platform.Migrations
b.HasIndex("BankAccountId"); b.HasIndex("BankAccountId");
b.HasIndex("DepartmantId"); b.HasIndex("CurrencyId");
b.HasIndex("DepartmentId");
b.HasIndex("EmploymentTypeId");
b.HasIndex("JobPositionId"); b.HasIndex("JobPositionId");
@ -3498,7 +3504,6 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.EmploymentType", b => modelBuilder.Entity("Kurs.Platform.Entities.EmploymentType", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime") b.Property<DateTime>("CreationTime")
@ -4050,7 +4055,6 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.JobPosition", b => modelBuilder.Entity("Kurs.Platform.Entities.JobPosition", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Code") b.Property<string>("Code")
@ -4066,7 +4070,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<Guid>("CurrencyId") b.Property<Guid?>("CurrencyId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
@ -4077,7 +4081,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<Guid>("DepartmentId") b.Property<Guid?>("DepartmentId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Description") b.Property<string>("Description")
@ -4107,11 +4111,13 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
b.Property<int>("MaxSalary") b.Property<decimal>("MaxSalary")
.HasColumnType("int"); .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<int>("MinSalary") b.Property<decimal>("MinSalary")
.HasColumnType("int"); .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
@ -4133,6 +4139,10 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CurrencyId");
b.HasIndex("DepartmentId");
b.ToTable("T_Hr_JobPosition", (string)null); b.ToTable("T_Hr_JobPosition", (string)null);
}); });
@ -9776,6 +9786,10 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b =>
{ {
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
.WithMany()
.HasForeignKey("CurrencyId");
b.HasOne("Kurs.Platform.Entities.Department", "Department") b.HasOne("Kurs.Platform.Entities.Department", "Department")
.WithMany() .WithMany()
.HasForeignKey("DepartmentId"); .HasForeignKey("DepartmentId");
@ -9788,6 +9802,8 @@ namespace Kurs.Platform.Migrations
.WithMany() .WithMany()
.HasForeignKey("ResponsibleEmployeeId"); .HasForeignKey("ResponsibleEmployeeId");
b.Navigation("Currency");
b.Navigation("Department"); b.Navigation("Department");
b.Navigation("ParentCostCenter"); b.Navigation("ParentCostCenter");
@ -9850,26 +9866,28 @@ namespace Kurs.Platform.Migrations
{ {
b.HasOne("Kurs.Platform.Entities.Badge", "Badge") b.HasOne("Kurs.Platform.Entities.Badge", "Badge")
.WithMany() .WithMany()
.HasForeignKey("BadgeId") .HasForeignKey("BadgeId");
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Platform.Entities.BankAccount", "BankAccount") b.HasOne("Kurs.Platform.Entities.BankAccount", "BankAccount")
.WithMany() .WithMany()
.HasForeignKey("BankAccountId") .HasForeignKey("BankAccountId")
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
.WithMany()
.HasForeignKey("CurrencyId");
b.HasOne("Kurs.Platform.Entities.Department", "Department") b.HasOne("Kurs.Platform.Entities.Department", "Department")
.WithMany() .WithMany()
.HasForeignKey("DepartmantId") .HasForeignKey("DepartmentId");
.OnDelete(DeleteBehavior.Cascade)
.IsRequired(); b.HasOne("Kurs.Platform.Entities.EmploymentType", "EmploymentType")
.WithMany()
.HasForeignKey("EmploymentTypeId");
b.HasOne("Kurs.Platform.Entities.JobPosition", "JobPosition") b.HasOne("Kurs.Platform.Entities.JobPosition", "JobPosition")
.WithMany() .WithMany()
.HasForeignKey("JobPositionId") .HasForeignKey("JobPositionId");
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Platform.Entities.Employee", "Manager") b.HasOne("Kurs.Platform.Entities.Employee", "Manager")
.WithMany() .WithMany()
@ -9879,8 +9897,12 @@ namespace Kurs.Platform.Migrations
b.Navigation("BankAccount"); b.Navigation("BankAccount");
b.Navigation("Currency");
b.Navigation("Department"); b.Navigation("Department");
b.Navigation("EmploymentType");
b.Navigation("JobPosition"); b.Navigation("JobPosition");
b.Navigation("Manager"); b.Navigation("Manager");
@ -9927,6 +9949,21 @@ namespace Kurs.Platform.Migrations
b.Navigation("Event"); b.Navigation("Event");
}); });
modelBuilder.Entity("Kurs.Platform.Entities.JobPosition", b =>
{
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
.WithMany()
.HasForeignKey("CurrencyId");
b.HasOne("Kurs.Platform.Entities.Department", "Department")
.WithMany()
.HasForeignKey("DepartmentId");
b.Navigation("Currency");
b.Navigation("Department");
});
modelBuilder.Entity("Kurs.Platform.Entities.Level", b => modelBuilder.Entity("Kurs.Platform.Entities.Level", b =>
{ {
b.HasOne("Kurs.Platform.Entities.ClassType", "ClassType") b.HasOne("Kurs.Platform.Entities.ClassType", "ClassType")

View file

@ -1798,37 +1798,6 @@ namespace Kurs.Platform.Migrations
table.PrimaryKey("PK_T_Hr_EmploymentType", x => x.Id); table.PrimaryKey("PK_T_Hr_EmploymentType", x => x.Id);
}); });
migrationBuilder.CreateTable(
name: "T_Hr_JobPosition",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Name = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Level = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MinSalary = table.Column<int>(type: "int", nullable: false),
MaxSalary = table.Column<int>(type: "int", nullable: false),
CurrencyId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
RequiredSkills = table.Column<string>(type: "text", nullable: true),
Responsibilities = table.Column<string>(type: "text", nullable: true),
Qualifications = table.Column<string>(type: "text", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Hr_JobPosition", x => x.Id);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "T_P_Activity", name: "T_P_Activity",
columns: table => new columns: table => new
@ -3770,9 +3739,9 @@ namespace Kurs.Platform.Migrations
ResponsibleEmployeeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), ResponsibleEmployeeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CostCenterType = table.Column<string>(type: "nvarchar(max)", nullable: true), CostCenterType = table.Column<string>(type: "nvarchar(max)", nullable: true),
BudgetedAmount = table.Column<int>(type: "int", nullable: false), BudgetedAmount = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false),
ActualAmount = table.Column<int>(type: "int", nullable: false), ActualAmount = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false),
CurrencyId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), CurrencyId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
FiscalYear = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true), FiscalYear = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true), IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
@ -3786,6 +3755,11 @@ namespace Kurs.Platform.Migrations
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_T_Hr_CostCenter", x => x.Id); table.PrimaryKey("PK_T_Hr_CostCenter", x => x.Id);
table.ForeignKey(
name: "FK_T_Hr_CostCenter_P_Sas_Currency_CurrencyId",
column: x => x.CurrencyId,
principalTable: "P_Sas_Currency",
principalColumn: "Id");
table.ForeignKey( table.ForeignKey(
name: "FK_T_Hr_CostCenter_T_Hr_CostCenter_ParentCostCenterId", name: "FK_T_Hr_CostCenter_T_Hr_CostCenter_ParentCostCenterId",
column: x => x.ParentCostCenterId, column: x => x.ParentCostCenterId,
@ -3805,7 +3779,7 @@ namespace Kurs.Platform.Migrations
ParentDepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), ParentDepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
ManagerId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), ManagerId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CostCenterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), CostCenterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Budget = table.Column<int>(type: "int", nullable: false, defaultValue: 0), Budget = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false, defaultValue: 0m),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true), IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
@ -3832,6 +3806,47 @@ namespace Kurs.Platform.Migrations
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable(
name: "T_Hr_JobPosition",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Name = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Level = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MinSalary = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
MaxSalary = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
CurrencyId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
RequiredSkills = table.Column<string>(type: "text", nullable: true),
Responsibilities = table.Column<string>(type: "text", nullable: true),
Qualifications = table.Column<string>(type: "text", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Hr_JobPosition", x => x.Id);
table.ForeignKey(
name: "FK_T_Hr_JobPosition_P_Sas_Currency_CurrencyId",
column: x => x.CurrencyId,
principalTable: "P_Sas_Currency",
principalColumn: "Id");
table.ForeignKey(
name: "FK_T_Hr_JobPosition_T_Hr_Department_DepartmentId",
column: x => x.DepartmentId,
principalTable: "T_Hr_Department",
principalColumn: "Id");
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "T_Hr_Employee", name: "T_Hr_Employee",
columns: table => new columns: table => new
@ -3860,16 +3875,16 @@ namespace Kurs.Platform.Migrations
EmergencyContactPhone = table.Column<string>(type: "nvarchar(max)", nullable: true), EmergencyContactPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
HireDate = table.Column<DateTime>(type: "datetime2", nullable: false), HireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TerminationDate = table.Column<DateTime>(type: "datetime2", nullable: true), TerminationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
EmploymentTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), EmploymentTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
JobPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), JobPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DepartmantId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
WorkLocation = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true), WorkLocation = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
ManagerId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), ManagerId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
BaseSalary = table.Column<int>(type: "int", nullable: false), BaseSalary = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
CurrencyId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), CurrencyId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
PayrollGroup = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true), PayrollGroup = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
BankAccountId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), BankAccountId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
BadgeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), BadgeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EmployeeStatus = table.Column<string>(type: "nvarchar(max)", nullable: true), EmployeeStatus = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true), IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
@ -3883,6 +3898,11 @@ namespace Kurs.Platform.Migrations
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_T_Hr_Employee", x => x.Id); table.PrimaryKey("PK_T_Hr_Employee", x => x.Id);
table.ForeignKey(
name: "FK_T_Hr_Employee_P_Sas_Currency_CurrencyId",
column: x => x.CurrencyId,
principalTable: "P_Sas_Currency",
principalColumn: "Id");
table.ForeignKey( table.ForeignKey(
name: "FK_T_Hr_Employee_T_Acc_BankAccount_BankAccountId", name: "FK_T_Hr_Employee_T_Acc_BankAccount_BankAccountId",
column: x => x.BankAccountId, column: x => x.BankAccountId,
@ -3893,25 +3913,27 @@ namespace Kurs.Platform.Migrations
name: "FK_T_Hr_Employee_T_Hr_Badge_BadgeId", name: "FK_T_Hr_Employee_T_Hr_Badge_BadgeId",
column: x => x.BadgeId, column: x => x.BadgeId,
principalTable: "T_Hr_Badge", principalTable: "T_Hr_Badge",
principalColumn: "Id", principalColumn: "Id");
onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_T_Hr_Employee_T_Hr_Department_DepartmantId", name: "FK_T_Hr_Employee_T_Hr_Department_DepartmentId",
column: x => x.DepartmantId, column: x => x.DepartmentId,
principalTable: "T_Hr_Department", principalTable: "T_Hr_Department",
principalColumn: "Id", principalColumn: "Id");
onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_T_Hr_Employee_T_Hr_Employee_ManagerId", name: "FK_T_Hr_Employee_T_Hr_Employee_ManagerId",
column: x => x.ManagerId, column: x => x.ManagerId,
principalTable: "T_Hr_Employee", principalTable: "T_Hr_Employee",
principalColumn: "Id"); principalColumn: "Id");
table.ForeignKey(
name: "FK_T_Hr_Employee_T_Hr_EmploymentType_EmploymentTypeId",
column: x => x.EmploymentTypeId,
principalTable: "T_Hr_EmploymentType",
principalColumn: "Id");
table.ForeignKey( table.ForeignKey(
name: "FK_T_Hr_Employee_T_Hr_JobPosition_JobPositionId", name: "FK_T_Hr_Employee_T_Hr_JobPosition_JobPositionId",
column: x => x.JobPositionId, column: x => x.JobPositionId,
principalTable: "T_Hr_JobPosition", principalTable: "T_Hr_JobPosition",
principalColumn: "Id", principalColumn: "Id");
onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
@ -4463,6 +4485,11 @@ namespace Kurs.Platform.Migrations
table: "T_Crd_QuestionOption", table: "T_Crd_QuestionOption",
column: "QuestionId"); column: "QuestionId");
migrationBuilder.CreateIndex(
name: "IX_T_Hr_CostCenter_CurrencyId",
table: "T_Hr_CostCenter",
column: "CurrencyId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_T_Hr_CostCenter_DepartmentId", name: "IX_T_Hr_CostCenter_DepartmentId",
table: "T_Hr_CostCenter", table: "T_Hr_CostCenter",
@ -4504,9 +4531,19 @@ namespace Kurs.Platform.Migrations
column: "BankAccountId"); column: "BankAccountId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_T_Hr_Employee_DepartmantId", name: "IX_T_Hr_Employee_CurrencyId",
table: "T_Hr_Employee", table: "T_Hr_Employee",
column: "DepartmantId"); column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_T_Hr_Employee_DepartmentId",
table: "T_Hr_Employee",
column: "DepartmentId");
migrationBuilder.CreateIndex(
name: "IX_T_Hr_Employee_EmploymentTypeId",
table: "T_Hr_Employee",
column: "EmploymentTypeId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_T_Hr_Employee_JobPositionId", name: "IX_T_Hr_Employee_JobPositionId",
@ -4518,6 +4555,16 @@ namespace Kurs.Platform.Migrations
table: "T_Hr_Employee", table: "T_Hr_Employee",
column: "ManagerId"); column: "ManagerId");
migrationBuilder.CreateIndex(
name: "IX_T_Hr_JobPosition_CurrencyId",
table: "T_Hr_JobPosition",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_T_Hr_JobPosition_DepartmentId",
table: "T_Hr_JobPosition",
column: "DepartmentId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_T_Sas_ApiEndpoint_EntityId", name: "IX_T_Sas_ApiEndpoint_EntityId",
table: "T_Sas_ApiEndpoint", table: "T_Sas_ApiEndpoint",
@ -4578,6 +4625,18 @@ namespace Kurs.Platform.Migrations
name: "FK_T_Acc_BankAccount_P_Sas_Currency_CurrencyId", name: "FK_T_Acc_BankAccount_P_Sas_Currency_CurrencyId",
table: "T_Acc_BankAccount"); table: "T_Acc_BankAccount");
migrationBuilder.DropForeignKey(
name: "FK_T_Hr_CostCenter_P_Sas_Currency_CurrencyId",
table: "T_Hr_CostCenter");
migrationBuilder.DropForeignKey(
name: "FK_T_Hr_Employee_P_Sas_Currency_CurrencyId",
table: "T_Hr_Employee");
migrationBuilder.DropForeignKey(
name: "FK_T_Hr_JobPosition_P_Sas_Currency_CurrencyId",
table: "T_Hr_JobPosition");
migrationBuilder.DropForeignKey( migrationBuilder.DropForeignKey(
name: "FK_T_Acc_BankAccount_T_Acc_Bank_BankId", name: "FK_T_Acc_BankAccount_T_Acc_Bank_BankId",
table: "T_Acc_BankAccount"); table: "T_Acc_BankAccount");
@ -4587,9 +4646,13 @@ namespace Kurs.Platform.Migrations
table: "T_Hr_CostCenter"); table: "T_Hr_CostCenter");
migrationBuilder.DropForeignKey( migrationBuilder.DropForeignKey(
name: "FK_T_Hr_Employee_T_Hr_Department_DepartmantId", name: "FK_T_Hr_Employee_T_Hr_Department_DepartmentId",
table: "T_Hr_Employee"); table: "T_Hr_Employee");
migrationBuilder.DropForeignKey(
name: "FK_T_Hr_JobPosition_T_Hr_Department_DepartmentId",
table: "T_Hr_JobPosition");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "AbpAuditLogActions"); name: "AbpAuditLogActions");
@ -4824,9 +4887,6 @@ namespace Kurs.Platform.Migrations
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "T_Crd_QuestionTag"); name: "T_Crd_QuestionTag");
migrationBuilder.DropTable(
name: "T_Hr_EmploymentType");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "T_P_Activity"); name: "T_P_Activity");
@ -5013,6 +5073,9 @@ namespace Kurs.Platform.Migrations
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "T_Hr_Badge"); name: "T_Hr_Badge");
migrationBuilder.DropTable(
name: "T_Hr_EmploymentType");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "T_Hr_JobPosition"); name: "T_Hr_JobPosition");
} }

View file

@ -917,7 +917,6 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.Badge", b => modelBuilder.Entity("Kurs.Platform.Entities.Badge", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("BackgroundColor") b.Property<string>("BackgroundColor")
@ -2297,14 +2296,15 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("ActualAmount") b.Property<decimal>("ActualAmount")
.HasColumnType("int"); .HasPrecision(18, 4)
.HasColumnType("decimal(18,4)");
b.Property<int>("BudgetedAmount") b.Property<decimal>("BudgetedAmount")
.HasColumnType("int"); .HasPrecision(18, 4)
.HasColumnType("decimal(18,4)");
b.Property<string>("Code") b.Property<string>("Code")
.IsRequired() .IsRequired()
@ -2322,7 +2322,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<Guid>("CurrencyId") b.Property<Guid?>("CurrencyId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
@ -2380,6 +2380,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CurrencyId");
b.HasIndex("DepartmentId"); b.HasIndex("DepartmentId");
b.HasIndex("ParentCostCenterId"); b.HasIndex("ParentCostCenterId");
@ -3017,13 +3019,13 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.Department", b => modelBuilder.Entity("Kurs.Platform.Entities.Department", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("Budget") b.Property<decimal>("Budget")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int") .HasPrecision(18, 4)
.HasDefaultValue(0); .HasColumnType("decimal(18,4)")
.HasDefaultValue(0m);
b.Property<string>("Code") b.Property<string>("Code")
.IsRequired() .IsRequired()
@ -3326,7 +3328,6 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.Employee", b => modelBuilder.Entity("Kurs.Platform.Entities.Employee", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Address1") b.Property<string>("Address1")
@ -3339,14 +3340,15 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(250) .HasMaxLength(250)
.HasColumnType("nvarchar(250)"); .HasColumnType("nvarchar(250)");
b.Property<Guid>("BadgeId") b.Property<Guid?>("BadgeId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<Guid>("BankAccountId") b.Property<Guid?>("BankAccountId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("BaseSalary") b.Property<decimal>("BaseSalary")
.HasColumnType("int"); .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<DateTime>("BirthDate") b.Property<DateTime>("BirthDate")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
@ -3370,7 +3372,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<Guid>("CurrencyId") b.Property<Guid?>("CurrencyId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
@ -3381,7 +3383,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<Guid>("DepartmantId") b.Property<Guid?>("DepartmentId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("District") b.Property<string>("District")
@ -3403,7 +3405,7 @@ namespace Kurs.Platform.Migrations
b.Property<string>("EmployeeStatus") b.Property<string>("EmployeeStatus")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<Guid>("EmploymentTypeId") b.Property<Guid?>("EmploymentTypeId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("FullName") b.Property<string>("FullName")
@ -3427,7 +3429,7 @@ namespace Kurs.Platform.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<Guid>("JobPositionId") b.Property<Guid?>("JobPositionId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
@ -3483,7 +3485,11 @@ namespace Kurs.Platform.Migrations
b.HasIndex("BankAccountId"); b.HasIndex("BankAccountId");
b.HasIndex("DepartmantId"); b.HasIndex("CurrencyId");
b.HasIndex("DepartmentId");
b.HasIndex("EmploymentTypeId");
b.HasIndex("JobPositionId"); b.HasIndex("JobPositionId");
@ -3495,7 +3501,6 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.EmploymentType", b => modelBuilder.Entity("Kurs.Platform.Entities.EmploymentType", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime") b.Property<DateTime>("CreationTime")
@ -4047,7 +4052,6 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.JobPosition", b => modelBuilder.Entity("Kurs.Platform.Entities.JobPosition", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Code") b.Property<string>("Code")
@ -4063,7 +4067,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<Guid>("CurrencyId") b.Property<Guid?>("CurrencyId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
@ -4074,7 +4078,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<Guid>("DepartmentId") b.Property<Guid?>("DepartmentId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Description") b.Property<string>("Description")
@ -4104,11 +4108,13 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
b.Property<int>("MaxSalary") b.Property<decimal>("MaxSalary")
.HasColumnType("int"); .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<int>("MinSalary") b.Property<decimal>("MinSalary")
.HasColumnType("int"); .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
@ -4130,6 +4136,10 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CurrencyId");
b.HasIndex("DepartmentId");
b.ToTable("T_Hr_JobPosition", (string)null); b.ToTable("T_Hr_JobPosition", (string)null);
}); });
@ -9773,6 +9783,10 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b =>
{ {
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
.WithMany()
.HasForeignKey("CurrencyId");
b.HasOne("Kurs.Platform.Entities.Department", "Department") b.HasOne("Kurs.Platform.Entities.Department", "Department")
.WithMany() .WithMany()
.HasForeignKey("DepartmentId"); .HasForeignKey("DepartmentId");
@ -9785,6 +9799,8 @@ namespace Kurs.Platform.Migrations
.WithMany() .WithMany()
.HasForeignKey("ResponsibleEmployeeId"); .HasForeignKey("ResponsibleEmployeeId");
b.Navigation("Currency");
b.Navigation("Department"); b.Navigation("Department");
b.Navigation("ParentCostCenter"); b.Navigation("ParentCostCenter");
@ -9847,26 +9863,28 @@ namespace Kurs.Platform.Migrations
{ {
b.HasOne("Kurs.Platform.Entities.Badge", "Badge") b.HasOne("Kurs.Platform.Entities.Badge", "Badge")
.WithMany() .WithMany()
.HasForeignKey("BadgeId") .HasForeignKey("BadgeId");
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Platform.Entities.BankAccount", "BankAccount") b.HasOne("Kurs.Platform.Entities.BankAccount", "BankAccount")
.WithMany() .WithMany()
.HasForeignKey("BankAccountId") .HasForeignKey("BankAccountId")
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
.WithMany()
.HasForeignKey("CurrencyId");
b.HasOne("Kurs.Platform.Entities.Department", "Department") b.HasOne("Kurs.Platform.Entities.Department", "Department")
.WithMany() .WithMany()
.HasForeignKey("DepartmantId") .HasForeignKey("DepartmentId");
.OnDelete(DeleteBehavior.Cascade)
.IsRequired(); b.HasOne("Kurs.Platform.Entities.EmploymentType", "EmploymentType")
.WithMany()
.HasForeignKey("EmploymentTypeId");
b.HasOne("Kurs.Platform.Entities.JobPosition", "JobPosition") b.HasOne("Kurs.Platform.Entities.JobPosition", "JobPosition")
.WithMany() .WithMany()
.HasForeignKey("JobPositionId") .HasForeignKey("JobPositionId");
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Platform.Entities.Employee", "Manager") b.HasOne("Kurs.Platform.Entities.Employee", "Manager")
.WithMany() .WithMany()
@ -9876,8 +9894,12 @@ namespace Kurs.Platform.Migrations
b.Navigation("BankAccount"); b.Navigation("BankAccount");
b.Navigation("Currency");
b.Navigation("Department"); b.Navigation("Department");
b.Navigation("EmploymentType");
b.Navigation("JobPosition"); b.Navigation("JobPosition");
b.Navigation("Manager"); b.Navigation("Manager");
@ -9924,6 +9946,21 @@ namespace Kurs.Platform.Migrations
b.Navigation("Event"); b.Navigation("Event");
}); });
modelBuilder.Entity("Kurs.Platform.Entities.JobPosition", b =>
{
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
.WithMany()
.HasForeignKey("CurrencyId");
b.HasOne("Kurs.Platform.Entities.Department", "Department")
.WithMany()
.HasForeignKey("DepartmentId");
b.Navigation("Currency");
b.Navigation("Department");
});
modelBuilder.Entity("Kurs.Platform.Entities.Level", b => modelBuilder.Entity("Kurs.Platform.Entities.Level", b =>
{ {
b.HasOne("Kurs.Platform.Entities.ClassType", "ClassType") b.HasOne("Kurs.Platform.Entities.ClassType", "ClassType")

View file

@ -13,7 +13,6 @@ using Microsoft.EntityFrameworkCore;
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.Users;
namespace Kurs.Platform.Data.Seeds; namespace Kurs.Platform.Data.Seeds;
@ -60,6 +59,15 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
private readonly IRepository<QuestionTag, Guid> _tagRepository; private readonly IRepository<QuestionTag, Guid> _tagRepository;
private readonly IRepository<QuestionPool, Guid> _questionPoolRepository; private readonly IRepository<QuestionPool, Guid> _questionPoolRepository;
private readonly IRepository<Question, Guid> _questionRepository; private readonly IRepository<Question, Guid> _questionRepository;
private readonly IRepository<EmploymentType, Guid> _employeeTypeRepository;
private readonly IRepository<JobPosition, Guid> _jobPositionRepository;
private readonly IRepository<Currency, Guid> _currencyRepository;
private readonly IRepository<Department, Guid> _departmentRepository;
private readonly IRepository<Badge, Guid> _badgeRepository;
private readonly IRepository<CostCenter, Guid> _costCenterRepository;
private readonly IRepository<Employee, Guid> _employeeRepository;
private readonly IRepository<Bank, Guid> _bankRepository;
private readonly IRepository<BankAccount, Guid> _bankAccountRepository;
public TenantDataSeeder( public TenantDataSeeder(
IRepository<IdentityUser, Guid> repositoryUser, IRepository<IdentityUser, Guid> repositoryUser,
@ -102,7 +110,16 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
IRepository<ForumCategory, Guid> forumCategoryRepository, IRepository<ForumCategory, Guid> forumCategoryRepository,
IRepository<QuestionTag, Guid> tagRepository, IRepository<QuestionTag, Guid> tagRepository,
IRepository<QuestionPool, Guid> questionPoolRepository, IRepository<QuestionPool, Guid> questionPoolRepository,
IRepository<Question, Guid> questionRepository IRepository<Question, Guid> questionRepository,
IRepository<EmploymentType, Guid> employeeTypeRepository,
IRepository<JobPosition, Guid> jobPositionRepository,
IRepository<Currency, Guid> currencyRepository,
IRepository<Department, Guid> departmentRepository,
IRepository<CostCenter, Guid> costCenterRepository,
IRepository<Employee, Guid> employeeRepository,
IRepository<Badge, Guid> badgeRepository,
IRepository<Bank, Guid> bankRepository,
IRepository<BankAccount, Guid> bankAccountRepository
) )
{ {
_repositoryUser = repositoryUser; _repositoryUser = repositoryUser;
@ -146,6 +163,15 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
_tagRepository = tagRepository; _tagRepository = tagRepository;
_questionPoolRepository = questionPoolRepository; _questionPoolRepository = questionPoolRepository;
_questionRepository = questionRepository; _questionRepository = questionRepository;
_employeeTypeRepository = employeeTypeRepository;
_jobPositionRepository = jobPositionRepository;
_currencyRepository = currencyRepository;
_departmentRepository = departmentRepository;
_costCenterRepository = costCenterRepository;
_employeeRepository = employeeRepository;
_badgeRepository = badgeRepository;
_bankRepository = bankRepository;
_bankAccountRepository = bankAccountRepository;
} }
private static IConfigurationRoot BuildConfiguration() private static IConfigurationRoot BuildConfiguration()
@ -769,6 +795,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
} }
} }
//Coordinator
foreach (var item in items.QuestionTags) foreach (var item in items.QuestionTags)
{ {
var exists = await _tagRepository.AnyAsync(x => x.Name == item.Name); var exists = await _tagRepository.AnyAsync(x => x.Name == item.Name);
@ -839,5 +866,192 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
} }
} }
} }
//Hr
foreach (var item in items.Badges)
{
if (string.IsNullOrWhiteSpace(item.Code) || string.IsNullOrWhiteSpace(item.Name))
continue;
var exists = await _badgeRepository.AnyAsync(x => x.Code == item.Code);
if (exists)
continue;
await _badgeRepository.InsertAsync(new Badge
{
Code = item.Code,
Name = item.Name,
Description = item.Description,
Icon = item.Icon,
Color = item.Color,
BackgroundColor = item.BackgroundColor,
Category = item.Category,
Criteria = item.Criteria,
Points = item.Points,
Rarity = item.Rarity,
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.EmployeeTypes)
{
if (string.IsNullOrWhiteSpace(item.Name))
continue;
var exists = await _employeeTypeRepository.AnyAsync(x => x.Name == item.Name);
if (exists)
continue;
await _employeeTypeRepository.InsertAsync(new EmploymentType
{
Name = item.Name,
}, autoSave: true);
}
foreach (var item in items.CostCenters)
{
if (string.IsNullOrWhiteSpace(item.Code) || string.IsNullOrWhiteSpace(item.Name))
continue;
var currency = await _currencyRepository.FirstOrDefaultAsync(x => x.Code == item.CurrencyCode);
var parentCostCenter = await _costCenterRepository.FirstOrDefaultAsync(x => x.Code == item.ParentCostCenterCode);
var responsibleEmployee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.ResponsibleEmployeeCode);
var department = await _departmentRepository.FirstOrDefaultAsync(x => x.Code == item.DepartmentCode);
var exists = await _costCenterRepository.AnyAsync(x => x.Code == item.Code);
if (exists)
continue;
await _costCenterRepository.InsertAsync(new CostCenter
{
Code = item.Code,
Name = item.Name,
Description = item.Description,
ParentCostCenterId = parentCostCenter != null ? parentCostCenter.Id : null,
ResponsibleEmployeeId = responsibleEmployee != null ? responsibleEmployee.Id : null,
DepartmentId = department != null ? department.Id : null,
CostCenterType = item.CostCenterType,
BudgetedAmount = item.BudgetedAmount,
ActualAmount = item.ActualAmount,
CurrencyId = currency != null ? currency.Id : null,
FiscalYear = item.FiscalYear,
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.JobPositions)
{
if (string.IsNullOrWhiteSpace(item.Name) || string.IsNullOrWhiteSpace(item.Code))
continue;
var exists = await _jobPositionRepository.AnyAsync(x => x.Code == item.Code);
if (exists)
continue;
var currency = await _currencyRepository.FirstOrDefaultAsync(x => x.Code == item.CurrencyCode);
var department = await _departmentRepository.FirstOrDefaultAsync(x => x.Code == item.DepartmentCode);
await _jobPositionRepository.InsertAsync(new JobPosition
{
Code = item.Code,
Name = item.Name,
Description = item.Description,
DepartmentId = department != null ? department.Id : null,
Level = item.Level,
MinSalary = item.MinSalary,
MaxSalary = item.MaxSalary,
CurrencyId = currency != null ? currency.Id : null,
RequiredSkills = item.RequiredSkills != null ? string.Join(",", item.RequiredSkills) : null,
Responsibilities = item.Responsibilities != null ? string.Join(",", item.Responsibilities) : null,
Qualifications = item.Qualifications != null ? string.Join(",", item.Qualifications) : null,
IsActive = item.IsActive
}, 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))
continue;
var exists = await _employeeRepository.AnyAsync(x => x.Code == item.Code);
if (exists)
continue;
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);
var badge = await _badgeRepository.FirstOrDefaultAsync(x => x.Code == item.BadgeCode);
await _employeeRepository.InsertAsync(new Employee
{
Code = item.Code,
FullName = item.FullName,
Avatar = item.Avatar,
NationalId = item.NationalId,
BirthDate = item.BirthDate,
Gender = item.Gender,
MaritalStatus = item.MaritalStatus,
Country = item.Country,
City = item.City,
District = item.District,
Street = item.Street,
PostalCode = item.PostalCode,
Phone = item.Phone,
PersonalPhone = item.PersonalPhone,
Email = item.Email,
Address1 = item.Address1,
Address2 = item.Address2,
EmergencyContactName = item.EmergencyContactName,
EmergencyContactRelationship = item.EmergencyContactRelationship,
EmergencyContactPhone = item.EmergencyContactPhone,
HireDate = item.HireDate,
TerminationDate = item.TerminationDate,
EmploymentTypeId = employmentType != null ? employmentType.Id : null,
JobPositionId = jobPosition != null ? jobPosition.Id : null,
DepartmentId = department != null ? department.Id : null,
WorkLocation = item.WorkLocation,
BaseSalary = item.BaseSalary,
ManagerId = manager != null ? manager.Id : null,
CurrencyId = currency != null ? currency.Id : null,
PayrollGroup = item.PayrollGroup,
BankAccountId = bankAccount != null ? bankAccount.Id : null,
BadgeId = badge != null ? badge.Id : null,
EmployeeStatus = item.EmployeeStatus,
IsActive = item.IsActive
}, autoSave: true);
}
} }
} }

View file

@ -49,6 +49,122 @@ public class TenantSeederDto
public List<SourceSeedDto> Sources { get; set; } public List<SourceSeedDto> Sources { get; set; }
public List<InterestingSeedDto> Interesting { get; set; } public List<InterestingSeedDto> Interesting { get; set; }
public List<ProgramSeedDto> Programs { get; set; } public List<ProgramSeedDto> Programs { get; set; }
//Hr
public List<EmployeeTypeSeedDto> EmployeeTypes { get; set; }
public List<JobPositionSeedDto> JobPositions { get; set; }
public List<DepartmentSeedDto> Departments { get; set; }
public List<BadgeSeedDto> Badges { get; set; }
public List<CostCenterSeedDto> CostCenters { get; set; }
public List<EmployeeSeedDto> Employees { get; set; }
}
public class EmployeeSeedDto
{
public string Code { get; set; }
public string FullName { get; set; }
public string Avatar { get; set; }
public string NationalId { get; set; }
public DateTime BirthDate { get; set; }
public string Gender { get; set; }
public string MaritalStatus { get; set; }
public string Country { get; set; }
public string City { get; set; }
public string District { get; set; }
public string Street { get; set; }
public string PostalCode { get; set; }
public string Phone { get; set; }
public string PersonalPhone { get; set; }
public string Email { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
public string EmergencyContactName { get; set; }
public string EmergencyContactRelationship { get; set; }
public string EmergencyContactPhone { get; set; }
public DateTime HireDate { get; set; }
public DateTime TerminationDate { get; set; }
public string EmploymentTypeName { get; set; }
public string JobPositionCode { get; set; }
public string DepartmentCode { get; set; }
public string WorkLocation { get; set; }
public decimal BaseSalary { get; set; }
public string ManagerCode { get; set; }
public string CurrencyCode { get; set; }
public string PayrollGroup { get; set; }
public string BankAccountNumber { get; set; }
public string BadgeCode { get; set; }
public string EmployeeStatus { get; set; }
public bool IsActive { get; set; }
}
public class BadgeSeedDto
{
public string Code { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Icon { get; set; }
public string Color { get; set; }
public string BackgroundColor { get; set; }
public string Category { get; set; }
public string Criteria { get; set; }
public int Points { get; set; }
public string Rarity { get; set; }
public bool IsActive { get; set; }
}
public class CostCenterSeedDto
{
public string Code { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string ParentCostCenterCode { get; set; }
public string ResponsibleEmployeeCode { get; set; }
public string DepartmentCode { get; set; }
public string CostCenterType { get; set; }
public decimal BudgetedAmount { get; set; }
public decimal ActualAmount { get; set; }
public string CurrencyCode { get; set; }
public string FiscalYear { get; set; }
public bool IsActive { get; set; }
}
public class DepartmentSeedDto
{
public string Code { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string ParentDepartmentCode { get; set; }
public List<string> SubDepartments { get; set; }
public string ManagerCode { get; set; }
public string CostCenterCode { get; set; }
public decimal Budget { get; set; }
public bool IsActive { get; set; }
}
public class JobPositionSeedDto
{
public string Code { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string DepartmentCode { get; set; }
public string Level { get; set; }
public decimal MinSalary { get; set; }
public decimal MaxSalary { get; set; }
public string CurrencyCode { get; set; }
public List<string> RequiredSkills { get; set; }
public List<string> Responsibilities { get; set; }
public List<string> Qualifications { get; set; }
public bool IsActive { get; set; }
}
public class EmployeeTypeSeedDto
{
public string Name { get; set; }
} }
public class GlobalSearchSeedDto public class GlobalSearchSeedDto

View file

@ -1,184 +1,184 @@
import { HrCostCenter, CostCenterType } from "../types/hr"; import { HrCostCenter, CostCenterType } from '../types/hr'
export const mockCostCenters: HrCostCenter[] = [ export const mockCostCenters: HrCostCenter[] = [
{ {
id: "cc-001", id: 'cc-001',
code: "CC-ADM-001", code: 'CC-ADM-001',
name: "Genel Yönetim", name: 'Genel Yönetim',
description: "Şirket genel yönetim masrafları", description: 'Şirket genel yönetim masrafları',
costCenterType: CostCenterType.Administrative, costCenterType: CostCenterType.Administrative,
budgetedAmount: 2500000, budgetedAmount: 2500000,
actualAmount: 2350000, actualAmount: 2350000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-12-01"), lastModificationTime: new Date('2024-12-01'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-002", id: 'cc-002',
code: "CC-HR-001", code: 'CC-HR-001',
name: "İnsan Kaynakları", name: 'İnsan Kaynakları',
description: "İnsan kaynakları departmanı masrafları", description: 'İnsan kaynakları departmanı masrafları',
costCenterType: CostCenterType.Support, costCenterType: CostCenterType.Support,
budgetedAmount: 1800000, budgetedAmount: 1800000,
actualAmount: 1650000, actualAmount: 1650000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-11-15"), lastModificationTime: new Date('2024-11-15'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-003", id: 'cc-003',
code: "CC-FIN-001", code: 'CC-FIN-001',
name: "Finans ve Muhasebe", name: 'Finans ve Muhasebe',
description: "Mali işler ve muhasebe masrafları", description: 'Mali işler ve muhasebe masrafları',
costCenterType: CostCenterType.Support, costCenterType: CostCenterType.Support,
budgetedAmount: 1500000, budgetedAmount: 1500000,
actualAmount: 1420000, actualAmount: 1420000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-11-20"), lastModificationTime: new Date('2024-11-20'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-004", id: 'cc-004',
code: "CC-IT-001", code: 'CC-IT-001',
name: "Bilgi İşlem", name: 'Bilgi İşlem',
description: "IT altyapı ve yazılım masrafları", description: 'IT altyapı ve yazılım masrafları',
costCenterType: CostCenterType.Support, costCenterType: CostCenterType.Support,
budgetedAmount: 3200000, budgetedAmount: 3200000,
actualAmount: 3100000, actualAmount: 3100000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-12-05"), lastModificationTime: new Date('2024-12-05'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-005", id: 'cc-005',
code: "CC-PROD-001", code: 'CC-PROD-001',
name: "Üretim Departmanı", name: 'Üretim Departmanı',
description: "Üretim faaliyetleri masrafları", description: 'Üretim faaliyetleri masrafları',
costCenterType: CostCenterType.Production, costCenterType: CostCenterType.Production,
budgetedAmount: 8500000, budgetedAmount: 8500000,
actualAmount: 8200000, actualAmount: 8200000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-12-10"), lastModificationTime: new Date('2024-12-10'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-006", id: 'cc-006',
code: "CC-SAL-001", code: 'CC-SAL-001',
name: "Satış ve Pazarlama", name: 'Satış ve Pazarlama',
description: "Satış ve pazarlama faaliyetleri", description: 'Satış ve pazarlama faaliyetleri',
costCenterType: CostCenterType.Revenue, costCenterType: CostCenterType.Revenue,
budgetedAmount: 4200000, budgetedAmount: 4200000,
actualAmount: 4050000, actualAmount: 4050000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-12-08"), lastModificationTime: new Date('2024-12-08'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-007", id: 'cc-007',
code: "CC-QUA-001", code: 'CC-QUA-001',
name: "Kalite Kontrol", name: 'Kalite Kontrol',
description: "Kalite kontrol ve güvence masrafları", description: 'Kalite kontrol ve güvence masrafları',
costCenterType: CostCenterType.Support, costCenterType: CostCenterType.Support,
budgetedAmount: 1200000, budgetedAmount: 1200000,
actualAmount: 1150000, actualAmount: 1150000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-11-25"), lastModificationTime: new Date('2024-11-25'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-008", id: 'cc-008',
code: "CC-LOG-001", code: 'CC-LOG-001',
name: "Lojistik ve Depo", name: 'Lojistik ve Depo',
description: "Lojistik operasyonları ve depo masrafları", description: 'Lojistik operasyonları ve depo masrafları',
costCenterType: CostCenterType.Support, costCenterType: CostCenterType.Support,
budgetedAmount: 2800000, budgetedAmount: 2800000,
actualAmount: 2650000, actualAmount: 2650000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-12-03"), lastModificationTime: new Date('2024-12-03'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-009", id: 'cc-009',
code: "CC-RND-001", code: 'CC-RND-001',
name: "Ar-Ge Departmanı", name: 'Ar-Ge Departmanı',
description: "Araştırma ve geliştirme masrafları", description: 'Araştırma ve geliştirme masrafları',
costCenterType: CostCenterType.Investment, costCenterType: CostCenterType.Investment,
budgetedAmount: 3500000, budgetedAmount: 3500000,
actualAmount: 3300000, actualAmount: 3300000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-12-07"), lastModificationTime: new Date('2024-12-07'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-010", id: 'cc-010',
code: "CC-PUR-001", code: 'CC-PUR-001',
name: "Satın Alma", name: 'Satın Alma',
description: "Satın alma ve tedarik masrafları", description: 'Satın alma ve tedarik masrafları',
costCenterType: CostCenterType.Support, costCenterType: CostCenterType.Support,
budgetedAmount: 1600000, budgetedAmount: 1600000,
actualAmount: 1520000, actualAmount: 1520000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-11-30"), lastModificationTime: new Date('2024-11-30'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-011", id: 'cc-011',
code: "CC-MAI-001", code: 'CC-MAI-001',
name: "Bakım ve Onarım", name: 'Bakım ve Onarım',
description: "Bakım ve onarım masrafları", description: 'Bakım ve onarım masrafları',
costCenterType: CostCenterType.Service, costCenterType: CostCenterType.Service,
budgetedAmount: 2200000, budgetedAmount: 2200000,
actualAmount: 2100000, actualAmount: 2100000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-12-02"), lastModificationTime: new Date('2024-12-02'),
subCostCenters: [], subCostCenters: [],
}, },
{ {
id: "cc-012", id: 'cc-012',
code: "CC-CUS-001", code: 'CC-CUS-001',
name: "Müşteri Hizmetleri", name: 'Müşteri Hizmetleri',
description: "Müşteri hizmetleri masrafları", description: 'Müşteri hizmetleri masrafları',
costCenterType: CostCenterType.Service, costCenterType: CostCenterType.Service,
budgetedAmount: 1000000, budgetedAmount: 1000000,
actualAmount: 950000, actualAmount: 950000,
currency: "TRY", currency: 'TRY',
fiscalYear: "2025", fiscalYear: '2025',
isActive: true, isActive: true,
creationTime: new Date("2024-01-15"), creationTime: new Date('2024-01-15'),
lastModificationTime: new Date("2024-11-28"), lastModificationTime: new Date('2024-11-28'),
subCostCenters: [], subCostCenters: [],
}, },
]; ]

View file

@ -40,7 +40,7 @@ export const mockEmployees: HrEmployee[] = [
employmentType: EmploymentTypeEnum.FullTime, employmentType: EmploymentTypeEnum.FullTime,
jobPositionId: "1", jobPositionId: "1",
jobPosition: mockJobPositions.find((jp) => jp.id === "1")!, jobPosition: mockJobPositions.find((jp) => jp.id === "1")!,
departmantId: "1", departmentId: "1",
department: mockDepartments.find((d) => d.id === "1")!, department: mockDepartments.find((d) => d.id === "1")!,
baseSalary: 65000, baseSalary: 65000,
currency: "TRY", currency: "TRY",
@ -99,7 +99,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "2", jobPositionId: "2",
jobPosition: mockJobPositions.find((jp) => jp.id === "2")!, jobPosition: mockJobPositions.find((jp) => jp.id === "2")!,
departmantId: "1", departmentId: "1",
department: mockDepartments.find((d) => d.id === "1")!, department: mockDepartments.find((d) => d.id === "1")!,
baseSalary: 72000, baseSalary: 72000,
currency: "TRY", currency: "TRY",
@ -158,7 +158,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "3", jobPositionId: "3",
jobPosition: mockJobPositions.find((jp) => jp.id === "3")!, jobPosition: mockJobPositions.find((jp) => jp.id === "3")!,
departmantId: "1", departmentId: "1",
department: mockDepartments.find((d) => d.id === "1")!, department: mockDepartments.find((d) => d.id === "1")!,
baseSalary: 85000, baseSalary: 85000,
currency: "TRY", currency: "TRY",
@ -217,7 +217,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "4", jobPositionId: "4",
jobPosition: mockJobPositions.find((jp) => jp.id === "4")!, jobPosition: mockJobPositions.find((jp) => jp.id === "4")!,
departmantId: "1", departmentId: "1",
department: mockDepartments.find((d) => d.id === "1")!, department: mockDepartments.find((d) => d.id === "1")!,
baseSalary: 60000, baseSalary: 60000,
currency: "TRY", currency: "TRY",
@ -276,7 +276,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "5", jobPositionId: "5",
jobPosition: mockJobPositions.find((jp) => jp.id === "5")!, jobPosition: mockJobPositions.find((jp) => jp.id === "5")!,
departmantId: "1", departmentId: "1",
department: mockDepartments.find((d) => d.id === "1")!, department: mockDepartments.find((d) => d.id === "1")!,
baseSalary: 95000, baseSalary: 95000,
currency: "TRY", currency: "TRY",
@ -335,7 +335,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "6", jobPositionId: "6",
jobPosition: mockJobPositions.find((jp) => jp.id === "6")!, jobPosition: mockJobPositions.find((jp) => jp.id === "6")!,
departmantId: "1", departmentId: "1",
department: mockDepartments.find((d) => d.id === "1")!, department: mockDepartments.find((d) => d.id === "1")!,
baseSalary: 15000, baseSalary: 15000,
currency: "TRY", currency: "TRY",
@ -394,7 +394,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "7", jobPositionId: "7",
jobPosition: mockJobPositions.find((jp) => jp.id === "7")!, jobPosition: mockJobPositions.find((jp) => jp.id === "7")!,
departmantId: "2", departmentId: "2",
department: mockDepartments.find((d) => d.id === "2")!, department: mockDepartments.find((d) => d.id === "2")!,
baseSalary: 75000, baseSalary: 75000,
currency: "TRY", currency: "TRY",
@ -453,7 +453,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "8", jobPositionId: "8",
jobPosition: mockJobPositions.find((jp) => jp.id === "8")!, jobPosition: mockJobPositions.find((jp) => jp.id === "8")!,
departmantId: "2", departmentId: "2",
department: mockDepartments.find((d) => d.id === "2")!, department: mockDepartments.find((d) => d.id === "2")!,
baseSalary: 130000, baseSalary: 130000,
currency: "TRY", currency: "TRY",
@ -512,7 +512,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "9", jobPositionId: "9",
jobPosition: mockJobPositions.find((jp) => jp.id === "9")!, jobPosition: mockJobPositions.find((jp) => jp.id === "9")!,
departmantId: "1", departmentId: "1",
department: mockDepartments.find((d) => d.id === "1")!, department: mockDepartments.find((d) => d.id === "1")!,
baseSalary: 50000, baseSalary: 50000,
currency: "TRY", currency: "TRY",
@ -571,7 +571,7 @@ export const mockEmployees: HrEmployee[] = [
jobPositionId: "10", jobPositionId: "10",
jobPosition: mockJobPositions.find((jp) => jp.id === "10")!, jobPosition: mockJobPositions.find((jp) => jp.id === "10")!,
departmantId: "1", departmentId: "1",
department: mockDepartments.find((d) => d.id === "1")!, department: mockDepartments.find((d) => d.id === "1")!,
baseSalary: 250000, baseSalary: 250000,
currency: "TRY", currency: "TRY",

View file

@ -22,7 +22,7 @@ export interface HrEmployee {
employmentType: EmploymentTypeEnum employmentType: EmploymentTypeEnum
jobPositionId: string jobPositionId: string
jobPosition?: HrJobPosition jobPosition?: HrJobPosition
departmantId: string departmentId: string
department?: HrDepartment department?: HrDepartment
managerId?: string managerId?: string
manager?: HrEmployee manager?: HrEmployee

View file

@ -350,7 +350,7 @@ const Degree360Evaluation: React.FC = () => {
name: targetEmployee.fullName, name: targetEmployee.fullName,
title: targetEmployee.jobPosition?.name, title: targetEmployee.jobPosition?.name,
department: department:
mockDepartments.find((d) => d.id === targetEmployee.departmantId)?.name || '', mockDepartments.find((d) => d.id === targetEmployee.departmentId)?.name || '',
type: 'employee', type: 'employee',
}, },
] ]
@ -359,7 +359,7 @@ const Degree360Evaluation: React.FC = () => {
case AssessorTypeEnum.Manager: { case AssessorTypeEnum.Manager: {
const managers = mockEmployees.filter( const managers = mockEmployees.filter(
(emp) => (emp) =>
emp.departmantId === targetEmployee.departmantId && emp.departmentId === targetEmployee.departmentId &&
(typeof emp.jobPosition?.level === 'number' && (typeof emp.jobPosition?.level === 'number' &&
typeof targetEmployee.jobPosition?.level === 'number' typeof targetEmployee.jobPosition?.level === 'number'
? emp.jobPosition?.level > targetEmployee.jobPosition?.level ? emp.jobPosition?.level > targetEmployee.jobPosition?.level
@ -370,7 +370,7 @@ const Degree360Evaluation: React.FC = () => {
id: emp.id, id: emp.id,
name: emp.fullName, name: emp.fullName,
title: emp.jobPosition?.name, title: emp.jobPosition?.name,
department: mockDepartments.find((d) => d.id === emp.departmantId)?.name || '', department: mockDepartments.find((d) => d.id === emp.departmentId)?.name || '',
type: 'employee', type: 'employee',
})) }))
} }
@ -379,14 +379,14 @@ const Degree360Evaluation: React.FC = () => {
const peers = mockEmployees.filter( const peers = mockEmployees.filter(
(emp) => (emp) =>
emp.id !== targetEmployeeId && emp.id !== targetEmployeeId &&
emp.departmantId === targetEmployee.departmantId && emp.departmentId === targetEmployee.departmentId &&
emp.jobPosition?.level === targetEmployee.jobPosition?.level, emp.jobPosition?.level === targetEmployee.jobPosition?.level,
) )
return peers.map((emp) => ({ return peers.map((emp) => ({
id: emp.id, id: emp.id,
name: emp.fullName, name: emp.fullName,
title: emp.jobPosition?.name, title: emp.jobPosition?.name,
department: mockDepartments.find((d) => d.id === emp.departmantId)?.name || '', department: mockDepartments.find((d) => d.id === emp.departmentId)?.name || '',
type: 'employee', type: 'employee',
})) }))
} }
@ -394,7 +394,7 @@ const Degree360Evaluation: React.FC = () => {
case AssessorTypeEnum.Subordinate: { case AssessorTypeEnum.Subordinate: {
const subordinates = mockEmployees.filter( const subordinates = mockEmployees.filter(
(emp) => (emp) =>
emp.departmantId === targetEmployee.departmantId && emp.departmentId === targetEmployee.departmentId &&
(typeof emp.jobPosition?.level === 'number' && (typeof emp.jobPosition?.level === 'number' &&
typeof targetEmployee.jobPosition?.level === 'number' typeof targetEmployee.jobPosition?.level === 'number'
? emp.jobPosition?.level < targetEmployee.jobPosition?.level ? emp.jobPosition?.level < targetEmployee.jobPosition?.level
@ -405,7 +405,7 @@ const Degree360Evaluation: React.FC = () => {
id: emp.id, id: emp.id,
name: emp.fullName, name: emp.fullName,
title: emp.jobPosition?.name, title: emp.jobPosition?.name,
department: mockDepartments.find((d) => d.id === emp.departmantId)?.name || '', department: mockDepartments.find((d) => d.id === emp.departmentId)?.name || '',
type: 'employee', type: 'employee',
})) }))
} }
@ -435,26 +435,26 @@ const Degree360Evaluation: React.FC = () => {
case AssessorTypeEnum.HRUpperManagement: { case AssessorTypeEnum.HRUpperManagement: {
const hrEmployees = mockEmployees.filter( const hrEmployees = mockEmployees.filter(
(emp) => (emp) =>
emp.id !== targetEmployeeId && (emp.departmantId === 'hr' || emp.departmantId === '3'), // HR departmanı emp.id !== targetEmployeeId && (emp.departmentId === 'hr' || emp.departmentId === '3'), // HR departmanı
) )
return hrEmployees.map((emp) => ({ return hrEmployees.map((emp) => ({
id: emp.id, id: emp.id,
name: emp.fullName, name: emp.fullName,
title: emp.jobPosition?.name, title: emp.jobPosition?.name,
department: mockDepartments.find((d) => d.id === emp.departmantId)?.name || '', department: mockDepartments.find((d) => d.id === emp.departmentId)?.name || '',
type: 'employee', type: 'employee',
})) }))
} }
case AssessorTypeEnum.OtherDepartment: { case AssessorTypeEnum.OtherDepartment: {
const otherDepartmentEmployees = mockEmployees.filter( const otherDepartmentEmployees = mockEmployees.filter(
(emp) => emp.id !== targetEmployeeId && emp.departmantId !== targetEmployee.departmantId, (emp) => emp.id !== targetEmployeeId && emp.departmentId !== targetEmployee.departmentId,
) )
return otherDepartmentEmployees.map((emp) => ({ return otherDepartmentEmployees.map((emp) => ({
id: emp.id, id: emp.id,
name: emp.fullName, name: emp.fullName,
title: emp.jobPosition?.name, title: emp.jobPosition?.name,
department: mockDepartments.find((d) => d.id === emp.departmantId)?.name || '', department: mockDepartments.find((d) => d.id === emp.departmentId)?.name || '',
type: 'employee', type: 'employee',
})) }))
} }
@ -512,7 +512,7 @@ const Degree360Evaluation: React.FC = () => {
}) })
const filteredEmployeesByDepartment = mockEmployees.filter( const filteredEmployeesByDepartment = mockEmployees.filter(
(emp) => selectedDepartment === 'all' || emp.departmantId === selectedDepartment, (emp) => selectedDepartment === 'all' || emp.departmentId === selectedDepartment,
) )
// Statistics // Statistics
@ -640,7 +640,7 @@ const Degree360Evaluation: React.FC = () => {
const evaluatedEmployee = mockEmployees.find( const evaluatedEmployee = mockEmployees.find(
(e) => e.id === participant.evaluatedEmployeeId, (e) => e.id === participant.evaluatedEmployeeId,
) )
if (!evaluatedEmployee || evaluatedEmployee.departmantId !== selectedResultsDepartment) { if (!evaluatedEmployee || evaluatedEmployee.departmentId !== selectedResultsDepartment) {
return false return false
} }
} }
@ -1519,7 +1519,7 @@ const Degree360Evaluation: React.FC = () => {
<h4 className="font-medium text-gray-900">{employee.fullName}</h4> <h4 className="font-medium text-gray-900">{employee.fullName}</h4>
<p className="text-gray-600">{employee.jobPosition?.name}</p> <p className="text-gray-600">{employee.jobPosition?.name}</p>
<p className="text-gray-600"> <p className="text-gray-600">
{mockDepartments.find((d) => d.id === employee.departmantId)?.name} {mockDepartments.find((d) => d.id === employee.departmentId)?.name}
</p> </p>
</div> </div>
<FaUsers className="w-4 h-4 text-gray-400" /> <FaUsers className="w-4 h-4 text-gray-400" />

View file

@ -144,7 +144,7 @@ const DepartmentManagement: React.FC = () => {
render: (department: HrDepartment) => ( render: (department: HrDepartment) => (
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<FaUsers className="w-4 h-4 text-gray-500" /> <FaUsers className="w-4 h-4 text-gray-500" />
<span>{mockEmployees.filter((a) => a.departmantId == department.id).length || 0}</span> <span>{mockEmployees.filter((a) => a.departmentId == department.id).length || 0}</span>
</div> </div>
), ),
}, },
@ -381,7 +381,7 @@ const DepartmentManagement: React.FC = () => {
<div className="flex items-center text-xs text-gray-600"> <div className="flex items-center text-xs text-gray-600">
<FaUsers className="w-4 h-4 mr-2 text-gray-400" /> <FaUsers className="w-4 h-4 mr-2 text-gray-400" />
<span> <span>
{mockEmployees.filter((emp) => emp.departmantId === department.id).length}{' '} {mockEmployees.filter((emp) => emp.departmentId === department.id).length}{' '}
Personel Personel
</span> </span>
</div> </div>

View file

@ -25,10 +25,10 @@ const DepartmentViewModal: React.FC<DepartmentViewModalProps> = ({
onEdit, onEdit,
}) => { }) => {
const employeeCount = mockEmployees.filter( const employeeCount = mockEmployees.filter(
(emp) => emp.departmantId === department?.id (emp) => emp.departmentId === department?.id
).length; ).length;
const departmentEmployees = mockEmployees.filter( const departmentEmployees = mockEmployees.filter(
(emp) => emp.departmantId === department?.id (emp) => emp.departmentId === department?.id
); );
return ( return (

View file

@ -88,7 +88,7 @@ const EmployeeForm: React.FC = () => {
hireDate: new Date(), hireDate: new Date(),
employmentType: EmploymentTypeEnum.FullTime, employmentType: EmploymentTypeEnum.FullTime,
jobPositionId: '', jobPositionId: '',
departmantId: '', departmentId: '',
baseSalary: 0, baseSalary: 0,
currency: 'TRY', currency: 'TRY',
payrollGroup: '', payrollGroup: '',
@ -170,7 +170,7 @@ const EmployeeForm: React.FC = () => {
if (!formData.hireDate) { if (!formData.hireDate) {
newErrors.hireDate = 'İşe giriş tarihi zorunludur' newErrors.hireDate = 'İşe giriş tarihi zorunludur'
} }
if (!formData.departmantId) { if (!formData.departmentId) {
newErrors.departmentId = 'Departman seçilmelidir' newErrors.departmentId = 'Departman seçilmelidir'
} }
if (!formData.jobPosition) { if (!formData.jobPosition) {
@ -539,10 +539,10 @@ const EmployeeForm: React.FC = () => {
Departman * Departman *
</label> </label>
<select <select
value={formData.departmantId} value={formData.departmentId}
onChange={(e) => handleInputChange('departmantId', e.target.value)} onChange={(e) => handleInputChange('departmentId', e.target.value)}
className={`block w-full px-2 py-1 text-sm border rounded-md shadow-sm focus:outline-none focus:ring-1 ${ className={`block w-full px-2 py-1 text-sm border rounded-md shadow-sm focus:outline-none focus:ring-1 ${
errors.departmantId errors.departmentId
? 'border-red-300 focus:border-red-500 focus:ring-red-500' ? 'border-red-300 focus:border-red-500 focus:ring-red-500'
: 'border-gray-300 focus:border-blue-500 focus:ring-blue-500' : 'border-gray-300 focus:border-blue-500 focus:ring-blue-500'
}`} }`}

View file

@ -59,7 +59,7 @@ const LeaveManagement: React.FC = () => {
// Get employees by department // Get employees by department
const getEmployeesByDepartment = (departmentId: string) => { const getEmployeesByDepartment = (departmentId: string) => {
return mockEmployees.filter((emp) => emp.departmantId === departmentId) return mockEmployees.filter((emp) => emp.departmentId === departmentId)
} }
// Get selected employee object // Get selected employee object

View file

@ -27,7 +27,7 @@ const generateOrganizationData = (): OrgChart[] => {
// Çalışanları işle // Çalışanları işle
mockEmployees.forEach((employee) => { mockEmployees.forEach((employee) => {
const department = mockDepartments.find((d) => d.id === employee.departmantId) const department = mockDepartments.find((d) => d.id === employee.departmentId)
let level = 3 // Varsayılan seviye (normal çalışan) let level = 3 // Varsayılan seviye (normal çalışan)
let parentId: string | undefined = undefined let parentId: string | undefined = undefined
@ -155,7 +155,7 @@ const OrganizationChart: React.FC = () => {
const result: TreeNode[] = [] const result: TreeNode[] = []
for (const node of nodes) { for (const node of nodes) {
const filteredChildren = filterTree(node.children) const filteredChildren = filterTree(node.children)
if (node.employee.departmantId === selectedDepartment || filteredChildren.length > 0) { if (node.employee.departmentId === selectedDepartment || filteredChildren.length > 0) {
result.push({ ...node, children: filteredChildren }) result.push({ ...node, children: filteredChildren })
} }
} }
@ -169,7 +169,7 @@ const OrganizationChart: React.FC = () => {
if (selectedDepartment === 'all') { if (selectedDepartment === 'all') {
return employees return employees
} }
return employees.filter((emp) => emp.departmantId === selectedDepartment) return employees.filter((emp) => emp.departmentId === selectedDepartment)
}, [employees, selectedDepartment]) }, [employees, selectedDepartment])
const toggleNode = (nodeId: string) => { const toggleNode = (nodeId: string) => {

View file

@ -49,7 +49,7 @@ const OvertimeManagement: React.FC = () => {
// Get employees by department // Get employees by department
const getEmployeesByDepartment = (departmentId: string) => { const getEmployeesByDepartment = (departmentId: string) => {
return mockEmployees.filter((emp) => emp.departmantId === departmentId) return mockEmployees.filter((emp) => emp.departmentId === departmentId)
} }
// Get selected employee object // Get selected employee object