From 1806cd4b263f88ef5ff5ba3ab28bbabe5a115a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Fri, 24 Oct 2025 12:21:33 +0300 Subject: [PATCH] Hr Training ve Certificate --- .../Seeds/HostData.json | 580 ++-- .../Seeds/ListFormsSeeder.cs | 2391 +++++++++++------ .../Enums/TableNameEnum.cs | 4 +- .../PlatformConsts.cs | 15 +- .../TableNameResolver.cs | 8 +- .../Kurs.Platform.Domain/Data/SeedConsts.cs | 10 +- .../Entities/Tenant/Hr/Certificate.cs | 19 + .../Entities/Tenant/Hr/Training.cs | 28 + .../EntityFrameworkCore/PlatformDbContext.cs | 36 + ....cs => 20251024083852_Initial.Designer.cs} | 192 +- ...3_Initial.cs => 20251024083852_Initial.cs} | 374 +-- .../PlatformDbContextModelSnapshot.cs | 190 +- .../Tenants/Seeds/TenantData.json | 75 +- .../Tenants/TenantDataSeeder.cs | 28 +- .../Tenants/TenantSeederDto.cs | 17 + ui/src/mocks/mockIntranet.ts | 195 +- .../DialogContext/DialogShowComponent.tsx | 8 + 17 files changed, 2789 insertions(+), 1381 deletions(-) create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Certificate.cs create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Training.cs rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251023210323_Initial.Designer.cs => 20251024083852_Initial.Designer.cs} (98%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251023210323_Initial.cs => 20251024083852_Initial.cs} (98%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json index 0b3bec8a..1ddaf8fa 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json @@ -1179,8 +1179,8 @@ { "resourceName": "Platform", "key": "App.Hr", - "en": "HR", - "tr": "İK" + "en": "Hr", + "tr": "İk" }, { "resourceName": "Platform", @@ -7593,16 +7593,34 @@ }, { "resourceName": "Platform", - "key": "App.Definitions.EventType", + "key": "App.Hr.Events", + "tr": "Etkinlikler", + "en": "Events" + }, + { + "resourceName": "Platform", + "key": "App.Hr.Events.EventType", "tr": "Etkinlik Türleri", "en": "Event Types" }, { "resourceName": "Platform", - "key": "App.Definitions.EventCategory", + "key": "App.Hr.Events.EventCategory", "tr": "Etkinlik Kategorisi", "en": "Event Category" }, + { + "resourceName": "Platform", + "key": "App.Hr.Events.Event", + "tr": "Etkinlikler", + "en": "Events" + }, + { + "resourceName": "Platform", + "key": "App.Hr.Training", + "tr": "Eğitimler", + "en": "Trainings" + }, { "resourceName": "Platform", "key": "App.Definitions.Information", @@ -7705,12 +7723,6 @@ "tr": "Avukatlar", "en": "Lawyers" }, - { - "resourceName": "Platform", - "key": "App.Definitions.Event", - "tr": "Etkinlikler", - "en": "Events" - }, { "resourceName": "Platform", "key": "App.Definitions.LessonPeriod", @@ -9484,14 +9496,14 @@ { "resourceName": "Platform", "key": "Public.products.hr.desc", - "tr": "İK süreçlerinizi dijitalleştirin.", - "en": "Digitize your HR processes." + "tr": "İk süreçlerinizi dijitalleştirin.", + "en": "Digitize your Hr processes." }, { "resourceName": "Platform", "key": "Public.products.hr.features.digital", - "tr": "Dijital İK Süreçleri", - "en": "Digital HR Processes" + "tr": "Dijital İk Süreçleri", + "en": "Digital Hr Processes" }, { "resourceName": "Platform", @@ -12059,7 +12071,7 @@ "resourceName": "Platform", "key": "App.Hr.Department", "tr": "Departmanlar", - "en": "Department" + "en": "Departments" }, { "resourceName": "Platform", @@ -12083,7 +12095,7 @@ "resourceName": "Platform", "key": "App.Hr.Badge", "tr": "Rozetler", - "en": "Badge" + "en": "Badges" }, { "resourceName": "Platform", @@ -12125,7 +12137,7 @@ "resourceName": "Platform", "key": "App.Crm.Customer", "tr": "Müşteriler", - "en": "Customer" + "en": "Customers" }, { "resourceName": "Platform", @@ -12143,7 +12155,7 @@ "resourceName": "Platform", "key": "App.Crm.Opportunity", "tr": "Fırsatlar", - "en": "Opportunity" + "en": "Opportunities" }, { "resourceName": "Platform", @@ -12167,13 +12179,13 @@ "resourceName": "Platform", "key": "App.Mrp.Workcenter", "tr": "İş Merkezleri", - "en": "Workcenter" + "en": "Workcenters" }, { "resourceName": "Platform", "key": "App.Mrp.Operation", "tr": "Operasyonlar", - "en": "Operation" + "en": "Operations" }, { "resourceName": "Platform", @@ -12221,13 +12233,13 @@ "resourceName": "Platform", "key": "App.Accounting.Waybill", "tr": "İrsaliyeler", - "en": "Waybill" + "en": "Waybills" }, { "resourceName": "Platform", "key": "App.Accounting.Invoice", "tr": "Faturalar", - "en": "Invoice" + "en": "Invoices" }, { "resourceName": "Platform", @@ -14172,36 +14184,6 @@ "RequiredPermissionName": "App.Definitions.EducationStatus", "IsDisabled": false }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.EventType", - "DisplayName": "App.Definitions.EventType", - "Order": 9, - "Url": "/admin/list/list-eventtype", - "Icon": "FcPlanner", - "RequiredPermissionName": "App.Definitions.EventType", - "IsDisabled": false - }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.EventCategory", - "DisplayName": "App.Definitions.EventCategory", - "Order": 10, - "Url": "/admin/list/list-eventcategory", - "Icon": "FcTreeStructure", - "RequiredPermissionName": "App.Definitions.EventCategory", - "IsDisabled": false - }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.Event", - "DisplayName": "App.Definitions.Event", - "Order": 11, - "Url": "/admin/list/list-event", - "Icon": "FcCalendar", - "RequiredPermissionName": "App.Definitions.Event", - "IsDisabled": false - }, { "ParentCode": "App.Definitions", "Code": "App.Definitions.Vaccine", @@ -15063,6 +15045,58 @@ "RequiredPermissionName": "App.Hr.Performance360", "IsDisabled": false }, + { + "ParentCode": "App.Hr", + "Code": "App.Hr.Events", + "DisplayName": "App.Hr.Events", + "Order": 13, + "Url": null, + "Icon": "FcTodoList", + "RequiredPermissionName": null, + "IsDisabled": false + }, + + { + "ParentCode": "App.Hr.Events", + "Code": "App.Hr.Events.EventType", + "DisplayName": "App.Hr.Events.EventType", + "Order": 1, + "Url": "/admin/list/list-eventtype", + "Icon": "FcPlanner", + "RequiredPermissionName": "App.Hr.Events.EventType", + "IsDisabled": false + }, + { + "ParentCode": "App.Hr.Events", + "Code": "App.Hr.Events.EventCategory", + "DisplayName": "App.Hr.Events.EventCategory", + "Order": 2, + "Url": "/admin/list/list-eventcategory", + "Icon": "FcTreeStructure", + "RequiredPermissionName": "App.Hr.Events.EventCategory", + "IsDisabled": false + }, + { + "ParentCode": "App.Hr.Events", + "Code": "App.Hr.Events.Event", + "DisplayName": "App.Hr.Events.Event", + "Order": 3, + "Url": "/admin/list/list-event", + "Icon": "FcCalendar", + "RequiredPermissionName": "App.Hr.Events.Event", + "IsDisabled": false + }, + { + "ParentCode": "App.Hr", + "Code": "App.Hr.Training", + "DisplayName": "App.Hr.Training", + "Order": 14, + "Url": "/admin/list/list-training", + "Icon": "FcGraduationCap", + "RequiredPermissionName": "App.Hr.Training", + "IsDisabled": false + }, + { "ParentCode": null, "Code": "App.Mrp", @@ -20213,195 +20247,6 @@ "MultiTenancySide": 3, "MenuGroup": "Kurs" }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventType", - "ParentName": null, - "DisplayName": "App.Definitions.EventType", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventType.Create", - "ParentName": "App.Definitions.EventType", - "DisplayName": "Create", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventType.Update", - "ParentName": "App.Definitions.EventType", - "DisplayName": "Update", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventType.Delete", - "ParentName": "App.Definitions.EventType", - "DisplayName": "Delete", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventType.Export", - "ParentName": "App.Definitions.EventType", - "DisplayName": "Export", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventType.Import", - "ParentName": "App.Definitions.EventType", - "DisplayName": "Import", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventType.Activity", - "ParentName": "App.Definitions.EventType", - "DisplayName": "Activity", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventCategory", - "ParentName": null, - "DisplayName": "App.Definitions.EventCategory", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventCategory.Create", - "ParentName": "App.Definitions.EventCategory", - "DisplayName": "Create", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventCategory.Update", - "ParentName": "App.Definitions.EventCategory", - "DisplayName": "Update", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventCategory.Delete", - "ParentName": "App.Definitions.EventCategory", - "DisplayName": "Delete", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventCategory.Export", - "ParentName": "App.Definitions.EventCategory", - "DisplayName": "Export", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventCategory.Import", - "ParentName": "App.Definitions.EventCategory", - "DisplayName": "Import", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.EventCategory.Activity", - "ParentName": "App.Definitions.EventCategory", - "DisplayName": "Activity", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Event", - "ParentName": null, - "DisplayName": "App.Definitions.Event", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Event.Create", - "ParentName": "App.Definitions.Event", - "DisplayName": "Create", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Event.Update", - "ParentName": "App.Definitions.Event", - "DisplayName": "Update", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Event.Delete", - "ParentName": "App.Definitions.Event", - "DisplayName": "Delete", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Event.Export", - "ParentName": "App.Definitions.Event", - "DisplayName": "Export", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Event.Import", - "ParentName": "App.Definitions.Event", - "DisplayName": "Import", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Event.Activity", - "ParentName": "App.Definitions.Event", - "DisplayName": "Activity", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, { "GroupName": "App.Administration", "Name": "App.Definitions.Vaccine", @@ -24761,6 +24606,259 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventType", + "ParentName": null, + "DisplayName": "App.Hr.Events.EventType", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventType.Create", + "ParentName": "App.Hr.Events.EventType", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventType.Update", + "ParentName": "App.Hr.Events.EventType", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventType.Delete", + "ParentName": "App.Hr.Events.EventType", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventType.Export", + "ParentName": "App.Hr.Events.EventType", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventType.Import", + "ParentName": "App.Hr.Events.EventType", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventType.Activity", + "ParentName": "App.Hr.Events.EventType", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventCategory", + "ParentName": null, + "DisplayName": "App.Hr.Events.EventCategory", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventCategory.Create", + "ParentName": "App.Hr.Events.EventCategory", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventCategory.Update", + "ParentName": "App.Hr.Events.EventCategory", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventCategory.Delete", + "ParentName": "App.Hr.Events.EventCategory", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventCategory.Export", + "ParentName": "App.Hr.Events.EventCategory", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventCategory.Import", + "ParentName": "App.Hr.Events.EventCategory", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.EventCategory.Activity", + "ParentName": "App.Hr.Events.EventCategory", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.Event", + "ParentName": null, + "DisplayName": "App.Hr.Events.Event", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.Event.Create", + "ParentName": "App.Hr.Events.Event", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.Event.Update", + "ParentName": "App.Hr.Events.Event", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.Event.Delete", + "ParentName": "App.Hr.Events.Event", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.Event.Export", + "ParentName": "App.Hr.Events.Event", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.Event.Import", + "ParentName": "App.Hr.Events.Event", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Events.Event.Activity", + "ParentName": "App.Hr.Events.Event", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Training", + "ParentName": null, + "DisplayName": "App.Hr.Training", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Training.Create", + "ParentName": "App.Hr.Training", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Training.Update", + "ParentName": "App.Hr.Training", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Training.Delete", + "ParentName": "App.Hr.Training", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Training.Export", + "ParentName": "App.Hr.Training", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Training.Import", + "ParentName": "App.Hr.Training", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Training.Activity", + "ParentName": "App.Hr.Training", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { "GroupName": "App.Crm", "Name": "App.Crm.Customer", diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 5fb2bf14..d72e303a 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -21004,868 +21004,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion - #region EventType - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.EventType)) - { - var listFormEventType = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 3 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.EventType, - Name = AppCodes.Definitions.EventType, - Title = AppCodes.Definitions.EventType, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.EventType, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventType)), - 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.Definitions.EventType + ".Create", - R = AppCodes.Definitions.EventType, - U = AppCodes.Definitions.EventType + ".Update", - D = AppCodes.Definitions.EventType + ".Delete", - E = AppCodes.Definitions.EventType + ".Export", - I = AppCodes.Definitions.EventType + ".Import", - A = AppCodes.Definitions.EventType + ".Activity", - }), - DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventType))}\" 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 = "Event Type Form", - Width = 500, - Height = 250 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { - new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= - [ - new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - ] - } - }), - 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 } - }), - } - ); - - #region EventType Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new() { - ListFormCode = listFormEventType.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.EventType + ".Create", - R = AppCodes.Definitions.EventType, - U = AppCodes.Definitions.EventType + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormEventType.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 250, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - 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.Definitions.EventType + ".Create", - R = AppCodes.Definitions.EventType, - U = AppCodes.Definitions.EventType + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - } - }); - #endregion - } - #endregion - - #region EventCategory - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.EventCategory)) - { - var listFormEventCategory = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 3 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.EventCategory, - Name = AppCodes.Definitions.EventCategory, - Title = AppCodes.Definitions.EventCategory, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.EventCategory, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventCategory)), - 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.Definitions.EventCategory + ".Create", - R = AppCodes.Definitions.EventCategory, - U = AppCodes.Definitions.EventCategory + ".Update", - D = AppCodes.Definitions.EventCategory + ".Delete", - E = AppCodes.Definitions.EventCategory + ".Export", - I = AppCodes.Definitions.EventCategory + ".Import", - A = AppCodes.Definitions.EventCategory + ".Activity", - }), - DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventCategory))}\" 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 = "Event Category Form", - Width = 500, - Height = 250 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { - new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= - [ - new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - ] - } - }), - 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 } - }), - } - ); - - #region EventCategory Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new() { - ListFormCode = listFormEventCategory.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.EventCategory + ".Create", - R = AppCodes.Definitions.EventCategory, - U = AppCodes.Definitions.EventCategory + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormEventCategory.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 250, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - 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.Definitions.EventCategory + ".Create", - R = AppCodes.Definitions.EventCategory, - U = AppCodes.Definitions.EventCategory + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - } - }); - #endregion - } - #endregion - - #region Event - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Event)) - { - var listFormEvent = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - LayoutJson = JsonSerializer.Serialize(new LayoutDto() - { - Grid = true, - Card = true, - Pivot = true, - Chart = true, - DefaultLayout = "grid", - CardLayoutColumn = 3 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Event, - Name = AppCodes.Definitions.Event, - Title = AppCodes.Definitions.Event, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.Event, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Event)), - 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.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - D = AppCodes.Definitions.Event + ".Delete", - E = AppCodes.Definitions.Event + ".Export", - I = AppCodes.Definitions.Event + ".Import", - A = AppCodes.Definitions.Event + ".Activity", - }), - DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Event))}\" 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 = "Event Form", - Width = 650, - Height = 550 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() - { - new() - { - Order = 1, - ColCount = 1, - ColSpan = 2, - ItemType = "group", - Items = - [ - new EditingFormItemDto { Order = 1, DataField = "CategoryId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 2, DataField = "TypeId", 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 = "Place", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "OrganizerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 6, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, - new EditingFormItemDto { Order = 7, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 8, DataField = "ParticipantsCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 9, DataField = "Likes", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, - ] - } - }), - 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 } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "Status", - FieldDbType = DbType.String, - Value = "Aktif", - CustomValueType = FieldCustomValueTypeEnum.Value }, - }), - } - ); - - #region Event Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] - { - // Id - new() - { - ListFormCode = listFormEvent.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.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // CategoryId - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "CategoryId", - Width = 150, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] - { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = LookUpQueryValues.EventCategoryValues, - }), - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // TypeId - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "TypeId", - Width = 150, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] - { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } - }), - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = LookUpQueryValues.EventTypeValues, - }), - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // Name - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, - 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.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // Place - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Place", - Width = 200, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // Description - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Description", - Width = 300, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // OrganizerId - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "OrganizerId", - Width = 120, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "name", - ValueExpr = "key", - LookupQuery = LookUpQueryValues.UserValues - }), - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // ParticipantsCount - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Int32, - FieldName = "ParticipantsCount", - Width = 80, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // ParticipantsCount - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Int32, - FieldName = "Likes", - Width = 80, - ListOrderNo = 9, - Visible = true, - IsActive = true, - IsDeleted = false, - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // Status - new() - { - ListFormCode = listFormEvent.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Status", - Width = 120, - ListOrderNo = 10, - Visible = true, - IsActive = true, - IsDeleted = false, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.StaticData, - DisplayExpr = "name", - ValueExpr = "key", - LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key="Published",Name="Published" }, - new () { Key="Draft",Name="Draft" }, - new () { Key="Cancelled",Name="Cancelled" }, - }), - }), - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - } - }); - #endregion - } - #endregion - #region MeetingMethod if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.MeetingMethod)) { @@ -23190,9 +22328,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Definitions.Event + ".Create", - R = AppCodes.Definitions.Event, - U = AppCodes.Definitions.Event + ".Update", + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", E = true, I = true, Deny = false @@ -38136,6 +37274,1529 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region EventType + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.EventType)) + { + var listFormEventType = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.EventType, + Name = AppCodes.Hr.EventType, + Title = AppCodes.Hr.EventType, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.EventType, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventType)), + 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.EventType + ".Create", + R = AppCodes.Hr.EventType, + U = AppCodes.Hr.EventType + ".Update", + D = AppCodes.Hr.EventType + ".Delete", + E = AppCodes.Hr.EventType + ".Export", + I = AppCodes.Hr.EventType + ".Import", + A = AppCodes.Hr.EventType + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventType))}\" 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 = "Event Type Form", + Width = 500, + Height = 250 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + ] + } + }), + 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 } + }), + } + ); + + #region EventType Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listFormEventType.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.EventType + ".Create", + R = AppCodes.Hr.EventType, + U = AppCodes.Hr.EventType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEventType.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 250, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + 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.EventType + ".Create", + R = AppCodes.Hr.EventType, + U = AppCodes.Hr.EventType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + } + }); + #endregion + } + #endregion + + #region EventCategory + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.EventCategory)) + { + var listFormEventCategory = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.EventCategory, + Name = AppCodes.Hr.EventCategory, + Title = AppCodes.Hr.EventCategory, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.EventCategory, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventCategory)), + 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.EventCategory + ".Create", + R = AppCodes.Hr.EventCategory, + U = AppCodes.Hr.EventCategory + ".Update", + D = AppCodes.Hr.EventCategory + ".Delete", + E = AppCodes.Hr.EventCategory + ".Export", + I = AppCodes.Hr.EventCategory + ".Import", + A = AppCodes.Hr.EventCategory + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventCategory))}\" 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 = "Event Category Form", + Width = 500, + Height = 250 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + ] + } + }), + 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 } + }), + } + ); + + #region EventCategory Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listFormEventCategory.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.EventCategory + ".Create", + R = AppCodes.Hr.EventCategory, + U = AppCodes.Hr.EventCategory + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormEventCategory.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 250, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + 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.EventCategory + ".Create", + R = AppCodes.Hr.EventCategory, + U = AppCodes.Hr.EventCategory + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + } + }); + #endregion + } + #endregion + + #region Event + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Event)) + { + var listFormEvent = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Event, + Name = AppCodes.Hr.Event, + Title = AppCodes.Hr.Event, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.Event, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Event)), + 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.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + D = AppCodes.Hr.Event + ".Delete", + E = AppCodes.Hr.Event + ".Export", + I = AppCodes.Hr.Event + ".Import", + A = AppCodes.Hr.Event + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Event))}\" 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 = "Event Form", + Width = 650, + Height = 550 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 1, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "CategoryId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "TypeId", 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 = "Place", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "OrganizerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 7, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 8, DataField = "ParticipantsCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 9, DataField = "Likes", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + ] + } + }), + 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 } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "Status", + FieldDbType = DbType.String, + Value = "Aktif", + CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + } + ); + + #region Event Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormEvent.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.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // CategoryId + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "CategoryId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = LookUpQueryValues.EventCategoryValues, + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // TypeId + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "TypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = LookUpQueryValues.EventTypeValues, + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + 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.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Place + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Place", + Width = 200, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Description + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 400, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // OrganizerId + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "OrganizerId", + Width = 150, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.UserValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // ParticipantsCount + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "ParticipantsCount", + Width = 80, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // ParticipantsCount + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Likes", + Width = 80, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 120, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key="Published",Name="Published" }, + new () { Key="Draft",Name="Draft" }, + new () { Key="Cancelled",Name="Cancelled" }, + }), + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Event + ".Create", + R = AppCodes.Hr.Event, + U = AppCodes.Hr.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + }); + #endregion + } + #endregion + + #region Trainings + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Training)) + { + var listFormTraining = 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.Training, + Name = AppCodes.Hr.Training, + Title = AppCodes.Hr.Training, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.Training, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Training)), + 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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + D = AppCodes.Hr.Training + ".Delete", + E = AppCodes.Hr.Training + ".Export", + I = AppCodes.Hr.Training + ".Import", + A = AppCodes.Hr.Training + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Training))}\" 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 = "Training Form", + Width = 400, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Title", IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Description", EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 3, DataField = "Instructor", IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Category", IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField = "Type", IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField = "Location", IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField = "Thumbnail", EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 8, DataField = "Duration", IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 9, DataField = "StartDate", IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 10, DataField = "EndDate", IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 11, DataField = "MaxParticipants", EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 12, DataField = "Status", EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { + FieldName = "Status", + FieldDbType = DbType.String, + Value = "upcoming", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "MaxParticipants", + FieldDbType = DbType.Int32, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new CommandColumnDto() { + Hint = "Sertifikalar", + Text = "Sertifikalar", + AuthName = AppCodes.Hr.Training + ".Update", + DialogName = "TrainingCertificates", + DialogParameters = JsonSerializer.Serialize(new { + name = "@Email", + id = "@Id" + }) + }, + }), + } + ); + + #region Training Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormTraining.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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Title", + Width = 200, + ListOrderNo = 2, + 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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Instructor", + Width = 100, + ListOrderNo = 4, + 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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Category", + Width = 100, + ListOrderNo = 5, + 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= "technical", Name= "Technical" }, + new () { Key= "soft-skills", Name= "Soft Skills" }, + new () { Key= "management", Name="Management" }, + new () { Key= "compliance", Name="Compliance" }, + new () { Key= "other", Name="Other" } + }), + }), + 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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Type", + Width = 100, + ListOrderNo = 6, + 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= "online", Name= "Online" }, + new () { Key= "classroom", Name= "Classroom" }, + new () { Key= "hybrid", Name="Hybrid" }, + }), + }), + 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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Location", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Thumbnail", + Width = 400, + 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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Duration", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "StartDate", + Width = 100, + ListOrderNo = 10, + 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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "EndDate", + Width = 100, + ListOrderNo = 11, + 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.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "MaxParticipants", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Enrolled", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormTraining.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 100, + ListOrderNo = 17, + 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= "upcoming", Name= "Upcoming" }, + new () { Key= "ongoing", Name= "Ongoing" }, + new () { Key= "completed", Name="Completed" }, + }), + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Training + ".Create", + R = AppCodes.Hr.Training, + U = AppCodes.Hr.Training + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + ]); + #endregion + } + #endregion + #endregion } } diff --git a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs index 8d6b06c1..ea2c1eab 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -116,5 +116,7 @@ public enum TableNameEnum Payroll, PayrollItem, Template360, - Performance360 + Performance360, + Training, + Certificate } \ 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 4300629e..a5d697f1 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -31,7 +31,7 @@ public static class PlatformConsts public static class EditorScriptValues { public static string CalcTotalDaysFromDates = "(() => {const d=v=>!v?null:(v instanceof Date?v:new Date(v));const nf={...formData,[editor.dataField]:e?.value};const s=d(nf.StartDate),t=d(nf.EndDate);setFormData({...formData,TotalDays: s&&t?Math.max(0,Math.floor((Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())-Date.UTC(s.getFullYear(),s.getMonth(),s.getDate()))/(24*60*60*1000))+1):null});})();"; - public static string CalcTotalHoursFromTimes="(()=>{const toD=v=>!v?null:(v instanceof Date?v:new Date(v));const next={...formData,[e.dataField]:e.value};const s=toD(next.StartTime),t=toD(next.EndTime);let h=null;if(s&&t){h=(t-s)/36e5;if(h<0)h+=24;h=Math.round(h*10)/10;}setFormData({...next,TotalHours:h});})();"; + public static string CalcTotalHoursFromTimes = "(()=>{const toD=v=>!v?null:(v instanceof Date?v:new Date(v));const next={...formData,[e.dataField]:e.value};const s=toD(next.StartTime),t=toD(next.EndTime);let h=null;if(s&&t){h=(t-s)/36e5;if(h<0)h+=24;h=Math.round(h*10)/10;}setFormData({...next,TotalHours:h});})();"; } public static class Prefix @@ -384,8 +384,6 @@ public static class PlatformConsts public const string Disease = Default + ".Disease"; public const string Document = Default + ".Document"; public const string EducationStatus = Default + ".EducationStatus"; - public const string EventType = Default + ".EventType"; - public const string EventCategory = Default + ".EventCategory"; public const string MeetingMethod = Default + ".MeetingMethod"; public const string MeetingResult = Default + ".MeetingResult"; public const string Program = Default + ".Program"; @@ -402,7 +400,6 @@ public static class PlatformConsts public const string Psychologist = Default + ".Psychologist"; public const string Meal = Default + ".Meal"; public const string Lawyer = Default + ".Lawyer"; - public const string Event = Default + ".Event"; public const string LessonPeriod = Default + ".LessonPeriod"; public const string RegistrationType = Default + ".RegistrationType"; public const string RegistrationMethod = Default + ".RegistrationMethod"; @@ -410,6 +407,15 @@ public static class PlatformConsts public const string Class = Default + ".Class"; public const string Level = Default + ".Level"; } + + //Hr + public static class Hr + { + public const string Default = Prefix.App + ".Hr"; + public const string EventType = Default + ".EventType"; + public const string EventCategory = Default + ".EventCategory"; + public const string Event = Default + ".Event"; + } } public static class ListFormCodes @@ -520,6 +526,7 @@ public static class PlatformConsts public const string Payroll = "list-payroll"; public const string Template360 = "list-template360"; public const string Performance360 = "list-performance360"; + public const string Training = "list-training"; } } diff --git a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs index 354e371d..120645b0 100644 --- a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs @@ -68,9 +68,6 @@ public static class TableNameResolver { nameof(TableNameEnum.Uom), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.Behavior), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.EducationStatus), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, - { nameof(TableNameEnum.EventCategory), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, - { nameof(TableNameEnum.EventType), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, - { nameof(TableNameEnum.Event), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.EventPhoto), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.EventComment), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.Disease), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, @@ -134,6 +131,11 @@ public static class TableNameResolver { nameof(TableNameEnum.PayrollItem), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.Template360), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.Performance360), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.EventCategory), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.EventType), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.Event), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.Training), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.Certificate), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, // 🔹 ACCOUNTING { nameof(TableNameEnum.Bank), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Accounting) }, diff --git a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs index 21d8d60b..7fa0e305 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -413,8 +413,6 @@ public static class SeedConsts public const string Disease = Default + ".Disease"; public const string Document = Default + ".Document"; public const string EducationStatus = Default + ".EducationStatus"; - public const string EventType = Default + ".EventType"; - public const string EventCategory = Default + ".EventCategory"; public const string MeetingMethod = Default + ".MeetingMethod"; public const string MeetingResult = Default + ".MeetingResult"; public const string Program = Default + ".Program"; @@ -431,7 +429,6 @@ public static class SeedConsts public const string Psychologist = Default + ".Psychologist"; public const string Meal = Default + ".Meal"; public const string Lawyer = Default + ".Lawyer"; - public const string Event = Default + ".Event"; public const string LessonPeriod = Default + ".LessonPeriod"; public const string RegistrationType = Default + ".RegistrationType"; public const string RegistrationMethod = Default + ".RegistrationMethod"; @@ -462,6 +459,13 @@ public static class SeedConsts public const string Payroll = Default + ".Payroll"; public const string Template360 = Default + ".Template360"; public const string Performance360 = Default + ".Performance360"; + + public const string Events = Default + ".Events"; + public const string EventType = Events + ".EventType"; + public const string EventCategory = Events + ".EventCategory"; + public const string Event = Events + ".Event"; + + public const string Training = Default + ".Training"; } public static class Accounting diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Certificate.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Certificate.cs new file mode 100644 index 00000000..578a58ef --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Certificate.cs @@ -0,0 +1,19 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class Certificate : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid TrainingId { get; set; } + public Training Training { get; set; } + + public Guid EmployeeId { get; set; } + public int? Score { get; set; } + public DateTime IssueDate { get; set; } + public DateTime? ExpiryDate { get; set; } + public string CertificateUrl { get; set; } +} diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Training.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Training.cs new file mode 100644 index 00000000..b9e53ec6 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Training.cs @@ -0,0 +1,28 @@ +// Domain/Entities/Training.cs +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class Training : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Title { get; set; } + public string Description { get; set; } + public string Instructor { get; set; } + public string Category { get; set; } // technical | soft-skills | management | compliance | other + public string Type { get; set; } // online | classroom | hybrid + public int Duration { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public int MaxParticipants { get; set; } + public int Enrolled { get; set; } + public string Status { get; set; } // upcoming | ongoing | completed + public string Location { get; set; } + public string Thumbnail { get; set; } + + public ICollection Certificates { get; set; } +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index c2be70c7..e2aaaa77 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -177,6 +177,8 @@ public class PlatformDbContext : public DbSet Leaves { get; set; } public DbSet Template360s { get; set; } public DbSet Performans360s { get; set; } + public DbSet Trainings { get; set; } + public DbSet Certificates { get; set; } #endregion @@ -1880,5 +1882,39 @@ public class PlatformDbContext : .HasPrincipalKey(e => e.Id) .OnDelete(DeleteBehavior.Restrict); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Training)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Title).IsRequired().HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Instructor).IsRequired().HasMaxLength(100); + b.Property(x => x.Category).IsRequired().HasMaxLength(50); + b.Property(x => x.Type).IsRequired().HasMaxLength(50); + b.Property(x => x.Status).IsRequired().HasMaxLength(50); + b.Property(x => x.Location).IsRequired().HasMaxLength(200); + b.Property(x => x.Thumbnail).HasMaxLength(500); + b.Property(x => x.Duration).HasDefaultValue(0); + b.Property(x => x.MaxParticipants).HasDefaultValue(0); + b.Property(x => x.Enrolled).HasDefaultValue(0); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Certificate)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.EmployeeId).IsRequired(); + b.Property(x => x.IssueDate).IsRequired(); + b.Property(x => x.CertificateUrl).HasMaxLength(300); + + b.HasOne(x => x.Training) + .WithMany(e => e.Certificates) + .HasForeignKey(x => x.TrainingId) + .HasPrincipalKey(e => e.Id) + .OnDelete(DeleteBehavior.Cascade); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023210323_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.Designer.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023210323_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.Designer.cs index 2aa1d99b..4b506da4 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023210323_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251023210323_Initial")] + [Migration("20251024083852_Initial")] partial class Initial { /// @@ -1529,6 +1529,71 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Sas_BranchUsers", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Certificate", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CertificateUrl") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExpiryDate") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssueDate") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TrainingId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TrainingId"); + + b.ToTable("T_Hr_Certificate", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.Property("Id") @@ -3632,7 +3697,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("TypeId"); - b.ToTable("T_Adm_Event", (string)null); + b.ToTable("T_Hr_Event", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.EventCategory", b => @@ -3681,7 +3746,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("T_Adm_EventCategory", (string)null); + b.ToTable("T_Hr_EventCategory", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.EventComment", b => @@ -3844,7 +3909,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("T_Adm_EventType", (string)null); + b.ToTable("T_Hr_EventType", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.GlobalSearch", b => @@ -7581,6 +7646,109 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Hr_Template360", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Training", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Duration") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Enrolled") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Instructor") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Location") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("MaxParticipants") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Thumbnail") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_Training", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Uom", b => { b.Property("Id") @@ -10206,6 +10374,17 @@ namespace Kurs.Platform.Migrations b.Navigation("Category"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Certificate", b => + { + b.HasOne("Kurs.Platform.Entities.Training", "Training") + .WithMany("Certificates") + .HasForeignKey("TrainingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Training"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.HasOne("Kurs.Platform.Entities.Country", null) @@ -10987,6 +11166,11 @@ namespace Kurs.Platform.Migrations b.Navigation("Performans360s"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Training", b => + { + b.Navigation("Certificates"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b => { b.Navigation("Uoms"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023210323_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023210323_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.cs index 10f4168d..f8987d3e 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251023210323_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.cs @@ -1274,46 +1274,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_T_Adm_EducationStatus", x => x.Id); }); - migrationBuilder.CreateTable( - name: "T_Adm_EventCategory", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_T_Adm_EventCategory", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "T_Adm_EventType", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_T_Adm_EventType", x => x.Id); - }); - migrationBuilder.CreateTable( name: "T_Adm_InstallmentOption", columns: table => new @@ -1798,6 +1758,46 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_T_Hr_EmploymentType", x => x.Id); }); + migrationBuilder.CreateTable( + name: "T_Hr_EventCategory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_T_Hr_EventCategory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "T_Hr_EventType", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_T_Hr_EventType", x => x.Id); + }); + migrationBuilder.CreateTable( name: "T_Hr_Payroll", columns: table => new @@ -1853,6 +1853,38 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_T_Hr_Template360", x => x.Id); }); + migrationBuilder.CreateTable( + name: "T_Hr_Training", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Title = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Instructor = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Category = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Duration = table.Column(type: "int", nullable: false, defaultValue: 0), + StartDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + MaxParticipants = table.Column(type: "int", nullable: false, defaultValue: 0), + Enrolled = table.Column(type: "int", nullable: false, defaultValue: 0), + Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Location = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Thumbnail = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_T_Hr_Training", x => x.Id); + }); + migrationBuilder.CreateTable( name: "T_Prt_Interesting", columns: table => new @@ -2937,47 +2969,6 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Restrict); }); - migrationBuilder.CreateTable( - name: "T_Adm_Event", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - CategoryId = table.Column(type: "uniqueidentifier", nullable: false), - TypeId = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Place = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), - OrganizerId = table.Column(type: "uniqueidentifier", nullable: false), - ParticipantsCount = table.Column(type: "int", nullable: false), - Likes = table.Column(type: "int", nullable: false), - isPublished = table.Column(type: "bit", nullable: false, defaultValue: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_T_Adm_Event", x => x.Id); - table.ForeignKey( - name: "FK_T_Adm_Event_T_Adm_EventCategory_CategoryId", - column: x => x.CategoryId, - principalTable: "T_Adm_EventCategory", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_T_Adm_Event_T_Adm_EventType_TypeId", - column: x => x.TypeId, - principalTable: "T_Adm_EventType", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - migrationBuilder.CreateTable( name: "T_Adm_OrderItem", columns: table => new @@ -3235,6 +3226,47 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "T_Hr_Event", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + CategoryId = table.Column(type: "uniqueidentifier", nullable: false), + TypeId = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Place = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + OrganizerId = table.Column(type: "uniqueidentifier", nullable: false), + ParticipantsCount = table.Column(type: "int", nullable: false), + Likes = table.Column(type: "int", nullable: false), + isPublished = table.Column(type: "bit", nullable: false, defaultValue: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_T_Hr_Event", x => x.Id); + table.ForeignKey( + name: "FK_T_Hr_Event_T_Hr_EventCategory_CategoryId", + column: x => x.CategoryId, + principalTable: "T_Hr_EventCategory", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_T_Hr_Event_T_Hr_EventType_TypeId", + column: x => x.TypeId, + principalTable: "T_Hr_EventType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "T_Hr_PayrollItem", columns: table => new @@ -3266,6 +3298,37 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "T_Hr_Certificate", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + TrainingId = table.Column(type: "uniqueidentifier", nullable: false), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), + Score = table.Column(type: "int", nullable: true), + IssueDate = table.Column(type: "datetime2", nullable: false), + ExpiryDate = table.Column(type: "datetime2", nullable: true), + CertificateUrl = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_T_Hr_Certificate", x => x.Id); + table.ForeignKey( + name: "FK_T_Hr_Certificate_T_Hr_Training_TrainingId", + column: x => x.TrainingId, + principalTable: "T_Hr_Training", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "T_Sas_ApiEndpoint", columns: table => new @@ -3636,62 +3699,6 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "T_Adm_EventComment", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - EventId = table.Column(type: "uniqueidentifier", nullable: false), - UserId = table.Column(type: "uniqueidentifier", nullable: false), - Comment = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), - Likes = table.Column(type: "int", nullable: false, defaultValue: 0), - 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_Adm_EventComment", x => x.Id); - table.ForeignKey( - name: "FK_T_Adm_EventComment_T_Adm_Event_EventId", - column: x => x.EventId, - principalTable: "T_Adm_Event", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "T_Adm_EventPhoto", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - EventId = table.Column(type: "uniqueidentifier", nullable: false), - Url = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_T_Adm_EventPhoto", x => x.Id); - table.ForeignKey( - name: "FK_T_Adm_EventPhoto_T_Adm_Event_EventId", - column: x => x.EventId, - principalTable: "T_Adm_Event", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateTable( name: "T_Crd_QuestionOption", columns: table => new @@ -3721,6 +3728,62 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "T_Adm_EventComment", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + EventId = table.Column(type: "uniqueidentifier", nullable: false), + UserId = table.Column(type: "uniqueidentifier", nullable: false), + Comment = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + Likes = table.Column(type: "int", nullable: false, defaultValue: 0), + 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_Adm_EventComment", x => x.Id); + table.ForeignKey( + name: "FK_T_Adm_EventComment_T_Hr_Event_EventId", + column: x => x.EventId, + principalTable: "T_Hr_Event", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "T_Adm_EventPhoto", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + EventId = table.Column(type: "uniqueidentifier", nullable: false), + Url = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_T_Adm_EventPhoto", x => x.Id); + table.ForeignKey( + name: "FK_T_Adm_EventPhoto_T_Hr_Event_EventId", + column: x => x.EventId, + principalTable: "T_Hr_Event", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "T_Sas_ReportGenerated", columns: table => new @@ -4578,16 +4641,6 @@ namespace Kurs.Platform.Migrations table: "T_Adm_BlogPost", column: "Slug"); - migrationBuilder.CreateIndex( - name: "IX_T_Adm_Event_CategoryId", - table: "T_Adm_Event", - column: "CategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_T_Adm_Event_TypeId", - table: "T_Adm_Event", - column: "TypeId"); - migrationBuilder.CreateIndex( name: "IX_T_Adm_EventComment_EventId", table: "T_Adm_EventComment", @@ -4685,6 +4738,11 @@ namespace Kurs.Platform.Migrations table: "T_Crd_QuestionOption", column: "QuestionId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Certificate_TrainingId", + table: "T_Hr_Certificate", + column: "TrainingId"); + migrationBuilder.CreateIndex( name: "IX_T_Hr_CostCenter_CurrencyId", table: "T_Hr_CostCenter", @@ -4755,6 +4813,16 @@ namespace Kurs.Platform.Migrations table: "T_Hr_Employee", column: "ManagerId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Event_CategoryId", + table: "T_Hr_Event", + column: "CategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Event_TypeId", + table: "T_Hr_Event", + column: "TypeId"); + migrationBuilder.CreateIndex( name: "IX_T_Hr_JobPosition_CurrencyId", table: "T_Hr_JobPosition", @@ -5112,6 +5180,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Crd_QuestionTag"); + migrationBuilder.DropTable( + name: "T_Hr_Certificate"); + migrationBuilder.DropTable( name: "T_Hr_Leave"); @@ -5230,7 +5301,7 @@ namespace Kurs.Platform.Migrations name: "T_Adm_BlogCategory"); migrationBuilder.DropTable( - name: "T_Adm_Event"); + name: "T_Hr_Event"); migrationBuilder.DropTable( name: "T_Adm_Order"); @@ -5247,6 +5318,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Crd_Question"); + migrationBuilder.DropTable( + name: "T_Hr_Training"); + migrationBuilder.DropTable( name: "T_Hr_Payroll"); @@ -5281,10 +5355,10 @@ namespace Kurs.Platform.Migrations name: "P_Sas_ListForm"); migrationBuilder.DropTable( - name: "T_Adm_EventCategory"); + name: "T_Hr_EventCategory"); migrationBuilder.DropTable( - name: "T_Adm_EventType"); + name: "T_Hr_EventType"); migrationBuilder.DropTable( name: "T_Crd_QuestionPool"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 4b4a28c6..f1294ab0 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -1526,6 +1526,71 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Sas_BranchUsers", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Certificate", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CertificateUrl") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExpiryDate") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssueDate") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TrainingId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TrainingId"); + + b.ToTable("T_Hr_Certificate", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.Property("Id") @@ -3629,7 +3694,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("TypeId"); - b.ToTable("T_Adm_Event", (string)null); + b.ToTable("T_Hr_Event", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.EventCategory", b => @@ -3678,7 +3743,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("T_Adm_EventCategory", (string)null); + b.ToTable("T_Hr_EventCategory", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.EventComment", b => @@ -3841,7 +3906,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("T_Adm_EventType", (string)null); + b.ToTable("T_Hr_EventType", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.GlobalSearch", b => @@ -7578,6 +7643,109 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Hr_Template360", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Training", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Duration") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Enrolled") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Instructor") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Location") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("MaxParticipants") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Thumbnail") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_Training", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Uom", b => { b.Property("Id") @@ -10203,6 +10371,17 @@ namespace Kurs.Platform.Migrations b.Navigation("Category"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Certificate", b => + { + b.HasOne("Kurs.Platform.Entities.Training", "Training") + .WithMany("Certificates") + .HasForeignKey("TrainingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Training"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.HasOne("Kurs.Platform.Entities.Country", null) @@ -10984,6 +11163,11 @@ namespace Kurs.Platform.Migrations b.Navigation("Performans360s"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Training", b => + { + b.Navigation("Certificates"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b => { b.Navigation("Uoms"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index 43b500c7..666c6044 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -100,9 +100,7 @@ "props": null, "description": null, "isActive": true, - "dependencies": [ - "AxiosListComponent" - ] + "dependencies": ["AxiosListComponent"] } ], "ReportCategories": [ @@ -2211,12 +2209,7 @@ "minSalary": 80000, "maxSalary": 120000, "currencyCode": "USD", - "requiredSkills": [ - "JavaScript", - "TypeScript", - "React", - "Node.js" - ], + "requiredSkills": ["JavaScript", "TypeScript", "React", "Node.js"], "responsibilities": [ "Develop frontend and backend applications", "Write clean and maintainable code", @@ -3412,5 +3405,67 @@ "departmentCode": "KAL", "targetEmployees": "EMP-005|EMP-006" } + ], + "Trainings": [ + { + "title": "React & TypeScript İleri Seviye", + "description": "Modern React uygulamaları geliştirmek için TypeScript kullanımı, hooks, context API ve performans optimizasyonu", + "instructor": "Mehmet Demir", + "category": "technical", + "type": "online", + "duration": 16, + "startDate": "01-11-2024", + "endDate": "08-11-2024", + "maxParticipants": 20, + "enrolled": 15, + "status": "upcoming", + "location": "Eğitim Salonu B", + "thumbnail": "https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=400&h=300&fit=crop" + }, + { + "title": "Etkili İletişim ve Sunum Teknikleri", + "description": "İş hayatında etkili iletişim kurma, profesyonel sunum hazırlama ve konuşma becerileri geliştirme", + "instructor": "Ayşe Kara", + "category": "soft-skills", + "type": "classroom", + "duration": 8, + "startDate": "05-10-2024", + "endDate": "05-10-2024", + "maxParticipants": 15, + "enrolled": 12, + "status": "ongoing", + "location": "Eğitim Salonu A", + "thumbnail": "https://images.unsplash.com/photo-1557804506-669a67965ba0?w=400&h=300&fit=crop" + }, + { + "title": "Agile & Scrum Master Eğitimi", + "description": "Çevik yazılım geliştirme metodolojileri, Scrum framework ve sertifikasyon hazırlığı", + "instructor": "Can Öztürk", + "category": "management", + "type": "hybrid", + "duration": 24, + "startDate": "10-09-2024", + "endDate": "03-09-2024", + "maxParticipants": 25, + "enrolled": 25, + "status": "completed", + "location": "Eğitim Salonu C", + "thumbnail": "https://images.unsplash.com/photo-1552664730-d307ca884978?w=400&h=300&fit=crop" + }, + { + "title": "Siber Güvenlik ve Veri Koruma", + "description": "KVKK uyumluluğu, siber güvenlik tehditleri ve kurumsal veri koruma stratejileri", + "instructor": "Zeynep Arslan", + "category": "compliance", + "type": "online", + "duration": 12, + "startDate": "05-11-2024", + "endDate": "02-11-2024", + "maxParticipants": 50, + "enrolled": 8, + "status": "upcoming", + "location": "Eğitim Salonu D", + "thumbnail": "https://images.unsplash.com/photo-1550751827-4bd374c3f58b?w=400&h=300&fit=crop" + } ] -} \ No newline at end of file +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index ed7fb6fc..6ed431e5 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -73,6 +73,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _payrollRepository; private readonly IRepository _template360Repository; private readonly IRepository _performans360Repository; + private readonly IRepository _trainingRepository; public TenantDataSeeder( IRepository repositoryUser, @@ -129,7 +130,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository overtimeRepository, IRepository payrollRepository, IRepository template360Repository, - IRepository performans360Repository + IRepository performans360Repository, + IRepository trainingRepository ) { _repositoryUser = repositoryUser; @@ -187,6 +189,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _payrollRepository = payrollRepository; _template360Repository = template360Repository; _performans360Repository = performans360Repository; + _trainingRepository = trainingRepository; } private static IConfigurationRoot BuildConfiguration() @@ -1177,5 +1180,28 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency TargetEmployees = string.Join("|", targetEmployees.Select(e => e.Id)) }, autoSave: true); } + + foreach (var item in items.Trainings) + { + var exists = await _trainingRepository.AnyAsync(x => x.Title == item.Title); + if (exists) + continue; + + await _trainingRepository.InsertAsync(new Training + { + Title = item.Title, + Description = item.Description, + Instructor = item.Instructor, + Category = item.Category, + Type = item.Type, + Duration = item.Duration, + StartDate = item.StartDate, + EndDate = item.EndDate, + MaxParticipants = item.MaxParticipants, + Status = item.Status, + Location = item.Location, + Thumbnail = item.Thumbnail + }, autoSave: true); + } } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index ad068c9d..aecb9788 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -62,6 +62,23 @@ public class TenantSeederDto public List Payrolls { get; set; } public List Template360s { get; set; } public List Performans360s { get; set; } + public List Trainings { get; set; } +} + +public class TrainingSeedDto +{ + public string Title { get; set; } + public string Description { get; set; } + public string Instructor { get; set; } + public string Category { get; set; } + public string Type { get; set; } + public string Location { get; set; } + public string Thumbnail { get; set; } + public int Duration { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public int MaxParticipants { get; set; } + public string Status { get; set; } } public class Performans360SeedDto diff --git a/ui/src/mocks/mockIntranet.ts b/ui/src/mocks/mockIntranet.ts index a0b49657..ed49f9ea 100644 --- a/ui/src/mocks/mockIntranet.ts +++ b/ui/src/mocks/mockIntranet.ts @@ -387,102 +387,6 @@ export const mockDocuments: Document[] = [ }, ] -export const mockTrainings: Training[] = [ - { - id: 'tr1', - title: 'React & TypeScript İleri Seviye', - description: - 'Modern React uygulamaları geliştirmek için TypeScript kullanımı, hooks, context API ve performans optimizasyonu', - instructor: 'Mehmet Demir', - category: 'technical', - type: 'online', - duration: 16, - startDate: new Date('2024-11-01'), - endDate: new Date('2024-11-08'), - maxParticipants: 20, - enrolled: 15, - status: 'upcoming', - thumbnail: 'https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=400&h=300&fit=crop', - }, - { - id: 'tr2', - title: 'Etkili İletişim ve Sunum Teknikleri', - description: - 'İş hayatında etkili iletişim kurma, profesyonel sunum hazırlama ve konuşma becerileri geliştirme', - instructor: 'Ayşe Kara', - category: 'soft-skills', - type: 'classroom', - duration: 8, - startDate: new Date('2024-10-25'), - endDate: new Date('2024-10-25'), - maxParticipants: 15, - enrolled: 12, - status: 'ongoing', - location: 'Eğitim Salonu A', - thumbnail: 'https://images.unsplash.com/photo-1557804506-669a67965ba0?w=400&h=300&fit=crop', - }, - { - id: 'tr3', - title: 'Agile & Scrum Master Eğitimi', - description: - 'Çevik yazılım geliştirme metodolojileri, Scrum framework ve sertifikasyon hazırlığı', - instructor: 'Can Öztürk', - category: 'management', - type: 'hybrid', - duration: 24, - startDate: new Date('2024-09-15'), - endDate: new Date('2024-09-30'), - maxParticipants: 25, - enrolled: 25, - status: 'completed', - thumbnail: 'https://images.unsplash.com/photo-1552664730-d307ca884978?w=400&h=300&fit=crop', - }, - { - id: 'tr4', - title: 'Siber Güvenlik ve Veri Koruma', - description: 'KVKK uyumluluğu, siber güvenlik tehditleri ve kurumsal veri koruma stratejileri', - instructor: 'Zeynep Arslan', - category: 'compliance', - type: 'online', - duration: 12, - startDate: new Date('2024-11-15'), - endDate: new Date('2024-11-22'), - maxParticipants: 50, - enrolled: 8, - status: 'upcoming', - thumbnail: 'https://images.unsplash.com/photo-1550751827-4bd374c3f58b?w=400&h=300&fit=crop', - }, -] - -export const mockCertificates: Certificate[] = [ - { - id: 'cert1', - employee: mockEmployees[0], - trainingTitle: 'Agile & Scrum Master Eğitimi', - issueDate: new Date('2024-09-30'), - expiryDate: new Date('2026-09-30'), - certificateUrl: '/certificates/cert1.pdf', - score: 95, - }, - { - id: 'cert2', - employee: mockEmployees[2], - trainingTitle: 'React & TypeScript İleri Seviye', - issueDate: new Date('2024-08-15'), - certificateUrl: '/certificates/cert2.pdf', - score: 88, - }, - { - id: 'cert3', - employee: mockEmployees[4], - trainingTitle: 'Siber Güvenlik ve Veri Koruma', - issueDate: new Date('2024-07-20'), - expiryDate: new Date('2025-07-20'), - certificateUrl: '/certificates/cert3.pdf', - score: 92, - }, -] - export const mockReservations: Reservation[] = [ { id: 'res1', @@ -977,3 +881,102 @@ export const mockSocialPosts: SocialPost[] = [ isOwnPost: false, }, ] + + +///////////////////////////////////////////////////////////////////////////////////// +///////EKLENENLER////////// +export const mockTrainings: Training[] = [ + { + id: 'tr1', + title: 'React & TypeScript İleri Seviye', + description: + 'Modern React uygulamaları geliştirmek için TypeScript kullanımı, hooks, context API ve performans optimizasyonu', + instructor: 'Mehmet Demir', + category: 'technical', + type: 'online', + duration: 16, + startDate: new Date('2024-11-01'), + endDate: new Date('2024-11-08'), + maxParticipants: 20, + enrolled: 15, + status: 'upcoming', + thumbnail: 'https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=400&h=300&fit=crop', + }, + { + id: 'tr2', + title: 'Etkili İletişim ve Sunum Teknikleri', + description: + 'İş hayatında etkili iletişim kurma, profesyonel sunum hazırlama ve konuşma becerileri geliştirme', + instructor: 'Ayşe Kara', + category: 'soft-skills', + type: 'classroom', + duration: 8, + startDate: new Date('2024-10-25'), + endDate: new Date('2024-10-25'), + maxParticipants: 15, + enrolled: 12, + status: 'ongoing', + location: 'Eğitim Salonu A', + thumbnail: 'https://images.unsplash.com/photo-1557804506-669a67965ba0?w=400&h=300&fit=crop', + }, + { + id: 'tr3', + title: 'Agile & Scrum Master Eğitimi', + description: + 'Çevik yazılım geliştirme metodolojileri, Scrum framework ve sertifikasyon hazırlığı', + instructor: 'Can Öztürk', + category: 'management', + type: 'hybrid', + duration: 24, + startDate: new Date('2024-09-15'), + endDate: new Date('2024-09-30'), + maxParticipants: 25, + enrolled: 25, + status: 'completed', + thumbnail: 'https://images.unsplash.com/photo-1552664730-d307ca884978?w=400&h=300&fit=crop', + }, + { + id: 'tr4', + title: 'Siber Güvenlik ve Veri Koruma', + description: 'KVKK uyumluluğu, siber güvenlik tehditleri ve kurumsal veri koruma stratejileri', + instructor: 'Zeynep Arslan', + category: 'compliance', + type: 'online', + duration: 12, + startDate: new Date('2024-11-15'), + endDate: new Date('2024-11-22'), + maxParticipants: 50, + enrolled: 8, + status: 'upcoming', + thumbnail: 'https://images.unsplash.com/photo-1550751827-4bd374c3f58b?w=400&h=300&fit=crop', + }, +] + +export const mockCertificates: Certificate[] = [ + { + id: 'cert1', + employee: mockEmployees[0], + trainingTitle: 'Agile & Scrum Master Eğitimi', + issueDate: new Date('2024-09-30'), + expiryDate: new Date('2026-09-30'), + certificateUrl: '/certificates/cert1.pdf', + score: 95, + }, + { + id: 'cert2', + employee: mockEmployees[2], + trainingTitle: 'React & TypeScript İleri Seviye', + issueDate: new Date('2024-08-15'), + certificateUrl: '/certificates/cert2.pdf', + score: 88, + }, + { + id: 'cert3', + employee: mockEmployees[4], + trainingTitle: 'Siber Güvenlik ve Veri Koruma', + issueDate: new Date('2024-07-20'), + expiryDate: new Date('2025-07-20'), + certificateUrl: '/certificates/cert3.pdf', + score: 92, + }, +] \ No newline at end of file diff --git a/ui/src/views/shared/DialogContext/DialogShowComponent.tsx b/ui/src/views/shared/DialogContext/DialogShowComponent.tsx index a58e6097..ff9c4d93 100644 --- a/ui/src/views/shared/DialogContext/DialogShowComponent.tsx +++ b/ui/src/views/shared/DialogContext/DialogShowComponent.tsx @@ -115,6 +115,14 @@ const DialogShowComponent = (): JSX.Element => { {...dialogContext.config?.props} > ) + case 'TrainingCertificates': + return ( + + ) default: return <> }