Intranet Dashboard Events

This commit is contained in:
Sedat Öztürk 2025-10-28 21:59:07 +03:00
parent a719b965b1
commit b5c61e9a6d
10 changed files with 287 additions and 155 deletions

View file

@ -53,7 +53,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
{ {
var employee = await _employeeRepository var employee = await _employeeRepository
.WithDetailsAsync(e => e.JobPosition) .WithDetailsAsync(e => e.JobPosition)
.ContinueWith(t => t.Result.FirstOrDefault(e => e.Id == evt.OrganizerId)); .ContinueWith(t => t.Result.FirstOrDefault(e => e.Id == evt.EmployeeId));
if (employee != null) if (employee != null)
{ {
@ -73,7 +73,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
Avatar = employee.Avatar Avatar = employee.Avatar
}, },
Participants = evt.ParticipantsCount, Participants = evt.ParticipantsCount,
Photos = evt.Photos?.Select(p => p.Url).ToList() ?? new List<string>(), Photos = evt.Photos?.Select(p => p.Url).ToList() ?? [],
Comments = [], Comments = [],
Likes = evt.Likes, Likes = evt.Likes,
IsPublished = evt.isPublished IsPublished = evt.isPublished
@ -86,7 +86,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
{ {
var commentAuthor = await _employeeRepository var commentAuthor = await _employeeRepository
.WithDetailsAsync(e => e.JobPosition) .WithDetailsAsync(e => e.JobPosition)
.ContinueWith(t => t.Result.FirstOrDefault(e => e.Id == comment.UserId)); .ContinueWith(t => t.Result.FirstOrDefault(e => e.Id == comment.EmployeeId));
if (commentAuthor != null) if (commentAuthor != null)
{ {
@ -100,7 +100,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
Position = commentAuthor.JobPosition.Name, Position = commentAuthor.JobPosition.Name,
Avatar = commentAuthor.Avatar Avatar = commentAuthor.Avatar
}, },
Content = comment.Comment, Content = comment.Content,
CreationTime = comment.CreationTime, CreationTime = comment.CreationTime,
Likes = comment.Likes Likes = comment.Likes
}); });

View file

@ -17,15 +17,15 @@ public class Event : FullAuditedEntity<Guid>, IMultiTenant
public string Description { get; set; } public string Description { get; set; }
public string Status { get; set; } public string Status { get; set; }
public Guid OrganizerId { get; set; } public Guid EmployeeId { get; set; }
// public HrEmployee Organizer { get; set; } public Employee Employee { get; set; }
public int ParticipantsCount { get; set; } public int ParticipantsCount { get; set; }
// public ICollection<HrEmployee> Participants { get; set; } = new List<HrEmployee>();
// Medya ve etkileşim // public ICollection<Employee> Participants { get; set; } = [];
public ICollection<EventPhoto> Photos { get; set; } = []; public ICollection<EventPhoto> Photos { get; set; } = [];
public ICollection<EventComment> Comments { get; set; } = []; public ICollection<EventComment> Comments { get; set; } = [];
public int Likes { get; set; } public int Likes { get; set; }
public bool isPublished { get; set; } = false; public bool isPublished { get; set; } = false;

View file

@ -9,8 +9,8 @@ public class EventComment : FullAuditedEntity<Guid>, IMultiTenant
public Guid? TenantId { get; set; } public Guid? TenantId { get; set; }
public Guid EventId { get; set; } public Guid EventId { get; set; }
public Guid UserId { get; set; } public Guid EmployeeId { get; set; }
public string Comment { get; set; } public string Content { get; set; }
public int Likes { get; set; } public int Likes { get; set; }
public Event Event { get; set; } public Event Event { get; set; }

View file

