diff --git a/api/src/Kurs.Platform.Application.Contracts/Banks/BankDto.cs b/api/src/Kurs.Platform.Application.Contracts/Banks/BankDto.cs index a073fa07..38e90d3d 100644 --- a/api/src/Kurs.Platform.Application.Contracts/Banks/BankDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/Banks/BankDto.cs @@ -8,8 +8,8 @@ public class BankDto : AuditedEntityDto public string Name { get; set; } public string IdentifierCode { get; set; } - public string AddressLine1 { get; set; } - public string AddressLine2 { get; set; } + public string Address1 { get; set; } + public string Address2 { get; set; } public string District { get; set; } public string City { get; set; } public string PostalCode { get; set; } diff --git a/api/src/Kurs.Platform.Application.Contracts/Tenants/CustomTenantDto.cs b/api/src/Kurs.Platform.Application.Contracts/Tenants/CustomTenantDto.cs index f1bc8e5f..a5e51e46 100644 --- a/api/src/Kurs.Platform.Application.Contracts/Tenants/CustomTenantDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/Tenants/CustomTenantDto.cs @@ -16,7 +16,7 @@ public class CustomTenantDto public string City { get; set; } public string District { get; set; } public string Street { get; set; } - public string Address { get; set; } + public string Address1 { get; set; } public string Address2 { get; set; } public string PostalCode { get; set; } public string Phone { get; set; } diff --git a/api/src/Kurs.Platform.Application/ListForms/ListFormDynamicApiAppService.cs b/api/src/Kurs.Platform.Application/ListForms/ListFormDynamicApiAppService.cs index 8cd1b94a..ca5f2e1b 100644 --- a/api/src/Kurs.Platform.Application/ListForms/ListFormDynamicApiAppService.cs +++ b/api/src/Kurs.Platform.Application/ListForms/ListFormDynamicApiAppService.cs @@ -121,7 +121,7 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic entity.SetCity(input.Data.City); entity.SetDistrict(input.Data.District); entity.SetStreet(input.Data.Street); - entity.SetAddress(input.Data.Address); + entity.SetAddress1(input.Data.Address); entity.SetAddress2(input.Data.Address2); entity.SetPostalCode(input.Data.PostalCode); entity.SetPhone(input.Data.Phone); @@ -156,7 +156,7 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic entity.SetCity(input.Data.City); entity.SetDistrict(input.Data.District); entity.SetStreet(input.Data.Street); - entity.SetAddress(input.Data.Address); + entity.SetAddress1(input.Data.Address); entity.SetAddress2(input.Data.Address2); entity.SetPostalCode(input.Data.PostalCode); entity.SetPhone(input.Data.Phone); diff --git a/api/src/Kurs.Platform.Application/Public/PublicAppService.cs b/api/src/Kurs.Platform.Application/Public/PublicAppService.cs index ad49f8e7..2ac05182 100644 --- a/api/src/Kurs.Platform.Application/Public/PublicAppService.cs +++ b/api/src/Kurs.Platform.Application/Public/PublicAppService.cs @@ -229,7 +229,7 @@ public class PublicAppService : PlatformAppService Founder = input.Tenant.Founder, VknTckn = input.Tenant.VknTckn, TaxOffice = input.Tenant.TaxOffice, - Address = input.Tenant.Address, + Address1 = input.Tenant.Address1, Address2 = input.Tenant.Address2, District = input.Tenant.District, Country = input.Tenant.Country, diff --git a/api/src/Kurs.Platform.Application/Tenants/PlatformTenantAppService.cs b/api/src/Kurs.Platform.Application/Tenants/PlatformTenantAppService.cs index 9bd8921b..faaf446d 100644 --- a/api/src/Kurs.Platform.Application/Tenants/PlatformTenantAppService.cs +++ b/api/src/Kurs.Platform.Application/Tenants/PlatformTenantAppService.cs @@ -83,7 +83,7 @@ public class PlatformTenantAppService : TenantAppService, IPlatformTenantAppServ dto.City = tenant.GetCity(); dto.District = tenant.GetDistrict(); dto.Street = tenant.GetStreet(); - dto.Address = tenant.GetAddress(); + dto.Address = tenant.GetAddress1(); dto.Address2 = tenant.GetAddress2(); dto.PostalCode = tenant.GetPostalCode(); dto.Phone = tenant.GetPhone(); diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json index 937bd6b9..150100f8 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json @@ -14998,7 +14998,7 @@ "Code": "App.Hr.Employee", "DisplayName": "App.Hr.Employee", "Order": 6, - "Url": "/admin/hr/employees", + "Url": "/admin/list/list-employee", "Icon": "FcConferenceCall", "RequiredPermissionName": "App.Hr.Employee", "IsDisabled": false diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 88ac9b3e..0e2eb257 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -800,8 +800,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 3, DataField = "IdentifierCode", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, - new EditingFormItemDto { Order = 4, DataField = "AddressLine1", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "AddressLine2", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Address1", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "Address2", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 6, DataField = "Country", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 7, DataField = "City", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 8, DataField = "District", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, @@ -984,7 +984,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency UserId = null, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "AddressLine1", + FieldName = "Address1", Width = 150, ListOrderNo = 5, Visible = true, @@ -1015,7 +1015,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency UserId = null, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "AddressLine2", + FieldName = "Address2", Width = 150, ListOrderNo = 6, Visible = true, @@ -29475,8 +29475,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 4, DataField = "IdentifierCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, - new EditingFormItemDto { Order = 5, DataField = "AddressLine1", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 6, DataField = "AddressLine2", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "Address1", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "Address2", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 8, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 9, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, @@ -29669,7 +29669,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency UserId = null, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "AddressLine1", + FieldName = "Address1", Width = 150, ListOrderNo = 5, Visible = true, @@ -29700,7 +29700,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency UserId = null, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "AddressLine2", + FieldName = "Address2", Width = 150, ListOrderNo = 6, Visible = true, @@ -33222,7 +33222,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "name", ValueExpr = "key", - LookupQuery = LookUpQueryValues.BankValues + LookupQuery = LookUpQueryValues.EmployeeValues }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { @@ -33263,7 +33263,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "name", ValueExpr = "key", - LookupQuery = LookUpQueryValues.BankValues + LookupQuery = LookUpQueryValues.CostCenterValues }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { @@ -33698,7 +33698,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "name", ValueExpr = "key", - // LookupQuery = LookUpQueryValues.CostCenterValues + LookupQuery = LookUpQueryValues.EmployeeValues }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { @@ -33969,6 +33969,1321 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Employees + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Employee)) + { + var listFormEmployee = 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.Employee, + Name = AppCodes.Hr.Employee, + Title = AppCodes.Hr.Employee, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.Employee, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Employee)), + 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.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + D = AppCodes.Hr.Employee + ".Delete", + E = AppCodes.Hr.Employee + ".Export", + I = AppCodes.Hr.Employee + ".Import", + A = AppCodes.Hr.Employee + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Employee))}\" 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 = "Employee 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, Caption="General", 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="FullName", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField="NationalId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField="BirthDate", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 5, DataField="Gender", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField="MaritalStatus", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 7, DataField="EmployeeStatus", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 8, DataField="IsActive", ColSpan = 2, EditorType2 = EditorTypes.dxCheckBox }, + ] + }, + new() { + Order=2, Caption="Contact", ColCount=1, ColSpan=2, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField="Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField="City", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField="District", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField="Street", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField="PostalCode", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 6, DataField="Phone", ColSpan = 1, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, + new EditingFormItemDto { Order = 7, DataField="PersonalPhone", ColSpan = 1, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, + new EditingFormItemDto { Order = 8, DataField="Email", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 9, DataField="Address", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 10, DataField="Address2", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, + ] + }, + new() { + Order=3, Caption="Emergency", ColCount=1, ColSpan=2, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField="EmergencyContactName", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField="EmergencyContactRelationship", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField="EmergencyContactPhone", ColSpan = 1, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, + ] + }, + new() { + Order=3, Caption="Job", ColCount=1, ColSpan=2, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField="HireDate", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 2, DataField="TerminationDate", ColSpan = 2, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 3, DataField="EmploymentTypeId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField="JobPositionId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField="DepartmantId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField="WorkLocation", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField="ManagerId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 8, DataField="BaseSalary", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 9, DataField="CurrencyId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 10, DataField="PayrollGroup", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 11, DataField="BankAccountId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 12, DataField="BadgeId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + ] + }, + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "IsActive", + FieldDbType = DbType.Boolean, + Value = "true", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Employee Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormEmployee.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.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.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.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "FullName", + 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.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "NationalId", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "BirthDate", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "MaritalStatus", + Width = 100, + 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.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "Male", Name= "MALE"}, + new () { Key= "Female", Name= "FEMALE" }, + new () { Key= "Other", Name= "OTHER" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "EmployeeStatus", + Width = 100, + 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.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "Active", Name= "ACTIVE"}, + new () { Key= "Inactive", Name= "INACTIVE" }, + new () { Key= "OnLeave", Name= "ON_LEAVE" }, + new () { Key= "Suspended", Name= "SUSPENDED" }, + new () { Key= "Terminated", Name= "TERMINATED" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Address1", + Width = 150, + 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.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Address2", + Width = 150, + 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.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Country", + 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.CountryValues, + CascadeEmptyFields = "City,District,Street" + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "City", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = LookUpQueryValues.CityValues, + CascadeRelationField = "Country", + CascadeFilterOperator="=", + CascadeParentFields = "Country", + CascadeEmptyFields = "District,Street" + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "District", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = LookUpQueryValues.DistrictValues, + CascadeRelationField = "City", + CascadeFilterOperator="=", + CascadeParentFields = "Country,City", + CascadeEmptyFields = "Street", + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PostalCode", + Width = 150, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone", + Width = 150, + ListOrderNo = 15, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PersonalPhone", + Width = 150, + ListOrderNo = 16, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Email", + Width = 150, + ListOrderNo = 17, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.email) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "EmergencyContactName", + Width = 100, + ListOrderNo = 18, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "EmergencyContactRelationship", + Width = 100, + ListOrderNo = 19, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "EmergencyContactPhone", + Width = 100, + ListOrderNo = 20, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "HireDate", + Width = 100, + ListOrderNo = 21, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "TerminationDate", + Width = 100, + ListOrderNo = 22, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "EmploymentTypeId", + Width = 100, + ListOrderNo = 23, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.EmploymentTypeValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "JobPositionId", + Width = 100, + ListOrderNo = 24, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.JobPositionValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "DepartmantId", + Width = 100, + ListOrderNo = 25, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.DepartmentValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "WorkLocation", + Width = 100, + ListOrderNo = 26, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "ManagerId", + Width = 100, + ListOrderNo = 27, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.EmployeeValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "BaseSalary", + Width = 100, + ListOrderNo = 28, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "CurrencyId", + Width = 100, + ListOrderNo = 29, + 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.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PayrollGroup", + Width = 100, + ListOrderNo = 30, + 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= "Hours", Name= "HOURS" }, + new () { Key= "Weeks", Name= "WEEKS" }, + new () { Key= "Months", Name= "MONTHS" } + }), + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BankAccountId", + Width = 100, + ListOrderNo = 31, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.BankAccountValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEmployee.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BadgeId", + Width = 100, + ListOrderNo = 32, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.BadgeValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Employee + ".Create", + R = AppCodes.Hr.Employee, + U = AppCodes.Hr.Employee + ".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 9dd1b2bc..1107d323 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs @@ -226,6 +226,13 @@ public static class LookUpQueryValues $"FROM \"{FullNameTable(TableNameEnum.Bank)}\" " + $"WHERE \"IsDeleted\" = 'false' "; + public static string BankAccountValues = + $"SELECT " + + $"\"Id\" AS \"Key\", " + + $"\"AccountNumber\" AS \"Name\" " + + $"FROM \"{FullNameTable(TableNameEnum.BankAccount)}\" " + + $"WHERE \"IsDeleted\" = 'false' "; + public static string CurrencyValues = $"SELECT " + $"\"Id\" AS \"Key\", " + @@ -239,7 +246,7 @@ 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 " + @@ -247,5 +254,36 @@ public static class LookUpQueryValues $"\"Name\" AS \"Name\" " + $"FROM \"{FullNameTable(TableNameEnum.CostCenter)}\" " + $"WHERE \"IsDeleted\" = 'false' " + - $"ORDER BY \"Name\";"; + $"ORDER BY \"Name\";"; + + public static string EmployeeValues = + $"SELECT " + + $"\"Id\" AS \"Key\", " + + $"\"FullName\" AS \"Name\" " + + $"FROM \"{FullNameTable(TableNameEnum.Employee)}\" " + + $"WHERE \"IsDeleted\" = 'false' " + + $"ORDER BY \"FullName\";"; + + public static string EmploymentTypeValues = + $"SELECT " + + $"\"Id\" AS \"Key\", " + + $"\"Name\" AS \"Name\" " + + $"FROM \"{FullNameTable(TableNameEnum.EmploymentType)}\" " + + $"WHERE \"IsDeleted\" = 'false' " + + $"ORDER BY \"Name\";"; + + public static string JobPositionValues = + $"SELECT " + + $"\"Id\" AS \"Key\", " + + $"\"Name\" AS \"Name\" " + + $"FROM \"{FullNameTable(TableNameEnum.JobPosition)}\" " + + $"WHERE \"IsDeleted\" = 'false' " + + $"ORDER BY \"Name\";"; + + public static string BadgeValues = + $"SELECT " + + $"\"Id\" AS \"Key\", " + + $"\"Name\" AS \"Name\" " + + $"FROM \"{FullNameTable(TableNameEnum.Badge)}\" " + + $"WHERE \"IsDeleted\" = 'false' "; } \ 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 bd59281f..278e4050 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -76,7 +76,7 @@ public static class PlatformConsts public const string City = "City"; public const string District = "District"; public const string Street = "Street"; - public const string Address = "Address"; + public const string Address1 = "Address1"; public const string Address2 = "Address2"; public const string PostalCode = "PostalCode"; public const string Phone = "Phone"; diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Bank.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Bank.cs index e59bbdab..3e0b2e0d 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Branch/Bank.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Branch/Bank.cs @@ -11,8 +11,8 @@ public class Bank : FullAuditedEntity, IMultiTenant public string Name { get; set; } public string IdentifierCode { get; set; } - public string AddressLine1 { get; set; } - public string AddressLine2 { get; set; } + public string Address1 { get; set; } + public string Address2 { get; set; } public string Country { get; set; } public string City { get; set; } public string District { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Branch.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Branch.cs index 3f3190fb..a7fff1e9 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Branch.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Branch.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.Platform.Entities; @@ -16,7 +15,7 @@ public class Branch : FullAuditedEntity public string City { get; set; } public string District { get; set; } public string Street { get; set; } - public string Address { get; set; } + public string Address1 { get; set; } public string Address2 { get; set; } public string PostalCode { get; set; } public string Phone { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/CostCenter.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/CostCenter.cs index 89147a39..a39e1f59 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/CostCenter.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/CostCenter.cs @@ -18,7 +18,7 @@ public class CostCenter : FullAuditedEntity, IMultiTenant public ICollection SubCostCenters { get; set; } public Guid? ResponsibleEmployeeId { get; set; } - // public HrEmployee ResponsibleEmployee { get; set; } + public Employee ResponsibleEmployee { get; set; } public Guid? DepartmentId { get; set; } public Department Department { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Department.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Department.cs index 54012525..563246a7 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Department.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Department.cs @@ -19,10 +19,10 @@ public class Department : FullAuditedEntity, IMultiTenant public ICollection SubDepartments { get; set; } public Guid? ManagerId { get; set; } - //public HrEmployee Manager { get; set; } + public Employee Manager { get; set; } public Guid? CostCenterId { get; set; } - //public HrCostCenter CostCenter { get; set; } + public CostCenter CostCenter { get; set; } public int Budget { get; set; } public bool IsActive { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Employee.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Employee.cs new file mode 100644 index 00000000..3eeb6877 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Employee.cs @@ -0,0 +1,67 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class Employee : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Code { get; set; } + public string FullName { get; set; } + public string Avatar { get; set; } + public string NationalId { get; set; } + public DateTime BirthDate { get; set; } + public string Gender { get; set; } + public string MaritalStatus { get; set; } + + // Embedded Address + public string Country { get; set; } + public string City { get; set; } + public string District { get; set; } + public string Street { get; set; } + public string PostalCode { get; set; } + public string Phone { get; set; } + public string PersonalPhone { get; set; } + public string Email { get; set; } + public string Address { get; set; } + public string Address2 { get; set; } + + // Emergency contact + public string EmergencyContactName { get; set; } + public string EmergencyContactRelationship { get; set; } + public string EmergencyContactPhone { get; set; } + + public DateTime HireDate { get; set; } + public DateTime? TerminationDate { get; set; } + public Guid EmploymentTypeId { get; set; } + public Guid JobPositionId { get; set; } + public JobPosition JobPosition { get; set; } + + public Guid DepartmantId { get; set; } + public Department Department { get; set; } + public string WorkLocation { get; set; } + + public Guid? ManagerId { get; set; } + public Employee Manager { get; set; } + + public int BaseSalary { get; set; } + public Guid CurrencyId { get; set; } + public string PayrollGroup { get; set; } + + public Guid BankAccountId { get; set; } + public BankAccount BankAccount { get; set; } + + public Guid BadgeId { get; set; } + public Badge Badge { get; set; } + + public string EmployeeStatus { get; set; } + public bool IsActive { get; set; } + + // Navigation lists (placeholders) + // public ICollection Leaves { get; set; } + // public ICollection Evaluations { get; set; } + // public ICollection Trainings { get; set; } + // public ICollection DisciplinaryActions { get; set; } +} diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Order.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Order.cs index 58e2519d..adfb78e3 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Order.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Order.cs @@ -16,7 +16,7 @@ public class Order : FullAuditedEntity, IMultiTenant public string Founder { get; set; } public long VknTckn { get; set; } public string TaxOffice { get; set; } - public string Address { get; set; } + public string Address1 { get; set; } public string Address2 { get; set; } public string District { get; set; } public string Country { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Extensions/AbpTenantExtensions.cs b/api/src/Kurs.Platform.Domain/Extensions/AbpTenantExtensions.cs index 9814d380..c0c0b264 100644 --- a/api/src/Kurs.Platform.Domain/Extensions/AbpTenantExtensions.cs +++ b/api/src/Kurs.Platform.Domain/Extensions/AbpTenantExtensions.cs @@ -86,13 +86,13 @@ public static class AbpTenantExtensions return tenant.GetProperty(PlatformConsts.Tenants.Street); } - public static void SetAddress(this Tenant tenant, string address) + public static void SetAddress1(this Tenant tenant, string address) { - tenant.SetProperty(PlatformConsts.Tenants.Address, address); + tenant.SetProperty(PlatformConsts.Tenants.Address1, address); } - public static string GetAddress(this Tenant tenant) + public static string GetAddress1(this Tenant tenant) { - return tenant.GetProperty(PlatformConsts.Tenants.Address); + return tenant.GetProperty(PlatformConsts.Tenants.Address1); } public static void SetAddress2(this Tenant tenant, string address2) diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index c442d2e2..1b61869f 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -238,7 +238,7 @@ public class PlatformDbContext : b.Property(a => a.City).HasMaxLength(128); b.Property(a => a.District).HasMaxLength(128); b.Property(a => a.Street).HasMaxLength(256); - b.Property(a => a.Address).HasMaxLength(512); + b.Property(a => a.Address1).HasMaxLength(512); b.Property(a => a.Address2).HasMaxLength(512); b.Property(a => a.PostalCode).HasMaxLength(16); b.Property(a => a.Phone).HasMaxLength(20); @@ -1376,7 +1376,7 @@ public class PlatformDbContext : b.Property(o => o.OrganizationName).HasMaxLength(128); b.Property(o => o.Founder).HasMaxLength(128); b.Property(o => o.TaxOffice).HasMaxLength(128); - b.Property(o => o.Address).HasMaxLength(512); + b.Property(o => o.Address1).HasMaxLength(512); b.Property(o => o.Address2).HasMaxLength(512); b.Property(o => o.District).HasMaxLength(128); b.Property(o => o.Country).HasMaxLength(128); @@ -1599,8 +1599,8 @@ public class PlatformDbContext : b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.IdentifierCode).HasMaxLength(64); - b.Property(x => x.AddressLine1).HasMaxLength(256); - b.Property(x => x.AddressLine2).HasMaxLength(256); + b.Property(x => x.Address1).HasMaxLength(256); + b.Property(x => x.Address2).HasMaxLength(256); b.Property(x => x.District).HasMaxLength(128); b.Property(x => x.City).HasMaxLength(128); b.Property(x => x.PostalCode).HasMaxLength(16); @@ -1690,17 +1690,17 @@ public class PlatformDbContext : .HasForeignKey(x => x.ParentDepartmentId) .OnDelete(DeleteBehavior.Restrict); - // b.HasOne(x => x.Manager) - // .WithMany() - // .HasForeignKey(x => x.ManagerId) - // .OnDelete(DeleteBehavior.Restrict); + b.HasOne(x => x.Manager) + .WithMany() + .HasForeignKey(x => x.ManagerId) + .OnDelete(DeleteBehavior.Restrict); - // b.HasOne(x => x.CostCenter) - // .WithMany() - // .HasForeignKey(x => x.CostCenterId) - // .OnDelete(DeleteBehavior.Restrict); + b.HasOne(x => x.CostCenter) + .WithMany() + .HasForeignKey(x => x.CostCenterId) + .OnDelete(DeleteBehavior.Restrict); }); - + builder.Entity(b => { b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CostCenter)), Prefix.DbSchema); @@ -1716,13 +1716,50 @@ public class PlatformDbContext : .WithMany(x => x.SubCostCenters) .HasForeignKey(x => x.ParentCostCenterId); - // b.HasOne(x => x.ResponsibleEmployee) - // .WithMany() - // .HasForeignKey(x => x.ResponsibleEmployeeId); + b.HasOne(x => x.ResponsibleEmployee) + .WithMany() + .HasForeignKey(x => x.ResponsibleEmployeeId); b.HasOne(x => x.Department) .WithMany() .HasForeignKey(x => x.DepartmentId); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Employee)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Code).IsRequired().HasMaxLength(50); + b.Property(x => x.FullName).HasMaxLength(200); + b.Property(x => x.Email).HasMaxLength(150); + b.Property(x => x.Phone).HasMaxLength(50); + b.Property(x => x.PersonalPhone).HasMaxLength(50); + b.Property(x => x.Avatar).HasMaxLength(250); + b.Property(x => x.NationalId).HasMaxLength(20); + b.Property(x => x.PayrollGroup).HasMaxLength(50); + b.Property(x => x.WorkLocation).HasMaxLength(150); + b.Property(x => x.IsActive).HasDefaultValue(true); + + b.HasOne(x => x.JobPosition) + .WithMany() + .HasForeignKey(x => x.JobPositionId); + + b.HasOne(x => x.Department) + .WithMany() + .HasForeignKey(x => x.DepartmantId); + + b.HasOne(x => x.Manager) + .WithMany() + .HasForeignKey(x => x.ManagerId); + + b.HasOne(x => x.BankAccount) + .WithMany() + .HasForeignKey(x => x.BankAccountId) + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(false); + + // b.HasOne(x => x.WorkSchedule).WithMany().HasForeignKey(x => x.WorkScheduleId); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEfCoreEntityExtensionMappings.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEfCoreEntityExtensionMappings.cs index 9f126270..6071bd76 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEfCoreEntityExtensionMappings.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEfCoreEntityExtensionMappings.cs @@ -130,7 +130,7 @@ public static class PlatformEfCoreEntityExtensionMappings ObjectExtensionManager.Instance .MapEfCoreProperty( - PlatformConsts.Tenants.Address, + PlatformConsts.Tenants.Address1, (entityBuilder, propertyBuilder) => { propertyBuilder.HasMaxLength(256).HasDefaultValue(null); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021143137_Initial.Designer.cs similarity index 97% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021143137_Initial.Designer.cs index d21819b4..9debf848 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021143137_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251021124022_Initial")] + [Migration("20251021143137_Initial")] partial class Initial { /// @@ -1013,11 +1013,11 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("AddressLine1") + b.Property("Address1") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); - b.Property("AddressLine2") + b.Property("Address2") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); @@ -1401,7 +1401,7 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("Address") + b.Property("Address1") .HasMaxLength(512) .HasColumnType("nvarchar(512)"); @@ -2387,6 +2387,8 @@ namespace Kurs.Platform.Migrations b.HasIndex("ParentCostCenterId"); + b.HasIndex("ResponsibleEmployeeId"); + b.ToTable("T_Hr_CostCenter", (string)null); }); @@ -3090,6 +3092,10 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("CostCenterId"); + + b.HasIndex("ManagerId"); + b.HasIndex("ParentDepartmentId"); b.ToTable("T_Hr_Department", (string)null); @@ -3320,6 +3326,175 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_EducationStatus", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("Address2") + .HasColumnType("nvarchar(max)"); + + b.Property("Avatar") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("BadgeId") + .HasColumnType("uniqueidentifier"); + + b.Property("BankAccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("BaseSalary") + .HasColumnType("int"); + + b.Property("BirthDate") + .HasColumnType("datetime2"); + + b.Property("City") + .HasColumnType("nvarchar(max)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Country") + .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("DepartmantId") + .HasColumnType("uniqueidentifier"); + + b.Property("District") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EmergencyContactName") + .HasColumnType("nvarchar(max)"); + + b.Property("EmergencyContactPhone") + .HasColumnType("nvarchar(max)"); + + b.Property("EmergencyContactRelationship") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("EmploymentTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("FullName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Gender") + .HasColumnType("nvarchar(max)"); + + b.Property("HireDate") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JobPositionId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ManagerId") + .HasColumnType("uniqueidentifier"); + + b.Property("MaritalStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("NationalId") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PayrollGroup") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PersonalPhone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Phone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PostalCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Street") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TerminationDate") + .HasColumnType("datetime2"); + + b.Property("WorkLocation") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("BadgeId"); + + b.HasIndex("BankAccountId"); + + b.HasIndex("DepartmantId"); + + b.HasIndex("JobPositionId"); + + b.HasIndex("ManagerId"); + + b.ToTable("T_Hr_Employee", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.EmploymentType", b => { b.Property("Id") @@ -5190,7 +5365,7 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("Address") + b.Property("Address1") .HasMaxLength(512) .HasColumnType("nvarchar(512)"); @@ -9280,7 +9455,7 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("Address") + b.Property("Address1") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); @@ -9609,9 +9784,15 @@ namespace Kurs.Platform.Migrations .WithMany("SubCostCenters") .HasForeignKey("ParentCostCenterId"); + b.HasOne("Kurs.Platform.Entities.Employee", "ResponsibleEmployee") + .WithMany() + .HasForeignKey("ResponsibleEmployeeId"); + b.Navigation("Department"); b.Navigation("ParentCostCenter"); + + b.Navigation("ResponsibleEmployee"); }); modelBuilder.Entity("Kurs.Platform.Entities.Country", b => @@ -9636,11 +9817,25 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Department", b => { + b.HasOne("Kurs.Platform.Entities.CostCenter", "CostCenter") + .WithMany() + .HasForeignKey("CostCenterId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Kurs.Platform.Entities.Employee", "Manager") + .WithMany() + .HasForeignKey("ManagerId") + .OnDelete(DeleteBehavior.Restrict); + b.HasOne("Kurs.Platform.Entities.Department", "ParentDepartment") .WithMany("SubDepartments") .HasForeignKey("ParentDepartmentId") .OnDelete(DeleteBehavior.Restrict); + b.Navigation("CostCenter"); + + b.Navigation("Manager"); + b.Navigation("ParentDepartment"); }); @@ -9651,6 +9846,46 @@ namespace Kurs.Platform.Migrations .HasForeignKey("CityId"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Employee", b => + { + b.HasOne("Kurs.Platform.Entities.Badge", "Badge") + .WithMany() + .HasForeignKey("BadgeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Platform.Entities.BankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Kurs.Platform.Entities.Department", "Department") + .WithMany() + .HasForeignKey("DepartmantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Platform.Entities.JobPosition", "JobPosition") + .WithMany() + .HasForeignKey("JobPositionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Platform.Entities.Employee", "Manager") + .WithMany() + .HasForeignKey("ManagerId"); + + b.Navigation("Badge"); + + b.Navigation("BankAccount"); + + b.Navigation("Department"); + + b.Navigation("JobPosition"); + + b.Navigation("Manager"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Event", b => { b.HasOne("Kurs.Platform.Entities.EventCategory", "Category") diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021143137_Initial.cs similarity index 96% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021143137_Initial.cs index 5246cbfb..49200298 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021124022_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251021143137_Initial.cs @@ -341,7 +341,7 @@ namespace Kurs.Platform.Migrations Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), NormalizedName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), EntityVersion = table.Column(type: "int", nullable: false), - Address = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + Address1 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Address2 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), @@ -1070,8 +1070,8 @@ namespace Kurs.Platform.Migrations BranchId = table.Column(type: "uniqueidentifier", nullable: true), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), IdentifierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - AddressLine1 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - AddressLine2 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + Address1 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + Address2 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), @@ -1380,7 +1380,7 @@ namespace Kurs.Platform.Migrations Founder = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), VknTckn = table.Column(type: "bigint", nullable: false), TaxOffice = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - Address = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Address1 = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), Address2 = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), @@ -1778,39 +1778,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_T_Hr_Badge", x => x.Id); }); - migrationBuilder.CreateTable( - name: "T_Hr_Department", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Code = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), - Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), - ParentDepartmentId = table.Column(type: "uniqueidentifier", nullable: true), - ManagerId = table.Column(type: "uniqueidentifier", nullable: true), - CostCenterId = table.Column(type: "uniqueidentifier", nullable: true), - Budget = table.Column(type: "int", nullable: false, defaultValue: 0), - 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_Department", x => x.Id); - table.ForeignKey( - name: "FK_T_Hr_Department_T_Hr_Department_ParentDepartmentId", - column: x => x.ParentDepartmentId, - principalTable: "T_Hr_Department", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - migrationBuilder.CreateTable( name: "T_Hr_EmploymentType", columns: table => new @@ -2029,7 +1996,7 @@ namespace Kurs.Platform.Migrations City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Street = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - Address = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Address1 = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), Address2 = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), PostalCode = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), Phone = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), @@ -3244,47 +3211,6 @@ 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 @@ -3831,6 +3757,163 @@ namespace Kurs.Platform.Migrations principalColumn: "Id"); }); + 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"); + }); + + migrationBuilder.CreateTable( + name: "T_Hr_Department", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + ParentDepartmentId = table.Column(type: "uniqueidentifier", nullable: true), + ManagerId = table.Column(type: "uniqueidentifier", nullable: true), + CostCenterId = table.Column(type: "uniqueidentifier", nullable: true), + Budget = table.Column(type: "int", nullable: false, defaultValue: 0), + 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_Department", x => x.Id); + table.ForeignKey( + name: "FK_T_Hr_Department_T_Hr_CostCenter_CostCenterId", + column: x => x.CostCenterId, + principalTable: "T_Hr_CostCenter", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_T_Hr_Department_T_Hr_Department_ParentDepartmentId", + column: x => x.ParentDepartmentId, + principalTable: "T_Hr_Department", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "T_Hr_Employee", + 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), + FullName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Avatar = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), + NationalId = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + BirthDate = table.Column(type: "datetime2", nullable: false), + Gender = table.Column(type: "nvarchar(max)", nullable: true), + MaritalStatus = table.Column(type: "nvarchar(max)", nullable: true), + Country = table.Column(type: "nvarchar(max)", nullable: true), + City = table.Column(type: "nvarchar(max)", nullable: true), + District = table.Column(type: "nvarchar(max)", nullable: true), + Street = table.Column(type: "nvarchar(max)", nullable: true), + PostalCode = table.Column(type: "nvarchar(max)", nullable: true), + Phone = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PersonalPhone = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Email = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Address = table.Column(type: "nvarchar(max)", nullable: true), + Address2 = table.Column(type: "nvarchar(max)", nullable: true), + EmergencyContactName = table.Column(type: "nvarchar(max)", nullable: true), + EmergencyContactRelationship = table.Column(type: "nvarchar(max)", nullable: true), + EmergencyContactPhone = table.Column(type: "nvarchar(max)", nullable: true), + HireDate = table.Column(type: "datetime2", nullable: false), + TerminationDate = table.Column(type: "datetime2", nullable: true), + EmploymentTypeId = table.Column(type: "uniqueidentifier", nullable: false), + JobPositionId = table.Column(type: "uniqueidentifier", nullable: false), + DepartmantId = table.Column(type: "uniqueidentifier", nullable: false), + WorkLocation = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + ManagerId = table.Column(type: "uniqueidentifier", nullable: true), + BaseSalary = table.Column(type: "int", nullable: false), + CurrencyId = table.Column(type: "uniqueidentifier", nullable: false), + PayrollGroup = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + BankAccountId = table.Column(type: "uniqueidentifier", nullable: false), + BadgeId = table.Column(type: "uniqueidentifier", nullable: false), + EmployeeStatus = table.Column(type: "nvarchar(max)", 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_Employee", x => x.Id); + table.ForeignKey( + name: "FK_T_Hr_Employee_T_Acc_BankAccount_BankAccountId", + column: x => x.BankAccountId, + principalTable: "T_Acc_BankAccount", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_T_Hr_Employee_T_Hr_Badge_BadgeId", + column: x => x.BadgeId, + principalTable: "T_Hr_Badge", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_T_Hr_Employee_T_Hr_Department_DepartmantId", + column: x => x.DepartmantId, + principalTable: "T_Hr_Department", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_T_Hr_Employee_T_Hr_Employee_ManagerId", + column: x => x.ManagerId, + principalTable: "T_Hr_Employee", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_T_Hr_Employee_T_Hr_JobPosition_JobPositionId", + column: x => x.JobPositionId, + principalTable: "T_Hr_JobPosition", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_AuditLogId", table: "AbpAuditLogActions", @@ -4390,11 +4473,51 @@ namespace Kurs.Platform.Migrations table: "T_Hr_CostCenter", column: "ParentCostCenterId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_CostCenter_ResponsibleEmployeeId", + table: "T_Hr_CostCenter", + column: "ResponsibleEmployeeId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Department_CostCenterId", + table: "T_Hr_Department", + column: "CostCenterId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Department_ManagerId", + table: "T_Hr_Department", + column: "ManagerId"); + migrationBuilder.CreateIndex( name: "IX_T_Hr_Department_ParentDepartmentId", table: "T_Hr_Department", column: "ParentDepartmentId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Employee_BadgeId", + table: "T_Hr_Employee", + column: "BadgeId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Employee_BankAccountId", + table: "T_Hr_Employee", + column: "BankAccountId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Employee_DepartmantId", + table: "T_Hr_Employee", + column: "DepartmantId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Employee_JobPositionId", + table: "T_Hr_Employee", + column: "JobPositionId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Employee_ManagerId", + table: "T_Hr_Employee", + column: "ManagerId"); + migrationBuilder.CreateIndex( name: "IX_T_Sas_ApiEndpoint_EntityId", table: "T_Sas_ApiEndpoint", @@ -4424,11 +4547,49 @@ namespace Kurs.Platform.Migrations name: "IX_T_Sas_ReportTemplate_CategoryId", table: "T_Sas_ReportTemplate", column: "CategoryId"); + + migrationBuilder.AddForeignKey( + name: "FK_T_Hr_CostCenter_T_Hr_Department_DepartmentId", + table: "T_Hr_CostCenter", + column: "DepartmentId", + principalTable: "T_Hr_Department", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_T_Hr_CostCenter_T_Hr_Employee_ResponsibleEmployeeId", + table: "T_Hr_CostCenter", + column: "ResponsibleEmployeeId", + principalTable: "T_Hr_Employee", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_T_Hr_Department_T_Hr_Employee_ManagerId", + table: "T_Hr_Department", + column: "ManagerId", + principalTable: "T_Hr_Employee", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); } /// protected override void Down(MigrationBuilder migrationBuilder) { + migrationBuilder.DropForeignKey( + name: "FK_T_Acc_BankAccount_P_Sas_Currency_CurrencyId", + table: "T_Acc_BankAccount"); + + migrationBuilder.DropForeignKey( + name: "FK_T_Acc_BankAccount_T_Acc_Bank_BankId", + table: "T_Acc_BankAccount"); + + migrationBuilder.DropForeignKey( + name: "FK_T_Hr_CostCenter_T_Hr_Department_DepartmentId", + table: "T_Hr_CostCenter"); + + migrationBuilder.DropForeignKey( + name: "FK_T_Hr_Employee_T_Hr_Department_DepartmantId", + table: "T_Hr_Employee"); + migrationBuilder.DropTable( name: "AbpAuditLogActions"); @@ -4573,9 +4734,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "P_Sas_Route"); - migrationBuilder.DropTable( - name: "T_Acc_BankAccount"); - migrationBuilder.DropTable( name: "T_Adm_About"); @@ -4666,18 +4824,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Crd_QuestionTag"); - migrationBuilder.DropTable( - name: "T_Hr_Badge"); - - migrationBuilder.DropTable( - name: "T_Hr_CostCenter"); - migrationBuilder.DropTable( name: "T_Hr_EmploymentType"); - migrationBuilder.DropTable( - name: "T_Hr_JobPosition"); - migrationBuilder.DropTable( name: "T_P_Activity"); @@ -4780,12 +4929,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "P_Sas_ListFormImport"); - migrationBuilder.DropTable( - name: "P_Sas_Currency"); - - migrationBuilder.DropTable( - name: "T_Acc_Bank"); - migrationBuilder.DropTable( name: "T_Adm_BlogCategory"); @@ -4807,9 +4950,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Crd_Question"); - migrationBuilder.DropTable( - name: "T_Hr_Department"); - migrationBuilder.DropTable( name: "T_Sas_CustomEntity"); @@ -4851,6 +4991,30 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "P_Sas_CountryGroup"); + + migrationBuilder.DropTable( + name: "P_Sas_Currency"); + + migrationBuilder.DropTable( + name: "T_Acc_Bank"); + + migrationBuilder.DropTable( + name: "T_Hr_Department"); + + migrationBuilder.DropTable( + name: "T_Hr_CostCenter"); + + migrationBuilder.DropTable( + name: "T_Hr_Employee"); + + migrationBuilder.DropTable( + name: "T_Acc_BankAccount"); + + migrationBuilder.DropTable( + name: "T_Hr_Badge"); + + migrationBuilder.DropTable( + name: "T_Hr_JobPosition"); } } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 373d2401..a5be42f1 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -1010,11 +1010,11 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("AddressLine1") + b.Property("Address1") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); - b.Property("AddressLine2") + b.Property("Address2") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); @@ -1398,7 +1398,7 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("Address") + b.Property("Address1") .HasMaxLength(512) .HasColumnType("nvarchar(512)"); @@ -2384,6 +2384,8 @@ namespace Kurs.Platform.Migrations b.HasIndex("ParentCostCenterId"); + b.HasIndex("ResponsibleEmployeeId"); + b.ToTable("T_Hr_CostCenter", (string)null); }); @@ -3087,6 +3089,10 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("CostCenterId"); + + b.HasIndex("ManagerId"); + b.HasIndex("ParentDepartmentId"); b.ToTable("T_Hr_Department", (string)null); @@ -3317,6 +3323,175 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_EducationStatus", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("Address2") + .HasColumnType("nvarchar(max)"); + + b.Property("Avatar") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("BadgeId") + .HasColumnType("uniqueidentifier"); + + b.Property("BankAccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("BaseSalary") + .HasColumnType("int"); + + b.Property("BirthDate") + .HasColumnType("datetime2"); + + b.Property("City") + .HasColumnType("nvarchar(max)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Country") + .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("DepartmantId") + .HasColumnType("uniqueidentifier"); + + b.Property("District") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EmergencyContactName") + .HasColumnType("nvarchar(max)"); + + b.Property("EmergencyContactPhone") + .HasColumnType("nvarchar(max)"); + + b.Property("EmergencyContactRelationship") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("EmploymentTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("FullName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Gender") + .HasColumnType("nvarchar(max)"); + + b.Property("HireDate") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JobPositionId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ManagerId") + .HasColumnType("uniqueidentifier"); + + b.Property("MaritalStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("NationalId") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PayrollGroup") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PersonalPhone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Phone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PostalCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Street") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TerminationDate") + .HasColumnType("datetime2"); + + b.Property("WorkLocation") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("BadgeId"); + + b.HasIndex("BankAccountId"); + + b.HasIndex("DepartmantId"); + + b.HasIndex("JobPositionId"); + + b.HasIndex("ManagerId"); + + b.ToTable("T_Hr_Employee", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.EmploymentType", b => { b.Property("Id") @@ -5187,7 +5362,7 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("Address") + b.Property("Address1") .HasMaxLength(512) .HasColumnType("nvarchar(512)"); @@ -9277,7 +9452,7 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("Address") + b.Property("Address1") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); @@ -9606,9 +9781,15 @@ namespace Kurs.Platform.Migrations .WithMany("SubCostCenters") .HasForeignKey("ParentCostCenterId"); + b.HasOne("Kurs.Platform.Entities.Employee", "ResponsibleEmployee") + .WithMany() + .HasForeignKey("ResponsibleEmployeeId"); + b.Navigation("Department"); b.Navigation("ParentCostCenter"); + + b.Navigation("ResponsibleEmployee"); }); modelBuilder.Entity("Kurs.Platform.Entities.Country", b => @@ -9633,11 +9814,25 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Department", b => { + b.HasOne("Kurs.Platform.Entities.CostCenter", "CostCenter") + .WithMany() + .HasForeignKey("CostCenterId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Kurs.Platform.Entities.Employee", "Manager") + .WithMany() + .HasForeignKey("ManagerId") + .OnDelete(DeleteBehavior.Restrict); + b.HasOne("Kurs.Platform.Entities.Department", "ParentDepartment") .WithMany("SubDepartments") .HasForeignKey("ParentDepartmentId") .OnDelete(DeleteBehavior.Restrict); + b.Navigation("CostCenter"); + + b.Navigation("Manager"); + b.Navigation("ParentDepartment"); }); @@ -9648,6 +9843,46 @@ namespace Kurs.Platform.Migrations .HasForeignKey("CityId"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Employee", b => + { + b.HasOne("Kurs.Platform.Entities.Badge", "Badge") + .WithMany() + .HasForeignKey("BadgeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Platform.Entities.BankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Kurs.Platform.Entities.Department", "Department") + .WithMany() + .HasForeignKey("DepartmantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Platform.Entities.JobPosition", "JobPosition") + .WithMany() + .HasForeignKey("JobPositionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Platform.Entities.Employee", "Manager") + .WithMany() + .HasForeignKey("ManagerId"); + + b.Navigation("Badge"); + + b.Navigation("BankAccount"); + + b.Navigation("Department"); + + b.Navigation("JobPosition"); + + b.Navigation("Manager"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Event", b => { b.HasOne("Kurs.Platform.Entities.EventCategory", "Category") diff --git a/ui/src/components/orders/PaymentForm.tsx b/ui/src/components/orders/PaymentForm.tsx index e3a6eb19..b8d879b5 100644 --- a/ui/src/components/orders/PaymentForm.tsx +++ b/ui/src/components/orders/PaymentForm.tsx @@ -182,7 +182,7 @@ export const PaymentForm: React.FC = ({ {translate('::Public.payment.customer.address')}: -
{tenant.address}
+
{tenant.address1}
diff --git a/ui/src/components/orders/TenantForm.tsx b/ui/src/components/orders/TenantForm.tsx index f08d7d4c..5f42db70 100644 --- a/ui/src/components/orders/TenantForm.tsx +++ b/ui/src/components/orders/TenantForm.tsx @@ -54,7 +54,7 @@ export const TenantForm: React.FC = ({ onSubmit }) => { founder: tenant.data.founder, vknTckn: tenant.data.vknTckn, taxOffice: tenant.data.taxOffice, - address: tenant.data.address, + address1: tenant.data.address1, address2: tenant.data.address2, district: tenant.data.district, country: tenant.data.country, @@ -196,7 +196,7 @@ export const TenantForm: React.FC = ({ onSubmit }) => { {translate('::Public.products.tenantForm.address')}: -
{formData.address}
+
{formData.address1}
@@ -342,8 +342,8 @@ export const TenantForm: React.FC = ({ onSubmit }) => {