From 7e74237d80d5dfa92187ee475f52c252bdc5c658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Tue, 21 Oct 2025 15:45:24 +0300 Subject: [PATCH] Hr Cost Center --- .../Seeds/HostData.json | 2 +- .../Seeds/ListFormsSeeder.cs | 622 ++++++++++++++++++ .../Enums/LookUpQueryValues.cs | 10 +- .../PlatformConsts.cs | 3 +- .../Kurs.Platform.Domain/Data/SeedConsts.cs | 1 + .../Entities/Tenant/Hr/CostCenter.cs | 32 + .../EntityFrameworkCore/PlatformDbContext.cs | 26 +- ....cs => 20251021124022_Initial.Designer.cs} | 297 ++++++--- ...1_Initial.cs => 20251021124022_Initial.cs} | 56 +- .../PlatformDbContextModelSnapshot.cs | 295 ++++++--- 10 files changed, 1156 insertions(+), 188 deletions(-) create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/CostCenter.cs rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251021111101_Initial.Designer.cs => 20251021124022_Initial.Designer.cs} (98%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251021111101_Initial.cs => 20251021124022_Initial.cs} (98%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json index eb8f9098..937bd6b9 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json @@ -14988,7 +14988,7 @@ "Code": "App.Hr.CostCenter", "DisplayName": "App.Hr.CostCenter", "Order": 5, - "Url": "/admin/hr/cost-centers", + "Url": "/admin/list/list-costcenter", "Icon": "FcSalesPerformance", "RequiredPermissionName": "App.Hr.CostCenter", "IsDisabled": false diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 26004199..88ac9b3e 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -33346,6 +33346,628 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Cost Centers + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.CostCenter)) + { + var listFormCostCenter = 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.CostCenter, + Name = AppCodes.Hr.CostCenter, + Title = AppCodes.Hr.CostCenter, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.CostCenter, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.CostCenter)), + 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.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + D = AppCodes.Hr.CostCenter + ".Delete", + E = AppCodes.Hr.CostCenter + ".Export", + I = AppCodes.Hr.CostCenter + ".Import", + A = AppCodes.Hr.CostCenter + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.CostCenter))}\" 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 = "Cost Center Form", + Width = 500, + 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="Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField="Name", ColSpan = 2, IsRequired =true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField="Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField="ParentCostCenterId", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField="ResponsibleEmployeeId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField="DepartmentId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 7, DataField="CostCenterType", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 8, DataField="BudgetedAmount", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 9, DataField="ActualAmount", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 10, DataField="CurrencyId", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 11, DataField="FiscalYear", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 12, 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 CommandColumnDto() { + Hint = "Personel Listesi", + Text ="Personel Listesi", + UrlTarget="_blank", + AuthName = AppCodes.Hr.Employee, + Url="/admin/list/list-employees/@Id" + }, + }), + } + ); + + #region Cost Center Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormCostCenter.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.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 100, + 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.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + 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.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 300, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "ParentCostCenterId", + Width = 200, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.CostCenterValues + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "ResponsibleEmployeeId", + Width = 200, + 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, + }), + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + // LookupQuery = LookUpQueryValues.CostCenterValues + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "DepartmentId", + Width = 200, + ListOrderNo = 7, + 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.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.DepartmentValues + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "CostCenterType", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + 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" } + }), + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "BudgetedAmount", + 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.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "ActualAmount", + 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.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "CurrencyId", + Width = 100, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.CurrencyValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "FiscalYear", + 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.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormCostCenter.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.CostCenter + ".Create", + R = AppCodes.Hr.CostCenter, + U = AppCodes.Hr.CostCenter + ".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/LookUpQueryValues.cs b/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs index 33f25319..9dd1b2bc 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs @@ -239,5 +239,13 @@ public static class LookUpQueryValues $"\"Name\" AS \"Name\" " + $"FROM \"{FullNameTable(TableNameEnum.Department)}\" " + $"WHERE \"IsDeleted\" = 'false' " + - $"ORDER BY \"Name\";"; + $"ORDER BY \"Name\";"; + + public static string CostCenterValues = + $"SELECT " + + $"\"Id\" AS \"Key\", " + + $"\"Name\" AS \"Name\" " + + $"FROM \"{FullNameTable(TableNameEnum.CostCenter)}\" " + + $"WHERE \"IsDeleted\" = 'false' " + + $"ORDER BY \"Name\";"; } \ 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 6558303b..bd59281f 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -502,8 +502,9 @@ public static class PlatformConsts public const string EmploymentType = "list-employmenttype"; public const string JobPosition = "list-jobposition"; public const string Department = "list-department"; - public const string Employee = "list-employee"; public const string Badge = "list-badge"; + public const string CostCenter = "list-costcenter"; + public const string Employee = "list-employee"; } } diff --git a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs index 230f9176..30a3d1d9 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -456,6 +456,7 @@ public static class SeedConsts public const string JobPosition = Default + ".JobPosition"; public const string EmploymentType = Default + ".EmploymentType"; public const string Badge = Default + ".Badge"; + public const string CostCenter = Default + ".CostCenter"; } public static class Accounting diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/CostCenter.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/CostCenter.cs new file mode 100644 index 00000000..89147a39 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/CostCenter.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 CostCenter : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public Guid? ParentCostCenterId { get; set; } + public CostCenter ParentCostCenter { get; set; } + public ICollection SubCostCenters { get; set; } + + public Guid? ResponsibleEmployeeId { get; set; } + // public HrEmployee ResponsibleEmployee { get; set; } + + public Guid? DepartmentId { get; set; } + public Department Department { get; set; } + + public string CostCenterType { get; set; } + public int BudgetedAmount { get; set; } + public int ActualAmount { get; set; } + public Guid CurrencyId { get; set; } + public string FiscalYear { get; set; } + public bool IsActive { get; set; } +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index c5030022..c442d2e2 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -1673,7 +1673,7 @@ public class PlatformDbContext : b.Property(x => x.Rarity).HasMaxLength(50); b.Property(x => x.IsActive).HasDefaultValue(true); }); - + builder.Entity(b => { b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Department)), Prefix.DbSchema); @@ -1700,5 +1700,29 @@ public class PlatformDbContext : // .HasForeignKey(x => x.CostCenterId) // .OnDelete(DeleteBehavior.Restrict); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CostCenter)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Code).IsRequired().HasMaxLength(50); + b.Property(x => x.Name).IsRequired().HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.FiscalYear).HasMaxLength(10); + b.Property(x => x.IsActive).HasDefaultValue(true); + + b.HasOne(x => x.ParentCostCenter) + .WithMany(x => x.SubCostCenters) + .HasForeignKey(x => x.ParentCostCenterId); + + // b.HasOne(x => x.ResponsibleEmployee) + // .WithMany() + // .HasForeignKey(x => x.ResponsibleEmployeeId); + + b.HasOne(x => x.Department) + .WithMany() + .HasForeignKey(x => x.DepartmentId); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021111101_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.Designer.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021111101_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.Designer.cs index 941bb68e..d21819b4 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021111101_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251021111101_Initial")] + [Migration("20251021124022_Initial")] partial class Initial { /// @@ -917,6 +917,97 @@ namespace Kurs.Platform.Migrations b.ToTable("P_P_BackgroundWorker", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Badge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BackgroundColor") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Category") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Color") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Criteria") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Icon") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Points") + .HasColumnType("int"); + + b.Property("Rarity") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_Badge", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Bank", b => { b.Property("Id") @@ -2206,6 +2297,99 @@ namespace Kurs.Platform.Migrations b.ToTable("P_Sas_ContactTitle", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualAmount") + .HasColumnType("int"); + + b.Property("BudgetedAmount") + .HasColumnType("int"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CostCenterType") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CurrencyId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DepartmentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("FiscalYear") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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("ParentCostCenterId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResponsibleEmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.HasIndex("ParentCostCenterId"); + + b.ToTable("T_Hr_CostCenter", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => { b.Property("Id") @@ -3521,97 +3705,6 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Sas_GlobalSearch", (string)null); }); - modelBuilder.Entity("Kurs.Platform.Entities.HrBadge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("BackgroundColor") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Category") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Color") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("Criteria") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Icon") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - 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(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Points") - .HasColumnType("int"); - - b.Property("Rarity") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.ToTable("T_Hr_Badge", (string)null); - }); - modelBuilder.Entity("Kurs.Platform.Entities.InstallmentOption", b => { b.Property("Id") @@ -9506,6 +9599,21 @@ namespace Kurs.Platform.Migrations b.Navigation("Session"); }); + modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => + { + b.HasOne("Kurs.Platform.Entities.Department", "Department") + .WithMany() + .HasForeignKey("DepartmentId"); + + b.HasOne("Kurs.Platform.Entities.CostCenter", "ParentCostCenter") + .WithMany("SubCostCenters") + .HasForeignKey("ParentCostCenterId"); + + b.Navigation("Department"); + + b.Navigation("ParentCostCenter"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => { b.HasOne("Kurs.Platform.Entities.CountryGroup", null) @@ -9971,6 +10079,11 @@ namespace Kurs.Platform.Migrations b.Navigation("Participants"); }); + modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => + { + b.Navigation("SubCostCenters"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => { b.Navigation("Cities"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021111101_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021111101_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.cs index 19d58121..5246cbfb 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021111101_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.cs @@ -3244,6 +3244,47 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "T_Hr_CostCenter", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + ParentCostCenterId = table.Column(type: "uniqueidentifier", nullable: true), + ResponsibleEmployeeId = table.Column(type: "uniqueidentifier", nullable: true), + DepartmentId = table.Column(type: "uniqueidentifier", nullable: true), + CostCenterType = table.Column(type: "nvarchar(max)", nullable: true), + BudgetedAmount = table.Column(type: "int", nullable: false), + ActualAmount = table.Column(type: "int", nullable: false), + CurrencyId = table.Column(type: "uniqueidentifier", nullable: false), + FiscalYear = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: 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_CostCenter", x => x.Id); + table.ForeignKey( + name: "FK_T_Hr_CostCenter_T_Hr_CostCenter_ParentCostCenterId", + column: x => x.ParentCostCenterId, + principalTable: "T_Hr_CostCenter", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_T_Hr_CostCenter_T_Hr_Department_DepartmentId", + column: x => x.DepartmentId, + principalTable: "T_Hr_Department", + principalColumn: "Id"); + }); + migrationBuilder.CreateTable( name: "T_Sas_ApiEndpoint", columns: table => new @@ -4339,6 +4380,16 @@ namespace Kurs.Platform.Migrations table: "T_Crd_QuestionOption", column: "QuestionId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_CostCenter_DepartmentId", + table: "T_Hr_CostCenter", + column: "DepartmentId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Hr_CostCenter_ParentCostCenterId", + table: "T_Hr_CostCenter", + column: "ParentCostCenterId"); + migrationBuilder.CreateIndex( name: "IX_T_Hr_Department_ParentDepartmentId", table: "T_Hr_Department", @@ -4619,7 +4670,7 @@ namespace Kurs.Platform.Migrations name: "T_Hr_Badge"); migrationBuilder.DropTable( - name: "T_Hr_Department"); + name: "T_Hr_CostCenter"); migrationBuilder.DropTable( name: "T_Hr_EmploymentType"); @@ -4756,6 +4807,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Crd_Question"); + migrationBuilder.DropTable( + name: "T_Hr_Department"); + 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 f04810e0..373d2401 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -914,6 +914,97 @@ namespace Kurs.Platform.Migrations b.ToTable("P_P_BackgroundWorker", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Badge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BackgroundColor") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Category") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Color") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Criteria") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Icon") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Points") + .HasColumnType("int"); + + b.Property("Rarity") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_Badge", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Bank", b => { b.Property("Id") @@ -2203,6 +2294,99 @@ namespace Kurs.Platform.Migrations b.ToTable("P_Sas_ContactTitle", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualAmount") + .HasColumnType("int"); + + b.Property("BudgetedAmount") + .HasColumnType("int"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CostCenterType") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CurrencyId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DepartmentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("FiscalYear") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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("ParentCostCenterId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResponsibleEmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.HasIndex("ParentCostCenterId"); + + b.ToTable("T_Hr_CostCenter", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => { b.Property("Id") @@ -3518,97 +3702,6 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Sas_GlobalSearch", (string)null); }); - modelBuilder.Entity("Kurs.Platform.Entities.HrBadge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("BackgroundColor") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Category") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Color") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("Criteria") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Icon") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - 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(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Points") - .HasColumnType("int"); - - b.Property("Rarity") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.ToTable("T_Hr_Badge", (string)null); - }); - modelBuilder.Entity("Kurs.Platform.Entities.InstallmentOption", b => { b.Property("Id") @@ -9503,6 +9596,21 @@ namespace Kurs.Platform.Migrations b.Navigation("Session"); }); + modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => + { + b.HasOne("Kurs.Platform.Entities.Department", "Department") + .WithMany() + .HasForeignKey("DepartmentId"); + + b.HasOne("Kurs.Platform.Entities.CostCenter", "ParentCostCenter") + .WithMany("SubCostCenters") + .HasForeignKey("ParentCostCenterId"); + + b.Navigation("Department"); + + b.Navigation("ParentCostCenter"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => { b.HasOne("Kurs.Platform.Entities.CountryGroup", null) @@ -9968,6 +10076,11 @@ namespace Kurs.Platform.Migrations b.Navigation("Participants"); }); + modelBuilder.Entity("Kurs.Platform.Entities.CostCenter", b => + { + b.Navigation("SubCostCenters"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => { b.Navigation("Cities");