@ -1148,7 +1148,7 @@ public class PlatformDbContext :
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventComment)), Prefix.DbSchema); b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventComment)), Prefix.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.Property(x => x.Comment).HasMaxLength(500); b.Property(x => x.Content).HasMaxLength(500);
b.Property(x => x.Likes).HasDefaultValue(0); b.Property(x => x.Likes).HasDefaultValue(0);
// Event -> EventComment (1 - N) // Event -> EventComment (1 - N)

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Kurs.Platform.Migrations namespace Kurs.Platform.Migrations
{ {
[DbContext(typeof(PlatformDbContext))] [DbContext(typeof(PlatformDbContext))]
[Migration("20251028175633_Initial")] [Migration("20251028185430_Initial")]
partial class Initial partial class Initial
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -3740,6 +3740,9 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(1000) .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)"); .HasColumnType("nvarchar(1000)");
b.Property<Guid>("EmployeeId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("bit") .HasColumnType("bit")
@ -3762,9 +3765,6 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("nvarchar(200)"); .HasColumnType("nvarchar(200)");
b.Property<Guid>("OrganizerId")
.HasColumnType("uniqueidentifier");
b.Property<int>("ParticipantsCount") b.Property<int>("ParticipantsCount")
.HasColumnType("int"); .HasColumnType("int");
@ -3792,6 +3792,8 @@ namespace Kurs.Platform.Migrations
b.HasIndex("CategoryId"); b.HasIndex("CategoryId");
b.HasIndex("EmployeeId");
b.HasIndex("TypeId"); b.HasIndex("TypeId");
b.ToTable("T_Net_Event", (string)null); b.ToTable("T_Net_Event", (string)null);
@ -3851,7 +3853,7 @@ namespace Kurs.Platform.Migrations
b.Property<Guid>("Id") b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Comment") b.Property<string>("Content")
.HasMaxLength(500) .HasMaxLength(500)
.HasColumnType("nvarchar(500)"); .HasColumnType("nvarchar(500)");
@ -3871,6 +3873,9 @@ namespace Kurs.Platform.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<Guid>("EmployeeId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("EventId") b.Property<Guid>("EventId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
@ -3897,9 +3902,6 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("TenantId"); .HasColumnName("TenantId");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("EventId"); b.HasIndex("EventId");
@ -11721,6 +11723,12 @@ namespace Kurs.Platform.Migrations
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.HasOne("Kurs.Platform.Entities.Employee", "Employee")
.WithMany()
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Platform.Entities.EventType", "Type") b.HasOne("Kurs.Platform.Entities.EventType", "Type")
.WithMany("Events") .WithMany("Events")
.HasForeignKey("TypeId") .HasForeignKey("TypeId")
@ -11729,6 +11737,8 @@ namespace Kurs.Platform.Migrations
b.Navigation("Category"); b.Navigation("Category");
b.Navigation("Employee");
b.Navigation("Type"); b.Navigation("Type");
}); });

View file

