Intarnet Event Photo

This commit is contained in:
Sedat ÖZTÜRK 2025-10-28 21:03:15 +03:00
parent 8254ce6736
commit a719b965b1
16 changed files with 654 additions and 360 deletions

View file

@ -0,0 +1,12 @@
using System;
namespace Kurs.Platform.Public;
public class EventCommentDto
{
public string Id { get; set; }
public EventOrganizerDto Author { get; set; }
public string Content { get; set; }
public DateTime CreationTime { get; set; }
public int Likes { get; set; }
}

View file

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
namespace Kurs.Platform.Public;
public class EventDto
{
public string Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Type { get; set; }
public DateTime Date { get; set; }
public string Location { get; set; }
public EventOrganizerDto Organizer { get; set; }
public int Participants { get; set; }
public List<string> Photos { get; set; } = new();
public List<EventCommentDto> Comments { get; set; } = new();
public int Likes { get; set; }
public bool IsPublished { get; set; }
}

View file

@ -0,0 +1,11 @@
using System;
namespace Kurs.Platform.Public;
public class EventOrganizerDto
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Position { get; set; }
public string Avatar { get; set; }
}

View file

@ -0,0 +1,10 @@
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
namespace Kurs.Platform.Public;
public interface IIntranetAppService : IApplicationService
{
Task<IntranetDashboardDto> GetIntranetDashboardAsync();
}

View file

@ -0,0 +1,8 @@
using System.Collections.Generic;
namespace Kurs.Platform.Public;
public class IntranetDashboardDto
{
public List<EventDto> Events { get; set; } = [];
}

View file

