From 246cea49a918b661f0fc5ec50a0c066d9c24cd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Mon, 20 Oct 2025 23:40:32 +0300 Subject: [PATCH] =?UTF-8?q?Event=20Entity=20de=C4=9Fi=C5=9Ftirildi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Seeds/ListFormsSeeder.cs | 103 +++++++++- .../Enums/LookUpQueryValues.cs | 16 +- .../Enums/TableNameEnum.cs | 2 + .../TableNameResolver.cs | 2 + .../Entities/Tenant/Event.cs | 15 ++ .../Entities/Tenant/EventComment.cs | 19 ++ .../Entities/Tenant/EventPhoto.cs | 17 ++ .../EntityFrameworkCore/PlatformDbContext.cs | 32 +++ ....cs => 20251020201144_Initial.Designer.cs} | 159 ++++++++++++++- ...5_Initial.cs => 20251020201144_Initial.cs} | 86 +++++++- .../PlatformDbContextModelSnapshot.cs | 157 +++++++++++++++ .../Tenants/Seeds/TenantData.json | 190 +++++++++++++++++- .../Tenants/TenantDataSeeder.cs | 33 +++ .../Tenants/TenantSeederDto.cs | 8 +- ui/src/mocks/mockEmployees.ts | 2 +- ui/src/mocks/mockIntranet.ts | 117 +---------- ui/src/types/intranet.ts | 88 +++----- ui/src/views/intranet/Dashboard.tsx | 12 +- .../views/intranet/widgets/ActiveSurveys.tsx | 3 +- .../widgets/ImportantAnnouncements.tsx | 3 +- .../{WeeklyMenu.tsx => MealWeeklyMenu.tsx} | 8 +- .../views/intranet/widgets/TodayBirthdays.tsx | 21 +- 22 files changed, 885 insertions(+), 208 deletions(-) create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/EventComment.cs create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/EventPhoto.cs rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251020111635_Initial.Designer.cs => 20251020201144_Initial.Designer.cs} (98%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251020111635_Initial.cs => 20251020201144_Initial.cs} (98%) rename ui/src/views/intranet/widgets/{WeeklyMenu.tsx => MealWeeklyMenu.tsx} (93%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index daf1e631..d239f81c 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -21493,9 +21493,12 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency 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, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, - new EditingFormItemDto { Order = 6, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + 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 }, ] } }), @@ -21714,6 +21717,93 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), 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() { @@ -21722,7 +21812,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "Status", Width = 120, - ListOrderNo = 7, + ListOrderNo = 10, Visible = true, IsActive = true, IsDeleted = false, @@ -21731,8 +21821,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key="Aktif",Name="Aktif" }, - new () { Key="Pasif",Name="Pasif" }, + new () { Key="Published",Name="Published" }, + new () { Key="Draft",Name="Draft" }, + new () { Key="Cancelled",Name="Cancelled" }, }), }), ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto diff --git a/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs b/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs index 51c401a5..d508b901 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs @@ -112,6 +112,20 @@ public static class LookUpQueryValues $") AS \"List\" " + $"ORDER BY \"Name\""; + public static string RoleValues = + $"SELECT " + + $"\"Id\" AS \"Key\", " + + $"\"Name\" AS \"Name\" " + + $"FROM \"AbpRoles\"" + + $"ORDER BY \"Name\""; + + public static string UserValues = + $"SELECT " + + $"\"Id\" AS \"Key\", " + + $"\"UserName\" AS \"Name\" " + + $"FROM \"AbpUsers\"" + + $"ORDER BY \"Name\""; + public static string BranchValues = $"SELECT \"Id\" AS \"Key\", " + $"\"Name\" AS \"Name\" " + @@ -143,7 +157,7 @@ public static class LookUpQueryValues $"FROM \"{FullNameTable(TableNameEnum.SkillType)}\" " + $"WHERE \"IsDeleted\" = 'false' " + $"ORDER BY \"Name\";"; - + public static string ClassTypeValues = $"SELECT " + $"\"Id\" AS \"Key\", " + diff --git a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs index 0e7b632d..aea2bda2 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -71,6 +71,8 @@ public enum TableNameEnum EventCategory, EventType, Event, + EventPhoto, + EventComment, SalesRejectionReason, ClassCancellationReason, LessonPeriod, diff --git a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs index 4b66a6df..ae65d3ee 100644 --- a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs @@ -71,6 +71,8 @@ public static class TableNameResolver { 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) }, { nameof(TableNameEnum.Psychologist), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.Vaccine), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Event.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Event.cs index ada40118..50803349 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Event.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Event.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -16,9 +17,23 @@ public class Event : FullAuditedEntity, IMultiTenant public string Description { get; set; } public string Status { get; set; } + public Guid OrganizerId { get; set; } + // public HrEmployee Organizer { get; set; } + + public int ParticipantsCount { get; set; } + // public ICollection Participants { get; set; } = new List(); + + // Medya ve etkileşim + public ICollection Photos { get; set; } = []; + public ICollection Comments { get; set; } = []; + public int Likes { get; set; } + public bool isPublished { get; set; } = false; + // Navigation public EventCategory Category { get; set; } public EventType Type { get; set; } Guid? IMultiTenant.TenantId => TenantId; } + + diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/EventComment.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/EventComment.cs new file mode 100644 index 00000000..1127a19e --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/EventComment.cs @@ -0,0 +1,19 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class EventComment : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid EventId { get; set; } + public Guid UserId { get; set; } + public string Comment { get; set; } + public int Likes { get; set; } + + public Event Event { get; set; } + + Guid? IMultiTenant.TenantId => TenantId; +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/EventPhoto.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/EventPhoto.cs new file mode 100644 index 00000000..d20e7ecb --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/EventPhoto.cs @@ -0,0 +1,17 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class EventPhoto : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid EventId { get; set; } + public string Url { get; set; } + + public Event Event { get; set; } + + Guid? IMultiTenant.TenantId => TenantId; +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 711bb9d2..222f4aa6 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -93,6 +93,8 @@ public class PlatformDbContext : public DbSet Events { get; set; } public DbSet EventCategories { get; set; } public DbSet EventTypes { get; set; } + public DbSet EventPhotos { get; set; } + public DbSet EventComments { get; set; } public DbSet LessonPeriods { get; set; } public DbSet Lawyers { get; set; } public DbSet Meals { get; set; } @@ -1089,6 +1091,7 @@ public class PlatformDbContext : b.Property(x => x.Place).HasMaxLength(200); b.Property(x => x.Description).HasMaxLength(1000); b.Property(x => x.Status).HasMaxLength(20); + b.Property(x => x.isPublished).HasDefaultValue(false); // EventCategory -> Event (1 - N) b.HasOne(x => x.Category) @@ -1103,6 +1106,35 @@ public class PlatformDbContext : .OnDelete(DeleteBehavior.Restrict); }); + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventPhoto)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Url).HasMaxLength(500); + + // Event -> EventPhoto (1 - N) + b.HasOne(x => x.Event) + .WithMany(x => x.Photos) + .HasForeignKey(x => x.EventId) + .OnDelete(DeleteBehavior.Cascade); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventComment)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Comment).HasMaxLength(500); + b.Property(x => x.Likes).HasDefaultValue(0); + + // Event -> EventComment (1 - N) + b.HasOne(x => x.Event) + .WithMany(x => x.Comments) + .HasForeignKey(x => x.EventId) + .OnDelete(DeleteBehavior.Cascade); + }); + builder.Entity(b => { b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesRejectionReason)), Prefix.DbSchema); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020111635_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020201144_Initial.Designer.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020111635_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020201144_Initial.Designer.cs index 8568cc5d..fca1213b 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020111635_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020201144_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251020111635_Initial")] + [Migration("20251020201144_Initial")] partial class Initial { /// @@ -3098,11 +3098,20 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("Likes") + .HasColumnType("int"); + b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("nvarchar(200)"); + b.Property("OrganizerId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParticipantsCount") + .HasColumnType("int"); + b.Property("Place") .HasMaxLength(200) .HasColumnType("nvarchar(200)"); @@ -3118,6 +3127,11 @@ namespace Kurs.Platform.Migrations b.Property("TypeId") .HasColumnType("uniqueidentifier"); + b.Property("isPublished") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + b.HasKey("Id"); b.HasIndex("CategoryId"); @@ -3176,6 +3190,120 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_EventCategory", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.EventComment", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Comment") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EventId") + .HasColumnType("uniqueidentifier"); + + 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("Likes") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EventId"); + + b.ToTable("T_Adm_EventComment", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.EventPhoto", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + 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("EventId") + .HasColumnType("uniqueidentifier"); + + 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("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Url") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("EventId"); + + b.ToTable("T_Adm_EventPhoto", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.EventType", b => { b.Property("Id") @@ -9114,6 +9242,28 @@ namespace Kurs.Platform.Migrations b.Navigation("Type"); }); + modelBuilder.Entity("Kurs.Platform.Entities.EventComment", b => + { + b.HasOne("Kurs.Platform.Entities.Event", "Event") + .WithMany("Comments") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.EventPhoto", b => + { + b.HasOne("Kurs.Platform.Entities.Event", "Event") + .WithMany("Photos") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Level", b => { b.HasOne("Kurs.Platform.Entities.ClassType", "ClassType") @@ -9511,6 +9661,13 @@ namespace Kurs.Platform.Migrations b.Navigation("Fields"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Event", b => + { + b.Navigation("Comments"); + + b.Navigation("Photos"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.EventCategory", b => { b.Navigation("Events"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020111635_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020201144_Initial.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020111635_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020201144_Initial.cs index a960c830..e14bde1e 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020111635_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251020201144_Initial.cs @@ -2844,6 +2844,10 @@ namespace Kurs.Platform.Migrations 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), @@ -3496,6 +3500,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_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 @@ -4068,6 +4128,16 @@ namespace Kurs.Platform.Migrations table: "T_Adm_Event", column: "TypeId"); + migrationBuilder.CreateIndex( + name: "IX_T_Adm_EventComment_EventId", + table: "T_Adm_EventComment", + column: "EventId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Adm_EventPhoto_EventId", + table: "T_Adm_EventPhoto", + column: "EventId"); + migrationBuilder.CreateIndex( name: "IX_T_Adm_OrderItem_OrderId", table: "T_Adm_OrderItem", @@ -4361,7 +4431,10 @@ namespace Kurs.Platform.Migrations name: "T_Adm_EducationStatus"); migrationBuilder.DropTable( - name: "T_Adm_Event"); + name: "T_Adm_EventComment"); + + migrationBuilder.DropTable( + name: "T_Adm_EventPhoto"); migrationBuilder.DropTable( name: "T_Adm_InstallmentOption"); @@ -4535,10 +4608,7 @@ namespace Kurs.Platform.Migrations name: "T_Adm_BlogCategory"); migrationBuilder.DropTable( - name: "T_Adm_EventCategory"); - - migrationBuilder.DropTable( - name: "T_Adm_EventType"); + name: "T_Adm_Event"); migrationBuilder.DropTable( name: "T_Adm_Order"); @@ -4582,6 +4652,12 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "P_Sas_ListForm"); + migrationBuilder.DropTable( + name: "T_Adm_EventCategory"); + + migrationBuilder.DropTable( + name: "T_Adm_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 78323703..14dd6f30 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -3095,11 +3095,20 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("Likes") + .HasColumnType("int"); + b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("nvarchar(200)"); + b.Property("OrganizerId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParticipantsCount") + .HasColumnType("int"); + b.Property("Place") .HasMaxLength(200) .HasColumnType("nvarchar(200)"); @@ -3115,6 +3124,11 @@ namespace Kurs.Platform.Migrations b.Property("TypeId") .HasColumnType("uniqueidentifier"); + b.Property("isPublished") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + b.HasKey("Id"); b.HasIndex("CategoryId"); @@ -3173,6 +3187,120 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_EventCategory", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.EventComment", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Comment") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EventId") + .HasColumnType("uniqueidentifier"); + + 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("Likes") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EventId"); + + b.ToTable("T_Adm_EventComment", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.EventPhoto", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + 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("EventId") + .HasColumnType("uniqueidentifier"); + + 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("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Url") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("EventId"); + + b.ToTable("T_Adm_EventPhoto", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.EventType", b => { b.Property("Id") @@ -9111,6 +9239,28 @@ namespace Kurs.Platform.Migrations b.Navigation("Type"); }); + modelBuilder.Entity("Kurs.Platform.Entities.EventComment", b => + { + b.HasOne("Kurs.Platform.Entities.Event", "Event") + .WithMany("Comments") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.EventPhoto", b => + { + b.HasOne("Kurs.Platform.Entities.Event", "Event") + .WithMany("Photos") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Level", b => { b.HasOne("Kurs.Platform.Entities.ClassType", "ClassType") @@ -9508,6 +9658,13 @@ namespace Kurs.Platform.Migrations b.Navigation("Fields"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Event", b => + { + b.Navigation("Comments"); + + b.Navigation("Photos"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.EventCategory", b => { b.Navigation("Events"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index dbafb3e2..5ece7cec 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -1338,13 +1338,154 @@ ], "EventTypes": [ { - "Name": "Gezi" + "Name": "Futbol Turnuvası" }, { - "Name": "Sinema" + "Name": "Basketbol Maçı" }, { - "Name": "Tiyatro" + "Name": "Koşu Etkinliği" + }, + { + "Name": "Tenis Turnuvası" + }, + { + "Name": "Yüzme Yarışı" + }, + { + "Name": "Bisiklet Turu" + }, + { + "Name": "Doğa Yürüyüşü" + }, + { + "Name": "Yoga Seansı" + }, + { + "Name": "Voleybol Turnuvası" + }, + { + "Name": "Kayak Gezisi" + }, + { + "Name": "Resim Sergisi" + }, + { + "Name": "Tiyatro Gösterisi" + }, + { + "Name": "Sinema Gecesi" + }, + { + "Name": "Heykel Atölyesi" + }, + { + "Name": "Fotoğraf Sergisi" + }, + { + "Name": "Ebru Atölyesi" + }, + { + "Name": "Kısa Film Yarışması" + }, + { + "Name": "Karikatür Sergisi" + }, + { + "Name": "Grafik Tasarım Workshopu" + }, + { + "Name": "Kültürel Sanat Günü" + }, + { + "Name": "Şehir Gezisi" + }, + { + "Name": "Tarihi Miras Turu" + }, + { + "Name": "Müze Ziyareti" + }, + { + "Name": "Kültürel Tanıtım Günü" + }, + { + "Name": "Yöresel Lezzetler Etkinliği" + }, + { + "Name": "Farklı Kültürlerle Tanışma" + }, + { + "Name": "Festival Katılımı" + }, + { + "Name": "Köy Gezisi" + }, + { + "Name": "Anıt ve Ören Yeri Ziyareti" + }, + { + "Name": "Uluslararası Kültür Buluşması" + }, + { + "Name": "Konser" + }, + { + "Name": "Koro Gösterisi" + }, + { + "Name": "Enstrüman Atölyesi" + }, + { + "Name": "DJ Gecesi" + }, + { + "Name": "Karaoke Yarışması" + }, + { + "Name": "Müzik Festivali" + }, + { + "Name": "Caz Akşamı" + }, + { + "Name": "Halk Müziği Gecesi" + }, + { + "Name": "Rock Konseri" + }, + { + "Name": "Müzik Dinleti Gecesi" + }, + { + "Name": "Teknik Eğitim Semineri" + }, + { + "Name": "Kariyer Gelişim Workshopu" + }, + { + "Name": "Liderlik Eğitimi" + }, + { + "Name": "İş Güvenliği Eğitimi" + }, + { + "Name": "İletişim Becerileri Atölyesi" + }, + { + "Name": "Yazılım Geliştirme Kampı" + }, + { + "Name": "Sunum Teknikleri Eğitimi" + }, + { + "Name": "Yapay Zeka Semineri" + }, + { + "Name": "Proje Yönetimi Eğitimi" + }, + { + "Name": "Yabancı Dil Workshopu" } ], "EventCategories": [ @@ -1354,14 +1495,55 @@ { "Name": "Sanat" }, + { + "Name": "Kültür" + }, { "Name": "Müzik" }, { "Name": "Eğitim" + } + ], + "Events": [ + { + "CategoryName": "Spor", + "TypeName": "Futbol Turnuvası", + "Name": "Yaz Futbol Turnuvası 2025", + "Place": "Şirket Kampüsü Spor Alanı", + "Description": "Tüm departmanların katılımıyla düzenlenen geleneksel yaz futbol turnuvası.", + "Status": "Published", + "ParticipantsCount": 64, + "OrganizerUserName": "system@sozsoft.com", + "Likes": 120, + "Photos": [], + "Comments": [] }, { - "Name": "Kültür" + "CategoryName": "Kültür", + "TypeName": "Kültürel Sanat Günü", + "Name": "Kültür Gezisi: Kapadokya", + "Place": "Kapadokya, Nevşehir", + "Description": "Çalışanlarımıza özel, rehber eşliğinde 2 günlük kültürel gezi.", + "Status": "Published", + "ParticipantsCount": 25, + "OrganizerUserName": "system@sozsoft.com", + "Likes": 45, + "Photos": [], + "Comments": [] + }, + { + "CategoryName": "Müzik", + "TypeName": "Caz Akşamı", + "Name": "Müzik Dinletisi: Jazz Akşamı", + "Place": "Şirket Konferans Salonu", + "Description": "Caz müziğinin en güzel örneklerinin canlı performanslarla sunulacağı özel akşam.", + "Status": "Published", + "ParticipantsCount": 40, + "OrganizerUserName": "system@sozsoft.com", + "Likes": 85, + "Photos": [], + "Comments": [] } ], "MeetingMethods": [ diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index f6f5d290..d709936c 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -12,11 +12,14 @@ using Volo.Abp.Domain.Repositories; using Microsoft.EntityFrameworkCore; using System.Linq; using System.Collections.Generic; +using Volo.Abp.Identity; +using Volo.Abp.Users; namespace Kurs.Platform.Data.Seeds; public class TenantDataSeeder : IDataSeedContributor, ITransientDependency { + private readonly IRepository _repositoryUser; private readonly IRepository _globalSearch; private readonly IRepository _customEndpointRepository; private readonly IRepository _customComponentRepository; @@ -59,6 +62,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _questionRepository; public TenantDataSeeder( + IRepository repositoryUser, IRepository globalSearch, IRepository sectorRepository, IRepository uomCategoryRepository, @@ -101,6 +105,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository questionRepository ) { + _repositoryUser = repositoryUser; _globalSearch = globalSearch; _sectorRepository = sectorRepository; _uomCategoryRepository = uomCategoryRepository; @@ -694,6 +699,34 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency } } + foreach (var item in items.Events) + { + var exists = await _eventRepository.AnyAsync(x => x.Name == item.Name); + + if (!exists) + { + var category = await _eventCategoryRepository.FirstOrDefaultAsync(x => x.Name == item.CategoryName); + var type = await _eventTypeRepository.FirstOrDefaultAsync(x => x.Name == item.TypeName); + var user = await _repositoryUser.FirstOrDefaultAsync(x => x.UserName == item.OrganizerUserName); + + if (category != null && type != null) + { + await _eventRepository.InsertAsync(new Event + { + CategoryId = category.Id, + TypeId = type.Id, + Name = item.Name, + Place = item.Place, + Description = item.Description, + OrganizerId = user.Id, + Status = item.Status, + ParticipantsCount = item.ParticipantsCount, + Likes = item.Likes + }); + } + } + } + foreach (var item in items.Sources) { var exists = await _sourceRepository.AnyAsync(x => x.Name == item.Name); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index 9d07461f..6395cc13 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -45,6 +45,7 @@ public class TenantSeederDto public List ClassCancellationReasons { get; set; } public List EventTypes { get; set; } public List EventCategories { get; set; } + public List Events { get; set; } public List Sources { get; set; } public List Interesting { get; set; } public List Programs { get; set; } @@ -321,12 +322,15 @@ public class EventCategorySeedDto public class EventSeedDto { - public Guid CategoryId { get; set; } - public Guid TypeId { get; set; } + public string CategoryName { get; set; } + public string TypeName { get; set; } public string Name { get; set; } public string Place { get; set; } public string Description { get; set; } public string Status { get; set; } + public string OrganizerUserName { get; set; } + public int ParticipantsCount { get; set; } + public int Likes { get; set; } } public class SourceSeedDto diff --git a/ui/src/mocks/mockEmployees.ts b/ui/src/mocks/mockEmployees.ts index 716fcd51..f76cfb07 100644 --- a/ui/src/mocks/mockEmployees.ts +++ b/ui/src/mocks/mockEmployees.ts @@ -21,7 +21,7 @@ export const mockEmployees: HrEmployee[] = [ personalPhone: "+90 532 555 0101", avatar: "https://i.pravatar.cc/150?img=12", nationalId: "12345678901", - birthDate: new Date("1988-02-14"), + birthDate: new Date("1988-10-20"), gender: GenderEnum.Male, maritalStatus: MaritalStatusEnum.Married, address: { diff --git a/ui/src/mocks/mockIntranet.ts b/ui/src/mocks/mockIntranet.ts index d0dd0993..a0b49657 100644 --- a/ui/src/mocks/mockIntranet.ts +++ b/ui/src/mocks/mockIntranet.ts @@ -7,9 +7,6 @@ import { Certificate, ExpenseRequest, Task, - Birthday, - WorkAnniversary, - QuickLink, Training, Reservation, MealMenu, @@ -127,7 +124,7 @@ export const mockEvents: CalendarEvent[] = [ 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-09-10'), + date: new Date('2025-20-22'), location: 'Ofis - Ana Salon', organizer: mockEmployees[0], participants: 28, @@ -160,7 +157,7 @@ export const mockEvents: CalendarEvent[] = [ 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-06-20'), + date: new Date('2025-10-25'), location: 'Spor Kompleksi Halı Saha', organizer: mockEmployees[2], participants: 32, @@ -341,7 +338,7 @@ export const mockTasks: Task[] = [ comments: 1, }, ] - +2 export const mockDocuments: Document[] = [ { id: 'doc1', @@ -390,104 +387,6 @@ export const mockDocuments: Document[] = [ }, ] -export const mockBirthdays: Birthday[] = [ - { - employee: mockEmployees[0], - date: new Date('1990-10-20'), // Bugün - age: 35, - }, - { - employee: mockEmployees[1], - date: new Date('1992-10-21'), // Bu hafta içinde - age: 33, - }, - { - employee: mockEmployees[2], - date: new Date('1988-10-23'), // Bu hafta içinde - age: 37, - }, - { - employee: mockEmployees[3], - date: new Date('1995-10-28'), // Bu ay içinde - age: 30, - }, -] - -export const mockAnniversaries: WorkAnniversary[] = [ - { - employee: mockEmployees[2], - hireDate: new Date('2019-10-10'), // Bu ay (Ekim) - years: 6, - }, - { - employee: mockEmployees[4], - hireDate: new Date('2020-10-15'), // Bu ay (Ekim) - years: 5, - }, - { - employee: mockEmployees[0], - hireDate: new Date('2021-10-20'), // Bu ay (Ekim) - years: 4, - }, -] - -export const mockQuickLinks: QuickLink[] = [ - { - id: 'ql1', - name: 'İzin Talebi', - description: 'Yıllık izin talebinde bulun', - icon: '🏖️', - url: '/intranet/hr/leave', - color: '#3b82f6', - category: 'İnsan Kaynakları', - }, - { - id: 'ql2', - name: 'Görevlerim', - description: 'Atanan görevleri görüntüle', - icon: '✅', - url: '/intranet/tasks', - color: '#10b981', - category: 'Proje Yönetimi', - }, - { - id: 'ql3', - name: 'Dokümanlar', - description: 'Şirket dokümanlarına eriş', - icon: '📁', - url: '/intranet/documents', - color: '#f59e0b', - category: 'Bilgi Yönetimi', - }, - { - id: 'ql4', - name: 'Etkinlikler', - description: 'Yaklaşan etkinlikler', - icon: '📅', - url: '/intranet/events', - color: '#8b5cf6', - category: 'Takvim', - }, - { - id: 'ql5', - name: 'IT Destek', - description: 'Teknik destek talebi oluştur', - icon: '🛠️', - url: '/intranet/it-support', - color: '#ef4444', - category: 'IT', - }, - { - id: 'ql6', - name: 'Mesai Girişi', - description: 'Mesai saatlerini kaydet', - icon: '⏰', - url: '/intranet/hr/timesheet', - color: '#06b6d4', - category: 'İnsan Kaynakları', - }, -] - export const mockTrainings: Training[] = [ { id: 'tr1', @@ -635,7 +534,7 @@ export const mockReservations: Reservation[] = [ export const mockMealMenus: MealMenu[] = [ { id: 'menu1', - date: new Date('2024-10-21'), + date: new Date('2025-10-20'), dayOfWeek: 'Pazartesi', meals: [ { @@ -647,7 +546,7 @@ export const mockMealMenus: MealMenu[] = [ }, { id: 'menu2', - date: new Date('2024-10-22'), + date: new Date('2025-10-21'), dayOfWeek: 'Salı', meals: [ { @@ -659,7 +558,7 @@ export const mockMealMenus: MealMenu[] = [ }, { id: 'menu3', - date: new Date('2024-10-23'), + date: new Date('2025-10-22'), dayOfWeek: 'Çarşamba', meals: [ { @@ -671,7 +570,7 @@ export const mockMealMenus: MealMenu[] = [ }, { id: 'menu4', - date: new Date('2024-10-24'), + date: new Date('2025-10-23'), dayOfWeek: 'Perşembe', meals: [ { @@ -683,7 +582,7 @@ export const mockMealMenus: MealMenu[] = [ }, { id: 'menu5', - date: new Date('2024-10-25'), + date: new Date('2025-10-24'), dayOfWeek: 'Cuma', meals: [ { diff --git a/ui/src/types/intranet.ts b/ui/src/types/intranet.ts index 8cc6ac60..e4b58d4a 100644 --- a/ui/src/types/intranet.ts +++ b/ui/src/types/intranet.ts @@ -17,15 +17,6 @@ export interface Announcement { imageUrl?: string } -// Etkinlik Yorumu -export interface EventComment { - id: string - author: HrEmployee - content: string - creationTime: Date - likes: number -} - // Etkinlik export interface CalendarEvent { id: string @@ -42,6 +33,15 @@ export interface CalendarEvent { isPublished: boolean } +// Etkinlik Yorumu +export interface EventComment { + id: string + author: HrEmployee + content: string + creationTime: Date + likes: number +} + // Harcama export interface ExpenseRequest { id: string @@ -94,31 +94,6 @@ export interface Document { tags: string[] } -// Doğum günü -export interface Birthday { - employee: HrEmployee - date: Date - age?: number -} - -// İş yıldönümü -export interface WorkAnniversary { - employee: HrEmployee - hireDate: Date - years: number -} - -// Hızlı Erişim -export interface QuickLink { - id: string - name: string - description: string - icon: string - url: string - color: string - category: string -} - // Eğitim export interface Training { id: string @@ -218,28 +193,7 @@ export interface Visitor { photo?: string } -export interface MediaItem { - id: string - type: 'image' | 'video' - url: string - file?: File -} - -export interface LightboxMedia { - type: 'image' | 'video' - url?: string - urls?: string[] -} - -export interface Location { - id: string - name: string - address: string - lat: number - lng: number - placeId?: string -} - +// Sosyal Duvar export interface SocialPost { id: string author: { @@ -295,3 +249,25 @@ export interface SocialPost { }> isOwnPost: boolean } + +export interface MediaItem { + id: string + type: 'image' | 'video' + url: string + file?: File +} + +export interface LightboxMedia { + type: 'image' | 'video' + url?: string + urls?: string[] +} + +export interface Location { + id: string + name: string + address: string + lat: number + lng: number + placeId?: string +} \ No newline at end of file diff --git a/ui/src/views/intranet/Dashboard.tsx b/ui/src/views/intranet/Dashboard.tsx index 29971953..a2d7ffe6 100644 --- a/ui/src/views/intranet/Dashboard.tsx +++ b/ui/src/views/intranet/Dashboard.tsx @@ -6,13 +6,12 @@ import relativeTime from 'dayjs/plugin/relativeTime' import isBetween from 'dayjs/plugin/isBetween' // Widgets -import TodayEvents from './widgets/TodayEvents' import TodayBirthdays from './widgets/TodayBirthdays' import UpcomingEvents from './widgets/UpcomingEvents' import RecentDocuments from './widgets/RecentDocuments' import ImportantAnnouncements from './widgets/ImportantAnnouncements' import PriorityTasks from './widgets/PriorityTasks' -import WeeklyMenu from './widgets/WeeklyMenu' +import MealWeeklyMenu from './widgets/MealWeeklyMenu' import ShuttleSchedule from './widgets/ShuttleSchedule' import LeaveManagement from './widgets/LeaveManagement' import OvertimeManagement from './widgets/OvertimeManagement' @@ -83,11 +82,10 @@ const IntranetDashboard: React.FC = () => { -
-
- - +
+
+ setShowReservationModal(true)} /> @@ -101,7 +99,7 @@ const IntranetDashboard: React.FC = () => {
- + setShowLeaveModal(true)} /> setShowOvertimeModal(true)} /> diff --git a/ui/src/views/intranet/widgets/ActiveSurveys.tsx b/ui/src/views/intranet/widgets/ActiveSurveys.tsx index a0e858cd..dfa16a4b 100644 --- a/ui/src/views/intranet/widgets/ActiveSurveys.tsx +++ b/ui/src/views/intranet/widgets/ActiveSurveys.tsx @@ -1,7 +1,8 @@ import React from 'react' import { FaClipboardCheck } from 'react-icons/fa' import dayjs from 'dayjs' -import { mockSurveys, Survey } from '../../../mocks/mockIntranet' +import { mockSurveys } from '../../../mocks/mockIntranet' +import { Survey } from '@/types/intranet' interface ActiveSurveysProps { onTakeSurvey: (survey: Survey) => void diff --git a/ui/src/views/intranet/widgets/ImportantAnnouncements.tsx b/ui/src/views/intranet/widgets/ImportantAnnouncements.tsx index c9c0e687..c2be798e 100644 --- a/ui/src/views/intranet/widgets/ImportantAnnouncements.tsx +++ b/ui/src/views/intranet/widgets/ImportantAnnouncements.tsx @@ -1,7 +1,8 @@ import React from 'react' import { FaBell, FaEye } from 'react-icons/fa' import dayjs from 'dayjs' -import { mockAnnouncements, Announcement } from '../../../mocks/mockIntranet' +import { mockAnnouncements } from '../../../mocks/mockIntranet' +import { Announcement } from '@/types/intranet' interface ImportantAnnouncementsProps { onAnnouncementClick: (announcement: Announcement) => void diff --git a/ui/src/views/intranet/widgets/WeeklyMenu.tsx b/ui/src/views/intranet/widgets/MealWeeklyMenu.tsx similarity index 93% rename from ui/src/views/intranet/widgets/WeeklyMenu.tsx rename to ui/src/views/intranet/widgets/MealWeeklyMenu.tsx index ed3ea673..5df5f9c5 100644 --- a/ui/src/views/intranet/widgets/WeeklyMenu.tsx +++ b/ui/src/views/intranet/widgets/MealWeeklyMenu.tsx @@ -6,8 +6,8 @@ import { mockMealMenus } from '../../../mocks/mockIntranet' dayjs.extend(isBetween) -const WeeklyMenu: React.FC = () => { - const weekMenus = mockMealMenus.filter((menu) => { +const MealWeeklyMenu: React.FC = () => { + const mealWeekMenus = mockMealMenus.filter((menu) => { const menuDate = dayjs(menu.date) const today = dayjs() const weekStart = today.startOf('week') @@ -26,7 +26,7 @@ const WeeklyMenu: React.FC = () => {
- {weekMenus.map((menu) => { + {mealWeekMenus.map((menu) => { const isToday = dayjs(menu.date).isSame(dayjs(), 'day') return (
{ ) } -export default WeeklyMenu +export default MealWeeklyMenu diff --git a/ui/src/views/intranet/widgets/TodayBirthdays.tsx b/ui/src/views/intranet/widgets/TodayBirthdays.tsx index c310d50b..158a5bd1 100644 --- a/ui/src/views/intranet/widgets/TodayBirthdays.tsx +++ b/ui/src/views/intranet/widgets/TodayBirthdays.tsx @@ -1,12 +1,13 @@ import React from 'react' import dayjs from 'dayjs' -import { mockBirthdays } from '../../../mocks/mockIntranet' +import { mockEmployees } from '@/mocks/mockEmployees' const TodayBirthdays: React.FC = () => { - const todayBirthdays = mockBirthdays.filter((b) => { - const birthDate = dayjs(b.date) - const today = dayjs() - return birthDate.month() === today.month() && birthDate.date() === today.date() + const today = dayjs() + const todayBirthdays = mockEmployees.filter((b) => { + return ( + dayjs(b.birthDate).month() === today.month() && dayjs(b.birthDate).date() === today.date() + ) }) return ( @@ -24,19 +25,19 @@ const TodayBirthdays: React.FC = () => { className="flex items-center gap-3 p-3 bg-white/50 dark:bg-gray-800/50 rounded-lg" > {birthday.employee.fullName}

- {birthday.employee.fullName} + {birthday.fullName}

- {birthday.age} yaşında 🎉 + {today.diff(dayjs(birthday.birthDate), 'year')} yaşında 🎉

- {birthday.employee.department?.name || 'Genel'} + {birthday.department?.name || 'Genel'}