@ -3338,47 +3338,6 @@ namespace Kurs.Platform.Migrations
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable(
name: "T_Net_Event",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
Place = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
Status = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
OrganizerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ParticipantsCount = table.Column<int>(type: "int", nullable: false),
Likes = table.Column<int>(type: "int", nullable: false),
isPublished = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Net_Event", x => x.Id);
table.ForeignKey(
name: "FK_T_Net_Event_T_Net_EventCategory_CategoryId",
column: x => x.CategoryId,
principalTable: "T_Net_EventCategory",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_T_Net_Event_T_Net_EventType_TypeId",
column: x => x.TypeId,
principalTable: "T_Net_EventType",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "T_Sas_ApiEndpoint", name: "T_Sas_ApiEndpoint",
columns: table => new columns: table => new
@ -3806,62 +3765,6 @@ namespace Kurs.Platform.Migrations
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable(
name: "T_Net_EventComment",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EventId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Comment = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
Likes = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Net_EventComment", x => x.Id);
table.ForeignKey(
name: "FK_T_Net_EventComment_T_Net_Event_EventId",
column: x => x.EventId,
principalTable: "T_Net_Event",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "T_Net_EventPhoto",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EventId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Url = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Net_EventPhoto", x => x.Id);
table.ForeignKey(
name: "FK_T_Net_EventPhoto_T_Net_Event_EventId",
column: x => x.EventId,
principalTable: "T_Net_Event",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "T_Sas_ReportGenerated", name: "T_Sas_ReportGenerated",
columns: table => new columns: table => new
@ -4432,6 +4335,53 @@ namespace Kurs.Platform.Migrations
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable(
name: "T_Net_Event",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
Place = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
Status = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
EmployeeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ParticipantsCount = table.Column<int>(type: "int", nullable: false),
Likes = table.Column<int>(type: "int", nullable: false),
isPublished = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Net_Event", x => x.Id);
table.ForeignKey(
name: "FK_T_Net_Event_T_Hr_Employee_EmployeeId",
column: x => x.EmployeeId,
principalTable: "T_Hr_Employee",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_T_Net_Event_T_Net_EventCategory_CategoryId",
column: x => x.CategoryId,
principalTable: "T_Net_EventCategory",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_T_Net_Event_T_Net_EventType_TypeId",
column: x => x.TypeId,
principalTable: "T_Net_EventType",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "T_Net_Reservation", name: "T_Net_Reservation",
columns: table => new columns: table => new
@ -4565,6 +4515,62 @@ namespace Kurs.Platform.Migrations
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable(
name: "T_Net_EventComment",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EventId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
EmployeeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Content = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
Likes = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Net_EventComment", x => x.Id);
table.ForeignKey(
name: "FK_T_Net_EventComment_T_Net_Event_EventId",
column: x => x.EventId,
principalTable: "T_Net_Event",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "T_Net_EventPhoto",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EventId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Url = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Net_EventPhoto", x => x.Id);
table.ForeignKey(
name: "FK_T_Net_EventPhoto_T_Net_Event_EventId",
column: x => x.EventId,
principalTable: "T_Net_Event",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "T_Net_SocialComment", name: "T_Net_SocialComment",
columns: table => new columns: table => new
@ -5420,6 +5426,11 @@ namespace Kurs.Platform.Migrations
table: "T_Net_Event", table: "T_Net_Event",
column: "CategoryId"); column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_T_Net_Event_EmployeeId",
table: "T_Net_Event",
column: "EmployeeId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_T_Net_Event_TypeId", name: "IX_T_Net_Event_TypeId",
table: "T_Net_Event", table: "T_Net_Event",

View file

@ -3737,6 +3737,9 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(1000) .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)"); .HasColumnType("nvarchar(1000)");
b.Property<Guid>("EmployeeId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("bit") .HasColumnType("bit")
@ -3759,9 +3762,6 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("nvarchar(200)"); .HasColumnType("nvarchar(200)");
b.Property<Guid>("OrganizerId")
.HasColumnType("uniqueidentifier");
b.Property<int>("ParticipantsCount") b.Property<int>("ParticipantsCount")
.HasColumnType("int"); .HasColumnType("int");
@ -3789,6 +3789,8 @@ namespace Kurs.Platform.Migrations
b.HasIndex("CategoryId"); b.HasIndex("CategoryId");
b.HasIndex("EmployeeId");
b.HasIndex("TypeId"); b.HasIndex("TypeId");
b.ToTable("T_Net_Event", (string)null); b.ToTable("T_Net_Event", (string)null);
@ -3848,7 +3850,7 @@ namespace Kurs.Platform.Migrations
b.Property<Guid>("Id") b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Comment") b.Property<string>("Content")
.HasMaxLength(500) .HasMaxLength(500)
.HasColumnType("nvarchar(500)"); .HasColumnType("nvarchar(500)");
@ -3868,6 +3870,9 @@ namespace Kurs.Platform.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<Guid>("EmployeeId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("EventId") b.Property<Guid>("EventId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
@ -3894,9 +3899,6 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("TenantId"); .HasColumnName("TenantId");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("EventId"); b.HasIndex("EventId");
@ -11718,6 +11720,12 @@ namespace Kurs.Platform.Migrations
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.HasOne("Kurs.Platform.Entities.Employee", "Employee")
.WithMany()
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Platform.Entities.EventType", "Type") b.HasOne("Kurs.Platform.Entities.EventType", "Type")
.WithMany("Events") .WithMany("Events")
.HasForeignKey("TypeId") .HasForeignKey("TypeId")
@ -11726,6 +11734,8 @@ namespace Kurs.Platform.Migrations
b.Navigation("Category"); b.Navigation("Category");
b.Navigation("Employee");
b.Navigation("Type"); b.Navigation("Type");
}); });

View file

@ -100,7 +100,9 @@
"props": null, "props": null,
"description": null, "description": null,
"isActive": true, "isActive": true,
"dependencies": ["AxiosListComponent"] "dependencies": [
"AxiosListComponent"
]
} }
], ],
"ReportCategories": [ "ReportCategories": [
@ -1548,85 +1550,138 @@
} }
], ],
"EventComments": [ "EventComments": [
{
"EventName": "Yaz Futbol Turnuvası 2025",
"EmployeeCode": "EMP-001",
"Content": "Muhteşem bir gündü! Yılın en güzel etkinliği 🎉",
"Likes": 12
},
{
"EventName": "Yaz Futbol Turnuvası 2025",
"EmployeeCode": "EMP-002",
"Content": "Voleybol turnuvası harikaydı, gelecek yıl yine yapalım!",
"Likes": 8
},
{
"EventName": "Kültür Gezisi: Kapadokya",
"EmployeeCode": "EMP-004",
"Content": "Ekibimiz 2. oldu! Çok gurur duydum herkesle 💪",
"Likes": 15
},
{
"EventName": "Kültür Gezisi: Kapadokya",
"EmployeeCode": "EMP-004",
"Content": "Gece boyunca kod yazmak ve pizza yemek priceless! 🍕",
"Likes": 10
},
{
"EventName": "Müzik Dinletisi: Jazz Akşamı",
"EmployeeCode": "EMP-001",
"Content": "İT departmanı şampiyon oldu! Gelecek sene kupayı koruyacağız 🏆",
"Likes": 18
},
{
"EventName": "Müzik Dinletisi: Jazz Akşamı",
"EmployeeCode": "EMP-002",
"Content": "Yılın en şık gecesi! Organizasyon mükemmeldi 👏",
"Likes": 25
},
{
"EventName": "Müzik Dinletisi: Jazz Akşamı",
"EmployeeCode": "EMP-002",
"Content": "Tombala hediyelerim harika, çok teşekkürler! 🎁",
"Likes": 14
},
{
"EventName": "Müzik Dinletisi: Jazz Akşamı",
"EmployeeCode": "EMP-006",
"Content": "Müzik grubunuz süperdi, dans pistinden ayrılamadık! 🎵",
"Likes": 19
},
{
"EventName": "Müzik Dinletisi: Jazz Akşamı",
"EmployeeCode": "EMP-002",
"Content": "İlk defa ebru yaptım, çok huzurlu bir deneyimdi 🎨",
"Likes": 11
}
], ],
"EventPhotos": [ "EventPhotos": [
{ {
"Name": "Yaz Futbol Turnuvası 2025", "EventName": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1530541930197-ff16ac917b0e?w=800" "Url": "https://images.unsplash.com/photo-1530541930197-ff16ac917b0e?w=800"
}, },
{ {
"Name": "Yaz Futbol Turnuvası 2025", "EventName": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1527529482837-4698179dc6ce?w=800" "Url": "https://images.unsplash.com/photo-1527529482837-4698179dc6ce?w=800"
}, },
{ {
"Name": "Yaz Futbol Turnuvası 2025", "EventName": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1528605105345-5344ea20e269?w=800" "Url": "https://images.unsplash.com/photo-1528605105345-5344ea20e269?w=800"
}, },
{ {
"Name": "Yaz Futbol Turnuvası 2025", "EventName": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1504196606672-aef5c9cefc92?w=800" "Url": "https://images.unsplash.com/photo-1504196606672-aef5c9cefc92?w=800"
}, },
{ {
"Name": "Kültür Gezisi: Kapadokya", "EventName": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=800" "Url": "https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=800"
}, },
{ {
"Name": "Kültür Gezisi: Kapadokya", "EventName": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800" "Url": "https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800"
}, },
{ {
"Name": "Kültür Gezisi: Kapadokya", "EventName": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1531482615713-2afd69097998?w=800" "Url": "https://images.unsplash.com/photo-1531482615713-2afd69097998?w=800"
}, },
{ {
"Name": "Müzik Dinletisi: Jazz Akşamı", "EventName": "Müzik Dinletisi: Jazz Akşamı",
"Url": "hhttps://images.unsplash.com/photo-1579952363873-27f3bade9f55?w=800" "Url": "hhttps://images.unsplash.com/photo-1579952363873-27f3bade9f55?w=800"
}, },
{ {
"Name": "Müzik Dinletisi: Jazz Akşamı", "EventName": "Müzik Dinletisi: Jazz Akşamı",
"Url": "https://images.unsplash.com/photo-1574629810360-7efbbe195018?w=800" "Url": "https://images.unsplash.com/photo-1574629810360-7efbbe195018?w=800"
}, },
{ {
"Name": "Müzik Dinletisi: Jazz Akşamı", "EventName": "Müzik Dinletisi: Jazz Akşamı",
"Url": "https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?w=800" "Url": "https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?w=800"
}, },
{ {
"Name": "Müzik Dinletisi: Jazz Akşamı", "EventName": "Müzik Dinletisi: Jazz Akşamı",
"Url": "https://images.unsplash.com/photo-1553778263-73a83bab9b0c?w=800" "Url": "https://images.unsplash.com/photo-1553778263-73a83bab9b0c?w=800"
}, },
{ {
"Name": "Müzik Dinletisi: Jazz Akşamı", "EventName": "Müzik Dinletisi: Jazz Akşamı",
"Url": "https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=800" "Url": "https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=800"
}, },
{ {
"Name": "Yaz Futbol Turnuvası 2025", "EventName": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1519167758481-83f29da8c2b9?w=800" "Url": "https://images.unsplash.com/photo-1519167758481-83f29da8c2b9?w=800"
}, },
{ {
"Name": "Yaz Futbol Turnuvası 2025", "EventName": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1464366400600-7168b8af9bc3?w=800" "Url": "https://images.unsplash.com/photo-1464366400600-7168b8af9bc3?w=800"
}, },
{ {
"Name": "Kültür Gezisi: Kapadokya", "EventName": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1478147427282-58a87a120781?w=800" "Url": "https://images.unsplash.com/photo-1478147427282-58a87a120781?w=800"
}, },
{ {
"Name": "Kültür Gezisi: Kapadokya", "EventName": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800" "Url": "https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800"
}, },
{ {
"Name": "Kültür Gezisi: Kapadokya", "EventName": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=800" "Url": "https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=800"
}, },
{ {
"Name": "Kültür Gezisi: Kapadokya", "EventName": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1513364776144-60967b0f800f?w=800" "Url": "https://images.unsplash.com/photo-1513364776144-60967b0f800f?w=800"
}, },
{ {
"Name": "Kültür Gezisi: Kapadokya", "EventName": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1515405295579-ba7b45403062?w=800" "Url": "https://images.unsplash.com/photo-1515405295579-ba7b45403062?w=800"
} }
], ],
"MeetingMethods": [ "MeetingMethods": [
{ {
@ -2350,7 +2405,12 @@
"minSalary": 80000, "minSalary": 80000,
"maxSalary": 120000, "maxSalary": 120000,
"currencyCode": "USD", "currencyCode": "USD",
"requiredSkills": ["JavaScript", "TypeScript", "React", "Node.js"], "requiredSkills": [
"JavaScript",
"TypeScript",
"React",
"Node.js"
],
"responsibilities": [ "responsibilities": [
"Develop frontend and backend applications", "Develop frontend and backend applications",
"Write clean and maintainable code", "Write clean and maintainable code",
@ -4042,7 +4102,9 @@
{ {
"postContent": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", "postContent": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪",
"type": "video", "type": "video",
"urls": ["https://www.w3schools.com/html/mov_bbb.mp4"] "urls": [
"https://www.w3schools.com/html/mov_bbb.mp4"
]
} }
], ],
"SocialPollOptions": [ "SocialPollOptions": [
@ -4123,4 +4185,4 @@
"employeeCode": "EMP-003" "employeeCode": "EMP-003"
} }
] ]
} }

