From a4adc860ff85e4fb47d3bc917bbccb7970957cc2 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 17:46:57 +0300 Subject: [PATCH] =?UTF-8?q?Template=20360=20ve=20Di=C4=9Fer=20seeder=20d?= =?UTF-8?q?=C3=BCzenlemeleri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Seeds/HostData.json | 40 +- .../Seeds/ListFormsSeeder.cs | 366 +++++++++++++++++- .../Enums/TableNameEnum.cs | 4 +- .../PlatformConsts.cs | 2 + .../TableNameResolver.cs | 1 + .../Kurs.Platform.Domain/Data/SeedConsts.cs | 2 +- .../Entities/Tenant/Hr/Payroll.cs | 4 +- .../Entities/Tenant/Hr/Template360.cs | 16 + .../EntityFrameworkCore/PlatformDbContext.cs | 42 +- ....cs => 20251023144126_Initial.Designer.cs} | 78 +++- ...7_Initial.cs => 20251023144126_Initial.cs} | 31 +- .../PlatformDbContextModelSnapshot.cs | 76 +++- .../Tenants/Seeds/TenantData.json | 249 +++++++++++- .../Tenants/TenantDataSeeder.cs | 102 ++++- .../Tenants/TenantSeederDto.cs | 52 +++ .../DialogContext/DialogShowComponent.tsx | 8 + 16 files changed, 1010 insertions(+), 63 deletions(-) create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Template360.cs rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251023112727_Initial.Designer.cs => 20251023144126_Initial.Designer.cs} (99%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251023112727_Initial.cs => 20251023144126_Initial.cs} (99%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json index 83b101ed..426b06aa 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json @@ -12111,7 +12111,7 @@ }, { "resourceName": "Platform", - "key": "App.Hr.EvaluationTemplate", + "key": "App.Hr.Template360", "tr": "360° Şablonları", "en": "360° Templates" }, @@ -13168,7 +13168,7 @@ "authority": null }, { - "key": "admin.hr.evaluationTemplates", + "key": "admin.hr.Template360s", "path": "/admin/hr/360-templates", "componentPath": "@/views/hr/components/Degree360Templates", "routeType": "protected", @@ -15045,12 +15045,12 @@ }, { "ParentCode": "App.Hr", - "Code": "App.Hr.EvaluationTemplate", - "DisplayName": "App.Hr.EvaluationTemplate", + "Code": "App.Hr.Template360", + "DisplayName": "App.Hr.Template360", "Order": 11, - "Url": "/admin/hr/360-templates", + "Url": "/admin/list/list-template360", "Icon": "FcInspection", - "RequiredPermissionName": "App.Hr.EvaluationTemplate", + "RequiredPermissionName": "App.Hr.Template360", "IsDisabled": false }, { @@ -24637,17 +24637,17 @@ }, { "GroupName": "App.Hr", - "Name": "App.Hr.EvaluationTemplate", + "Name": "App.Hr.Template360", "ParentName": null, - "DisplayName": "App.Hr.EvaluationTemplate", + "DisplayName": "App.Hr.Template360", "IsEnabled": true, "MultiTenancySide": 3, "MenuGroup": "Erp" }, { "GroupName": "App.Hr", - "Name": "App.Hr.EvaluationTemplate.Create", - "ParentName": "App.Hr.EvaluationTemplate", + "Name": "App.Hr.Template360.Create", + "ParentName": "App.Hr.Template360", "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, @@ -24655,8 +24655,8 @@ }, { "GroupName": "App.Hr", - "Name": "App.Hr.EvaluationTemplate.Update", - "ParentName": "App.Hr.EvaluationTemplate", + "Name": "App.Hr.Template360.Update", + "ParentName": "App.Hr.Template360", "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, @@ -24664,8 +24664,8 @@ }, { "GroupName": "App.Hr", - "Name": "App.Hr.EvaluationTemplate.Delete", - "ParentName": "App.Hr.EvaluationTemplate", + "Name": "App.Hr.Template360.Delete", + "ParentName": "App.Hr.Template360", "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, @@ -24673,8 +24673,8 @@ }, { "GroupName": "App.Hr", - "Name": "App.Hr.EvaluationTemplate.Export", - "ParentName": "App.Hr.EvaluationTemplate", + "Name": "App.Hr.Template360.Export", + "ParentName": "App.Hr.Template360", "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, @@ -24682,8 +24682,8 @@ }, { "GroupName": "App.Hr", - "Name": "App.Hr.EvaluationTemplate.Import", - "ParentName": "App.Hr.EvaluationTemplate", + "Name": "App.Hr.Template360.Import", + "ParentName": "App.Hr.Template360", "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, @@ -24691,8 +24691,8 @@ }, { "GroupName": "App.Hr", - "Name": "App.Hr.EvaluationTemplate.Activity", - "ParentName": "App.Hr.EvaluationTemplate", + "Name": "App.Hr.Template360.Activity", + "ParentName": "App.Hr.Template360", "DisplayName": "Activity", "IsEnabled": true, "MultiTenancySide": 3, diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index d0ee0e33..0ff928cf 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -13337,6 +13337,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "MonthlyPrice", + Format = "fixedPoint", + Alignment = "right", Width = 120, ListOrderNo = 5, Visible = true, @@ -13363,6 +13365,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "YearlyPrice", + Format = "fixedPoint", + Alignment = "right", Width = 120, ListOrderNo = 7, Visible = true, @@ -13628,6 +13632,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Commission", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 3, Visible = true, @@ -13901,6 +13907,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Commission", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 4, Visible = true, @@ -14499,6 +14507,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Subtotal", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 15, Visible = true, @@ -14525,6 +14535,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Commission", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 16, Visible = true, @@ -14551,6 +14563,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Total", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 17, Visible = true, @@ -17187,6 +17201,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Rate", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 5, Visible = true, @@ -20035,6 +20051,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Ratio", + Format = "fixedPoint", + Alignment = "right", Width = 150, ListOrderNo = 4, Visible = true, @@ -20070,6 +20088,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Rounding", + Format = "fixedPoint", + Alignment = "right", Width = 150, ListOrderNo = 5, Visible = true, @@ -27772,6 +27792,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "MonthlyPaymentRate", + Format = "fixedPoint", + Alignment = "right", Width = 150, ListOrderNo = 9, Visible = true, @@ -31161,6 +31183,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Points", + Format = "fixedPoint", + Alignment = "right", Width = 60, ListOrderNo = 4, Visible = true, @@ -32164,6 +32188,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Points", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 9, Visible = true, @@ -32652,6 +32678,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "MinSalary", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 7, Visible = true, @@ -32683,6 +32711,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "MaxSalary", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 8, Visible = true, @@ -33286,6 +33316,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Budget", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 8, Visible = true, @@ -33800,6 +33832,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "BudgetedAmount", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 9, Visible = true, @@ -33831,6 +33865,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "ActualAmount", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 10, Visible = true, @@ -33860,7 +33896,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency RoleId = null, UserId = null, CultureName = LanguageCodes.En, - SourceDbType = DbType.Decimal, + SourceDbType = DbType.Int32, FieldName = "CurrencyId", Width = 100, ListOrderNo = 11, @@ -33900,6 +33936,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "FiscalYear", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 12, Visible = true, @@ -35090,6 +35128,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "BaseSalary", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 28, Visible = true, @@ -35656,6 +35696,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "TotalDays", + Alignment = "right", Width = 100, ListOrderNo = 6, Visible = true, @@ -36256,6 +36297,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "TotalHours", + Alignment = "right", Width = 100, ListOrderNo = 5, Visible = true, @@ -36369,6 +36411,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Amount", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 8, Visible = true, @@ -37010,6 +37054,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "BaseSalary", + Format = "fixedPoint", + Alignment = "right", Width = 150, ListOrderNo = 6, Visible = true, @@ -37044,6 +37090,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Overtime", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 7, Visible = true, @@ -37075,6 +37123,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Bonus", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 8, Visible = true, @@ -37106,6 +37156,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "GrossSalary", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 9, Visible = true, @@ -37137,6 +37189,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "NetSalary", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 10, Visible = true, @@ -37168,6 +37222,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "Tax", + Format = "fixedPoint", + Alignment = "right", Width = 100, ListOrderNo = 11, Visible = true, @@ -37199,6 +37255,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.Decimal, FieldName = "SocialSecurity", + Alignment = "right", + Format = "fixedPoint", Width = 100, ListOrderNo = 12, Visible = true, @@ -37276,6 +37334,312 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Template 360 + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Payroll)) + { + var listFormTemplate360 = 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.Template360, + Name = AppCodes.Hr.Template360, + Title = AppCodes.Hr.Template360, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.Template360, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Template360)), + 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.Template360 + ".Create", + R = AppCodes.Hr.Template360, + U = AppCodes.Hr.Template360 + ".Update", + D = AppCodes.Hr.Template360 + ".Delete", + E = AppCodes.Hr.Template360 + ".Export", + I = AppCodes.Hr.Template360 + ".Import", + A = AppCodes.Hr.Template360 + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Template360))}\" 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 = "Template 360 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 = "Name", ColSpan = 2, IsRequired=true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "AssessorTypes", ColSpan = 2, IsRequired=true, EditorType2 = EditorTypes.dxTagBox }, + new EditingFormItemDto { Order = 3, DataField = "IsActive", ColSpan = 2, EditorType2 = EditorTypes.dxCheckBox }, + ] + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "IsActive", + FieldDbType = DbType.Boolean, + Value = "true", + CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Questions", + Text = "Questions", + AuthName = TenantManagementPermissions.Tenants.ManageConnectionStrings, + DialogName = "Template360Questions", + DialogParameters = JsonSerializer.Serialize(new { + name = "@Name", + id = "@Id" + }) + }, + }), + } + ); + + #region Template 360 Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormTemplate360.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.Template360 + ".Create", + R = AppCodes.Hr.Template360, + U = AppCodes.Hr.Template360 + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTemplate360.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 300, + 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, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Template360 + ".Create", + R = AppCodes.Hr.Template360, + U = AppCodes.Hr.Template360 + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTemplate360.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 600, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Template360 + ".Create", + R = AppCodes.Hr.Template360, + U = AppCodes.Hr.Template360 + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTemplate360.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AssessorTypes", + Width = 500, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "self", Name= "Self" }, + new () { Key= "manager", Name= "Manager" }, + new () { Key= "peer", Name= "Peer"}, + new () { Key= "subordinate", Name= "Subordinate" }, + new () { Key= "customer", Name= "Customer" }, + new () { Key= "otherDepartment", Name= "OtherDepartment" }, + new () { Key= "hrUpperManagement", Name= "HRUpperManagement" }, + new () { Key= "external", Name= "External" }, + }), + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Template360 + ".Create", + R = AppCodes.Hr.Template360, + U = AppCodes.Hr.Template360 + ".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 96bb366d..5b60d513 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -114,5 +114,7 @@ public enum TableNameEnum Leave, Overtime, Payroll, - PayrollItem + PayrollItem, + Template360, + Result360 } \ 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 a2730db2..d5cecdf0 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -518,6 +518,8 @@ public static class PlatformConsts public const string Leave = "list-leave"; public const string Overtime = "list-overtime"; public const string Payroll = "list-payroll"; + public const string Template360 = "list-template360"; + public const string Result360 = "list-result360"; } } diff --git a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs index 21c98d94..ef35593f 100644 --- a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs @@ -132,6 +132,7 @@ public static class TableNameResolver { nameof(TableNameEnum.Overtime), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.Payroll), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.PayrollItem), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.Template360), (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 4a9cbe18..f3be4733 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -461,7 +461,7 @@ public static class SeedConsts public const string Overtime = Default + ".Overtime"; public const string Payroll = Default + ".Payroll"; public const string Template360 = Default + ".Template360"; - public const string Evulation360 = Default + ".Evulation360"; + public const string Result360 = Default + ".Result360"; } public static class Accounting diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Payroll.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Payroll.cs index 97da2e58..01aaa5ed 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Payroll.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Payroll.cs @@ -10,8 +10,8 @@ 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 int PeriodYear { get; set; } + public int PeriodMonth { get; set; } public decimal? BaseSalary { get; set; } public decimal? Overtime { get; set; } public decimal? Bonus { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Template360.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Template360.cs new file mode 100644 index 00000000..36effaba --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Template360.cs @@ -0,0 +1,16 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class Template360 : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + public string AssessorTypes { get; set; } + public string QuestionGroupsJson { get; set; } +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index ef2759bf..e387f30c 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -65,6 +65,7 @@ public class PlatformDbContext : public DbSet ReportGenerated { get; set; } public DbSet ReportCategories { get; set; } public DbSet Activities { get; set; } + public DbSet IpRestrictions { get; set; } #endregion #region Definitions from the modules @@ -119,10 +120,6 @@ public class PlatformDbContext : #endregion - #region Administrator from the modules - public DbSet IpRestrictions { get; set; } - #endregion - #region Web Site from the modules public DbSet Abouts { get; set; } public DbSet Services { get; set; } @@ -148,18 +145,9 @@ public class PlatformDbContext : public DbSet Questions { get; set; } public DbSet QuestionOptions { get; set; } - #region Hr - public DbSet Employees { get; set; } - public DbSet Departments { get; set; } - public DbSet JobPositions { get; set; } - public DbSet EmploymentTypes { get; set; } - public DbSet Badges { get; set; } - public DbSet CostCenters { get; set; } #endregion - #endregion - - #region Entities from the modules + #region Administrator from the modules /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext * and replaced them for this DbContext. This allows you to perform JOIN @@ -188,6 +176,19 @@ public class PlatformDbContext : #endregion + #region Hr + public DbSet Employees { get; set; } + public DbSet Departments { get; set; } + public DbSet JobPositions { get; set; } + public DbSet EmploymentTypes { get; set; } + public DbSet Badges { get; set; } + public DbSet CostCenters { get; set; } + public DbSet Payrolls { get; set; } + public DbSet Overtimes { get; set; } + public DbSet Leaves { get; set; } + public DbSet Template360s { get; set; } + #endregion + public PlatformDbContext(DbContextOptions options) : base(options) { @@ -1852,5 +1853,18 @@ public class PlatformDbContext : .HasPrincipalKey(e => e.Id) .OnDelete(DeleteBehavior.Cascade); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Template360)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + b.Property(x => x.AssessorTypes).HasMaxLength(500); + + b.Property(x => x.QuestionGroupsJson).HasColumnType("text"); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023144126_Initial.Designer.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023144126_Initial.Designer.cs index 1924ac6b..fa43f5ad 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023144126_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251023112727_Initial")] + [Migration("20251023144126_Initial")] partial class Initial { /// @@ -5809,7 +5809,6 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Payroll", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("BaseSalary") @@ -5868,13 +5867,12 @@ namespace Kurs.Platform.Migrations b.Property("PaymentDate") .HasColumnType("datetime2"); - b.Property("PeriodMonth") - .IsRequired() + b.Property("PeriodMonth") .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); + .HasColumnType("int"); - b.Property("PeriodYear") - .HasColumnType("nvarchar(max)"); + b.Property("PeriodYear") + .HasColumnType("int"); b.Property("SocialSecurity") .HasPrecision(18, 2) @@ -5899,7 +5897,6 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.PayrollItem", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Amount") @@ -7442,6 +7439,71 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Prt_Source", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Template360", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AssessorTypes") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + 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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("QuestionGroupsJson") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_Template360", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Uom", b => { b.Property("Id") diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023144126_Initial.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023144126_Initial.cs index fad452b4..3e21b90e 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023112727_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023144126_Initial.cs @@ -1805,8 +1805,8 @@ namespace Kurs.Platform.Migrations 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), + PeriodYear = table.Column(type: "int", nullable: false), + PeriodMonth = table.Column(type: "int", 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), @@ -1829,6 +1829,30 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_T_Hr_Payroll", x => x.Id); }); + migrationBuilder.CreateTable( + name: "T_Hr_Template360", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + AssessorTypes = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + QuestionGroupsJson = table.Column(type: "text", 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_Template360", x => x.Id); + }); + migrationBuilder.CreateTable( name: "T_Prt_Interesting", columns: table => new @@ -5048,6 +5072,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Hr_PayrollItem"); + migrationBuilder.DropTable( + name: "T_Hr_Template360"); + migrationBuilder.DropTable( name: "T_Prt_Interesting"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 57d6b38b..de6a4db0 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -5806,7 +5806,6 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Payroll", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("BaseSalary") @@ -5865,13 +5864,12 @@ namespace Kurs.Platform.Migrations b.Property("PaymentDate") .HasColumnType("datetime2"); - b.Property("PeriodMonth") - .IsRequired() + b.Property("PeriodMonth") .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); + .HasColumnType("int"); - b.Property("PeriodYear") - .HasColumnType("nvarchar(max)"); + b.Property("PeriodYear") + .HasColumnType("int"); b.Property("SocialSecurity") .HasPrecision(18, 2) @@ -5896,7 +5894,6 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.PayrollItem", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Amount") @@ -7439,6 +7436,71 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Prt_Source", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Template360", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AssessorTypes") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + 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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("QuestionGroupsJson") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_Template360", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Uom", b => { b.Property("Id") diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index 619ce0e0..2744e6b5 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -2181,22 +2181,22 @@ ], "EmployeeTypes": [ { - "name": "FULL_TIME" + "name": "Full Time" }, { - "name": "PART_TIME" + "name": "Part Time" }, { - "name": "CONTRACT" + "name": "Contract" }, { - "name": "INTERN" + "name": "Intern" }, { - "name": "TEMPORARY" + "name": "Temporary" }, { - "name": "CONSULTANT" + "name": "Consultant" } ], "JobPositions": [ @@ -3106,5 +3106,242 @@ "trainings": [], "disciplinaryActions": [] } + ], + "Leaves": [ + { + "employeeCode": "EMP-001", + "leaveType": "Annual", + "startDate": "12-12-2024", + "endDate": "12-04-2024", + "totalDays": 5, + "reason": "Yıllık izin talebi", + "status": "Pending", + "appliedDate": "11-15-2024", + "isHalfDay": false + }, + { + "employeeCode": "EMP-002", + "leaveType": "Sick", + "startDate": "11-10-2024", + "endDate": "11-12-2024", + "totalDays": 3, + "reason": "Sağlık kontrolü", + "status": "Approved", + "appliedDate": "11-08-2024", + "approvedDate": "11-09-2024", + "isHalfDay": false + }, + { + "employeeCode": "EMP-003", + "leaveType": "Personal", + "startDate": "01-12-2024", + "endDate": "01-12-2024", + "totalDays": 0.5, + "reason": "Kişisel işler", + "status": "Rejected", + "appliedDate": "02-11-2024", + "rejectionReason": "Proje teslim tarihi nedeniyle uygun değil", + "isHalfDay": true + }, + { + "employeeCode": "EMP-004", + "leaveType": "Emergency", + "startDate": "05-11-2024", + "endDate": "06-11-2024", + "totalDays": 2, + "reason": "Acil aile durumu", + "status": "Pending", + "appliedDate": "04-11-2024", + "isHalfDay": false + } + ], + "Overtimes": [ + { + "employeeCode": "EMP-001", + "date": "12-05-2024", + "startTime": "18:00", + "endTime": "21:00", + "totalHours": 3, + "reason": "Proje deadline'ı nedeniyle acil çalışma", + "status": "Approved", + "rate": 1.5, + "amount": 450 + }, + { + "employeeCode": "EMP-002", + "date": "12-01-2024", + "startTime": "17:30", + "endTime": "20:00", + "totalHours": 2.5, + "reason": "Müşteri talep değişikliği nedeniyle ek çalışma", + "status": "Pending", + "rate": 1.5, + "amount": 375 + }, + { + "employeeCode": "EMP-003", + "date": "12-01-2024", + "startTime": "19:00", + "endTime": "22:30", + "totalHours": 3.5, + "reason": "Sistem bakımı ve güncelleme çalışmaları", + "status": "Approved", + "rate": 1.5, + "amount": 525 + }, + { + "employeeCode": "EMP-004", + "date": "12-12-2024", + "startTime": "17:00", + "endTime": "19:00", + "totalHours": 2, + "reason": "Rapor hazırlama ve sunum düzenleme", + "status": "Rejected", + "rate": 1.5, + "amount": 0 + }, + { + "employeeCode": "EMP-005", + "date": "12-11-2024", + "startTime": "18:30", + "endTime": "21:00", + "totalHours": 2.5, + "reason": "Acil hata düzeltme ve test çalışmaları", + "status": "Approved", + "approvedBy": "emp_001", + "rate": 2.0, + "amount": 500 + }, + { + "employeeCode": "EMP-006", + "date": "02-10-2024", + "startTime": "16:00", + "endTime": "20:00", + "totalHours": 4, + "reason": "Yeni müşteri onboarding süreci", + "status": "Pending", + "rate": 1.5, + "amount": 600 + }, + { + "employeeCode": "EMP-007", + "date": "01-09-2024", + "startTime": "17:45", + "endTime": "21:15", + "totalHours": 3.5, + "reason": "Veri analizi ve raporlama çalışmaları", + "status": "Approved", + "approvedBy": "emp_002", + "rate": 1.5, + "amount": 525 + }, + { + "employeeCode": "EMP-008", + "date": "09-08-2024", + "startTime": "18:00", + "endTime": "20:30", + "totalHours": 2.5, + "reason": "Eğitim materyali hazırlama", + "status": "Pending", + "rate": 1.5, + "amount": 375 + }, + { + "employeeCode": "EMP-009", + "date": "01-07-2024", + "startTime": "19:30", + "endTime": "23:00", + "totalHours": 3.5, + "reason": "Kritik sistem güvenlik yaması uygulaması", + "status": "Approved", + "rate": 1.5, + "amount": 525 + }, + { + "employeeCode": "EMP-010", + "date": "06-06-2024", + "startTime": "17:30", + "endTime": "20:00", + "totalHours": 2.5, + "reason": "Stratejik planlama toplantısı hazırlığı", + "status": "Rejected", + "rate": 1.5, + "amount": 0 + } + ], + "Payrolls": [ + { + "employeeCode": "EMP-001", + "periodYear": 2023, + "periodMonth": 1, + "baseSalary": 3000, + "overtime": 0, + "bonus": 0, + "grossSalary": 0, + "netSalary": 0, + "tax": 0, + "socialSecurity": 0, + "status": "Cancelled" + }, + { + "employeeCode": "EMP-002", + "periodYear": 2023, + "periodMonth": 1, + "baseSalary": 3200, + "overtime": 0, + "bonus": 0, + "grossSalary": 0, + "netSalary": 0, + "tax": 0, + "socialSecurity": 0, + "status": "Paid" + }, + { + "employeeCode": "EMP-003", + "periodYear": 2023, + "periodMonth": 1, + "baseSalary": 2800, + "overtime": 0, + "bonus": 0, + "grossSalary": 0, + "netSalary": 0, + "tax": 0, + "socialSecurity": 0, + "status": "Approved" + }, + { + "employeeCode": "EMP-004", + "periodYear": 2023, + "periodMonth": 1, + "baseSalary": 3500, + "overtime": 0, + "bonus": 0, + "grossSalary": 0, + "netSalary": 0, + "tax": 0, + "socialSecurity": 0, + "status": "Calculated" + }, + { + "employeeCode": "EMP-004", + "periodYear": 2023, + "periodMonth": 1, + "baseSalary": 4000, + "overtime": 0, + "bonus": 0, + "grossSalary": 0, + "netSalary": 0, + "tax": 0, + "socialSecurity": 0, + "status": "Draft" + } + ], + "Template360s": [ + { + "name": "Genel Yetkinlik Değerlendirmesi", + "description": "Tüm pozisyonlar için kullanılabilecek genel 360° derece değerlendirme şablonu", + "isActive": true, + "assessorTypes": "self|manager|peer|subordinate|customer|external|hrUpperManagement|otherDepartment" + } ] } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index 1b356a3b..59b6dc67 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -68,6 +68,10 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _employeeRepository; private readonly IRepository _bankRepository; private readonly IRepository _bankAccountRepository; + private readonly IRepository _leaveRepository; + private readonly IRepository _overtimeRepository; + private readonly IRepository _payrollRepository; + private readonly IRepository _template360Repository; public TenantDataSeeder( IRepository repositoryUser, @@ -119,7 +123,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository employeeRepository, IRepository badgeRepository, IRepository bankRepository, - IRepository bankAccountRepository + IRepository bankAccountRepository, + IRepository leaveRepository, + IRepository overtimeRepository, + IRepository payrollRepository, + IRepository template360Repository ) { _repositoryUser = repositoryUser; @@ -172,6 +180,10 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _badgeRepository = badgeRepository; _bankRepository = bankRepository; _bankAccountRepository = bankAccountRepository; + _leaveRepository = leaveRepository; + _overtimeRepository = overtimeRepository; + _payrollRepository = payrollRepository; + _template360Repository = template360Repository; } private static IConfigurationRoot BuildConfiguration() @@ -1050,5 +1062,93 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IsActive = item.IsActive }, autoSave: true); } + + foreach (var item in items.Leaves) + { + var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode); + if (employee != null) + { + var exists = await _leaveRepository.AnyAsync(x => x.EmployeeId == employee.Id); + if (exists) + continue; + + await _leaveRepository.InsertAsync(new Leave + { + EmployeeId = employee.Id, + LeaveType = item.LeaveType, + StartDate = item.StartDate, + EndDate = item.EndDate, + TotalDays = item.TotalDays, + IsHalfDay = item.IsHalfDay, + Reason = item.Reason, + Status = item.Status, + }, autoSave: true); + } + } + + foreach (var item in items.Overtimes) + { + var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode); + if (employee != null) + { + var exists = await _overtimeRepository.AnyAsync(x => x.EmployeeId == employee.Id); + if (exists) + continue; + + await _overtimeRepository.InsertAsync(new Overtime + { + EmployeeId = employee.Id, + Date = item.Date, + StartTime = item.StartTime, + EndTime = item.EndTime, + TotalHours = item.TotalHours, + Reason = item.Reason, + Status = item.Status, + Rate = item.Rate, + Amount = item.Amount + }, autoSave: true); + } + } + + foreach (var item in items.Payrolls) + { + var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode); + if (employee != null) + { + var exists = await _payrollRepository.AnyAsync(x => x.EmployeeId == employee.Id); + if (exists) + continue; + + await _payrollRepository.InsertAsync(new Payroll + { + EmployeeId = employee.Id, + PeriodYear = item.PeriodYear, + PeriodMonth = item.PeriodMonth, + BaseSalary = item.BaseSalary, + Overtime = item.Overtime, + Bonus = item.Bonus, + GrossSalary = item.GrossSalary, + NetSalary = item.NetSalary, + Tax = item.Tax, + SocialSecurity = item.SocialSecurity, + Status = item.Status + }, autoSave: true); + } + } + + foreach (var item in items.Template360s) + { + var exists = await _template360Repository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _template360Repository.InsertAsync(new Template360 + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive, + AssessorTypes = item.AssessorTypes, + }, autoSave: true); + } } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index 409aa41e..afde629c 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -57,6 +57,58 @@ public class TenantSeederDto public List Badges { get; set; } public List CostCenters { get; set; } public List Employees { get; set; } + public List Leaves { get; set; } + public List Overtimes { get; set; } + public List Payrolls { get; set; } + public List Template360s { get; set; } +} + +public class Template360SeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + public string AssessorTypes { get; set; } +} + +public class PayrollSeedDto +{ + public string EmployeeCode { get; set; } + public int PeriodYear { get; set; } + public int 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 class OvertimeSeedDto +{ + public string EmployeeCode { get; set; } + public DateTime Date { get; set; } + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } + public decimal TotalHours { get; set; } + public string Reason { get; set; } + public string Status { get; set; } + public decimal Rate { get; set; } + public decimal Amount { get; set; } +} + +public class LeaveSeedDto +{ + public string EmployeeCode { get; set; } + public string LeaveType { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public decimal TotalDays { get; set; } + public bool IsHalfDay { get; set; } + public string Reason { get; set; } + public string Status { get; set; } } public class EmployeeSeedDto diff --git a/ui/src/views/shared/DialogContext/DialogShowComponent.tsx b/ui/src/views/shared/DialogContext/DialogShowComponent.tsx index aa992e9c..5dd4b1b6 100644 --- a/ui/src/views/shared/DialogContext/DialogShowComponent.tsx +++ b/ui/src/views/shared/DialogContext/DialogShowComponent.tsx @@ -99,6 +99,14 @@ const DialogShowComponent = (): JSX.Element => { {...dialogContext.config?.props} > ) + case 'Template360Questions': + return ( + + ) default: return <> }