@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Localization;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Users;
using static Kurs.Platform.Data.Seeds.SeedConsts;
namespace Kurs.Platform.Public;
@ -162,7 +163,7 @@ public class BlogAppService : PlatformAppService, IBlogAppService
return ObjectMapper.Map<BlogCategory, BlogCategoryDto>(category);
}
[Authorize("App.BlogManagement.Create")]
[Authorize(AppCodes.BlogManagement.BlogCategory + ".Create")]
public async Task<BlogCategoryDto> CreateCategoryAsync(CreateUpdateBlogCategoryDto input)
{
var category = new BlogCategory
@ -180,7 +181,7 @@ public class BlogAppService : PlatformAppService, IBlogAppService
return ObjectMapper.Map<BlogCategory, BlogCategoryDto>(category);
}
[Authorize("App.BlogManagement.Update")]
[Authorize(AppCodes.BlogManagement.BlogCategory + ".Update")]
public async Task<BlogCategoryDto> UpdateCategoryAsync(Guid id, CreateUpdateBlogCategoryDto input)
{
var category = await _categoryRepository.GetAsync(id);
@ -197,7 +198,7 @@ public class BlogAppService : PlatformAppService, IBlogAppService
return ObjectMapper.Map<BlogCategory, BlogCategoryDto>(category);
}
[Authorize("App.BlogManagement.Delete")]
[Authorize(AppCodes.BlogManagement.BlogCategory + ".Delete")]
public async Task DeleteCategoryAsync(Guid id)
{
// Check if category has posts

View file

@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Kurs.Platform.Entities;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Domain.Repositories;
namespace Kurs.Platform.Public;
[Authorize]
public class IntranetAppService : PlatformAppService, IIntranetAppService
{
private readonly IRepository<Event, Guid> _eventRepository;
private readonly IRepository<EventCategory, Guid> _eventCategoryRepository;
private readonly IRepository<EventType, Guid> _eventTypeRepository;
private readonly IRepository<EventPhoto, Guid> _eventPhotoRepository;
private readonly IRepository<EventComment, Guid> _eventCommentRepository;
private readonly IRepository<Employee, Guid> _employeeRepository;
public IntranetAppService(
IRepository<Event, Guid> eventRepository,
IRepository<EventCategory, Guid> eventCategoryRepository,
IRepository<EventType, Guid> eventTypeRepository,
IRepository<EventPhoto, Guid> eventPhotoRepository,
IRepository<EventComment, Guid> eventCommentRepository,
IRepository<Employee, Guid> employeeRepository)
{
_eventRepository = eventRepository;
_eventCategoryRepository = eventCategoryRepository;
_eventTypeRepository = eventTypeRepository;
_eventPhotoRepository = eventPhotoRepository;
_eventCommentRepository = eventCommentRepository;
_employeeRepository = employeeRepository;
}
public async Task<IntranetDashboardDto> GetIntranetDashboardAsync()
{
return new IntranetDashboardDto
{
Events = await GetUpcomingEventsAsync()
};
}
private async Task<List<EventDto>> GetUpcomingEventsAsync()
{
var events = await _eventRepository
.WithDetailsAsync(e => e.Category, e => e.Type, e => e.Photos, e => e.Comments)
.ContinueWith(t => t.Result.ToList().Where(e => e.isPublished).OrderByDescending(e => e.CreationTime));
var result = new List<EventDto>();
foreach (var evt in events)
{
var employee = await _employeeRepository
.WithDetailsAsync(e => e.JobPosition)
.ContinueWith(t => t.Result.FirstOrDefault(e => e.Id == evt.OrganizerId));
if (employee != null)
{
var calendarEvent = new EventDto
{
Id = evt.Id.ToString(),
Title = evt.Name,
Description = evt.Description,
Type = evt.Type?.Name?.ToLowerInvariant() ?? "social",
Date = evt.CreationTime,
Location = evt.Place,
Organizer = new EventOrganizerDto
{
Id = employee.Id,
Name = employee.FullName,
Position = employee.JobPosition.Name,
Avatar = employee.Avatar
},
Participants = evt.ParticipantsCount,
Photos = evt.Photos?.Select(p => p.Url).ToList() ?? new List<string>(),
Comments = [],
Likes = evt.Likes,
IsPublished = evt.isPublished
};
// Comment'lerin author bilgilerini doldur
if (evt.Comments != null && evt.Comments.Any())
{
foreach (var comment in evt.Comments)
{
var commentAuthor = await _employeeRepository
.WithDetailsAsync(e => e.JobPosition)
.ContinueWith(t => t.Result.FirstOrDefault(e => e.Id == comment.UserId));
if (commentAuthor != null)
{
calendarEvent.Comments.Add(new EventCommentDto
{
Id = comment.Id.ToString(),
Author = new EventOrganizerDto
{
Id = commentAuthor.Id,
Name = commentAuthor.FullName,
Position = commentAuthor.JobPosition.Name,
Avatar = commentAuthor.Avatar
},
Content = comment.Comment,
CreationTime = comment.CreationTime,
Likes = comment.Likes
});
}
}
}
result.Add(calendarEvent);
}
}
return result;
}
}

View file

@ -10,7 +10,6 @@ using Microsoft.Extensions.Logging;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;
using static Kurs.Platform.Data.Seeds.SeedConsts;

View file

@ -68,8 +68,6 @@ public static class TableNameResolver
{ nameof(TableNameEnum.Uom), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) },
{ nameof(TableNameEnum.Behavior), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) },
{ nameof(TableNameEnum.EducationStatus), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) },
{ nameof(TableNameEnum.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) },
@ -141,6 +139,8 @@ public static class TableNameResolver
{ nameof(TableNameEnum.EventCategory), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) },
{ nameof(TableNameEnum.EventType), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) },
{ nameof(TableNameEnum.Event), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) },
{ nameof(TableNameEnum.EventPhoto), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) },
{ nameof(TableNameEnum.EventComment), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) },
{ nameof(TableNameEnum.Training), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) },
{ nameof(TableNameEnum.Certificate), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) },
{ nameof(TableNameEnum.Meal), (PlatformConsts.TablePrefix.BranchByName, MenuPrefix.Intranet) },

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Kurs.Platform.Migrations
{
[DbContext(typeof(PlatformDbContext))]
[Migration("20251028123320_Initial")]
[Migration("20251028175633_Initial")]
partial class Initial
{
/// <inheritdoc />
@ -3904,7 +3904,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("EventId");
b.ToTable("T_Adm_EventComment", (string)null);
b.ToTable("T_Net_EventComment", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.EventPhoto", b =>
@ -3957,7 +3957,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("EventId");
b.ToTable("T_Adm_EventPhoto", (string)null);
b.ToTable("T_Net_EventPhoto", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.EventType", b =>

View file

@ -3807,7 +3807,7 @@ namespace Kurs.Platform.Migrations
});
migrationBuilder.CreateTable(
name: "T_Adm_EventComment",
name: "T_Net_EventComment",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
@ -3826,9 +3826,9 @@ namespace Kurs.Platform.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_T_Adm_EventComment", x => x.Id);
table.PrimaryKey("PK_T_Net_EventComment", x => x.Id);
table.ForeignKey(
name: "FK_T_Adm_EventComment_T_Net_Event_EventId",
name: "FK_T_Net_EventComment_T_Net_Event_EventId",
column: x => x.EventId,
principalTable: "T_Net_Event",
principalColumn: "Id",
@ -3836,7 +3836,7 @@ namespace Kurs.Platform.Migrations
});
migrationBuilder.CreateTable(
name: "T_Adm_EventPhoto",
name: "T_Net_EventPhoto",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
@ -3853,9 +3853,9 @@ namespace Kurs.Platform.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_T_Adm_EventPhoto", x => x.Id);
table.PrimaryKey("PK_T_Net_EventPhoto", x => x.Id);
table.ForeignKey(
name: "FK_T_Adm_EventPhoto_T_Net_Event_EventId",
name: "FK_T_Net_EventPhoto_T_Net_Event_EventId",
column: x => x.EventId,
principalTable: "T_Net_Event",
principalColumn: "Id",
@ -5163,16 +5163,6 @@ namespace Kurs.Platform.Migrations
table: "T_Adm_BlogPost",
column: "Slug");
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",
@ -5435,6 +5425,16 @@ namespace Kurs.Platform.Migrations
table: "T_Net_Event",
column: "TypeId");
migrationBuilder.CreateIndex(
name: "IX_T_Net_EventComment_EventId",
table: "T_Net_EventComment",
column: "EventId");
migrationBuilder.CreateIndex(
name: "IX_T_Net_EventPhoto_EventId",
table: "T_Net_EventPhoto",
column: "EventId");
migrationBuilder.CreateIndex(
name: "IX_T_Net_Reservation_EmployeeId",
table: "T_Net_Reservation",
@ -5743,12 +5743,6 @@ namespace Kurs.Platform.Migrations
migrationBuilder.DropTable(
name: "T_Adm_EducationStatus");
migrationBuilder.DropTable(
name: "T_Adm_EventComment");
migrationBuilder.DropTable(
name: "T_Adm_EventPhoto");
migrationBuilder.DropTable(
name: "T_Adm_InstallmentOption");
@ -5836,6 +5830,12 @@ namespace Kurs.Platform.Migrations
migrationBuilder.DropTable(
name: "T_Net_Certificate");
migrationBuilder.DropTable(
name: "T_Net_EventComment");
migrationBuilder.DropTable(
name: "T_Net_EventPhoto");
migrationBuilder.DropTable(
name: "T_Net_Reservation");
@ -5962,9 +5962,6 @@ namespace Kurs.Platform.Migrations
migrationBuilder.DropTable(
name: "T_Adm_BlogCategory");
migrationBuilder.DropTable(
name: "T_Net_Event");
migrationBuilder.DropTable(
name: "T_Adm_Order");
@ -5995,6 +5992,9 @@ namespace Kurs.Platform.Migrations
migrationBuilder.DropTable(
name: "T_Net_Training");
migrationBuilder.DropTable(
name: "T_Net_Event");
migrationBuilder.DropTable(
name: "T_Net_SocialMedia");
@ -6025,18 +6025,18 @@ namespace Kurs.Platform.Migrations
migrationBuilder.DropTable(
name: "P_Sas_ListForm");
migrationBuilder.DropTable(
name: "T_Net_EventCategory");
migrationBuilder.DropTable(
name: "T_Net_EventType");
migrationBuilder.DropTable(
name: "T_Crd_QuestionPool");
migrationBuilder.DropTable(
name: "T_Hr_Survey");
migrationBuilder.DropTable(
name: "T_Net_EventCategory");
migrationBuilder.DropTable(
name: "T_Net_EventType");
migrationBuilder.DropTable(
name: "T_Net_SocialPost");

View file

@ -3901,7 +3901,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("EventId");
b.ToTable("T_Adm_EventComment", (string)null);
b.ToTable("T_Net_EventComment", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.EventPhoto", b =>
@ -3954,7 +3954,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("EventId");
b.ToTable("T_Adm_EventPhoto", (string)null);
b.ToTable("T_Net_EventPhoto", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.EventType", b =>

View file

@ -1512,7 +1512,8 @@
"Description": "Tüm departmanların katılımıyla düzenlenen geleneksel yaz futbol turnuvası.",
"Status": "Published",
"ParticipantsCount": 64,
"OrganizerUserName": "system@sozsoft.com",
"OrganizerEmployeeCode": "EMP-001",
"IsPublished": true,
"Likes": 120,
"Photos": [],
"Comments": []
@ -1525,7 +1526,8 @@
"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",
"OrganizerEmployeeCode": "EMP-002",
"IsPublished": true,
"Likes": 45,
"Photos": [],
"Comments": []
@ -1538,12 +1540,94 @@
"Description": "Caz müziğinin en güzel örneklerinin canlı performanslarla sunulacağı özel akşam.",
"Status": "Published",
"ParticipantsCount": 40,
"OrganizerUserName": "system@sozsoft.com",
"OrganizerEmployeeCode": "EMP-003",
"IsPublished": true,
"Likes": 85,
"Photos": [],
"Comments": []
}
],
"EventComments": [
],
"EventPhotos": [
{
"Name": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1530541930197-ff16ac917b0e?w=800"
},
{
"Name": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1527529482837-4698179dc6ce?w=800"
},
{
"Name": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1528605105345-5344ea20e269?w=800"
},
{
"Name": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1504196606672-aef5c9cefc92?w=800"
},
{
"Name": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=800"
},
{
"Name": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800"
},
{
"Name": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1531482615713-2afd69097998?w=800"
},
{
"Name": "Müzik Dinletisi: Jazz Akşamı",
"Url": "hhttps://images.unsplash.com/photo-1579952363873-27f3bade9f55?w=800"
},
{
"Name": "Müzik Dinletisi: Jazz Akşamı",
"Url": "https://images.unsplash.com/photo-1574629810360-7efbbe195018?w=800"
},
{
"Name": "Müzik Dinletisi: Jazz Akşamı",
"Url": "https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?w=800"
},
{
"Name": "Müzik Dinletisi: Jazz Akşamı",
"Url": "https://images.unsplash.com/photo-1553778263-73a83bab9b0c?w=800"
},
{
"Name": "Müzik Dinletisi: Jazz Akşamı",
"Url": "https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=800"
},
{
"Name": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1519167758481-83f29da8c2b9?w=800"
},
{
"Name": "Yaz Futbol Turnuvası 2025",
"Url": "https://images.unsplash.com/photo-1464366400600-7168b8af9bc3?w=800"
},
{
"Name": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1478147427282-58a87a120781?w=800"
},
{
"Name": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800"
},
{
"Name": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=800"
},
{
"Name": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1513364776144-60967b0f800f?w=800"
},
{
"Name": "Kültür Gezisi: Kapadokya",
"Url": "https://images.unsplash.com/photo-1515405295579-ba7b45403062?w=800"
}
],
"MeetingMethods": [
{
"Name": "Gelen Arama",
@ -2199,6 +2283,63 @@
"name": "Consultant"
}
],
"Departments": [
{
"code": "ÜRT",
"name": "Üretim",
"description": "Üretim departmanı",
"parentDepartmentCode": null,
"subDepartments": [],
"managerCode": "EMP-001",
"costCenterCode": "CC-ADM-001",
"budget": 8500000,
"isActive": true
},
{
"code": "BAK",
"name": "Bakım",
"description": "Bakım departmanı",
"parentDepartmentCode": null,
"subDepartments": [],
"managerCode": "EMP-002",
"costCenterCode": "CC-HR-001",
"budget": 2200000,
"isActive": true
},
{
"code": "KAL",
"name": "Kalite Kontrol",
"description": "Kalite kontrol departmanı",
"parentDepartmentCode": "ÜRT",
"subDepartments": [],
"managerCode": "EMP-003",
"costCenterCode": "CC-FIN-001",
"budget": 1200000,
"isActive": true
},
{
"code": "DEP",
"name": "Depo",
"description": "Depo departmanı",
"parentDepartmentCode": "ÜRT",
"subDepartments": [],
"managerCode": "EMP-004",
"costCenterCode": "CC-FIN-001",
"budget": 2800000,
"isActive": true
},
{
"code": "IDR",
"name": "İdari İşler",
"description": "İdari işler departmanı",
"parentDepartmentCode": null,
"subDepartments": [],
"managerCode": "EMP-005",
"costCenterCode": "CC-HR-001",
"budget": 2500000,
"isActive": true
}
],
"JobPositions": [
{
"code": "DEV-001",
@ -2478,63 +2619,6 @@
"isActive": true
}
],
"Departments": [
{
"code": "ÜRT",
"name": "Üretim",
"description": "Üretim departmanı",
"parentDepartmentCode": null,
"subDepartments": [],
"managerCode": "1",
"costCenterCode": "cc-005",
"budget": 8500000,
"isActive": true
},
{
"code": "BAK",
"name": "Bakım",
"description": "Bakım departmanı",
"parentDepartmentCode": null,
"subDepartments": [],
"managerCode": "7",
"costCenterCode": "cc-011",
"budget": 2200000,
"isActive": true
},
{
"code": "KAL",
"name": "Kalite Kontrol",
"description": "Kalite kontrol departmanı",
"parentDepartmentCode": "ÜRT",
"subDepartments": [],
"managerCode": "5",
"costCenterCode": "cc-007",
"budget": 1200000,
"isActive": true
},
{
"code": "DEP",
"name": "Depo",
"description": "Depo departmanı",
"parentDepartmentCode": "ÜRT",
"subDepartments": [],
"managerCode": "3",
"costCenterCode": "cc-008",
"budget": 2800000,
"isActive": true
},
{
"code": "IDR",
"name": "İdari İşler",
"description": "İdari işler departmanı",
"parentDepartmentCode": null,
"subDepartments": [],
"managerCode": "2",
"costCenterCode": "cc-001",
"budget": 2500000,
"isActive": true
}
],
"CostCenters": [
{
"code": "CC-ADM-001",
@ -2728,13 +2812,13 @@
"emergencyContactrelationship": "Eşi",
"emergencyContactphone": "5325550100",
"hireDate": "09-01-2020",
"terminationDate": "09-01-2020",
"terminationDate": null,
"employmentTypeName": "Full Time",
"jobPositionCode": "1",
"departmentCode": "1",
"jobPositionCode": "MGR-001",
"departmentCode": "BAK",
"workLocation": "Ankara Merkez",
"baseSalary": 65000,
"managerCode": "1",
"managerCode": null,
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "1",
@ -2770,11 +2854,11 @@
"hireDate": "01-06-2021",
"terminationDate": null,
"employmentTypeName": "Full Time",
"jobPositionCode": "2",
"departmentCode": "1",
"jobPositionCode": "HR-001",
"departmentCode": "IDR",
"workLocation": "Ankara Şube",
"baseSalary": 72000,
"managerCode": "1",
"managerCode": "EMP-001",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "2",
@ -2810,11 +2894,11 @@
"hireDate": "10-02-2020",
"terminationDate": null,
"employmentTypeName": "Full Time",
"jobPositionCode": "3",
"departmentCode": "1",
"jobPositionCode": "DEV-001",
"departmentCode": "ÜRT",
"workLocation": "İstanbul HQ",
"baseSalary": 85000,
"managerCode": "1",
"managerCode": "EMP-001",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "2",
@ -2850,11 +2934,11 @@
"hireDate": "10-01-2022",
"terminationDate": null,
"employmentTypeName": "Part Time",
"jobPositionCode": "4",
"departmentCode": "1",
"jobPositionCode": "UX-001",
"departmentCode": "DEP",
"workLocation": "Ankara Şube",
"baseSalary": 60000,
"managerCode": "1",
"managerCode": "EMP-003",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "3",
@ -2890,11 +2974,11 @@
"hireDate": "01-04-2019",
"terminationDate": null,
"employmentTypeName": "Full Time",
"jobPositionCode": "5",
"departmentCode": "1",
"jobPositionCode": "DA-001",
"departmentCode": "IDR",
"workLocation": "İstanbul HQ",
"baseSalary": 95000,
"managerCode": "1",
"managerCode": "EMP-001",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "4",
@ -2930,11 +3014,11 @@
"hireDate": "02-03-2023",
"terminationDate": null,
"employmentTypeName": "Intern",
"jobPositionCode": "6",
"departmentCode": "1",
"jobPositionCode": "CS-001",
"departmentCode": "ÜRT",
"workLocation": "İzmir Ofis",
"baseSalary": 15000,
"managerCode": "1",
"managerCode": "EMP-003",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "1",
@ -2970,11 +3054,11 @@
"hireDate": "09-07-2021",
"terminationDate": null,
"employmentTypeName": "Full Time",
"jobPositionCode": "7",
"departmentCode": "2",
"jobPositionCode": "IT-001",
"departmentCode": "BAK",
"workLocation": "Bursa Depo",
"baseSalary": 75000,
"managerCode": "1",
"managerCode": "EMP-001",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "3",
@ -3010,11 +3094,11 @@
"hireDate": "01-09-2018",
"terminationDate": null,
"employmentTypeName": "Full Time",
"jobPositionCode": "8",
"departmentCode": "2",
"jobPositionCode": "SA-001",
"departmentCode": "BAK",
"workLocation": "İzmir Bölge Ofisi",
"baseSalary": 130000,
"managerCode": "1",
"managerCode": "EMP-001",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "2",
@ -3050,11 +3134,11 @@
"hireDate": "02-06-2020",
"terminationDate": null,
"employmentTypeName": "Full Time",
"jobPositionCode": "9",
"departmentCode": "1",
"jobPositionCode": "CS-001",
"departmentCode": "ÜRT",
"workLocation": "Ankara Çağrı Merkezi",
"baseSalary": 50000,
"managerCode": "1",
"managerCode": "EMP-003",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "1",
@ -3090,11 +3174,11 @@
"hireDate": "06-05-2017",
"terminationDate": null,
"employmentTypeName": "Full Time",
"jobPositionCode": "10",
"departmentCode": "1",
"jobPositionCode": "ACC-001",
"departmentCode": "ÜRT",
"workLocation": "İstanbul Genel Merkez",
"baseSalary": 250000,
"managerCode": "1",
"managerCode": "EMP-001",
"currencyCode": "TRY",
"payrollGroup": "Monthly",
"bankAccountNumber": "4",

View file

@ -44,6 +44,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
private readonly IRepository<EventType, Guid> _eventTypeRepository;
private readonly IRepository<EventCategory, Guid> _eventCategoryRepository;
private readonly IRepository<Event, Guid> _eventRepository;
private readonly IRepository<EventComment, Guid> _eventCommentRepository;
private readonly IRepository<EventPhoto, Guid> _eventPhotoRepository;
private readonly IRepository<MeetingMethod, Guid> _meetingMethodRepository;
private readonly IRepository<MeetingResult, Guid> _meetingResultRepository;
private readonly IRepository<Program, Guid> _programRepository;
@ -124,6 +126,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
IRepository<EventType, Guid> eventTypeRepository,
IRepository<EventCategory, Guid> eventCategoryRepository,
IRepository<Event, Guid> eventRepository,
IRepository<EventPhoto, Guid> eventPhotoRepository,
IRepository<EventComment, Guid> eventCommentRepository,
IRepository<Source, Guid> sourceRepository,
IRepository<Interesting, Guid> interestingRepository,
IRepository<Program, Guid> programRepository,
@ -196,6 +200,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
_eventTypeRepository = eventTypeRepository;
_eventCategoryRepository = eventCategoryRepository;
_eventRepository = eventRepository;
_eventCommentRepository = eventCommentRepository;
_eventPhotoRepository = eventPhotoRepository;
_sourceRepository = sourceRepository;
_interestingRepository = interestingRepository;
_programRepository = programRepository;
@ -766,54 +772,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
}
}
foreach (var item in items.EventTypes)
{
var exists = await _eventTypeRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _eventTypeRepository.InsertAsync(new EventType { Name = item.Name }, autoSave: true);
}
}
foreach (var item in items.EventCategories)
{
var exists = await _eventCategoryRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _eventCategoryRepository.InsertAsync(new EventCategory { Name = item.Name }, autoSave: true);
}
}
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);
@ -1537,5 +1495,70 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
EmployeeId = employee != null ? employee.Id : null
}, autoSave: true);
}
//Events
foreach (var item in items.EventTypes)
{
var exists = await _eventTypeRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _eventTypeRepository.InsertAsync(new EventType { Name = item.Name }, autoSave: true);
}
}
foreach (var item in items.EventCategories)
{
var exists = await _eventCategoryRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _eventCategoryRepository.InsertAsync(new EventCategory { Name = item.Name }, autoSave: true);
}
}
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 employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.OrganizerEmployeeCode);
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 = employee.Id,
Status = item.Status,
ParticipantsCount = item.ParticipantsCount,
Likes = item.Likes,
isPublished = item.IsPublished,
});
}
}
}
foreach (var item in items.EventPhotos)
{
var exists = await _eventPhotoRepository.AnyAsync(x => x.Url == item.Url);
if (!exists)
{
var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.Name);
await _eventPhotoRepository.InsertAsync(new EventPhoto
{
EventId = eventEntity.Id,
Url = item.Url
}, autoSave: true);
}
}
}
}