View file

@ -1513,7 +1513,12 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
if (!exists) if (!exists)
{ {
await _eventCategoryRepository.InsertAsync(new EventCategory { Name = item.Name }, autoSave: true); await _eventCategoryRepository.InsertAsync(
new EventCategory
{
Name = item.Name
}, autoSave: true
);
} }
} }
@ -1536,28 +1541,53 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
Name = item.Name, Name = item.Name,
Place = item.Place, Place = item.Place,
Description = item.Description, Description = item.Description,
OrganizerId = employee.Id, EmployeeId = employee.Id,
Status = item.Status, Status = item.Status,
ParticipantsCount = item.ParticipantsCount, ParticipantsCount = item.ParticipantsCount,
Likes = item.Likes, Likes = item.Likes,
isPublished = item.IsPublished, isPublished = item.IsPublished,
}); }, autoSave: true);
} }
} }
} }
foreach (var item in items.EventPhotos) foreach (var item in items.EventPhotos)
{ {
var exists = await _eventPhotoRepository.AnyAsync(x => x.Url == item.Url); var exists = await _eventPhotoRepository.AnyAsync(x => x.Url == item.Url);
if (!exists) if (!exists)
{ {
var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.Name); var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.EventName);
await _eventPhotoRepository.InsertAsync(new EventPhoto await _eventPhotoRepository.InsertAsync(new EventPhoto
{ {
EventId = eventEntity.Id, EventId = eventEntity.Id,
Url = item.Url Url = item.Url
}, autoSave: true); });
}
}
foreach (var item in items.EventComments)
{
var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.EventName);
if (eventEntity == null)
continue;
var exists = await _eventCommentRepository.AnyAsync(x => x.Content == item.Content);
if (!exists)
{
var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode);
if (employee == null)
continue;
await _eventCommentRepository.InsertAsync(new EventComment
{
EventId = eventEntity.Id,
Content = item.Content,
EmployeeId = employee.Id,
Likes = item.Likes
});
} }
} }
} }

