From c74c357c36926a4417a896d79f89f07652a184f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Thu, 23 Oct 2025 15:05:16 +0300 Subject: [PATCH] Hr Payroll --- .../Seeds/HostData.json | 6 +- .../Seeds/ListFormsSeeder.cs | 937 +++++++++++++++--- .../Enums/TableNameEnum.cs | 4 +- .../PlatformConsts.cs | 6 + .../TableNameResolver.cs | 2 + .../Kurs.Platform.Domain/Data/SeedConsts.cs | 2 +- .../Entities/Tenant/Hr/Payroll.cs | 32 + .../Entities/Tenant/Hr/PayrollItem.cs | 19 + .../Queries/DefaultValueHelper.cs | 27 +- .../Queries/DefaultValueManager.cs | 8 +- .../EntityFrameworkCore/PlatformDbContext.cs | 38 +- ....cs => 20251023112727_Initial.Designer.cs} | 184 +++- ...3_Initial.cs => 20251023112727_Initial.cs} | 77 +- .../PlatformDbContextModelSnapshot.cs | 182 ++++ .../Tenants/Seeds/TenantData.json | 210 ++-- .../Tenants/TenantDataSeeder.cs | 5 +- .../Tenants/TenantSeederDto.cs | 6 +- ui/src/types/hr.ts | 4 +- .../DialogContext/DialogShowComponent.tsx | 8 + 19 files changed, 1505 insertions(+), 252 deletions(-) create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Payroll.cs create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/PayrollItem.cs rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251023082453_Initial.Designer.cs => 20251023112727_Initial.Designer.cs} (98%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251023082453_Initial.cs => 20251023112727_Initial.cs} (98%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json index 672fec97..83b101ed 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json @@ -12100,8 +12100,8 @@ { "resourceName": "Platform", "key": "App.Hr.Payroll", - "tr": "Bordro", - "en": "Payroll" + "tr": "Bordro İşlemleri", + "en": "Payroll Management" }, { "resourceName": "Platform", @@ -15038,7 +15038,7 @@ "Code": "App.Hr.Payroll", "DisplayName": "App.Hr.Payroll", "Order": 10, - "Url": "/admin/hr/payroll", + "Url": "/admin/list/list-payroll", "Icon": "FcMoneyTransfer", "RequiredPermissionName": "App.Hr.Payroll", "IsDisabled": false diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 74b2950c..d0ee0e33 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -31869,7 +31869,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Code", - Width = 100, + Width = 200, ListOrderNo = 3, Visible = true, IsActive = true, @@ -31903,7 +31903,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Name", - Width = 100, + Width = 200, ListOrderNo = 3, Visible = true, IsActive = true, @@ -31937,7 +31937,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Description", - Width = 200, + Width = 400, ListOrderNo = 4, Visible = true, IsActive = true, @@ -32096,16 +32096,16 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Performance", Name= "PERFORMANCE" }, - new () { Key= "Leadership", Name= "LEADERSHIP" }, - new () { Key= "Innovation", Name= "INNOVATION" }, - new () { Key= "Teamwork", Name= "TEAMWORK" }, - new () { Key= "Customer", Name= "CUSTOMER" }, - new () { Key= "Safety", Name= "SAFETY" }, - new () { Key= "Attendance", Name= "ATTENDANCE" }, - new () { Key= "Training", Name= "TRAINING" }, - new () { Key= "Project", Name= "PROJECT" }, - new () { Key= "Special", Name= "SPECIAL" }, + new () { Key= "Performance", Name= "Performance" }, + new () { Key= "Leadership", Name= "Leadership" }, + new () { Key= "Innovation", Name= "Innovation" }, + new () { Key= "Teamwork", Name= "Teamwork" }, + new () { Key= "Customer", Name= "Customer" }, + new () { Key= "Safety", Name= "Safety" }, + new () { Key= "Attendance", Name= "Attendance" }, + new () { Key= "Training", Name= "Training" }, + new () { Key= "Project", Name= "Project" }, + new () { Key= "Special", Name= "Special" }, }), }), ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto @@ -32133,7 +32133,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Criteria", - Width = 100, + Width = 400, ListOrderNo = 8, Visible = true, IsActive = true, @@ -32207,11 +32207,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Common", Name= "COMMON" }, - new () { Key= "Uncommon", Name= "UNCOMMON" }, - new () { Key= "Rare", Name= "RARE" }, - new () { Key= "Epic", Name= "EPIC" }, - new () { Key= "Legendary", Name= "LEGENDARY" }, + new () { Key= "Common", Name= "Common" }, + new () { Key= "Uncommon", Name= "Uncommon" }, + new () { Key= "Rare", Name= "Rare" }, + new () { Key= "Epic", Name= "Epic" }, + new () { Key= "Legendary", Name= "Legendary" }, }), }), ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto @@ -32500,7 +32500,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Name", - Width = 200, + Width = 150, ListOrderNo = 3, Visible = true, IsActive = true, @@ -32534,7 +32534,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Description", - Width = 300, + Width = 400, ListOrderNo = 4, Visible = true, IsActive = true, @@ -32564,7 +32564,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Guid, FieldName = "DepartmentId", - Width = 200, + Width = 100, ListOrderNo = 5, Visible = true, IsActive = true, @@ -32602,7 +32602,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Level", - Width = 100, + Width = 80, ListOrderNo = 6, Visible = true, IsActive = true, @@ -32621,14 +32621,14 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Entry", Name= "ENTRY" }, - new () { Key= "Junior", Name= "JUNIOR" }, - new () { Key= "Mid", Name= "MID"}, - new () { Key= "Senior", Name= "SENIOR" }, - new () { Key= "Lead", Name= "LEAD" }, - new () { Key= "Manager", Name= "MANAGER" }, - new () { Key= "Director", Name= "DIRECTOR" }, - new () { Key= "Executive", Name= "EXECUTIVE" }, + new () { Key= "Entry", Name= "Entry" }, + new () { Key= "Junior", Name= "Junior" }, + new () { Key= "Mid", Name= "Mid"}, + new () { Key= "Senior", Name= "Senior" }, + new () { Key= "Lead", Name= "Lead" }, + new () { Key= "Manager", Name= "Manager" }, + new () { Key= "Director", Name= "Director" }, + new () { Key= "Executive", Name= "Executive" }, }), }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto @@ -32652,7 +32652,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "MinSalary", - Width = 200, + Width = 100, ListOrderNo = 7, Visible = true, IsActive = true, @@ -32752,7 +32752,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "RequiredSkills", - Width = 100, + Width = 400, ListOrderNo = 10, Visible = true, IsActive = true, @@ -32783,7 +32783,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Responsibilities", - Width = 100, + Width = 400, ListOrderNo = 11, Visible = true, IsActive = true, @@ -32814,7 +32814,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Qualifications", - Width = 100, + Width = 400, ListOrderNo = 12, Visible = true, IsActive = true, @@ -33765,14 +33765,14 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Revenue", Name= "REVENUE" }, - new () { Key= "Standard", Name= "STANDARD" }, - new () { Key= "Discretionary", Name= "DISCRETIONARY"}, - new () { Key= "Investment", Name= "INVESTMENT" }, - new () { Key= "Service", Name= "SERVICE" }, - new () { Key= "Production", Name= "PRODUCTION" }, - new () { Key= "Support", Name= "SUPPORT" }, - new () { Key= "Administrative", Name="ADMINISTRATIVE" } + new () { Key= "Revenue", Name= "Revenue" }, + new () { Key= "Standard", Name= "Standard" }, + new () { Key= "Discretionary", Name= "Discretionary"}, + new () { Key= "Investment", Name= "Investment" }, + new () { Key= "Service", Name= "Service" }, + new () { Key= "Production", Name= "Production" }, + new () { Key= "Support", Name= "Support" }, + new () { Key= "Administrative", Name="Administrative" } }), }), ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto @@ -34051,7 +34051,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Popup = new GridEditingPopupDto() { Title = "Employee Form", - Width = 500, + Width = 1000, Height = 520 }, AllowDeleting = true, @@ -34079,58 +34079,58 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency EditingFormJson = JsonSerializer.Serialize(new List() { new() { - Order=1, Caption="General", ColCount=1, ColSpan=2, ItemType="group", Items = + Order=1, Caption="General", ColCount=1, ColSpan=1, ItemType="group", Items = [ - new EditingFormItemDto { Order = 1, DataField="Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField="FullName", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField="NationalId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField="BirthDate", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, - new EditingFormItemDto { Order = 5, DataField="Gender", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 6, DataField="MaritalStatus", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 7, DataField="EmployeeStatus", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 8, DataField="IsActive", ColSpan = 2, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 1, DataField="Code", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField="FullName", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField="NationalId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField="BirthDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 5, DataField="Gender", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField="MaritalStatus", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 7, DataField="EmployeeStatus", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 8, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, ] }, new() { - Order=2, Caption="Contact", ColCount=1, ColSpan=2, ItemType="group", Items = + Order=2, Caption="Contact", ColCount=1, ColSpan=1, ItemType="group", Items = [ - new EditingFormItemDto { Order = 1, DataField="Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 2, DataField="City", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 3, DataField="District", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 4, DataField="Street", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 5, DataField="PostalCode", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 1, DataField="Country", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField="City", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField="District", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField="Street", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField="PostalCode", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 6, DataField="Phone", ColSpan = 1, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, new EditingFormItemDto { Order = 7, DataField="PersonalPhone", ColSpan = 1, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, - new EditingFormItemDto { Order = 8, DataField="Email", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 9, DataField="Address1", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 10, DataField="Address2", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 8, DataField="Email", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 9, DataField="Address1", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 10, DataField="Address2", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, ] }, new() { - Order=3, Caption="Emergency", ColCount=1, ColSpan=2, ItemType="group", Items = + Order=3, Caption="Job", ColCount=1, ColSpan=1, ItemType="group", Items = [ - new EditingFormItemDto { Order = 1, DataField="EmergencyContactName", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField="EmergencyContactRelationship", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 1, DataField="HireDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 2, DataField="TerminationDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 3, DataField="EmploymentTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField="JobPositionId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField="DepartmentId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField="WorkLocation", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField="ManagerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 8, DataField="BaseSalary", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 9, DataField="CurrencyId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 10, DataField="PayrollGroup", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 11, DataField="BankAccountId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 12, DataField="BadgeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + ] + }, + new() { + Order=4, Caption="Emergency", ColCount=1, ColSpan=1, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField="EmergencyContactName", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField="EmergencyContactRelationship", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 3, DataField="EmergencyContactPhone", ColSpan = 1, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, ] }, - new() { - Order=3, Caption="Job", ColCount=1, ColSpan=2, ItemType="group", Items = - [ - new EditingFormItemDto { Order = 1, DataField="HireDate", ColSpan = 2, IsRequired = true, 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 = 4, DataField="JobPositionId", 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 = 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 = 9, DataField="CurrencyId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 10, DataField="PayrollGroup", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 11, DataField="BankAccountId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 12, DataField="BadgeId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - ] - }, }), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { @@ -34219,7 +34219,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "FullName", - Width = 200, + Width = 150, ListOrderNo = 3, Visible = true, IsActive = true, @@ -34333,9 +34333,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Male", Name= "MALE"}, - new () { Key= "Female", Name= "FEMALE" }, - new () { Key= "Other", Name= "OTHER" }, + new () { Key= "Male", Name= "Male"}, + new () { Key= "Female", Name= "Female" }, + new () { Key= "Other", Name= "Other" }, }), }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto @@ -34378,11 +34378,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Active", Name= "ACTIVE"}, - new () { Key= "Inactive", Name= "INACTIVE" }, - new () { Key= "OnLeave", Name= "ON_LEAVE" }, - new () { Key= "Suspended", Name= "SUSPENDED" }, - new () { Key= "Terminated", Name= "TERMINATED" }, + new () { Key= "Active", Name= "Active"}, + new () { Key= "Inactive", Name= "Inactive" }, + new () { Key= "OnLeave", Name= "OnLeave" }, + new () { Key= "Suspended", Name= "Suspended" }, + new () { Key= "Terminated", Name= "Terminated" }, }), }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto @@ -34438,7 +34438,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Address1", - Width = 150, + Width = 200, ListOrderNo = 9, Visible = true, IsActive = true, @@ -34469,7 +34469,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Address2", - Width = 150, + Width = 200, ListOrderNo = 10, Visible = true, IsActive = true, @@ -34623,7 +34623,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "PostalCode", - Width = 150, + Width = 100, ListOrderNo = 14, Visible = true, IsActive = true, @@ -34654,7 +34654,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Phone", - Width = 150, + Width = 100, ListOrderNo = 15, Visible = true, IsActive = true, @@ -34685,7 +34685,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "PersonalPhone", - Width = 150, + Width = 100, ListOrderNo = 16, Visible = true, IsActive = true, @@ -34716,7 +34716,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Email", - Width = 150, + Width = 200, ListOrderNo = 17, Visible = true, IsActive = true, @@ -34814,7 +34814,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "EmergencyContactPhone", - Width = 100, + Width = 150, ListOrderNo = 20, Visible = true, IsActive = true, @@ -35021,7 +35021,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "WorkLocation", - Width = 100, + Width = 150, ListOrderNo = 26, Visible = true, IsActive = true, @@ -35171,9 +35171,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Hours", Name= "HOURS" }, - new () { Key= "Weeks", Name= "WEEKS" }, - new () { Key= "Months", Name= "MONTHS" } + new () { Key= "Hours", Name= "Hours" }, + new () { Key= "Weeks", Name= "Weeks" }, + new () { Key= "Months", Name= "Months" } }), }), ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto @@ -35551,14 +35551,14 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Annual", Name= "ANNUAL" }, - new () { Key= "Sick", Name= "SICK" }, - new () { Key= "Maternity", Name= "MATERNITY"}, - new () { Key= "Paternity", Name= "PATERNITY" }, - new () { Key= "Personal", Name= "PERSONAL" }, - new () { Key= "Emergency", Name= "EMERGENCY" }, - new () { Key= "Study", Name= "STUDY" }, - new () { Key= "Unpaid", Name="UNPAID" } + new () { Key= "Annual", Name= "Annual" }, + new () { Key= "Sick", Name= "Sick" }, + new () { Key= "Maternity", Name= "Maternity"}, + new () { Key= "Paternity", Name= "Paternity" }, + new () { Key= "Personal", Name= "Personal" }, + new () { Key= "Emergency", Name= "Emergency" }, + new () { Key= "Study", Name= "Study" }, + new () { Key= "Unpaid", Name="Unpaid" } }), }), ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { @@ -35774,10 +35774,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Pending", Name= "PENDING" }, - new () { Key= "Approved", Name= "APPROVED" }, - new () { Key= "Rejected", Name= "REJECTED"}, - new () { Key= "Cancelled", Name= "CANCELLED" }, + new () { Key= "Pending", Name= "Pending" }, + new () { Key= "Approved", Name= "Approved" }, + new () { Key= "Rejected", Name= "Rejected"}, + new () { Key= "Cancelled", Name= "Cancelled" }, }), }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto @@ -36419,10 +36419,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key= "Pending", Name= "PENDING" }, - new () { Key= "Approved", Name= "APPROVED" }, - new () { Key= "Rejected", Name= "REJECTED"}, - new () { Key= "Cancelled", Name= "CANCELLED" }, + new () { Key= "Pending", Name= "Pending" }, + new () { Key= "Approved", Name= "Approved" }, + new () { Key= "Rejected", Name= "Rejected"}, + new () { Key= "Cancelled", Name= "Cancelled" }, }), }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto @@ -36575,6 +36575,707 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Payroll + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Payroll)) + { + var listFormPayroll = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = true, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Payroll, + Name = AppCodes.Hr.Payroll, + Title = AppCodes.Hr.Payroll, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.Payroll, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Payroll)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = true }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnAutoWidth = true, + ColumnChooserEnabled = true, + AllowColumnResizing = true, + AllowColumnReordering = true, + ColumnResizingMode = "widget", + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + D = AppCodes.Hr.Payroll + ".Delete", + E = AppCodes.Hr.Payroll + ".Export", + I = AppCodes.Hr.Payroll + ".Import", + A = AppCodes.Hr.Payroll + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Payroll))}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Payroll Form", + Width = 400, + Height = 520 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "EmployeeId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "PeriodYear", ColSpan = 2, IsRequired=true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 3, DataField = "PeriodMonth", ColSpan = 2, IsRequired=true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField = "PaymentDate", ColSpan = 2, IsRequired=true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 5, DataField = "BaseSalary", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 6, DataField = "Overtime", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 7, DataField = "Bonus", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 8, DataField = "GrossSalary", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 9, DataField = "NetSalary", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 10, DataField = "Tax", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 11, DataField = "SocialSecurity", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 12, DataField = "Status", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox}, + ] + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "Status", + FieldDbType = DbType.String, + Value = "Draft", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "PeriodYear", + FieldDbType = DbType.Int32, + Value = "@YEAR", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "PeriodMonth", + FieldDbType = DbType.Int32, + Value = "@MONTH", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "PaymentDate", + FieldDbType = DbType.Date, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "BaseSalary", + FieldDbType = DbType.Decimal, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "Overtime", + FieldDbType = DbType.Decimal, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "Bonus", + FieldDbType = DbType.Decimal, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "GrossSalary", + FieldDbType = DbType.Decimal, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "NetSalary", + FieldDbType = DbType.Decimal, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "Tax", + FieldDbType = DbType.Decimal, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "SocialSecurity", + FieldDbType = DbType.Decimal, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + ButtonPosition = UiCommandButtonPositionTypeEnum.Toolbar, + Hint = "Toplu Bordro", + Text ="Toplu Bordro", + AuthName = AppCodes.Hr.Payroll + ".Update", + DialogName = "CollectivePayroll", + DialogParameters = JsonSerializer.Serialize(new { + name = "@Name", + id = "@Id" + }) + }, + new() { + Hint = "Ödeme & Kesinti", + Text ="Ödeme & Kesinti", + UrlTarget="_blank", + AuthName = AppCodes.Hr.Payroll + ".Update", + Url="/admin/list/list-employees/@Id" + }, + new() { + Hint = "Accept", + Text ="Accept", + UrlTarget="_blank", + AuthName = AppCodes.Hr.Payroll + ".Update", + Url="/admin/list/list-employees/@Id" + }, + new() { + Hint = "Reject", + Text ="Reject", + UrlTarget="_blank", + AuthName = AppCodes.Hr.Payroll + ".Update", + Url="/admin/list/list-employees/@Id" + }, + }), + } + ); + + #region Payroll Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "EmployeeId", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.EmployeeValues + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "PeriodYear", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "PeriodMonth", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= 1, Name= "01-Ocak" }, + new () { Key= 2, Name= "02-Şubat" }, + new () { Key= 3, Name= "03-Mart"}, + new () { Key= 4, Name= "04-Nisan" }, + new () { Key= 5, Name= "05-Mayıs" }, + new () { Key= 6, Name= "06-Haziran" }, + new () { Key= 7, Name= "07-Temmuz" }, + new () { Key= 8, Name= "08-Ağustos" }, + new () { Key= 9, Name= "09-Eylül" }, + new () { Key=10, Name= "10-Ekim" }, + new () { Key=11, Name= "11-Kasım" }, + new () { Key=12, Name= "12-Aralık" }, + }), + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "PaymentDate", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "BaseSalary", + Width = 150, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Overtime", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Bonus", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "GrossSalary", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "NetSalary", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Tax", + Width = 100, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "SocialSecurity", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + new() { + ListFormCode = listFormPayroll.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "Draft", Name= "Draft" }, + new () { Key= "Calculated", Name= "Calculated" }, + new () { Key= "Approved", Name= "Approved"}, + new () { Key= "Paid", Name= "Paid" }, + new () { Key= "Cancelled", Name= "Cancelled" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Payroll + ".Create", + R = AppCodes.Hr.Payroll, + U = AppCodes.Hr.Payroll + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + ]); + #endregion + } + #endregion + #endregion } } diff --git a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs index 0b6b03d6..96bb366d 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -112,5 +112,7 @@ public enum TableNameEnum CostCenter, Employee, Leave, - Overtime + Overtime, + Payroll, + PayrollItem } \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs index ba961ce0..a2730db2 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -24,6 +24,8 @@ public static class PlatformConsts public static string HtmlEditorOptions = "{\"toolbar\": {\"multiline\": true, \"items\": [{\"name\": \"undo\"},{\"name\": \"redo\"},{\"name\": \"separator\"},{\"name\": \"size\",\"acceptedValues\": [\"8pt\",\"10pt\",\"12pt\",\"14pt\",\"18pt\",\"24pt\",\"36pt\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font size\"}}},{\"name\": \"font\",\"acceptedValues\": [\"Arial\",\"Courier New\",\"Georgia\",\"Impact\",\"Lucida Console\",\"Tahoma\",\"Times New Roman\",\"Verdana\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"bold\"},{\"name\": \"italic\"},{\"name\": \"strike\"},{\"name\": \"underline\"},{\"name\": \"separator\"},{\"name\": \"alignLeft\"},{\"name\": \"alignCenter\"},{\"name\": \"alignRight\"},{\"name\": \"alignJustify\"},{\"name\": \"separator\"},{\"name\": \"orderedList\"},{\"name\": \"bulletList\"},{\"name\": \"separator\"},{\"name\": \"header\",\"acceptedValues\": [false,1,2,3,4,5],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"color\"},{\"name\": \"background\"},{\"name\": \"separator\"},{\"name\": \"link\"},{\"name\": \"image\"},{\"name\": \"separator\"},{\"name\": \"clear\"},{\"name\": \"codeBlock\"},{\"name\": \"blockquote\"},{\"name\": \"separator\"},{\"name\": \"insertTable\"},{\"name\": \"deleteTable\"},{\"name\": \"insertRowAbove\"},{\"name\": \"insertRowBelow\"},{\"name\": \"deleteRow\"},{\"name\": \"insertColumnLeft\"},{\"name\": \"insertColumnRight\"},{\"name\": \"deleteColumn\"}]}}"; public static string PhoneEditorOptions = "{\"format\": \"phoneGlobal\", \"mask\":\"(000) 000-0000\", \"maskInvalidMessage\":\"Lütfen geçerli bir telefon numarası girin\", \"useMaskedValue\":false, \"maskRules\": { \"X\": \"[1-9]\" }, \"placeholder\": \"(555) 123-4567\" }"; public static string TimeSpanOptions = "{\"type\":\"time\",\"pickerType\":\"list\",\"displayFormat\":\"HH:mm\",\"dateSerializationFormat\":\"yyyy-MM-ddTHH:mm:ss\",\"interval\":30,\"width\":\"100%\"}"; + public static string NumberStandartFormat = "{ \"format\": \",##0.###\" }"; + public static string NumberPercentFormat = "{ \"format\": \"#0.##'%'\" }"; } public static class EditorScriptValues @@ -515,6 +517,7 @@ public static class PlatformConsts public const string Employee = "list-employee"; public const string Leave = "list-leave"; public const string Overtime = "list-overtime"; + public const string Payroll = "list-payroll"; } } @@ -1317,6 +1320,9 @@ public static class PlatformConsts public const string UserName = "@USERNAME"; public const string Roles = "@ROLES"; public const string Now = "@NOW"; + public const string Year = "@YEAR"; + public const string Month = "@MONTH"; + public const string Day = "@DAY"; public const string Id = "@ID"; public const string Selected_Ids = "@SELECTED_IDS"; public const string TenantId = "@TENANTID"; diff --git a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs index 8dc93cd2..21c98d94 100644 --- a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs @@ -130,6 +130,8 @@ public static class TableNameResolver { nameof(TableNameEnum.Employee), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.Leave), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.Overtime), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.Payroll), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.PayrollItem), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, // 🔹 ACCOUNTING { nameof(TableNameEnum.Bank), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Accounting) }, diff --git a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs index b41c93bc..4a9cbe18 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -459,7 +459,7 @@ public static class SeedConsts public const string CostCenter = Default + ".CostCenter"; public const string Leave = Default + ".Leave"; public const string Overtime = Default + ".Overtime"; - public const string Payrool = Default + ".Payrool"; + public const string Payroll = Default + ".Payroll"; public const string Template360 = Default + ".Template360"; public const string Evulation360 = Default + ".Evulation360"; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Payroll.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Payroll.cs new file mode 100644 index 00000000..97da2e58 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Payroll.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class Payroll : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid EmployeeId { get; set; } + public string PeriodYear { get; set; } + public string PeriodMonth { get; set; } + public decimal? BaseSalary { get; set; } + public decimal? Overtime { get; set; } + public decimal? Bonus { get; set; } + public decimal? GrossSalary { get; set; } + public decimal? NetSalary { get; set; } + public decimal? Tax { get; set; } + public decimal? SocialSecurity { get; set; } + public string Status { get; set; } + public DateTime? PaymentDate { get; set; } + + // Navigation placeholders (allowances & deductions) + public ICollection Items { get; set; } + + public Payroll() + { + Items = []; + } +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/PayrollItem.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/PayrollItem.cs new file mode 100644 index 00000000..4e87b65c --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/PayrollItem.cs @@ -0,0 +1,19 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class PayrollItem : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid PayrollItemId { get; set; } + public Payroll Payroll { get; set; } + + public string Name { get; set; } + public decimal Amount { get; set; } + public string ItemType { get; set; } // "Allowance" or "Deduction" + public bool? Taxable { get; set; } + public bool? Mandatory { get; set; } +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain/Queries/DefaultValueHelper.cs b/api/src/Kurs.Platform.Domain/Queries/DefaultValueHelper.cs index d8bdfef6..07e0357d 100644 --- a/api/src/Kurs.Platform.Domain/Queries/DefaultValueHelper.cs +++ b/api/src/Kurs.Platform.Domain/Queries/DefaultValueHelper.cs @@ -3,32 +3,41 @@ using System.Globalization; using Kurs.Platform; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; +using Volo.Abp.Timing; using Volo.Abp.Users; public class DefaultValueHelper : ITransientDependency { private readonly ICurrentUser _currentUser; private readonly ICurrentTenant _currentTenant; - + private readonly IClock _clock; + public DefaultValueHelper( ICurrentUser currentUser, - ICurrentTenant currentTenant + ICurrentTenant currentTenant, + IClock clock ) { _currentUser = currentUser; _currentTenant = currentTenant; + _clock = clock; } public string GetDefaultValue(string strValue) -{ - if (string.IsNullOrEmpty(strValue)) + { + if (string.IsNullOrEmpty(strValue)) return strValue; - var result = strValue - .Replace(PlatformConsts.DefaultValues.UserId, _currentUser.Id?.ToString() ?? Guid.Empty.ToString()) - .Replace(PlatformConsts.DefaultValues.UserName, _currentUser.UserName ?? string.Empty) - .Replace(PlatformConsts.DefaultValues.Roles, string.Join("','", _currentUser.Roles ?? Array.Empty())) - .Replace(PlatformConsts.DefaultValues.Now, DateTime.UtcNow.ToString("o", CultureInfo.InvariantCulture)); + var now = _clock.Now; + + var result = strValue + .Replace(PlatformConsts.DefaultValues.UserId, _currentUser.Id?.ToString() ?? Guid.Empty.ToString()) + .Replace(PlatformConsts.DefaultValues.UserName, _currentUser.UserName ?? string.Empty) + .Replace(PlatformConsts.DefaultValues.Roles, string.Join("','", _currentUser.Roles ?? Array.Empty())) + .Replace(PlatformConsts.DefaultValues.Now, now.ToString("O", CultureInfo.InvariantCulture)) + .Replace(PlatformConsts.DefaultValues.Day, now.Day.ToString(CultureInfo.InvariantCulture)) + .Replace(PlatformConsts.DefaultValues.Month, now.Month.ToString(CultureInfo.InvariantCulture)) + .Replace(PlatformConsts.DefaultValues.Year, now.Year.ToString(CultureInfo.InvariantCulture)); // 🔹 TenantId özel durumu: NULL => IS NULL, varsa => = 'GUID' if (_currentTenant?.Id.HasValue == true) diff --git a/api/src/Kurs.Platform.Domain/Queries/DefaultValueManager.cs b/api/src/Kurs.Platform.Domain/Queries/DefaultValueManager.cs index 23f35853..a6bb6b53 100644 --- a/api/src/Kurs.Platform.Domain/Queries/DefaultValueManager.cs +++ b/api/src/Kurs.Platform.Domain/Queries/DefaultValueManager.cs @@ -74,7 +74,13 @@ public class DefaultValueManager : PlatformDomainService, IDefaultValueManager else if (field.Value == PlatformConsts.DefaultValues.Roles) value = CurrentUser.Roles; //.JoinAsString("','"); else if (field.Value == PlatformConsts.DefaultValues.Now) - value = Clock.Now; // DateTime.UtcNow.ToString("o", CultureInfo.InvariantCulture); + value = Clock.Now; + else if (field.Value == PlatformConsts.DefaultValues.Day) + value = Clock.Now.Day; + else if (field.Value == PlatformConsts.DefaultValues.Month) + value = Clock.Now.Month; + else if (field.Value == PlatformConsts.DefaultValues.Year) + value = Clock.Now.Year; else if (field.Value == PlatformConsts.DefaultValues.Id) value = keys?.FirstOrDefault(); else if (field.Value == PlatformConsts.DefaultValues.Selected_Ids) diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 796990e4..ef2759bf 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -1791,7 +1791,7 @@ public class PlatformDbContext : b.Property(x => x.Attachments).HasMaxLength(2000); b.HasOne(x => x.Employee) - .WithMany(e => e.Leaves) + .WithMany(e => e.Leaves) .HasForeignKey(x => x.EmployeeId) .HasPrincipalKey(e => e.Id) .OnDelete(DeleteBehavior.Restrict); @@ -1813,10 +1813,44 @@ public class PlatformDbContext : b.Property(x => x.Amount).HasPrecision(18, 2); b.HasOne(x => x.Employee) - .WithMany(e => e.Overtimes) + .WithMany(e => e.Overtimes) .HasForeignKey(x => x.EmployeeId) .HasPrincipalKey(e => e.Id) .OnDelete(DeleteBehavior.Restrict); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Payroll)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.EmployeeId).IsRequired(); + b.Property(x => x.PeriodMonth).IsRequired().HasMaxLength(20); + b.Property(x => x.BaseSalary).HasPrecision(18, 2); + b.Property(x => x.Overtime).HasPrecision(18, 2); + b.Property(x => x.Bonus).HasPrecision(18, 2); + b.Property(x => x.GrossSalary).HasPrecision(18, 2); + b.Property(x => x.NetSalary).HasPrecision(18, 2); + b.Property(x => x.Tax).HasPrecision(18, 2); + b.Property(x => x.SocialSecurity).HasPrecision(18, 2); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PayrollItem)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(100); + b.Property(x => x.Amount).HasPrecision(18, 2); + b.Property(x => x.ItemType).IsRequired().HasMaxLength(20); + b.Property(x => x.Taxable).HasDefaultValue(false); + b.Property(x => x.Mandatory).HasDefaultValue(false); + + b.HasOne(x => x.Payroll) + .WithMany(e => e.Items) + .HasForeignKey(x => x.PayrollItemId) + .HasPrincipalKey(e => e.Id) + .OnDelete(DeleteBehavior.Cascade); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023082453_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.Designer.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023082453_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.Designer.cs index 3c04ef8c..1924ac6b 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023082453_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251023082453_Initial")] + [Migration("20251023112727_Initial")] partial class Initial { /// @@ -5666,6 +5666,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Amount") + .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("ApprovedById") @@ -5715,6 +5716,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Rate") + .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("Reason") @@ -5804,6 +5806,170 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_PaymentMethod", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Payroll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BaseSalary") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Bonus") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrossSalary") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("NetSalary") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Overtime") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("PaymentDate") + .HasColumnType("datetime2"); + + b.Property("PeriodMonth") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PeriodYear") + .HasColumnType("nvarchar(max)"); + + b.Property("SocialSecurity") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Status") + .HasColumnType("nvarchar(max)"); + + b.Property("Tax") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_Payroll", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.PayrollItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemType") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Mandatory") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("PayrollItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("Taxable") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("PayrollItemId"); + + b.ToTable("T_Hr_PayrollItem", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Product", b => { b.Property("Id") @@ -10226,6 +10392,17 @@ namespace Kurs.Platform.Migrations b.Navigation("Employee"); }); + modelBuilder.Entity("Kurs.Platform.Entities.PayrollItem", b => + { + b.HasOne("Kurs.Platform.Entities.Payroll", "Payroll") + .WithMany("Items") + .HasForeignKey("PayrollItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Payroll"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Question", b => { b.HasOne("Kurs.Platform.Entities.QuestionPool", "QuestionPool") @@ -10601,6 +10778,11 @@ namespace Kurs.Platform.Migrations b.Navigation("Items"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Payroll", b => + { + b.Navigation("Items"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Question", b => { b.Navigation("Options"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023082453_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023082453_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.cs index adeee715..fad452b4 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023082453_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.cs @@ -1798,6 +1798,37 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_T_Hr_EmploymentType", x => x.Id); }); + migrationBuilder.CreateTable( + name: "T_Hr_Payroll", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), + PeriodYear = table.Column(type: "nvarchar(max)", nullable: true), + PeriodMonth = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), + BaseSalary = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), + Overtime = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), + Bonus = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), + GrossSalary = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), + NetSalary = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), + Tax = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), + SocialSecurity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), + Status = table.Column(type: "nvarchar(max)", nullable: true), + PaymentDate = table.Column(type: "datetime2", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_T_Hr_Payroll", x => x.Id); + }); + migrationBuilder.CreateTable( name: "T_Prt_Interesting", columns: table => new @@ -3180,6 +3211,37 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "T_Hr_PayrollItem", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + PayrollItemId = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Amount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + ItemType = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), + Taxable = table.Column(type: "bit", nullable: true, defaultValue: false), + Mandatory = table.Column(type: "bit", nullable: true, defaultValue: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_T_Hr_PayrollItem", x => x.Id); + table.ForeignKey( + name: "FK_T_Hr_PayrollItem_T_Hr_Payroll_PayrollItemId", + column: x => x.PayrollItemId, + principalTable: "T_Hr_Payroll", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "T_Sas_ApiEndpoint", columns: table => new @@ -3990,8 +4052,8 @@ namespace Kurs.Platform.Migrations ApprovedById = table.Column(type: "uniqueidentifier", nullable: true), ApprovedDate = table.Column(type: "datetime2", nullable: true), RejectionReason = table.Column(type: "nvarchar(max)", nullable: true), - Rate = table.Column(type: "decimal(18,2)", nullable: false), - Amount = table.Column(type: "decimal(18,2)", nullable: true), + Rate = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + Amount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -4650,6 +4712,11 @@ namespace Kurs.Platform.Migrations table: "T_Hr_Overtime", column: "EmployeeId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_PayrollItem_PayrollItemId", + table: "T_Hr_PayrollItem", + column: "PayrollItemId"); + migrationBuilder.CreateIndex( name: "IX_T_Sas_ApiEndpoint_EntityId", table: "T_Sas_ApiEndpoint", @@ -4978,6 +5045,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Hr_Overtime"); + migrationBuilder.DropTable( + name: "T_Hr_PayrollItem"); + migrationBuilder.DropTable( name: "T_Prt_Interesting"); @@ -5101,6 +5171,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Crd_Question"); + migrationBuilder.DropTable( + name: "T_Hr_Payroll"); + migrationBuilder.DropTable( name: "T_Sas_CustomEntity"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 77531725..57d6b38b 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -5663,6 +5663,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Amount") + .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("ApprovedById") @@ -5712,6 +5713,7 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Rate") + .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("Reason") @@ -5801,6 +5803,170 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_PaymentMethod", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Payroll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BaseSalary") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Bonus") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrossSalary") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("NetSalary") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Overtime") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("PaymentDate") + .HasColumnType("datetime2"); + + b.Property("PeriodMonth") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PeriodYear") + .HasColumnType("nvarchar(max)"); + + b.Property("SocialSecurity") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Status") + .HasColumnType("nvarchar(max)"); + + b.Property("Tax") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_Payroll", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.PayrollItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemType") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Mandatory") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("PayrollItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("Taxable") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("PayrollItemId"); + + b.ToTable("T_Hr_PayrollItem", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Product", b => { b.Property("Id") @@ -10223,6 +10389,17 @@ namespace Kurs.Platform.Migrations b.Navigation("Employee"); }); + modelBuilder.Entity("Kurs.Platform.Entities.PayrollItem", b => + { + b.HasOne("Kurs.Platform.Entities.Payroll", "Payroll") + .WithMany("Items") + .HasForeignKey("PayrollItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Payroll"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Question", b => { b.HasOne("Kurs.Platform.Entities.QuestionPool", "QuestionPool") @@ -10598,6 +10775,11 @@ namespace Kurs.Platform.Migrations b.Navigation("Items"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Payroll", b => + { + b.Navigation("Items"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Question", b => { b.Navigation("Options"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index c606792b..619ce0e0 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -2711,14 +2711,14 @@ "fullName": "Ali Öztürk", "avatar": "https://i.pravatar.cc/150?img=12", "nationalId": "12345678901", - "birthDate": "20.10.1988", + "birthDate": "10-10-1988", "gender": "Male", "maritalStatus": "Married", - "country": "Türkiye", - "city": "Ankara", - "district": "Ankara", - "street": "Kızılay Cd. No:12", - "postalCode": "06050", + "country": "TR", + "city": "TR.34", + "district": "Ümraniye", + "street": "Fatih sultan mehmet mah.", + "postalCode": "34771", "phone": "2125550100", "personalPhone": "5325550101", "email": "ali.ozturk@company.com", @@ -2727,8 +2727,8 @@ "emergencyContactname": "Ayşe Öztürk", "emergencyContactrelationship": "Eşi", "emergencyContactphone": "5325550100", - "hireDate": "15-01-2020", - "terminationDate": "15-01-2020", + "hireDate": "09-01-2020", + "terminationDate": "09-01-2020", "employmentTypeName": "FullTime", "jobPositionCode": "1", "departmentCode": "1", @@ -2736,8 +2736,8 @@ "baseSalary": 65000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "1", + "payrollGroup": "Monthly", + "bankAccountNumber": "1", "badgeCode": "B001", "employeeStatus": "Active", "isActive": true, @@ -2751,14 +2751,14 @@ "fullName": "Ayşe Kaya", "avatar": "https://i.pravatar.cc/150?img=5", "nationalId": "12345678902", - "birthDate": "22.08.1990", + "birthDate": "02-08-1990", "gender": "Female", "maritalStatus": "Single", - "country": "Türkiye", - "city": "Ankara", - "district": "Ankara", - "street": "İnönü Bulvarı No:456", - "postalCode": "06000", + "country": "TR", + "city": "TR.06", + "district": "Güdül", + "street": "Özköy mah.", + "postalCode": "6840", "phone": "2125550102", "personalPhone": "5325550103", "email": "ayse.kaya@company.com", @@ -2768,7 +2768,7 @@ "emergencyContactrelationship": "Anne", "emergencyContactphone": "5325550104", "hireDate": "01-06-2021", - "terminationDate": "", + "terminationDate": null, "employmentTypeName": "FullTime", "jobPositionCode": "2", "departmentCode": "1", @@ -2776,8 +2776,8 @@ "baseSalary": 72000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "2", + "payrollGroup": "Monthly", + "bankAccountNumber": "2", "badgeCode": "B002", "employeeStatus": "Active", "isActive": true, @@ -2791,24 +2791,24 @@ "fullName": "Mehmet Yılmaz", "avatar": "https://i.pravatar.cc/150?img=8", "nationalId": "12345678903", - "birthDate": "12.03.1987", + "birthDate": "12-03-1987", "gender": "Male", "maritalStatus": "Married", - "country": "Türkiye", - "city": "İstanbul", - "district": "İstanbul", - "street": "Cumhuriyet Cad. No:123", + "country": "TR", + "city": "TR.11", + "district": "Merkez", + "street": "Kızıldamlar köyü", "postalCode": "34000", - "phone": "+90 212 555 0105", - "personalPhone": "+90 532 555 0106", + "phone": "2125550105", + "personalPhone": "5325550106", "email": "mehmet.yilmaz@company.com", "address1": "", "address2": "", "emergencyContactname": "Zeynep Yılmaz", "emergencyContactrelationship": "Eşi", - "emergencyContactphone": "+90 532 555 0107", - "hireDate": "15-02-2020", - "terminationDate": "", + "emergencyContactphone": "5325550107", + "hireDate": "10-02-2020", + "terminationDate": null, "employmentTypeName": "FullTime", "jobPositionCode": "3", "departmentCode": "1", @@ -2816,8 +2816,8 @@ "baseSalary": 85000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "2", + "payrollGroup": "Monthly", + "bankAccountNumber": "2", "badgeCode": "B003", "employeeStatus": "Active", "isActive": true, @@ -2831,24 +2831,24 @@ "fullName": "Selin Demir", "avatar": "https://i.pravatar.cc/150?img=9", "nationalId": "12345678904", - "birthDate": "25.05.1993", + "birthDate": "05-05-1993", "gender": "Female", "maritalStatus": "Single", - "country": "Türkiye", - "city": "Ankara", - "district": "Ankara", - "street": "Atatürk Bulvarı No:78", + "country": "TR", + "city": "", + "district": "", + "street": "", "postalCode": "06100", - "phone": "+90 312 555 0108", - "personalPhone": "+90 542 555 0109", + "phone": "3125550108", + "personalPhone": "5425550109", "email": "selin.demir@company.com", "address1": "", "address2": "", "emergencyContactname": "Ali Demir", "emergencyContactrelationship": "Baba", - "emergencyContactphone": "+90 532 555 0110", + "emergencyContactphone": "5325550110", "hireDate": "10-01-2022", - "terminationDate": "", + "terminationDate": null, "employmentTypeName": "PartTime", "jobPositionCode": "4", "departmentCode": "1", @@ -2856,8 +2856,8 @@ "baseSalary": 60000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "3", + "payrollGroup": "Monthly", + "bankAccountNumber": "3", "badgeCode": "B004", "employeeStatus": "Active", "isActive": true, @@ -2871,24 +2871,24 @@ "fullName": "Ahmet Çelik", "avatar": "https://i.pravatar.cc/150?img=33", "nationalId": "12345678905", - "birthDate": "10.09.1985", + "birthDate": "10-09-1985", "gender": "Male", "maritalStatus": "Married", - "country": "Türkiye", - "city": "İstanbul", - "district": "İstanbul", - "street": "Bağdat Cad. No:25", + "country": "TR", + "city": "TR.34", + "district": "Kadıköy", + "street": "Bağdat Cad.", "postalCode": "34728", - "phone": "+90 212 555 0111", - "personalPhone": "+90 532 555 0112", + "phone": "2125550111", + "personalPhone": "5325550112", "email": "ahmet.celik@company.com", "address1": "", "address2": "", "emergencyContactname": "Emine Çelik", "emergencyContactrelationship": "Eşi", - "emergencyContactphone": "+90 532 555 0113", + "emergencyContactphone": "5325550113", "hireDate": "01-04-2019", - "terminationDate": "", + "terminationDate": null, "employmentTypeName": "FullTime", "jobPositionCode": "5", "departmentCode": "1", @@ -2896,8 +2896,8 @@ "baseSalary": 95000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "4", + "payrollGroup": "Monthly", + "bankAccountNumber": "4", "badgeCode": "B005", "employeeStatus": "Active", "isActive": true, @@ -2911,24 +2911,24 @@ "fullName": "Zeynep Arslan", "avatar": "https://i.pravatar.cc/150?img=10", "nationalId": "12345678906", - "birthDate": "30.01.1995", + "birthDate": "01-01-1995", "gender": "Female", "maritalStatus": "Single", - "country": "Türkiye", - "city": "İzmir", + "country": "TR", + "city": "TR.35", "district": "İzmir", - "street": "Yıldız Mah. No:19", + "street": "Yıldız Mah.", "postalCode": "35000", - "phone": "+90 216 555 0114", - "personalPhone": "+90 532 555 0115", + "phone": "2165550114", + "personalPhone": "5325550115", "email": "zeynep.arslan@company.com", "address1": "", "address2": "", "emergencyContactname": "Hasan Arslan", "emergencyContactrelationship": "Baba", - "emergencyContactphone": "+90 532 555 0116", - "hireDate": "20-03-2023", - "terminationDate": "", + "emergencyContactphone": "5325550116", + "hireDate": "02-03-2023", + "terminationDate": null, "employmentTypeName": "Intern", "jobPositionCode": "6", "departmentCode": "1", @@ -2936,8 +2936,8 @@ "baseSalary": 15000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "1", + "payrollGroup": "Monthly", + "bankAccountNumber": "1", "badgeCode": "B006", "employeeStatus": "Active", "isActive": true, @@ -2951,24 +2951,24 @@ "fullName": "Burak Koç", "avatar": "https://i.pravatar.cc/150?img=14", "nationalId": "12345678907", - "birthDate": "18.06.1991", + "birthDate": "08-06-1991", "gender": "Male", "maritalStatus": "Married", - "country": "Türkiye", - "city": "Bursa", - "district": "Bursa", - "street": "Osmangazi Mah. No:45", + "country": "TR", + "city": "TR.06", + "district": "Ankara", + "street": "Osmangazi Mah.", "postalCode": "16000", - "phone": "+90 224 555 0117", - "personalPhone": "+90 532 555 0118", + "phone": "2245550117", + "personalPhone": "5325550118", "email": "burak.koc@company.com", "address1": "", "address2": "", "emergencyContactname": "Elif Koç", "emergencyContactrelationship": "Eşi", - "emergencyContactphone": "+90 532 555 0119", - "hireDate": "12-07-2021", - "terminationDate": "", + "emergencyContactphone": "5325550119", + "hireDate": "09-07-2021", + "terminationDate": null, "employmentTypeName": "FullTime", "jobPositionCode": "7", "departmentCode": "2", @@ -2976,8 +2976,8 @@ "baseSalary": 75000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "3", + "payrollGroup": "Monthly", + "bankAccountNumber": "3", "badgeCode": "B007", "employeeStatus": "Active", "isActive": true, @@ -2991,24 +2991,24 @@ "fullName": "Elif Şahin", "avatar": "https://i.pravatar.cc/150?img=20", "nationalId": "12345678908", - "birthDate": "05.11.1989", + "birthDate": "05-11-1989", "gender": "Female", "maritalStatus": "Married", - "country": "Türkiye", - "city": "İzmir", + "country": "TR", + "city": "TR.11", "district": "İzmir", "street": "Alsancak Mah. No:88", "postalCode": "35220", - "phone": "+90 232 555 0120", - "personalPhone": "+90 532 555 0121", + "phone": "2325550120", + "personalPhone": "5325550121", "email": "elif.sahin@company.com", "address1": "", "address2": "", "emergencyContactname": "Murat Şahin", "emergencyContactrelationship": "Eşi", - "emergencyContactphone": "+90 532 555 0122", + "emergencyContactphone": "5325550122", "hireDate": "01-09-2018", - "terminationDate": "", + "terminationDate": null, "employmentTypeName": "FullTime", "jobPositionCode": "8", "departmentCode": "2", @@ -3016,8 +3016,8 @@ "baseSalary": 130000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "2", + "payrollGroup": "Monthly", + "bankAccountNumber": "2", "badgeCode": "B008", "employeeStatus": "Active", "isActive": true, @@ -3031,24 +3031,24 @@ "fullName": "Canan Öztürk", "avatar": "https://i.pravatar.cc/150?img=25", "nationalId": "12345678909", - "birthDate": "14.04.1992", + "birthDate": "04-04-1992", "gender": "Female", "maritalStatus": "Single", - "country": "Türkiye", - "city": "Ankara", + "country": "TR", + "city": "TR.45", "district": "Ankara", "street": "Bahçelievler Mah. No:55", "postalCode": "06490", - "phone": "+90 312 555 0123", - "personalPhone": "+90 532 555 0124", + "phone": "3125550123", + "personalPhone": "5325550124", "email": "canan.ozturk@company.com", "address1": "", "address2": "", "emergencyContactname": "Hüseyin Öztürk", "emergencyContactrelationship": "Baba", - "emergencyContactphone": "+90 532 555 0125", - "hireDate": "02-11-2020", - "terminationDate": "", + "emergencyContactphone": "5325550125", + "hireDate": "02-06-2020", + "terminationDate": null, "employmentTypeName": "FullTime", "jobPositionCode": "9", "departmentCode": "1", @@ -3056,8 +3056,8 @@ "baseSalary": 50000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "1", + "payrollGroup": "Monthly", + "bankAccountNumber": "1", "badgeCode": "B009", "employeeStatus": "Active", "isActive": true, @@ -3071,24 +3071,24 @@ "fullName": "Murat Aydın", "avatar": "https://i.pravatar.cc/150?img=30", "nationalId": "12345678910", - "birthDate": "22.12.1984", + "birthDate": "03-12-1984", "gender": "Male", "maritalStatus": "Married", - "country": "Türkiye", - "city": "İstanbul", + "country": "TR", + "city": "TR.34", "district": "İstanbul", "street": "Şişli Mah. No:101", "postalCode": "34360", - "phone": "+90 212 555 0126", - "personalPhone": "+90 532 555 0127", + "phone": "2125550126", + "personalPhone": "5325550127", "email": "murat.aydin@company.com", "address1": "", "address2": "", "emergencyContactname": "Ayten Aydın", "emergencyContactrelationship": "Eşi", - "emergencyContactphone": "+90 532 555 0128", - "hireDate": "15-05-2017", - "terminationDate": "", + "emergencyContactphone": "5325550128", + "hireDate": "06-05-2017", + "terminationDate": null, "employmentTypeName": "FullTime", "jobPositionCode": "10", "departmentCode": "1", @@ -3096,8 +3096,8 @@ "baseSalary": 250000, "managerCode": "1", "currencyCode": "TRY", - "payrollGroup": "MONTHLY", - "bankAccountCode": "4", + "payrollGroup": "Monthly", + "bankAccountNumber": "4", "badgeCode": "B010", "employeeStatus": "Active", "isActive": true, diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index 6d8d807b..1b356a3b 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -996,9 +996,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency 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; @@ -1037,7 +1034,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency EmergencyContactPhone = item.EmergencyContactPhone, HireDate = item.HireDate, - TerminationDate = item.TerminationDate, + TerminationDate = item.TerminationDate != null ? item.TerminationDate : null, EmploymentTypeId = employmentType != null ? employmentType.Id : null, JobPositionId = jobPosition != null ? jobPosition.Id : null, DepartmentId = department != null ? department.Id : null, diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index 9d9b6ff9..409aa41e 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -85,7 +85,7 @@ public class EmployeeSeedDto public string EmergencyContactPhone { get; set; } public DateTime HireDate { get; set; } - public DateTime TerminationDate { get; set; } + public DateTime? TerminationDate { get; set; } public string EmploymentTypeName { get; set; } public string JobPositionCode { get; set; } public string DepartmentCode { get; set; } @@ -293,8 +293,8 @@ public class CustomComponentSeedDto { public string Name { get; set; } public string Code { get; set; } - public string? Props { get; set; } - public string? Description { get; set; } + public string Props { get; set; } + public string Description { get; set; } public bool IsActive { get; set; } public List Dependencies { get; set; } = new(); } diff --git a/ui/src/types/hr.ts b/ui/src/types/hr.ts index 156b4940..0dbec700 100644 --- a/ui/src/types/hr.ts +++ b/ui/src/types/hr.ts @@ -294,8 +294,8 @@ export interface HrPayroll { employee?: HrEmployee period: string baseSalary: number - allowances: HrPayrollAllowance[] - deductions: HrPayrollDeduction[] + allowances: HrPayrollAllowance[] // İnsan Kaynakları Maaş Ek Ödemeleri + deductions: HrPayrollDeduction[] // İnsan Kaynakları Maaş Kesintileri overtime: number bonus: number grossSalary: number diff --git a/ui/src/views/shared/DialogContext/DialogShowComponent.tsx b/ui/src/views/shared/DialogContext/DialogShowComponent.tsx index ef070a70..aa992e9c 100644 --- a/ui/src/views/shared/DialogContext/DialogShowComponent.tsx +++ b/ui/src/views/shared/DialogContext/DialogShowComponent.tsx @@ -91,6 +91,14 @@ const DialogShowComponent = (): JSX.Element => { {...dialogContext.config?.props} > ) + case 'CollectivePayroll': + return ( + + ) default: return <> }