View file

@ -46,6 +46,7 @@ public class TenantSeederDto
public List<EventTypeSeedDto> EventTypes { get; set; }
public List<EventCategorySeedDto> EventCategories { get; set; }
public List<EventSeedDto> Events { get; set; }
public List<EventPhotoSeedDto> EventPhotos { get; set; }
public List<SourceSeedDto> Sources { get; set; }
public List<InterestingSeedDto> Interesting { get; set; }
public List<ProgramSeedDto> Programs { get; set; }
@ -79,6 +80,12 @@ public class TenantSeederDto
public List<SocialLikeSeedDto> SocialLikes { get; set; }
}
public class EventPhotoSeedDto
{
public string Name { get; set; }
public string Url { get; set; }
}
public class SocialPostSeedDto
{
public string Content { get; set; }
@ -687,9 +694,10 @@ public class EventSeedDto
public string Place { get; set; }
public string Description { get; set; }
public string Status { get; set; }
public string OrganizerUserName { get; set; }
public string OrganizerEmployeeCode { get; set; }
public int ParticipantsCount { get; set; }
public int Likes { get; set; }
public bool IsPublished { get; set; }
}
public class SourceSeedDto

View file

@ -334,172 +334,6 @@ export const mockAnnouncements: Announcement[] = [
},
]
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',
@ -812,8 +646,7 @@ export const mockSurveys: Survey[] = [
},
]
// Mevcut çalışanları kullan - "Siz" kullanıcısı mockEmployees[0] (Ali Öztürk) olacak
const currentUser = { ...mockEmployees[0], fullName: 'Siz' } // Ali Öztürk'ü "Siz" olarak kullan
const currentUser = { ...mockEmployees[0], fullName: 'Siz' }
export const mockSocialPosts: SocialPost[] = [
{
@ -986,3 +819,171 @@ export const mockSocialPosts: SocialPost[] = [
isOwnPost: false,
},
]
/////////////////////////////////////////////////////////////////////////////////////
///////APP SERVİS YAPILANLAR//////////
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,
},
]