View file

@ -47,6 +47,7 @@ public class TenantSeederDto
public List<EventCategorySeedDto> EventCategories { get; set; } public List<EventCategorySeedDto> EventCategories { get; set; }
public List<EventSeedDto> Events { get; set; } public List<EventSeedDto> Events { get; set; }
public List<EventPhotoSeedDto> EventPhotos { get; set; } public List<EventPhotoSeedDto> EventPhotos { get; set; }
public List<EventCommentSeedDto> EventComments { get; set; }
public List<SourceSeedDto> Sources { get; set; } public List<SourceSeedDto> Sources { get; set; }
public List<InterestingSeedDto> Interesting { get; set; } public List<InterestingSeedDto> Interesting { get; set; }
public List<ProgramSeedDto> Programs { get; set; } public List<ProgramSeedDto> Programs { get; set; }
@ -80,9 +81,17 @@ public class TenantSeederDto
public List<SocialLikeSeedDto> SocialLikes { get; set; } public List<SocialLikeSeedDto> SocialLikes { get; set; }
} }
public class EventCommentSeedDto
{
public string EventName { get; set; }
public string EmployeeCode { get; set; }
public string Content { get; set; }
public int Likes { get; set; }
}
public class EventPhotoSeedDto public class EventPhotoSeedDto
{ {
public string Name { get; set; } public string EventName { get; set; }
public string Url { get; set; } public string Url { get; set; }
} }