From fa5ed66ae2f347e073f1ff3d3fbaae14f449e877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Sat, 25 Oct 2025 22:13:07 +0300 Subject: [PATCH] Hr Visitors --- .../Seeds/HostData.json | 80 +++ .../Seeds/ListFormsSeeder.cs | 549 +++++++++++++++++- .../Enums/TableNameEnum.cs | 3 +- .../PlatformConsts.cs | 1 + .../TableNameResolver.cs | 1 + .../Kurs.Platform.Domain/Data/SeedConsts.cs | 1 + .../Entities/Tenant/Hr/Certificate.cs | 1 + .../Entities/Tenant/Hr/Employee.cs | 8 +- .../Entities/Tenant/Hr/Visitor.cs | 23 + .../EntityFrameworkCore/PlatformDbContext.cs | 38 ++ ....cs => 20251025190722_Initial.Designer.cs} | 124 +++- ...1_Initial.cs => 20251025190722_Initial.cs} | 123 ++-- .../PlatformDbContextModelSnapshot.cs | 122 +++- .../Tenants/Seeds/TenantData.json | 48 +- .../Tenants/TenantDataSeeder.cs | 28 +- .../Tenants/TenantSeederDto.cs | 23 +- ui/src/mocks/mockIntranet.ts | 420 +++++++------- 17 files changed, 1326 insertions(+), 267 deletions(-) create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Visitor.cs rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251025170721_Initial.Designer.cs => 20251025190722_Initial.Designer.cs} (98%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251025170721_Initial.cs => 20251025190722_Initial.cs} (99%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json index 9b3f2395..f99d5c04 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json @@ -7839,6 +7839,12 @@ "tr": "Duyurular", "en": "Announcements" }, + { + "resourceName": "Platform", + "key": "App.Hr.Visitor", + "tr": "Ziyaretçiler", + "en": "Visitors" + }, { "resourceName": "Platform", "key": "App.Definitions.Information", @@ -15395,6 +15401,16 @@ "RequiredPermissionName": "App.Hr.Announcement", "IsDisabled": false }, + { + "ParentCode": "App.Hr", + "Code": "App.Hr.Visitor", + "DisplayName": "App.Hr.Visitor", + "Order": 18, + "Url": "/admin/list/list-visitor", + "Icon": "FcContacts", + "RequiredPermissionName": "App.Hr.Visitor", + "IsDisabled": false + }, { "ParentCode": null, "Code": "App.Mrp", @@ -25342,6 +25358,70 @@ "MultiTenancySide": 3, "MenuGroup": "Kurs" }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Visitor", + "ParentName": null, + "DisplayName": "App.Hr.Visitor", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Visitor.Create", + "ParentName": "App.Hr.Visitor", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Visitor.Update", + "ParentName": "App.Hr.Visitor", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Visitor.Delete", + "ParentName": "App.Hr.Visitor", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Visitor.Export", + "ParentName": "App.Hr.Visitor", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Visitor.Import", + "ParentName": "App.Hr.Visitor", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Visitor.Activity", + "ParentName": "App.Hr.Visitor", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { "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 f023db12..3924d606 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -39459,7 +39459,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldName = "Type", FieldDbType = DbType.String, Value = "morning", - CustomValueType = FieldCustomValueTypeEnum.Value } + CustomValueType = FieldCustomValueTypeEnum.Value } }) } ); @@ -39907,7 +39907,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldName = "PublishDate", FieldDbType = DbType.Date, Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } + CustomValueType = FieldCustomValueTypeEnum.CustomKey } }) } ); @@ -40338,6 +40338,551 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Visitors + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Visitor)) + { + var listFormVisitor = 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.Visitor, + Name = AppCodes.Hr.Visitor, + Title = AppCodes.Hr.Visitor, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.Visitor, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Visitor)), + 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.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + D = AppCodes.Hr.Visitor + ".Delete", + E = AppCodes.Hr.Visitor + ".Export", + I = AppCodes.Hr.Visitor + ".Import", + A = AppCodes.Hr.Visitor + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Visitor))}\" 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 = "Visitor Form", + Width = 500, + Height = 450 + }, + 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 = "FullName", IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "CompanyName", IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Email", EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Phone", IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions }, + new EditingFormItemDto { Order = 5, DataField = "Purpose", IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "VisitDate", IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 7, DataField = "CheckIn", EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 8, DataField = "CheckOut", EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 9, DataField = "EmployeeId", IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 10, DataField = "Status", IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { + FieldName = "VisitDate", + FieldDbType = DbType.Date, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CheckIn", + FieldDbType = DbType.Date, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "Status", + FieldDbType = DbType.String, + Value = "checked-in", + CustomValueType = FieldCustomValueTypeEnum.Value }, + }) + } + ); + + #region Visitor Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormVisitor.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.Announcement + ".Create", + R = AppCodes.Hr.Announcement, + U = AppCodes.Hr.Announcement + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "FullName", + Width = 150, + 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.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "CompanyName", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Email", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.email) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Phone", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.email) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Purpose", + Width = 200, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.email) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "VisitDate", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "CheckIn", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "CheckOut", + 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.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "EmployeeId", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.EmployeeValues + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormVisitor.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 100, + ListOrderNo = 11, + 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= "checked-in", Name= "Checked-in" }, + new () { Key= "checked-out", Name= "Checked-out" }, + new () { Key= "scheduled", Name= "Scheduled" }, + }), + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Visitor + ".Create", + R = AppCodes.Hr.Visitor, + U = AppCodes.Hr.Visitor + ".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 3bcaf566..c0348d90 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -121,5 +121,6 @@ public enum TableNameEnum Certificate, Reservation, ShuttleRoute, - Announcement + Announcement, + Visitor } \ 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 1ab81a3b..f2d304a4 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -532,6 +532,7 @@ public static class PlatformConsts public const string Reservation = "list-reservation"; public const string ShuttleRoute = "list-shuttleroute"; public const string Announcement = "list-announcement"; + public const string Visitor = "list-visitor"; } } diff --git a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs index fb0a4b23..7a2fa1ae 100644 --- a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs @@ -139,6 +139,7 @@ public static class TableNameResolver { nameof(TableNameEnum.Reservation), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.ShuttleRoute), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.Announcement), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.Visitor), (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 5fd62996..474b9864 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -470,6 +470,7 @@ public static class SeedConsts public const string Reservation = Default + ".Reservation"; public const string ShuttleRoute = Default + ".ShuttleRoute"; public const string Announcement = Default + ".Announcement"; + public const string Visitor = Default + ".Visitor"; } 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 index 578a58ef..13ada420 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Certificate.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Certificate.cs @@ -12,6 +12,7 @@ public class Certificate : FullAuditedEntity, IMultiTenant public Training Training { get; set; } public Guid EmployeeId { get; set; } + public Employee Employee { get; set; } public int? Score { get; set; } public DateTime IssueDate { get; set; } public DateTime? ExpiryDate { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Employee.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Employee.cs index 9afd1a80..52d92aba 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Employee.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Employee.cs @@ -66,10 +66,10 @@ public class Employee : FullAuditedEntity, IMultiTenant public string EmployeeStatus { get; set; } public bool IsActive { get; set; } - // Navigation lists (placeholders) public ICollection Overtimes { get; set; } public ICollection Leaves { get; set; } - // public ICollection Evaluations { get; set; } - // public ICollection Trainings { get; set; } - // public ICollection DisciplinaryActions { get; set; } + public ICollection Announcements { get; set; } + public ICollection Visitors { get; set; } + public ICollection Reservations { get; set; } + public ICollection Certificates { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Visitor.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Visitor.cs new file mode 100644 index 00000000..c2a1b960 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Visitor.cs @@ -0,0 +1,23 @@ +// Domain/Entities/Visitor.cs +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class Visitor : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string FullName { get; set; } + public string CompanyName { get; set; } + public string Email { get; set; } + public string Phone { get; set; } + public string Purpose { get; set; } + public DateTime VisitDate { get; set; } + public DateTime? CheckIn { get; set; } + public DateTime? CheckOut { get; set; } + public Guid? EmployeeId { get; set; } // HrEmployee referansı + public Employee Employee { get; set; } + public string Status { get; set; } //checked-in, checked-out, scheduled +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index e7731dac..891d0b3c 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -182,6 +182,7 @@ public class PlatformDbContext : public DbSet Reservations { get; set; } public DbSet ShuttleRoutes { get; set; } public DbSet Announcements { get; set; } + public DbSet Visitors { get; set; } #endregion @@ -1918,6 +1919,12 @@ public class PlatformDbContext : .HasForeignKey(x => x.TrainingId) .HasPrincipalKey(e => e.Id) .OnDelete(DeleteBehavior.Cascade); + + b.HasOne(x => x.Employee) + .WithMany(e => e.Certificates) + .HasForeignKey(x => x.EmployeeId) + .HasPrincipalKey(e => e.Id) + .OnDelete(DeleteBehavior.Restrict); }); builder.Entity(b => @@ -1931,6 +1938,12 @@ public class PlatformDbContext : b.Property(x => x.Purpose).IsRequired().HasMaxLength(500); b.Property(x => x.Notes).HasMaxLength(1000); b.Property(x => x.Status).IsRequired().HasMaxLength(50); + + b.HasOne(x => x.Employee) + .WithMany(e => e.Reservations) + .HasForeignKey(x => x.EmployeeId) + .HasPrincipalKey(e => e.Id) + .OnDelete(DeleteBehavior.Restrict); }); builder.Entity(b => @@ -1961,6 +1974,31 @@ public class PlatformDbContext : b.Property(x => x.Departments).HasMaxLength(1000); b.Property(x => x.Attachments).HasMaxLength(2000); b.Property(x => x.ViewCount).HasDefaultValue(0); + + b.HasOne(x => x.Employee) + .WithMany(e => e.Announcements) + .HasForeignKey(x => x.EmployeeId) + .HasPrincipalKey(e => e.Id) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Visitor)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.FullName).IsRequired().HasMaxLength(100); + b.Property(x => x.CompanyName).HasMaxLength(150); + b.Property(a => a.Phone).IsRequired().HasMaxLength(20); + b.Property(x => x.Email).HasMaxLength(150); + b.Property(x => x.Purpose).HasMaxLength(250); + b.Property(x => x.Status).IsRequired().HasMaxLength(20); + + b.HasOne(x => x.Employee) + .WithMany(e => e.Visitors) + .HasForeignKey(x => x.EmployeeId) + .HasPrincipalKey(e => e.Id) + .OnDelete(DeleteBehavior.Restrict); }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025170721_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025190722_Initial.Designer.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025170721_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025190722_Initial.Designer.cs index 8322fe7b..1c43eab4 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025170721_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025190722_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251025170721_Initial")] + [Migration("20251025190722_Initial")] partial class Initial { /// @@ -1684,6 +1684,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("EmployeeId"); + b.HasIndex("TrainingId"); b.ToTable("T_Hr_Certificate", (string)null); @@ -8261,6 +8263,91 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_Vehicle", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Visitor", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CheckIn") + .HasColumnType("datetime2"); + + b.Property("CheckOut") + .HasColumnType("datetime2"); + + b.Property("CompanyName") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + 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("Email") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("FullName") + .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("Phone") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Purpose") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("VisitDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.ToTable("T_Hr_Visitor", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.WorkHour", b => { b.Property("Id") @@ -10578,8 +10665,9 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Announcement", b => { b.HasOne("Kurs.Platform.Entities.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId"); + .WithMany("Announcements") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); b.Navigation("Employee"); }); @@ -10637,12 +10725,20 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Certificate", b => { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany("Certificates") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + b.HasOne("Kurs.Platform.Entities.Training", "Training") .WithMany("Certificates") .HasForeignKey("TrainingId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.Navigation("Employee"); + b.Navigation("Training"); }); @@ -11067,9 +11163,9 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Reservation", b => { b.HasOne("Kurs.Platform.Entities.Employee", "Employee") - .WithMany() + .WithMany("Reservations") .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Employee"); @@ -11119,6 +11215,16 @@ namespace Kurs.Platform.Migrations b.Navigation("UomCategory"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Visitor", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany("Visitors") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + }); + modelBuilder.Entity("Kurs.Platform.Forum.ForumPost", b => { b.HasOne("Kurs.Platform.Forum.ForumPost", "ParentPost") @@ -11360,9 +11466,17 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Employee", b => { + b.Navigation("Announcements"); + + b.Navigation("Certificates"); + b.Navigation("Leaves"); b.Navigation("Overtimes"); + + b.Navigation("Reservations"); + + b.Navigation("Visitors"); }); modelBuilder.Entity("Kurs.Platform.Entities.Event", b => diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025170721_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025190722_Initial.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025170721_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025190722_Initial.cs index 636be507..4f23e736 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025170721_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251025190722_Initial.cs @@ -3324,37 +3324,6 @@ 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 @@ -3932,6 +3901,37 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_T_Hr_Announcement", x => x.Id); }); + 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_Hr_CostCenter", columns: table => new @@ -4287,7 +4287,42 @@ namespace Kurs.Platform.Migrations column: x => x.EmployeeId, principalTable: "T_Hr_Employee", principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "T_Hr_Visitor", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + FullName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + CompanyName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Email = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Phone = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), + Purpose = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), + VisitDate = table.Column(type: "datetime2", nullable: false), + CheckIn = table.Column(type: "datetime2", nullable: true), + CheckOut = table.Column(type: "datetime2", nullable: true), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: true), + Status = table.Column(type: "nvarchar(20)", maxLength: 20, 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_Visitor", x => x.Id); + table.ForeignKey( + name: "FK_T_Hr_Visitor_T_Hr_Employee_EmployeeId", + column: x => x.EmployeeId, + principalTable: "T_Hr_Employee", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( @@ -4834,6 +4869,11 @@ namespace Kurs.Platform.Migrations table: "T_Hr_Announcement", column: "EmployeeId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Certificate_EmployeeId", + table: "T_Hr_Certificate", + column: "EmployeeId"); + migrationBuilder.CreateIndex( name: "IX_T_Hr_Certificate_TrainingId", table: "T_Hr_Certificate", @@ -4959,6 +4999,11 @@ namespace Kurs.Platform.Migrations table: "T_Hr_Reservation", column: "EmployeeId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Visitor_EmployeeId", + table: "T_Hr_Visitor", + column: "EmployeeId"); + migrationBuilder.CreateIndex( name: "IX_T_Sas_ApiEndpoint_EntityId", table: "T_Sas_ApiEndpoint", @@ -4994,7 +5039,16 @@ namespace Kurs.Platform.Migrations table: "T_Hr_Announcement", column: "EmployeeId", principalTable: "T_Hr_Employee", - principalColumn: "Id"); + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_T_Hr_Certificate_T_Hr_Employee_EmployeeId", + table: "T_Hr_Certificate", + column: "EmployeeId", + principalTable: "T_Hr_Employee", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_T_Hr_CostCenter_T_Hr_Department_DepartmentId", @@ -5312,6 +5366,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Hr_ShuttleRoute"); + migrationBuilder.DropTable( + name: "T_Hr_Visitor"); + migrationBuilder.DropTable( name: "T_Prt_Interesting"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index c04c5e1c..5a80d687 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -1681,6 +1681,8 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); + b.HasIndex("EmployeeId"); + b.HasIndex("TrainingId"); b.ToTable("T_Hr_Certificate", (string)null); @@ -8258,6 +8260,91 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_Vehicle", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Visitor", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CheckIn") + .HasColumnType("datetime2"); + + b.Property("CheckOut") + .HasColumnType("datetime2"); + + b.Property("CompanyName") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + 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("Email") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("FullName") + .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("Phone") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Purpose") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("VisitDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.ToTable("T_Hr_Visitor", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.WorkHour", b => { b.Property("Id") @@ -10575,8 +10662,9 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Announcement", b => { b.HasOne("Kurs.Platform.Entities.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId"); + .WithMany("Announcements") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); b.Navigation("Employee"); }); @@ -10634,12 +10722,20 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Certificate", b => { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany("Certificates") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + b.HasOne("Kurs.Platform.Entities.Training", "Training") .WithMany("Certificates") .HasForeignKey("TrainingId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.Navigation("Employee"); + b.Navigation("Training"); }); @@ -11064,9 +11160,9 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Reservation", b => { b.HasOne("Kurs.Platform.Entities.Employee", "Employee") - .WithMany() + .WithMany("Reservations") .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Employee"); @@ -11116,6 +11212,16 @@ namespace Kurs.Platform.Migrations b.Navigation("UomCategory"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Visitor", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany("Visitors") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + }); + modelBuilder.Entity("Kurs.Platform.Forum.ForumPost", b => { b.HasOne("Kurs.Platform.Forum.ForumPost", "ParentPost") @@ -11357,9 +11463,17 @@ namespace Kurs.Platform.Migrations modelBuilder.Entity("Kurs.Platform.Entities.Employee", b => { + b.Navigation("Announcements"); + + b.Navigation("Certificates"); + b.Navigation("Leaves"); b.Navigation("Overtimes"); + + b.Navigation("Reservations"); + + b.Navigation("Visitors"); }); modelBuilder.Entity("Kurs.Platform.Entities.Event", b => diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index 9a1a9f18..4c827309 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -100,7 +100,9 @@ "props": null, "description": null, "isActive": true, - "dependencies": ["AxiosListComponent"] + "dependencies": [ + "AxiosListComponent" + ] } ], "ReportCategories": [ @@ -2209,7 +2211,12 @@ "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", @@ -3629,5 +3636,40 @@ "viewCount": 312, "departmentCodes": "BAK|DEP" } + ], + "Visitors": [ + { + "fullName": "Ali Veli", + "companyName": "ABC Teknoloji", + "email": "ali.veli@abc.com", + "phone": "5321112233", + "visitDate": "2025-10-05", + "checkIn": "05-10-2025", + "employeeCode": "EMP-001", + "purpose": "İş Ortaklığı Görüşmesi", + "status": "checked-in" + }, + { + "fullName": "Fatma Yıldız", + "companyName": "XYZ Danışmanlık", + "email": "fatma@xyz.com", + "phone": "5332223344", + "visitDate": "01-10-2024", + "employeeCode": "EMP-002", + "purpose": "Eğitim Danışmanlığı", + "status": "scheduled" + }, + { + "fullName": "Mehmet Kara", + "companyName": "DEF Yazılım", + "email": "mehmet@def.com", + "phone": "5343334455", + "visitDate": "08-10-2024", + "checkIn": "08-10-2024", + "checkOut": "10-10-2024", + "employeeCode": "EMP-003", + "purpose": "Teknik Sunum", + "status": "checked-out" + } ] -} +} \ 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 51eb6f16..becfd162 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -77,6 +77,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _reservationRepository; private readonly IRepository _shuttleRouteRepository; private readonly IRepository _announcementRepository; + private readonly IRepository _visitorRepository; public TenantDataSeeder( IRepository repositoryUser, @@ -137,7 +138,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository trainingRepository, IRepository reservationRepository, IRepository shuttleRouteRepository, - IRepository announcementRepository + IRepository announcementRepository, + IRepository visitorRepository ) { _repositoryUser = repositoryUser; @@ -199,6 +201,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _reservationRepository = reservationRepository; _shuttleRouteRepository = shuttleRouteRepository; _announcementRepository = announcementRepository; + _visitorRepository = visitorRepository; } private static IConfigurationRoot BuildConfiguration() @@ -1282,5 +1285,28 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency Departments = string.Join("|", targetDepartments.Select(d => d.Id)), }, autoSave: true); } + + + foreach (var item in items.Visitors) + { + var exists = await _visitorRepository.AnyAsync(x => x.FullName == item.FullName); + if (exists) + continue; + + var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode); + await _visitorRepository.InsertAsync(new Visitor + { + FullName = item.FullName, + CompanyName = item.CompanyName, + Email = item.Email, + Phone = item.Phone, + Purpose = item.Purpose, + VisitDate = item.VisitDate, + CheckIn = item.CheckIn, + CheckOut = item.CheckOut, + EmployeeId = employee != null ? employee.Id : null, + Status = item.Status + }, autoSave: true); + } } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index 197b37e4..be5a18db 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -66,6 +66,21 @@ public class TenantSeederDto public List Reservations { get; set; } public List ShuttleRoutes { get; set; } public List Announcements { get; set; } + public List Visitors { get; set; } +} + +public class VisitorSeedDto +{ + public string FullName { get; set; } + public string CompanyName { get; set; } + public string Email { get; set; } + public string Phone { get; set; } + public string Purpose { get; set; } + public DateTime VisitDate { get; set; } + public DateTime? CheckIn { get; set; } + public DateTime? CheckOut { get; set; } + public string EmployeeCode { get; set; } + public string Status { get; set; } } public class AnnouncementSeedDto @@ -75,14 +90,14 @@ public class AnnouncementSeedDto public string Content { get; set; } public string ImageUrl { get; set; } public string Category { get; set; } - public string EmployeeCode { get; set; } + public string EmployeeCode { get; set; } public DateTime PublishDate { get; set; } public DateTime? ExpiryDate { get; set; } public bool IsPinned { get; set; } public int ViewCount { get; set; } public string DepartmentCodes { get; set; } } - + public class ShuttleRouteSeedDto { public string Name { get; set; } @@ -93,7 +108,7 @@ public class ShuttleRouteSeedDto public int Available { get; set; } public string Type { get; set; } } - + public class ReservationSeedDto { public string Type { get; set; } @@ -106,7 +121,7 @@ public class ReservationSeedDto public string Notes { get; set; } public string Status { get; set; } } - + public class TrainingSeedDto { public string Title { get; set; } diff --git a/ui/src/mocks/mockIntranet.ts b/ui/src/mocks/mockIntranet.ts index 451b291b..a28c6581 100644 --- a/ui/src/mocks/mockIntranet.ts +++ b/ui/src/mocks/mockIntranet.ts @@ -15,171 +15,6 @@ import { SocialPost, } from '@/types/intranet' -export const mockEvents: CalendarEvent[] = [ - { - id: 'evt1', - title: 'Yaz Pikniği 2025', - description: - 'Şirket çalışanları olarak doğayla iç içe harika bir gün geçirdik. Takım oyunları, barbekü ve çok eğlence!', - type: 'social', - date: new Date('2025-10-20'), - location: 'Polonezköy Piknik Alanı', - organizer: mockEmployees[4], - participants: 45, - photos: [ - 'https://images.unsplash.com/photo-1530541930197-ff16ac917b0e?w=800', - 'https://images.unsplash.com/photo-1527529482837-4698179dc6ce?w=800', - 'https://images.unsplash.com/photo-1528605105345-5344ea20e269?w=800', - 'https://images.unsplash.com/photo-1504196606672-aef5c9cefc92?w=800', - ], - comments: [ - { - id: 'c1', - author: mockEmployees[0], - content: 'Muhteşem bir gündü! Yılın en güzel etkinliği 🎉', - creationTime: new Date('2025-07-16T10:30:00'), - likes: 12, - }, - { - id: 'c2', - author: mockEmployees[2], - content: 'Voleybol turnuvası harikaydı, gelecek yıl yine yapalım!', - creationTime: new Date('2025-07-16T14:20:00'), - likes: 8, - }, - ], - likes: 34, - isPublished: true, - }, - { - id: 'evt2', - title: 'Hackathon 2025', - description: '24 saatlik yazılım geliştirme maratonu. İnovasyon, teknoloji ve takım çalışması!', - type: 'training', - date: new Date('2025-20-22'), - location: 'Ofis - Ana Salon', - organizer: mockEmployees[0], - participants: 28, - photos: [ - 'https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=800', - 'https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800', - 'https://images.unsplash.com/photo-1531482615713-2afd69097998?w=800', - ], - comments: [ - { - id: 'c3', - author: mockEmployees[1], - content: 'Ekibimiz 2. oldu! Çok gurur duydum herkesle 💪', - creationTime: new Date('2025-09-11T09:00:00'), - likes: 15, - }, - { - id: 'c4', - author: mockEmployees[3], - content: 'Gece boyunca kod yazmak ve pizza yemek priceless! 🍕', - creationTime: new Date('2025-09-11T11:45:00'), - likes: 10, - }, - ], - likes: 42, - isPublished: true, - }, - { - id: 'evt3', - title: 'Kurumsal Futbol Turnuvası', - description: 'Departmanlar arası futbol turnuvasında ter döktük, gol attık ve kazandık! 🏆', - type: 'sport', - date: new Date('2025-10-25'), - location: 'Spor Kompleksi Halı Saha', - organizer: mockEmployees[2], - participants: 32, - photos: [ - 'https://images.unsplash.com/photo-1579952363873-27f3bade9f55?w=800', - 'https://images.unsplash.com/photo-1574629810360-7efbbe195018?w=800', - 'https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?w=800', - 'https://images.unsplash.com/photo-1553778263-73a83bab9b0c?w=800', - ], - comments: [ - { - id: 'c5', - author: mockEmployees[4], - content: 'İT departmanı şampiyon oldu! Gelecek sene kupayı koruyacağız 🏆', - creationTime: new Date('2025-06-21T08:30:00'), - likes: 18, - }, - ], - likes: 28, - isPublished: true, - }, - { - id: 'evt4', - title: 'Yılbaşı Gala Gecesi 2024', - description: 'Harika bir yıla muhteşem bir gala ile veda ettik. Müzik, dans ve sürprizler!', - type: 'company', - date: new Date('2024-12-28'), - location: 'Grand Hotel - Balo Salonu', - organizer: mockEmployees[3], - participants: 68, - photos: [ - 'https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=800', - 'https://images.unsplash.com/photo-1519167758481-83f29da8c2b9?w=800', - 'https://images.unsplash.com/photo-1464366400600-7168b8af9bc3?w=800', - 'https://images.unsplash.com/photo-1478147427282-58a87a120781?w=800', - 'https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800', - ], - comments: [ - { - id: 'c6', - author: mockEmployees[0], - content: 'Yılın en şık gecesi! Organizasyon mükemmeldi 👏', - creationTime: new Date('2024-12-29T10:00:00'), - likes: 25, - }, - { - id: 'c7', - author: mockEmployees[1], - content: 'Tombala hediyelerim harika, çok teşekkürler! 🎁', - creationTime: new Date('2024-12-29T12:30:00'), - likes: 14, - }, - { - id: 'c8', - author: mockEmployees[2], - content: 'Müzik grubunuz süperdi, dans pistinden ayrılamadık! 🎵', - creationTime: new Date('2024-12-29T15:20:00'), - likes: 19, - }, - ], - likes: 51, - isPublished: true, - }, - { - id: 'evt5', - title: 'Sanat Atölyesi - Ebru Workshop', - description: 'Geleneksel Türk sanatı ebru yapımı atölyesinde harika eserler ortaya çıktı!', - type: 'culture', - date: new Date('2025-05-12'), - location: 'Ofis - Yaratıcı Alan', - organizer: mockEmployees[1], - participants: 18, - photos: [ - 'https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=800', - 'https://images.unsplash.com/photo-1513364776144-60967b0f800f?w=800', - 'https://images.unsplash.com/photo-1515405295579-ba7b45403062?w=800', - ], - comments: [ - { - id: 'c9', - author: mockEmployees[3], - content: 'İlk defa ebru yaptım, çok huzurlu bir deneyimdi 🎨', - creationTime: new Date('2025-05-13T09:15:00'), - likes: 11, - }, - ], - likes: 22, - isPublished: true, - }, -] export const mockExpenseRequests: ExpenseRequest[] = [ { @@ -361,50 +196,6 @@ export const mockSurveys: Survey[] = [ }, ] -export const mockVisitors: Visitor[] = [ - { - id: 'vis1', - fullName: 'Ali Veli', - company: 'ABC Teknoloji', - email: 'ali.veli@abc.com', - phone: '+90 532 111 22 33', - visitDate: new Date('2024-10-20T10:00:00'), - checkIn: new Date('2024-10-20T10:15:00'), - host: mockEmployees[1], - purpose: 'İş Ortaklığı Görüşmesi', - status: 'checked-in', - badgeNumber: 'V-001', - photo: 'https://i.pravatar.cc/150?img=60', - }, - { - id: 'vis2', - fullName: 'Fatma Yıldız', - company: 'XYZ Danışmanlık', - email: 'fatma@xyz.com', - phone: '+90 533 222 33 44', - visitDate: new Date('2024-10-21T14:00:00'), - host: mockEmployees[2], - purpose: 'Eğitim Danışmanlığı', - status: 'scheduled', - photo: 'https://i.pravatar.cc/150?img=47', - }, - { - id: 'vis3', - fullName: 'Mehmet Kara', - company: 'DEF Yazılım', - email: 'mehmet@def.com', - phone: '+90 534 333 44 55', - visitDate: new Date('2024-10-18T11:00:00'), - checkIn: new Date('2024-10-18T11:05:00'), - checkOut: new Date('2024-10-18T13:30:00'), - host: mockEmployees[3], - purpose: 'Teknik Sunum', - status: 'checked-out', - badgeNumber: 'V-002', - photo: 'https://i.pravatar.cc/150?img=68', - }, -] - export const mockSocialPosts: SocialPost[] = [ { id: '1', @@ -660,7 +451,6 @@ export const mockSocialPosts: SocialPost[] = [ }, ] - ///////////////////////////////////////////////////////////////////////////////////// ///////EKLENENLER////////// export const mockTrainings: Training[] = [ @@ -979,4 +769,214 @@ export const mockAnnouncements: Announcement[] = [ viewCount: 312, attachments: [{ name: 'Bilgi_Guvenligi_Politikasi_v2.pdf', url: '#', size: '2.4 MB' }], }, +] + +export const mockEvents: CalendarEvent[] = [ + { + id: 'evt1', + title: 'Yaz Pikniği 2025', + description: + 'Şirket çalışanları olarak doğayla iç içe harika bir gün geçirdik. Takım oyunları, barbekü ve çok eğlence!', + type: 'social', + date: new Date('2025-10-20'), + location: 'Polonezköy Piknik Alanı', + organizer: mockEmployees[4], + participants: 45, + photos: [ + 'https://images.unsplash.com/photo-1530541930197-ff16ac917b0e?w=800', + 'https://images.unsplash.com/photo-1527529482837-4698179dc6ce?w=800', + 'https://images.unsplash.com/photo-1528605105345-5344ea20e269?w=800', + 'https://images.unsplash.com/photo-1504196606672-aef5c9cefc92?w=800', + ], + comments: [ + { + id: 'c1', + author: mockEmployees[0], + content: 'Muhteşem bir gündü! Yılın en güzel etkinliği 🎉', + creationTime: new Date('2025-07-16T10:30:00'), + likes: 12, + }, + { + id: 'c2', + author: mockEmployees[2], + content: 'Voleybol turnuvası harikaydı, gelecek yıl yine yapalım!', + creationTime: new Date('2025-07-16T14:20:00'), + likes: 8, + }, + ], + likes: 34, + isPublished: true, + }, + { + id: 'evt2', + title: 'Hackathon 2025', + description: '24 saatlik yazılım geliştirme maratonu. İnovasyon, teknoloji ve takım çalışması!', + type: 'training', + date: new Date('2025-20-22'), + location: 'Ofis - Ana Salon', + organizer: mockEmployees[0], + participants: 28, + photos: [ + 'https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=800', + 'https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800', + 'https://images.unsplash.com/photo-1531482615713-2afd69097998?w=800', + ], + comments: [ + { + id: 'c3', + author: mockEmployees[1], + content: 'Ekibimiz 2. oldu! Çok gurur duydum herkesle 💪', + creationTime: new Date('2025-09-11T09:00:00'), + likes: 15, + }, + { + id: 'c4', + author: mockEmployees[3], + content: 'Gece boyunca kod yazmak ve pizza yemek priceless! 🍕', + creationTime: new Date('2025-09-11T11:45:00'), + likes: 10, + }, + ], + likes: 42, + isPublished: true, + }, + { + id: 'evt3', + title: 'Kurumsal Futbol Turnuvası', + description: 'Departmanlar arası futbol turnuvasında ter döktük, gol attık ve kazandık! 🏆', + type: 'sport', + date: new Date('2025-10-25'), + location: 'Spor Kompleksi Halı Saha', + organizer: mockEmployees[2], + participants: 32, + photos: [ + 'https://images.unsplash.com/photo-1579952363873-27f3bade9f55?w=800', + 'https://images.unsplash.com/photo-1574629810360-7efbbe195018?w=800', + 'https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?w=800', + 'https://images.unsplash.com/photo-1553778263-73a83bab9b0c?w=800', + ], + comments: [ + { + id: 'c5', + author: mockEmployees[4], + content: 'İT departmanı şampiyon oldu! Gelecek sene kupayı koruyacağız 🏆', + creationTime: new Date('2025-06-21T08:30:00'), + likes: 18, + }, + ], + likes: 28, + isPublished: true, + }, + { + id: 'evt4', + title: 'Yılbaşı Gala Gecesi 2024', + description: 'Harika bir yıla muhteşem bir gala ile veda ettik. Müzik, dans ve sürprizler!', + type: 'company', + date: new Date('2024-12-28'), + location: 'Grand Hotel - Balo Salonu', + organizer: mockEmployees[3], + participants: 68, + photos: [ + 'https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=800', + 'https://images.unsplash.com/photo-1519167758481-83f29da8c2b9?w=800', + 'https://images.unsplash.com/photo-1464366400600-7168b8af9bc3?w=800', + 'https://images.unsplash.com/photo-1478147427282-58a87a120781?w=800', + 'https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800', + ], + comments: [ + { + id: 'c6', + author: mockEmployees[0], + content: 'Yılın en şık gecesi! Organizasyon mükemmeldi 👏', + creationTime: new Date('2024-12-29T10:00:00'), + likes: 25, + }, + { + id: 'c7', + author: mockEmployees[1], + content: 'Tombala hediyelerim harika, çok teşekkürler! 🎁', + creationTime: new Date('2024-12-29T12:30:00'), + likes: 14, + }, + { + id: 'c8', + author: mockEmployees[2], + content: 'Müzik grubunuz süperdi, dans pistinden ayrılamadık! 🎵', + creationTime: new Date('2024-12-29T15:20:00'), + likes: 19, + }, + ], + likes: 51, + isPublished: true, + }, + { + id: 'evt5', + title: 'Sanat Atölyesi - Ebru Workshop', + description: 'Geleneksel Türk sanatı ebru yapımı atölyesinde harika eserler ortaya çıktı!', + type: 'culture', + date: new Date('2025-05-12'), + location: 'Ofis - Yaratıcı Alan', + organizer: mockEmployees[1], + participants: 18, + photos: [ + 'https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=800', + 'https://images.unsplash.com/photo-1513364776144-60967b0f800f?w=800', + 'https://images.unsplash.com/photo-1515405295579-ba7b45403062?w=800', + ], + comments: [ + { + id: 'c9', + author: mockEmployees[3], + content: 'İlk defa ebru yaptım, çok huzurlu bir deneyimdi 🎨', + creationTime: new Date('2025-05-13T09:15:00'), + likes: 11, + }, + ], + likes: 22, + isPublished: true, + }, +] + +export const mockVisitors: Visitor[] = [ + { + id: 'vis1', + fullName: 'Ali Veli', + company: 'ABC Teknoloji', + email: 'ali.veli@abc.com', + phone: '+90 532 111 22 33', + visitDate: new Date('2025-10-25T10:00:00'), + checkIn: new Date('2025-10-25T10:15:00'), + host: mockEmployees[1], + purpose: 'İş Ortaklığı Görüşmesi', + status: 'checked-in', + badgeNumber: 'V-001', + photo: 'https://i.pravatar.cc/150?img=60', + }, + { + id: 'vis2', + fullName: 'Fatma Yıldız', + company: 'XYZ Danışmanlık', + email: 'fatma@xyz.com', + phone: '+90 533 222 33 44', + visitDate: new Date('2024-10-21T14:00:00'), + host: mockEmployees[2], + purpose: 'Eğitim Danışmanlığı', + status: 'scheduled', + photo: 'https://i.pravatar.cc/150?img=47', + }, + { + id: 'vis3', + fullName: 'Mehmet Kara', + company: 'DEF Yazılım', + email: 'mehmet@def.com', + phone: '+90 534 333 44 55', + visitDate: new Date('2024-10-18T11:00:00'), + checkIn: new Date('2024-10-18T11:05:00'), + checkOut: new Date('2024-10-18T13:30:00'), + host: mockEmployees[3], + purpose: 'Teknik Sunum', + status: 'checked-out', + badgeNumber: 'V-002', + photo: 'https://i.pravatar.cc/150?img=68', + }, ] \ No newline at end of file