Intranet AppService Leave and Overtime
This commit is contained in:
parent
ef4e84f7f6
commit
264f802265
16 changed files with 443 additions and 341 deletions
|
|
@ -15,5 +15,7 @@ public class IntranetDashboardDto
|
||||||
public List<AnnouncementDto> Announcements { get; set; } = [];
|
public List<AnnouncementDto> Announcements { get; set; } = [];
|
||||||
public List<ShuttleRouteDto> ShuttleRoutes { get; set; } = [];
|
public List<ShuttleRouteDto> ShuttleRoutes { get; set; } = [];
|
||||||
public List<MealDto> Meals { get; set; } = [];
|
public List<MealDto> Meals { get; set; } = [];
|
||||||
|
public List<LeaveDto> Leaves { get; set; } = [];
|
||||||
|
public List<OvertimeDto> Overtimes { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
using System;
|
||||||
|
using Volo.Abp.Application.Dtos;
|
||||||
|
|
||||||
|
namespace Kurs.Platform.Intranet;
|
||||||
|
|
||||||
|
public class LeaveDto : FullAuditedEntityDto<Guid>
|
||||||
|
{
|
||||||
|
public Guid? TenantId { get; set; }
|
||||||
|
|
||||||
|
public Guid EmployeeId { get; set; }
|
||||||
|
public EmployeeDto Employee { get; set; }
|
||||||
|
|
||||||
|
public string LeaveType { get; set; }
|
||||||
|
public DateTime StartDate { get; set; }
|
||||||
|
public DateTime EndDate { get; set; }
|
||||||
|
public decimal TotalDays { get; set; }
|
||||||
|
public bool IsHalfDay { get; set; }
|
||||||
|
public string Reason { get; set; }
|
||||||
|
public string Status { get; set; }
|
||||||
|
public DateTime AppliedDate { get; set; }
|
||||||
|
public Guid? ApprovedById { get; set; }
|
||||||
|
public EmployeeDto ApprovedBy { get; set; }
|
||||||
|
public DateTime? ApprovedDate { get; set; }
|
||||||
|
public string RejectionReason { get; set; }
|
||||||
|
public string Attachments { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
using System;
|
||||||
|
using Volo.Abp.Application.Dtos;
|
||||||
|
|
||||||
|
namespace Kurs.Platform.Intranet;
|
||||||
|
|
||||||
|
public class OvertimeDto : FullAuditedEntityDto<Guid>
|
||||||
|
{
|
||||||
|
public Guid? TenantId { get; set; }
|
||||||
|
|
||||||
|
public Guid EmployeeId { get; set; }
|
||||||
|
public EmployeeDto Employee { get; set; } // Navigation'dan doldurulabilir
|
||||||
|
|
||||||
|
public DateTime Date { get; set; } // Mesai tarihi
|
||||||
|
public DateTime StartTime { get; set; } // Başlangıç zamanı
|
||||||
|
public DateTime EndTime { get; set; } // Bitiş zamanı
|
||||||
|
public decimal TotalHours { get; set; } // Toplam fazla mesai süresi
|
||||||
|
public string Reason { get; set; } // Fazla mesai nedeni
|
||||||
|
public string Status { get; set; } // Durum: "Bekliyor", "Onaylandı", "Reddedildi"
|
||||||
|
public Guid? ApprovedById { get; set; } // Onaylayan kişi ID
|
||||||
|
public DateTime? ApprovedDate { get; set; } // Onay tarihi
|
||||||
|
public string RejectionReason { get; set; } // Reddetme nedeni
|
||||||
|
public decimal Rate { get; set; } // Fazla mesai oranı (ör. 1.5x)
|
||||||
|
public decimal? Amount { get; set; } // Hesaplanan ödeme tutarı
|
||||||
|
}
|
||||||
|
|
@ -33,6 +33,8 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
private readonly IRepository<Department, Guid> _departmentRepository;
|
private readonly IRepository<Department, Guid> _departmentRepository;
|
||||||
private readonly IRepository<ShuttleRoute, Guid> _shuttleRouteRepository;
|
private readonly IRepository<ShuttleRoute, Guid> _shuttleRouteRepository;
|
||||||
private readonly IRepository<Meal, Guid> _mealRepository;
|
private readonly IRepository<Meal, Guid> _mealRepository;
|
||||||
|
private readonly IRepository<Leave, Guid> _leaveRepository;
|
||||||
|
private readonly IRepository<Overtime, Guid> _overtimeRepository;
|
||||||
|
|
||||||
public IntranetAppService(
|
public IntranetAppService(
|
||||||
ICurrentTenant currentTenant,
|
ICurrentTenant currentTenant,
|
||||||
|
|
@ -48,7 +50,9 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
IRepository<Announcement, Guid> announcementRepository,
|
IRepository<Announcement, Guid> announcementRepository,
|
||||||
IRepository<Department, Guid> departmentRepository,
|
IRepository<Department, Guid> departmentRepository,
|
||||||
IRepository<ShuttleRoute, Guid> shuttleRouteRepository,
|
IRepository<ShuttleRoute, Guid> shuttleRouteRepository,
|
||||||
IRepository<Meal, Guid> mealRepository
|
IRepository<Meal, Guid> mealRepository,
|
||||||
|
IRepository<Leave, Guid> leaveRepository,
|
||||||
|
IRepository<Overtime, Guid> overtimeRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_currentTenant = currentTenant;
|
_currentTenant = currentTenant;
|
||||||
|
|
@ -65,6 +69,8 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
_departmentRepository = departmentRepository;
|
_departmentRepository = departmentRepository;
|
||||||
_shuttleRouteRepository = shuttleRouteRepository;
|
_shuttleRouteRepository = shuttleRouteRepository;
|
||||||
_mealRepository = mealRepository;
|
_mealRepository = mealRepository;
|
||||||
|
_leaveRepository = leaveRepository;
|
||||||
|
_overtimeRepository = overtimeRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IntranetDashboardDto> GetIntranetDashboardAsync()
|
public async Task<IntranetDashboardDto> GetIntranetDashboardAsync()
|
||||||
|
|
@ -80,10 +86,34 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
Documents = await GetIntranetDocumentsAsync(BlobContainerNames.Intranet),
|
Documents = await GetIntranetDocumentsAsync(BlobContainerNames.Intranet),
|
||||||
Announcements = await GetAnnouncementsAsync(),
|
Announcements = await GetAnnouncementsAsync(),
|
||||||
ShuttleRoutes = await GetShuttleRoutesAsync(),
|
ShuttleRoutes = await GetShuttleRoutesAsync(),
|
||||||
Meals = await GetMealsAsync()
|
Meals = await GetMealsAsync(),
|
||||||
|
Leaves = await GetLeavesAsync(),
|
||||||
|
Overtimes = await GetOvertimesAsync()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task<List<OvertimeDto>> GetOvertimesAsync()
|
||||||
|
{
|
||||||
|
var today = DateTime.Now;
|
||||||
|
|
||||||
|
var overtimes = await _overtimeRepository
|
||||||
|
.WithDetailsAsync(e => e.Employee)
|
||||||
|
.ContinueWith(t => t.Result.ToList());
|
||||||
|
|
||||||
|
return ObjectMapper.Map<List<Overtime>, List<OvertimeDto>>(overtimes);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<List<LeaveDto>> GetLeavesAsync()
|
||||||
|
{
|
||||||
|
var today = DateTime.Now;
|
||||||
|
|
||||||
|
var leaves = await _leaveRepository
|
||||||
|
.WithDetailsAsync(e => e.Employee)
|
||||||
|
.ContinueWith(t => t.Result.ToList());
|
||||||
|
|
||||||
|
return ObjectMapper.Map<List<Leave>, List<LeaveDto>>(leaves);
|
||||||
|
}
|
||||||
|
|
||||||
private async Task<List<MealDto>> GetMealsAsync()
|
private async Task<List<MealDto>> GetMealsAsync()
|
||||||
{
|
{
|
||||||
// Bu haftanın başlangıç ve bitiş tarihlerini hesapla
|
// Bu haftanın başlangıç ve bitiş tarihlerini hesapla
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ public class IntranetAutoMapperProfile : Profile
|
||||||
CreateMap<Training, TrainingDto>();
|
CreateMap<Training, TrainingDto>();
|
||||||
CreateMap<Currency, CurrencyDto>();
|
CreateMap<Currency, CurrencyDto>();
|
||||||
CreateMap<Expense, ExpenseDto>();
|
CreateMap<Expense, ExpenseDto>();
|
||||||
|
CreateMap<Leave, LeaveDto>();
|
||||||
|
CreateMap<Overtime, OvertimeDto>();
|
||||||
|
|
||||||
CreateMap<Meal, MealDto>()
|
CreateMap<Meal, MealDto>()
|
||||||
.ForMember(dest => dest.Materials, opt => opt.Ignore());
|
.ForMember(dest => dest.Materials, opt => opt.Ignore());
|
||||||
|
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
import { HrLeave, LeaveStatusEnum, LeaveTypeEnum } from "../types/hr";
|
|
||||||
import { mockEmployees } from "./mockEmployees";
|
|
||||||
|
|
||||||
export const mockEmployeeLeaves: HrLeave[] = [
|
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
employeeId: "1",
|
|
||||||
employee: mockEmployees.find((e) => e.id === "1"),
|
|
||||||
leaveType: LeaveTypeEnum.Annual,
|
|
||||||
startDate: new Date("2024-12-20"),
|
|
||||||
endDate: new Date("2024-12-24"),
|
|
||||||
totalDays: 5,
|
|
||||||
reason: "Yıllık izin talebi",
|
|
||||||
status: LeaveStatusEnum.Pending,
|
|
||||||
appliedDate: new Date("2024-11-15"),
|
|
||||||
isHalfDay: false,
|
|
||||||
attachments: [],
|
|
||||||
creationTime: new Date("2024-11-15"),
|
|
||||||
lastModificationTime: new Date("2024-11-15"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2",
|
|
||||||
employeeId: "2",
|
|
||||||
employee: mockEmployees.find((e) => e.id === "2"),
|
|
||||||
leaveType: LeaveTypeEnum.Sick,
|
|
||||||
startDate: new Date("2024-11-10"),
|
|
||||||
endDate: new Date("2024-11-12"),
|
|
||||||
totalDays: 3,
|
|
||||||
reason: "Sağlık kontrolü",
|
|
||||||
status: LeaveStatusEnum.Approved,
|
|
||||||
appliedDate: new Date("2024-11-08"),
|
|
||||||
approvedDate: new Date("2024-11-09"),
|
|
||||||
isHalfDay: false,
|
|
||||||
attachments: [],
|
|
||||||
creationTime: new Date("2024-11-08"),
|
|
||||||
lastModificationTime: new Date("2024-11-09"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "3",
|
|
||||||
employeeId: "3",
|
|
||||||
employee: mockEmployees.find((e) => e.id === "3"),
|
|
||||||
leaveType: LeaveTypeEnum.Personal,
|
|
||||||
startDate: new Date("2024-12-01"),
|
|
||||||
endDate: new Date("2024-12-01"),
|
|
||||||
totalDays: 0.5,
|
|
||||||
reason: "Kişisel işler",
|
|
||||||
status: LeaveStatusEnum.Rejected,
|
|
||||||
appliedDate: new Date("2024-11-20"),
|
|
||||||
rejectionReason: "Proje teslim tarihi nedeniyle uygun değil",
|
|
||||||
isHalfDay: true,
|
|
||||||
attachments: [],
|
|
||||||
creationTime: new Date("2024-11-20"),
|
|
||||||
lastModificationTime: new Date("2024-11-21"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "4",
|
|
||||||
employeeId: "4",
|
|
||||||
employee: mockEmployees.find((e) => e.id === "4"),
|
|
||||||
leaveType: LeaveTypeEnum.Emergency,
|
|
||||||
startDate: new Date("2024-11-25"),
|
|
||||||
endDate: new Date("2024-11-26"),
|
|
||||||
totalDays: 2,
|
|
||||||
reason: "Acil aile durumu",
|
|
||||||
status: LeaveStatusEnum.Pending,
|
|
||||||
appliedDate: new Date("2024-11-24"),
|
|
||||||
isHalfDay: false,
|
|
||||||
attachments: [],
|
|
||||||
creationTime: new Date("2024-11-24"),
|
|
||||||
lastModificationTime: new Date("2024-11-24"),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
@ -4,6 +4,8 @@ import {
|
||||||
DocumentDto,
|
DocumentDto,
|
||||||
EventDto,
|
EventDto,
|
||||||
ExpenseDto,
|
ExpenseDto,
|
||||||
|
LeaveDto,
|
||||||
|
OvertimeDto,
|
||||||
ReservationDto,
|
ReservationDto,
|
||||||
ShuttleRouteDto,
|
ShuttleRouteDto,
|
||||||
TrainingDto,
|
TrainingDto,
|
||||||
|
|
@ -11,6 +13,9 @@ import {
|
||||||
} from '@/proxy/intranet/models'
|
} from '@/proxy/intranet/models'
|
||||||
import { mockEmployees } from './mockEmployees'
|
import { mockEmployees } from './mockEmployees'
|
||||||
import { Survey, SocialPost } from '@/types/intranet'
|
import { Survey, SocialPost } from '@/types/intranet'
|
||||||
|
import { LeaveStatusEnum, LeaveTypeEnum } from '@/types/hr'
|
||||||
|
|
||||||
|
const currentUser = { ...mockEmployees[0], fullName: 'Siz' }
|
||||||
|
|
||||||
export const mockSurveys: Survey[] = [
|
export const mockSurveys: Survey[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -187,8 +192,6 @@ export const mockSurveys: Survey[] = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const currentUser = { ...mockEmployees[0], fullName: 'Siz' }
|
|
||||||
|
|
||||||
export const mockSocialPosts: SocialPost[] = [
|
export const mockSocialPosts: SocialPost[] = [
|
||||||
{
|
{
|
||||||
id: '1',
|
id: '1',
|
||||||
|
|
@ -972,3 +975,222 @@ export const mockShuttleRoutes: ShuttleRouteDto[] = [
|
||||||
type: 'evening',
|
type: 'evening',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const mockLeaves: LeaveDto[] = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
employeeId: '1',
|
||||||
|
employee: mockEmployees.find((e) => e.id === '1'),
|
||||||
|
leaveType: LeaveTypeEnum.Annual,
|
||||||
|
startDate: new Date('2024-12-20'),
|
||||||
|
endDate: new Date('2024-12-24'),
|
||||||
|
totalDays: 5,
|
||||||
|
reason: 'Yıllık izin talebi',
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
appliedDate: new Date('2024-11-15'),
|
||||||
|
isHalfDay: false,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date('2024-11-15'),
|
||||||
|
lastModificationTime: new Date('2024-11-15'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
employeeId: '2',
|
||||||
|
employee: mockEmployees.find((e) => e.id === '2'),
|
||||||
|
leaveType: LeaveTypeEnum.Sick,
|
||||||
|
startDate: new Date('2024-11-10'),
|
||||||
|
endDate: new Date('2024-11-12'),
|
||||||
|
totalDays: 3,
|
||||||
|
reason: 'Sağlık kontrolü',
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
appliedDate: new Date('2024-11-08'),
|
||||||
|
approvedDate: new Date('2024-11-09'),
|
||||||
|
isHalfDay: false,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date('2024-11-08'),
|
||||||
|
lastModificationTime: new Date('2024-11-09'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
employeeId: '3',
|
||||||
|
employee: mockEmployees.find((e) => e.id === '3'),
|
||||||
|
leaveType: LeaveTypeEnum.Personal,
|
||||||
|
startDate: new Date('2024-12-01'),
|
||||||
|
endDate: new Date('2024-12-01'),
|
||||||
|
totalDays: 0.5,
|
||||||
|
reason: 'Kişisel işler',
|
||||||
|
status: LeaveStatusEnum.Rejected,
|
||||||
|
appliedDate: new Date('2024-11-20'),
|
||||||
|
rejectionReason: 'Proje teslim tarihi nedeniyle uygun değil',
|
||||||
|
isHalfDay: true,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date('2024-11-20'),
|
||||||
|
lastModificationTime: new Date('2024-11-21'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
employeeId: '4',
|
||||||
|
employee: mockEmployees.find((e) => e.id === '4'),
|
||||||
|
leaveType: LeaveTypeEnum.Emergency,
|
||||||
|
startDate: new Date('2024-11-25'),
|
||||||
|
endDate: new Date('2024-11-26'),
|
||||||
|
totalDays: 2,
|
||||||
|
reason: 'Acil aile durumu',
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
appliedDate: new Date('2024-11-24'),
|
||||||
|
isHalfDay: false,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date('2024-11-24'),
|
||||||
|
lastModificationTime: new Date('2024-11-24'),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const mockOvertimes: OvertimeDto[] = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
employeeId: '1',
|
||||||
|
date: new Date('2024-12-15'),
|
||||||
|
startTime: '18:00',
|
||||||
|
endTime: '21:00',
|
||||||
|
totalHours: 3,
|
||||||
|
reason: "Proje deadline'ı nedeniyle acil çalışma",
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: 'emp_002',
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 450, // 3 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date('2024-12-15T09:00:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-15T10:30:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
employeeId: '3',
|
||||||
|
date: new Date('2024-12-14'),
|
||||||
|
startTime: '17:30',
|
||||||
|
endTime: '20:00',
|
||||||
|
totalHours: 2.5,
|
||||||
|
reason: 'Müşteri talep değişikliği nedeniyle ek çalışma',
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 375, // 2.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date('2024-12-14T17:30:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-14T17:30:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
employeeId: '4',
|
||||||
|
date: new Date('2024-12-13'),
|
||||||
|
startTime: '19:00',
|
||||||
|
endTime: '22:30',
|
||||||
|
totalHours: 3.5,
|
||||||
|
reason: 'Sistem bakımı ve güncelleme çalışmaları',
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: 'emp_002',
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date('2024-12-13T19:00:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-13T22:35:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
employeeId: '5',
|
||||||
|
date: new Date('2024-12-12'),
|
||||||
|
startTime: '17:00',
|
||||||
|
endTime: '19:00',
|
||||||
|
totalHours: 2,
|
||||||
|
reason: 'Rapor hazırlama ve sunum düzenleme',
|
||||||
|
status: LeaveStatusEnum.Rejected,
|
||||||
|
approvedBy: 'emp_002',
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 0, // Reddedildiği için ücret hesaplanmadı
|
||||||
|
creationTime: new Date('2024-12-12T17:00:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-12T08:30:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '5',
|
||||||
|
employeeId: '6',
|
||||||
|
date: new Date('2024-12-11'),
|
||||||
|
startTime: '18:30',
|
||||||
|
endTime: '21:00',
|
||||||
|
totalHours: 2.5,
|
||||||
|
reason: 'Acil hata düzeltme ve test çalışmaları',
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: 'emp_001',
|
||||||
|
rate: 2.0, // Hafta sonu çalışması
|
||||||
|
amount: 500, // 2.5 saat * 100 TL/saat * 2.0 kat
|
||||||
|
creationTime: new Date('2024-12-11T18:30:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-11T21:05:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '6',
|
||||||
|
employeeId: '7',
|
||||||
|
date: new Date('2024-12-10'),
|
||||||
|
startTime: '16:00',
|
||||||
|
endTime: '20:00',
|
||||||
|
totalHours: 4,
|
||||||
|
reason: 'Yeni müşteri onboarding süreci',
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 600, // 4 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date('2024-12-10T16:00:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-10T16:00:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '7',
|
||||||
|
employeeId: '8',
|
||||||
|
date: new Date('2024-12-09'),
|
||||||
|
startTime: '17:45',
|
||||||
|
endTime: '21:15',
|
||||||
|
totalHours: 3.5,
|
||||||
|
reason: 'Veri analizi ve raporlama çalışmaları',
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: 'emp_002',
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date('2024-12-09T17:45:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-09T21:20:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '8',
|
||||||
|
employeeId: '9',
|
||||||
|
date: new Date('2024-12-08'),
|
||||||
|
startTime: '18:00',
|
||||||
|
endTime: '20:30',
|
||||||
|
totalHours: 2.5,
|
||||||
|
reason: 'Eğitim materyali hazırlama',
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 375, // 2.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date('2024-12-08T18:00:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-08T18:00:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '9',
|
||||||
|
employeeId: '10',
|
||||||
|
date: new Date('2024-12-07'),
|
||||||
|
startTime: '19:30',
|
||||||
|
endTime: '23:00',
|
||||||
|
totalHours: 3.5,
|
||||||
|
reason: 'Kritik sistem güvenlik yaması uygulaması',
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: 'emp_001',
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date('2024-12-07T19:30:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-07T23:05:00'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '10',
|
||||||
|
employeeId: '1',
|
||||||
|
date: new Date('2024-12-06'),
|
||||||
|
startTime: '17:30',
|
||||||
|
endTime: '20:00',
|
||||||
|
totalHours: 2.5,
|
||||||
|
reason: 'Stratejik planlama toplantısı hazırlığı',
|
||||||
|
status: LeaveStatusEnum.Rejected,
|
||||||
|
approvedBy: 'emp_002',
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 0, // Reddedildiği için ücret hesaplanmadı
|
||||||
|
creationTime: new Date('2024-12-06T17:30:00'),
|
||||||
|
lastModificationTime: new Date('2024-12-06T08:15:00'),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
@ -1,151 +0,0 @@
|
||||||
import { HrOvertime, LeaveStatusEnum } from "../types/hr";
|
|
||||||
|
|
||||||
export const mockOvertimes: HrOvertime[] = [
|
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
employeeId: "1",
|
|
||||||
date: new Date("2024-12-15"),
|
|
||||||
startTime: "18:00",
|
|
||||||
endTime: "21:00",
|
|
||||||
totalHours: 3,
|
|
||||||
reason: "Proje deadline'ı nedeniyle acil çalışma",
|
|
||||||
status: LeaveStatusEnum.Approved,
|
|
||||||
approvedBy: "emp_002",
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 450, // 3 saat * 100 TL/saat * 1.5 kat
|
|
||||||
creationTime: new Date("2024-12-15T09:00:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-15T10:30:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2",
|
|
||||||
employeeId: "3",
|
|
||||||
date: new Date("2024-12-14"),
|
|
||||||
startTime: "17:30",
|
|
||||||
endTime: "20:00",
|
|
||||||
totalHours: 2.5,
|
|
||||||
reason: "Müşteri talep değişikliği nedeniyle ek çalışma",
|
|
||||||
status: LeaveStatusEnum.Pending,
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 375, // 2.5 saat * 100 TL/saat * 1.5 kat
|
|
||||||
creationTime: new Date("2024-12-14T17:30:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-14T17:30:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "3",
|
|
||||||
employeeId: "4",
|
|
||||||
date: new Date("2024-12-13"),
|
|
||||||
startTime: "19:00",
|
|
||||||
endTime: "22:30",
|
|
||||||
totalHours: 3.5,
|
|
||||||
reason: "Sistem bakımı ve güncelleme çalışmaları",
|
|
||||||
status: LeaveStatusEnum.Approved,
|
|
||||||
approvedBy: "emp_002",
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
|
||||||
creationTime: new Date("2024-12-13T19:00:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-13T22:35:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "4",
|
|
||||||
employeeId: "5",
|
|
||||||
date: new Date("2024-12-12"),
|
|
||||||
startTime: "17:00",
|
|
||||||
endTime: "19:00",
|
|
||||||
totalHours: 2,
|
|
||||||
reason: "Rapor hazırlama ve sunum düzenleme",
|
|
||||||
status: LeaveStatusEnum.Rejected,
|
|
||||||
approvedBy: "emp_002",
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 0, // Reddedildiği için ücret hesaplanmadı
|
|
||||||
creationTime: new Date("2024-12-12T17:00:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-12T08:30:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "5",
|
|
||||||
employeeId: "6",
|
|
||||||
date: new Date("2024-12-11"),
|
|
||||||
startTime: "18:30",
|
|
||||||
endTime: "21:00",
|
|
||||||
totalHours: 2.5,
|
|
||||||
reason: "Acil hata düzeltme ve test çalışmaları",
|
|
||||||
status: LeaveStatusEnum.Approved,
|
|
||||||
approvedBy: "emp_001",
|
|
||||||
rate: 2.0, // Hafta sonu çalışması
|
|
||||||
amount: 500, // 2.5 saat * 100 TL/saat * 2.0 kat
|
|
||||||
creationTime: new Date("2024-12-11T18:30:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-11T21:05:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "6",
|
|
||||||
employeeId: "7",
|
|
||||||
date: new Date("2024-12-10"),
|
|
||||||
startTime: "16:00",
|
|
||||||
endTime: "20:00",
|
|
||||||
totalHours: 4,
|
|
||||||
reason: "Yeni müşteri onboarding süreci",
|
|
||||||
status: LeaveStatusEnum.Pending,
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 600, // 4 saat * 100 TL/saat * 1.5 kat
|
|
||||||
creationTime: new Date("2024-12-10T16:00:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-10T16:00:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "7",
|
|
||||||
employeeId: "8",
|
|
||||||
date: new Date("2024-12-09"),
|
|
||||||
startTime: "17:45",
|
|
||||||
endTime: "21:15",
|
|
||||||
totalHours: 3.5,
|
|
||||||
reason: "Veri analizi ve raporlama çalışmaları",
|
|
||||||
status: LeaveStatusEnum.Approved,
|
|
||||||
approvedBy: "emp_002",
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
|
||||||
creationTime: new Date("2024-12-09T17:45:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-09T21:20:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "8",
|
|
||||||
employeeId: "9",
|
|
||||||
date: new Date("2024-12-08"),
|
|
||||||
startTime: "18:00",
|
|
||||||
endTime: "20:30",
|
|
||||||
totalHours: 2.5,
|
|
||||||
reason: "Eğitim materyali hazırlama",
|
|
||||||
status: LeaveStatusEnum.Pending,
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 375, // 2.5 saat * 100 TL/saat * 1.5 kat
|
|
||||||
creationTime: new Date("2024-12-08T18:00:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-08T18:00:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "9",
|
|
||||||
employeeId: "10",
|
|
||||||
date: new Date("2024-12-07"),
|
|
||||||
startTime: "19:30",
|
|
||||||
endTime: "23:00",
|
|
||||||
totalHours: 3.5,
|
|
||||||
reason: "Kritik sistem güvenlik yaması uygulaması",
|
|
||||||
status: LeaveStatusEnum.Approved,
|
|
||||||
approvedBy: "emp_001",
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
|
||||||
creationTime: new Date("2024-12-07T19:30:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-07T23:05:00"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "10",
|
|
||||||
employeeId: "1",
|
|
||||||
date: new Date("2024-12-06"),
|
|
||||||
startTime: "17:30",
|
|
||||||
endTime: "20:00",
|
|
||||||
totalHours: 2.5,
|
|
||||||
reason: "Stratejik planlama toplantısı hazırlığı",
|
|
||||||
status: LeaveStatusEnum.Rejected,
|
|
||||||
approvedBy: "emp_002",
|
|
||||||
rate: 1.5,
|
|
||||||
amount: 0, // Reddedildiği için ücret hesaplanmadı
|
|
||||||
creationTime: new Date("2024-12-06T17:30:00"),
|
|
||||||
lastModificationTime: new Date("2024-12-06T08:15:00"),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
@ -6,11 +6,12 @@ import {
|
||||||
HrCostCenter,
|
HrCostCenter,
|
||||||
HrDisciplinaryAction,
|
HrDisciplinaryAction,
|
||||||
HrEmergencyContact,
|
HrEmergencyContact,
|
||||||
HrLeave,
|
|
||||||
HrPerformanceEvaluation,
|
HrPerformanceEvaluation,
|
||||||
HrTraining,
|
HrTraining,
|
||||||
HrWorkSchedule,
|
HrWorkSchedule,
|
||||||
JobLevelEnum,
|
JobLevelEnum,
|
||||||
|
LeaveStatusEnum,
|
||||||
|
LeaveTypeEnum,
|
||||||
MaritalStatusEnum,
|
MaritalStatusEnum,
|
||||||
} from '@/types/hr'
|
} from '@/types/hr'
|
||||||
|
|
||||||
|
|
@ -25,6 +26,8 @@ export interface IntranetDashboardDto {
|
||||||
announcements: AnnouncementDto[]
|
announcements: AnnouncementDto[]
|
||||||
shuttleRoutes: ShuttleRouteDto[]
|
shuttleRoutes: ShuttleRouteDto[]
|
||||||
meals: MealDto[]
|
meals: MealDto[]
|
||||||
|
leaves: LeaveDto[]
|
||||||
|
overtimes: OvertimeDto[]
|
||||||
// surveys: Survey[]
|
// surveys: Survey[]
|
||||||
// priorityTasks: TaskDto[]
|
// priorityTasks: TaskDto[]
|
||||||
}
|
}
|
||||||
|
|
@ -91,7 +94,7 @@ export interface EmployeeDto {
|
||||||
badgeNumber?: string
|
badgeNumber?: string
|
||||||
employeeStatus: EmployeeStatusEnum
|
employeeStatus: EmployeeStatusEnum
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
leaves: HrLeave[]
|
leaves: LeaveDto[]
|
||||||
evaluations: HrPerformanceEvaluation[]
|
evaluations: HrPerformanceEvaluation[]
|
||||||
trainings: HrTraining[]
|
trainings: HrTraining[]
|
||||||
disciplinaryActions: HrDisciplinaryAction[]
|
disciplinaryActions: HrDisciplinaryAction[]
|
||||||
|
|
@ -280,3 +283,43 @@ export interface MealDto {
|
||||||
totalCalorie?: number
|
totalCalorie?: number
|
||||||
materials: string[]
|
materials: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// İnsan Kaynakları Fazla Mesai
|
||||||
|
export interface OvertimeDto {
|
||||||
|
id: string
|
||||||
|
employeeId: string
|
||||||
|
employee?: EmployeeDto
|
||||||
|
date: Date
|
||||||
|
startTime: string
|
||||||
|
endTime: string
|
||||||
|
totalHours: number
|
||||||
|
reason: string
|
||||||
|
status: LeaveStatusEnum
|
||||||
|
approvedBy?: string
|
||||||
|
approver?: EmployeeDto
|
||||||
|
rate?: number
|
||||||
|
amount?: number
|
||||||
|
creationTime: Date
|
||||||
|
lastModificationTime: Date
|
||||||
|
}
|
||||||
|
|
||||||
|
// İnsan Kaynakları İzni
|
||||||
|
export interface LeaveDto {
|
||||||
|
id: string
|
||||||
|
employeeId: string
|
||||||
|
employee?: EmployeeDto
|
||||||
|
leaveType: LeaveTypeEnum
|
||||||
|
startDate: Date
|
||||||
|
endDate: Date
|
||||||
|
totalDays: number
|
||||||
|
reason?: string
|
||||||
|
status: LeaveStatusEnum
|
||||||
|
appliedDate: Date
|
||||||
|
approvedBy?: string
|
||||||
|
approvedDate?: Date
|
||||||
|
rejectionReason?: string
|
||||||
|
isHalfDay: boolean
|
||||||
|
attachments: string[]
|
||||||
|
creationTime: Date
|
||||||
|
lastModificationTime: Date
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,27 +24,6 @@ export interface HrCostCenter {
|
||||||
lastModificationTime: Date
|
lastModificationTime: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HrLeave {
|
|
||||||
// İnsan Kaynakları İzni
|
|
||||||
id: string
|
|
||||||
employeeId: string
|
|
||||||
employee?: EmployeeDto
|
|
||||||
leaveType: LeaveTypeEnum
|
|
||||||
startDate: Date
|
|
||||||
endDate: Date
|
|
||||||
totalDays: number
|
|
||||||
reason?: string
|
|
||||||
status: LeaveStatusEnum
|
|
||||||
appliedDate: Date
|
|
||||||
approvedBy?: string
|
|
||||||
approvedDate?: Date
|
|
||||||
rejectionReason?: string
|
|
||||||
isHalfDay: boolean
|
|
||||||
attachments: string[]
|
|
||||||
creationTime: Date
|
|
||||||
lastModificationTime: Date
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface HrPerformanceEvaluation {
|
export interface HrPerformanceEvaluation {
|
||||||
// İnsan Kaynakları Performans Değerlendirmesi
|
// İnsan Kaynakları Performans Değerlendirmesi
|
||||||
id: string
|
id: string
|
||||||
|
|
@ -185,25 +164,6 @@ export interface HrEmploymentType {
|
||||||
lastModificationTime: Date
|
lastModificationTime: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HrOvertime {
|
|
||||||
// İnsan Kaynakları Fazla Mesai
|
|
||||||
id: string
|
|
||||||
employeeId: string
|
|
||||||
employee?: EmployeeDto
|
|
||||||
date: Date
|
|
||||||
startTime: string
|
|
||||||
endTime: string
|
|
||||||
totalHours: number
|
|
||||||
reason: string
|
|
||||||
status: LeaveStatusEnum
|
|
||||||
approvedBy?: string
|
|
||||||
approver?: EmployeeDto
|
|
||||||
rate?: number
|
|
||||||
amount?: number
|
|
||||||
creationTime: Date
|
|
||||||
lastModificationTime: Date
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface HrPayroll {
|
export interface HrPayroll {
|
||||||
// İnsan Kaynakları Maaş Bordrosu
|
// İnsan Kaynakları Maaş Bordrosu
|
||||||
id: string
|
id: string
|
||||||
|
|
@ -547,22 +507,22 @@ export enum JobLevelEnum {
|
||||||
|
|
||||||
export enum LeaveTypeEnum {
|
export enum LeaveTypeEnum {
|
||||||
// İzin Türü
|
// İzin Türü
|
||||||
Annual = 'ANNUAL', // Yıllık
|
Annual = 'Annual', // Yıllık
|
||||||
Sick = 'SICK', // Hastalık
|
Sick = 'Sick', // Hastalık
|
||||||
Maternity = 'MATERNITY', // Doğum
|
Maternity = 'Maternity', // Doğum
|
||||||
Paternity = 'PATERNITY', // Babalık
|
Paternity = 'Paternity', // Babalık
|
||||||
Personal = 'PERSONAL', // Kişisel
|
Personal = 'Personal', // Kişisel
|
||||||
Emergency = 'EMERGENCY', // Acil
|
Emergency = 'Emergency', // Acil
|
||||||
Study = 'STUDY', // Eğitim
|
Study = 'Study', // Eğitim
|
||||||
Unpaid = 'UNPAID', // Ücretsiz
|
Unpaid = 'Unpaid', // Ücretsiz
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LeaveStatusEnum {
|
export enum LeaveStatusEnum {
|
||||||
// İzin Durumu
|
// İzin Durumu
|
||||||
Pending = 'PENDING', // Beklemede
|
Pending = 'Pending', // Beklemede
|
||||||
Approved = 'APPROVED', // Onaylandı
|
Approved = 'Approved', // Onaylandı
|
||||||
Rejected = 'REJECTED', // Reddedildi
|
Rejected = 'Rejected', // Reddedildi
|
||||||
Cancelled = 'CANCELLED', // İptal edildi
|
Cancelled = 'Cancelled', // İptal edildi
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum EvaluationStatusEnum {
|
export enum EvaluationStatusEnum {
|
||||||
|
|
|
||||||
|
|
@ -9,18 +9,19 @@ import {
|
||||||
FaEye,
|
FaEye,
|
||||||
FaUsers,
|
FaUsers,
|
||||||
} from 'react-icons/fa'
|
} from 'react-icons/fa'
|
||||||
import { HrLeave, LeaveStatusEnum, LeaveTypeEnum } from '../../../types/hr'
|
import { LeaveStatusEnum, LeaveTypeEnum } from '../../../types/hr'
|
||||||
import DataTable, { Column } from '../../../components/common/DataTable'
|
import DataTable, { Column } from '../../../components/common/DataTable'
|
||||||
import { mockEmployeeLeaves } from '../../../mocks/mockEmployeeLeaves'
|
|
||||||
import { mockEmployees } from '../../../mocks/mockEmployees'
|
import { mockEmployees } from '../../../mocks/mockEmployees'
|
||||||
import { mockDepartments } from '../../../mocks/mockDepartments'
|
import { mockDepartments } from '../../../mocks/mockDepartments'
|
||||||
import Widget from '../../../components/common/Widget'
|
import Widget from '../../../components/common/Widget'
|
||||||
import { getLeaveTypeText, getLeaveStatusColor, getLeaveStatusText } from '../../../utils/erp'
|
import { getLeaveTypeText, getLeaveStatusColor, getLeaveStatusText } from '../../../utils/erp'
|
||||||
import { Container } from '@/components/shared'
|
import { Container } from '@/components/shared'
|
||||||
|
import { mockLeaves } from '@/mocks/mockIntranet'
|
||||||
|
import { LeaveDto } from '@/proxy/intranet/models'
|
||||||
|
|
||||||
const LeaveManagement: React.FC = () => {
|
const LeaveManagement: React.FC = () => {
|
||||||
// Leave states
|
// Leave states
|
||||||
const [leaves, setLeaves] = useState<HrLeave[]>(mockEmployeeLeaves)
|
const [leaves, setLeaves] = useState<LeaveDto[]>(mockLeaves)
|
||||||
const [selectedStatus, setSelectedStatus] = useState<string>('all')
|
const [selectedStatus, setSelectedStatus] = useState<string>('all')
|
||||||
const [selectedType, setSelectedType] = useState<string>('all')
|
const [selectedType, setSelectedType] = useState<string>('all')
|
||||||
const [selectedPeriod, setSelectedPeriod] = useState<string>('all')
|
const [selectedPeriod, setSelectedPeriod] = useState<string>('all')
|
||||||
|
|
@ -33,7 +34,7 @@ const LeaveManagement: React.FC = () => {
|
||||||
const [showViewModal, setShowViewModal] = useState(false)
|
const [showViewModal, setShowViewModal] = useState(false)
|
||||||
const [showRejectModal, setShowRejectModal] = useState(false)
|
const [showRejectModal, setShowRejectModal] = useState(false)
|
||||||
const [showBulkModal, setShowBulkModal] = useState(false)
|
const [showBulkModal, setShowBulkModal] = useState(false)
|
||||||
const [selectedLeave, setSelectedLeave] = useState<HrLeave | null>(null)
|
const [selectedLeave, setSelectedLeave] = useState<LeaveDto | null>(null)
|
||||||
const [rejectReason, setRejectReason] = useState('')
|
const [rejectReason, setRejectReason] = useState('')
|
||||||
|
|
||||||
// Form state for add/edit
|
// Form state for add/edit
|
||||||
|
|
@ -92,7 +93,7 @@ const LeaveManagement: React.FC = () => {
|
||||||
setShowBulkModal(true)
|
setShowBulkModal(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleEdit = (leave: HrLeave) => {
|
const handleEdit = (leave: LeaveDto) => {
|
||||||
setSelectedLeave(leave)
|
setSelectedLeave(leave)
|
||||||
setFormData({
|
setFormData({
|
||||||
employeeId: leave.employeeId,
|
employeeId: leave.employeeId,
|
||||||
|
|
@ -147,7 +148,7 @@ const LeaveManagement: React.FC = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleView = (leave: HrLeave) => {
|
const handleView = (leave: LeaveDto) => {
|
||||||
setSelectedLeave(leave)
|
setSelectedLeave(leave)
|
||||||
setShowViewModal(true)
|
setShowViewModal(true)
|
||||||
}
|
}
|
||||||
|
|
@ -163,7 +164,7 @@ const LeaveManagement: React.FC = () => {
|
||||||
const totalDays =
|
const totalDays =
|
||||||
Math.ceil((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)) + 1
|
Math.ceil((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)) + 1
|
||||||
|
|
||||||
const newLeave: HrLeave = {
|
const newLeave: LeaveDto = {
|
||||||
id: `leave_${Date.now()}`,
|
id: `leave_${Date.now()}`,
|
||||||
employeeId: formData.employeeId,
|
employeeId: formData.employeeId,
|
||||||
leaveType: formData.leaveType,
|
leaveType: formData.leaveType,
|
||||||
|
|
@ -244,7 +245,7 @@ const LeaveManagement: React.FC = () => {
|
||||||
const totalDays =
|
const totalDays =
|
||||||
Math.ceil((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)) + 1
|
Math.ceil((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)) + 1
|
||||||
|
|
||||||
const newLeaves: HrLeave[] = bulkFormData.selectedEmployees.map((employeeId) => {
|
const newLeaves: LeaveDto[] = bulkFormData.selectedEmployees.map((employeeId) => {
|
||||||
const employee = getSelectedEmployee(employeeId)
|
const employee = getSelectedEmployee(employeeId)
|
||||||
return {
|
return {
|
||||||
id: `leave_${Date.now()}_${employeeId}`,
|
id: `leave_${Date.now()}_${employeeId}`,
|
||||||
|
|
@ -325,11 +326,11 @@ const LeaveManagement: React.FC = () => {
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns: Column<HrLeave>[] = [
|
const columns: Column<LeaveDto>[] = [
|
||||||
{
|
{
|
||||||
key: 'employee',
|
key: 'employee',
|
||||||
header: 'Personel',
|
header: 'Personel',
|
||||||
render: (leave: HrLeave) => (
|
render: (leave: LeaveDto) => (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<FaUser className="w-4 h-4 text-gray-500" />
|
<FaUser className="w-4 h-4 text-gray-500" />
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -342,12 +343,12 @@ const LeaveManagement: React.FC = () => {
|
||||||
{
|
{
|
||||||
key: 'leaveType',
|
key: 'leaveType',
|
||||||
header: 'İzin Türü',
|
header: 'İzin Türü',
|
||||||
render: (leave: HrLeave) => getLeaveTypeText(leave.leaveType),
|
render: (leave: LeaveDto) => getLeaveTypeText(leave.leaveType),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'period',
|
key: 'period',
|
||||||
header: 'İzin Dönemi',
|
header: 'İzin Dönemi',
|
||||||
render: (leave: HrLeave) => (
|
render: (leave: LeaveDto) => (
|
||||||
<div className="text-sm">
|
<div className="text-sm">
|
||||||
<div>{new Date(leave.startDate).toLocaleDateString('tr-TR')}</div>
|
<div>{new Date(leave.startDate).toLocaleDateString('tr-TR')}</div>
|
||||||
<div className="text-gray-500">{new Date(leave.endDate).toLocaleDateString('tr-TR')}</div>
|
<div className="text-gray-500">{new Date(leave.endDate).toLocaleDateString('tr-TR')}</div>
|
||||||
|
|
@ -357,7 +358,7 @@ const LeaveManagement: React.FC = () => {
|
||||||
{
|
{
|
||||||
key: 'totalDays',
|
key: 'totalDays',
|
||||||
header: 'Gün Sayısı',
|
header: 'Gün Sayısı',
|
||||||
render: (leave: HrLeave) => (
|
render: (leave: LeaveDto) => (
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
<FaCalendar className="w-4 h-4 text-gray-500" />
|
<FaCalendar className="w-4 h-4 text-gray-500" />
|
||||||
<span>{leave.totalDays} gün</span>
|
<span>{leave.totalDays} gün</span>
|
||||||
|
|
@ -367,12 +368,12 @@ const LeaveManagement: React.FC = () => {
|
||||||
{
|
{
|
||||||
key: 'appliedDate',
|
key: 'appliedDate',
|
||||||
header: 'Başvuru Tarihi',
|
header: 'Başvuru Tarihi',
|
||||||
render: (leave: HrLeave) => new Date(leave.appliedDate).toLocaleDateString('tr-TR'),
|
render: (leave: LeaveDto) => new Date(leave.appliedDate).toLocaleDateString('tr-TR'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'status',
|
key: 'status',
|
||||||
header: 'Durum',
|
header: 'Durum',
|
||||||
render: (leave: HrLeave) => (
|
render: (leave: LeaveDto) => (
|
||||||
<span
|
<span
|
||||||
className={`px-2 py-1 text-xs font-medium rounded-full ${getLeaveStatusColor(
|
className={`px-2 py-1 text-xs font-medium rounded-full ${getLeaveStatusColor(
|
||||||
leave.status,
|
leave.status,
|
||||||
|
|
@ -385,7 +386,7 @@ const LeaveManagement: React.FC = () => {
|
||||||
{
|
{
|
||||||
key: 'actions',
|
key: 'actions',
|
||||||
header: 'İşlemler',
|
header: 'İşlemler',
|
||||||
render: (leave: HrLeave) => (
|
render: (leave: LeaveDto) => (
|
||||||
<div className="flex gap-1">
|
<div className="flex gap-1">
|
||||||
<button
|
<button
|
||||||
onClick={() => handleView(leave)}
|
onClick={() => handleView(leave)}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,18 @@
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { FaClock, FaUser, FaPlus, FaEdit, FaCheck, FaTimes, FaEye, FaUsers } from 'react-icons/fa'
|
import { FaClock, FaUser, FaPlus, FaEdit, FaCheck, FaTimes, FaEye, FaUsers } from 'react-icons/fa'
|
||||||
import { LeaveStatusEnum, HrOvertime } from '../../../types/hr'
|
import { LeaveStatusEnum } from '../../../types/hr'
|
||||||
import DataTable, { Column } from '../../../components/common/DataTable'
|
import DataTable, { Column } from '../../../components/common/DataTable'
|
||||||
import { mockOvertimes } from '../../../mocks/mockOvertimes'
|
|
||||||
import { mockEmployees } from '../../../mocks/mockEmployees'
|
import { mockEmployees } from '../../../mocks/mockEmployees'
|
||||||
import { mockDepartments } from '../../../mocks/mockDepartments'
|
import { mockDepartments } from '../../../mocks/mockDepartments'
|
||||||
import Widget from '../../../components/common/Widget'
|
import Widget from '../../../components/common/Widget'
|
||||||
import { getLeaveStatusColor, getLeaveStatusText } from '../../../utils/erp'
|
import { getLeaveStatusColor, getLeaveStatusText } from '../../../utils/erp'
|
||||||
import { Container } from '@/components/shared'
|
import { Container } from '@/components/shared'
|
||||||
|
import { mockOvertimes } from '@/mocks/mockIntranet'
|
||||||
|
import { OvertimeDto } from '@/proxy/intranet/models'
|
||||||
|
|
||||||
const OvertimeManagement: React.FC = () => {
|
const OvertimeManagement: React.FC = () => {
|
||||||
// Overtime states
|
// Overtime states
|
||||||
const [overtimes, setOvertimes] = useState<HrOvertime[]>(mockOvertimes)
|
const [overtimes, setOvertimes] = useState<OvertimeDto[]>(mockOvertimes)
|
||||||
const [overtimeSelectedStatus, setOvertimeSelectedStatus] = useState<string>('all')
|
const [overtimeSelectedStatus, setOvertimeSelectedStatus] = useState<string>('all')
|
||||||
const [overtimeSelectedPeriod, setOvertimeSelectedPeriod] = useState<string>('all')
|
const [overtimeSelectedPeriod, setOvertimeSelectedPeriod] = useState<string>('all')
|
||||||
const [searchOvertimesTerm, setSearchOvertimesTerm] = useState('')
|
const [searchOvertimesTerm, setSearchOvertimesTerm] = useState('')
|
||||||
|
|
@ -23,7 +24,7 @@ const OvertimeManagement: React.FC = () => {
|
||||||
const [showOvertimeViewModal, setShowOvertimeViewModal] = useState(false)
|
const [showOvertimeViewModal, setShowOvertimeViewModal] = useState(false)
|
||||||
const [showOvertimeRejectModal, setShowOvertimeRejectModal] = useState(false)
|
const [showOvertimeRejectModal, setShowOvertimeRejectModal] = useState(false)
|
||||||
const [showBulkOvertimeModal, setShowBulkOvertimeModal] = useState(false)
|
const [showBulkOvertimeModal, setShowBulkOvertimeModal] = useState(false)
|
||||||
const [selectedOvertime, setSelectedOvertime] = useState<HrOvertime | null>(null)
|
const [selectedOvertime, setSelectedOvertime] = useState<OvertimeDto | null>(null)
|
||||||
const [overtimeRejectReason, setOvertimeRejectReason] = useState('')
|
const [overtimeRejectReason, setOvertimeRejectReason] = useState('')
|
||||||
|
|
||||||
// Overtime form state
|
// Overtime form state
|
||||||
|
|
@ -70,7 +71,7 @@ const OvertimeManagement: React.FC = () => {
|
||||||
setShowOvertimeAddModal(true)
|
setShowOvertimeAddModal(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOvertimeEdit = (overtime: HrOvertime) => {
|
const handleOvertimeEdit = (overtime: OvertimeDto) => {
|
||||||
setSelectedOvertime(overtime)
|
setSelectedOvertime(overtime)
|
||||||
setOvertimeFormData({
|
setOvertimeFormData({
|
||||||
employeeId: overtime.employeeId,
|
employeeId: overtime.employeeId,
|
||||||
|
|
@ -123,7 +124,7 @@ const OvertimeManagement: React.FC = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOvertimeView = (overtime: HrOvertime) => {
|
const handleOvertimeView = (overtime: OvertimeDto) => {
|
||||||
setSelectedOvertime(overtime)
|
setSelectedOvertime(overtime)
|
||||||
setShowOvertimeViewModal(true)
|
setShowOvertimeViewModal(true)
|
||||||
}
|
}
|
||||||
|
|
@ -148,7 +149,7 @@ const OvertimeManagement: React.FC = () => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const newOvertime: HrOvertime = {
|
const newOvertime: OvertimeDto = {
|
||||||
id: `ot_${Date.now()}`,
|
id: `ot_${Date.now()}`,
|
||||||
employeeId: overtimeFormData.employeeId,
|
employeeId: overtimeFormData.employeeId,
|
||||||
date: new Date(overtimeFormData.date),
|
date: new Date(overtimeFormData.date),
|
||||||
|
|
@ -256,7 +257,7 @@ const OvertimeManagement: React.FC = () => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const newOvertimes: HrOvertime[] = bulkOvertimeFormData.selectedEmployees.map((employeeId) => {
|
const newOvertimes: OvertimeDto[] = bulkOvertimeFormData.selectedEmployees.map((employeeId) => {
|
||||||
const employee = getSelectedEmployee(employeeId)
|
const employee = getSelectedEmployee(employeeId)
|
||||||
return {
|
return {
|
||||||
id: `ot_${Date.now()}_${employeeId}`,
|
id: `ot_${Date.now()}_${employeeId}`,
|
||||||
|
|
@ -340,11 +341,11 @@ const OvertimeManagement: React.FC = () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Overtime table columns
|
// Overtime table columns
|
||||||
const overtimeColumns: Column<HrOvertime>[] = [
|
const overtimeColumns: Column<OvertimeDto>[] = [
|
||||||
{
|
{
|
||||||
key: 'employee',
|
key: 'employee',
|
||||||
header: 'Personel',
|
header: 'Personel',
|
||||||
render: (overtime: HrOvertime) => {
|
render: (overtime: OvertimeDto) => {
|
||||||
const employee = mockEmployees.find((emp) => emp.id === overtime.employeeId)
|
const employee = mockEmployees.find((emp) => emp.id === overtime.employeeId)
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
|
|
@ -360,14 +361,14 @@ const OvertimeManagement: React.FC = () => {
|
||||||
{
|
{
|
||||||
key: 'date',
|
key: 'date',
|
||||||
header: 'Tarih',
|
header: 'Tarih',
|
||||||
render: (overtime: HrOvertime) => (
|
render: (overtime: OvertimeDto) => (
|
||||||
<div className="text-sm">{new Date(overtime.date).toLocaleDateString('tr-TR')}</div>
|
<div className="text-sm">{new Date(overtime.date).toLocaleDateString('tr-TR')}</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'time',
|
key: 'time',
|
||||||
header: 'Mesai Saatleri',
|
header: 'Mesai Saatleri',
|
||||||
render: (overtime: HrOvertime) => (
|
render: (overtime: OvertimeDto) => (
|
||||||
<div className="text-sm">
|
<div className="text-sm">
|
||||||
<div>
|
<div>
|
||||||
{overtime.startTime} - {overtime.endTime}
|
{overtime.startTime} - {overtime.endTime}
|
||||||
|
|
@ -379,7 +380,7 @@ const OvertimeManagement: React.FC = () => {
|
||||||
{
|
{
|
||||||
key: 'reason',
|
key: 'reason',
|
||||||
header: 'Neden',
|
header: 'Neden',
|
||||||
render: (overtime: HrOvertime) => (
|
render: (overtime: OvertimeDto) => (
|
||||||
<div className="text-sm max-w-xs truncate" title={overtime.reason}>
|
<div className="text-sm max-w-xs truncate" title={overtime.reason}>
|
||||||
{overtime.reason}
|
{overtime.reason}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -388,19 +389,19 @@ const OvertimeManagement: React.FC = () => {
|
||||||
{
|
{
|
||||||
key: 'rate',
|
key: 'rate',
|
||||||
header: 'Çarpan',
|
header: 'Çarpan',
|
||||||
render: (overtime: HrOvertime) => <div className="text-sm">x{overtime.rate}</div>,
|
render: (overtime: OvertimeDto) => <div className="text-sm">x{overtime.rate}</div>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'amount',
|
key: 'amount',
|
||||||
header: 'Tutar',
|
header: 'Tutar',
|
||||||
render: (overtime: HrOvertime) => (
|
render: (overtime: OvertimeDto) => (
|
||||||
<div className="text-sm font-medium">{overtime.amount?.toLocaleString('tr-TR')} ₺</div>
|
<div className="text-sm font-medium">{overtime.amount?.toLocaleString('tr-TR')} ₺</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'status',
|
key: 'status',
|
||||||
header: 'Durum',
|
header: 'Durum',
|
||||||
render: (overtime: HrOvertime) => (
|
render: (overtime: OvertimeDto) => (
|
||||||
<span
|
<span
|
||||||
className={`px-2 py-1 text-xs font-medium rounded-full ${getLeaveStatusColor(
|
className={`px-2 py-1 text-xs font-medium rounded-full ${getLeaveStatusColor(
|
||||||
overtime.status,
|
overtime.status,
|
||||||
|
|
@ -413,7 +414,7 @@ const OvertimeManagement: React.FC = () => {
|
||||||
{
|
{
|
||||||
key: 'actions',
|
key: 'actions',
|
||||||
header: 'İşlemler',
|
header: 'İşlemler',
|
||||||
render: (overtime: HrOvertime) => (
|
render: (overtime: OvertimeDto) => (
|
||||||
<div className="flex gap-1">
|
<div className="flex gap-1">
|
||||||
<button
|
<button
|
||||||
onClick={() => handleOvertimeView(overtime)}
|
onClick={() => handleOvertimeView(overtime)}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ const IntranetDashboard: React.FC = () => {
|
||||||
{ id: 'documents', permission: 'App.Files.Widget', column: 'left' },
|
{ id: 'documents', permission: 'App.Files.Widget', column: 'left' },
|
||||||
{ id: 'upcoming-trainings', permission: 'App.Hr.Training.Widget', column: 'left' },
|
{ id: 'upcoming-trainings', permission: 'App.Hr.Training.Widget', column: 'left' },
|
||||||
{ id: 'active-reservations', permission: 'App.Intranet.Reservation.Widget', column: 'left' },
|
{ id: 'active-reservations', permission: 'App.Intranet.Reservation.Widget', column: 'left' },
|
||||||
{ id: 'active-surveys', permission: 'App.Intranet.Survey.Widget', column: 'left' },
|
{ id: 'active-surveys', permission: 'App.Hr.Survey.Widget', column: 'left' },
|
||||||
{ id: 'visitors', permission: 'App.Intranet.Visitor.Widget', column: 'left' },
|
{ id: 'visitors', permission: 'App.Intranet.Visitor.Widget', column: 'left' },
|
||||||
{ id: 'expense-management', permission: 'App.Hr.Expense.Widget', column: 'left' },
|
{ id: 'expense-management', permission: 'App.Hr.Expense.Widget', column: 'left' },
|
||||||
{ id: 'social-wall', permission: 'App.Intranet.SocialPost.Widget', column: 'center' },
|
{ id: 'social-wall', permission: 'App.Intranet.SocialPost.Widget', column: 'center' },
|
||||||
|
|
@ -285,6 +285,20 @@ const IntranetDashboard: React.FC = () => {
|
||||||
return <ShuttleRoute shuttleRoutes={intranetDashboard?.shuttleRoutes || []} />
|
return <ShuttleRoute shuttleRoutes={intranetDashboard?.shuttleRoutes || []} />
|
||||||
case 'meal-weekly-menu':
|
case 'meal-weekly-menu':
|
||||||
return <MealWeeklyMenu meals={intranetDashboard?.meals || []} />
|
return <MealWeeklyMenu meals={intranetDashboard?.meals || []} />
|
||||||
|
case 'leave-management':
|
||||||
|
return (
|
||||||
|
<LeaveManagement
|
||||||
|
leaves={intranetDashboard?.leaves || []}
|
||||||
|
onNewLeave={() => setShowLeaveModal(true)}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
case 'overtime-management':
|
||||||
|
return (
|
||||||
|
<OvertimeManagement
|
||||||
|
overtimes={intranetDashboard?.overtimes || []}
|
||||||
|
onNewOvertime={() => setShowOvertimeModal(true)}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
case 'active-surveys':
|
case 'active-surveys':
|
||||||
return <ActiveSurveys onTakeSurvey={handleTakeSurvey} />
|
return <ActiveSurveys onTakeSurvey={handleTakeSurvey} />
|
||||||
|
|
@ -292,10 +306,6 @@ const IntranetDashboard: React.FC = () => {
|
||||||
return <SocialWall />
|
return <SocialWall />
|
||||||
case 'priority-tasks':
|
case 'priority-tasks':
|
||||||
return <PriorityTasks />
|
return <PriorityTasks />
|
||||||
case 'leave-management':
|
|
||||||
return <LeaveManagement onNewLeave={() => setShowLeaveModal(true)} />
|
|
||||||
case 'overtime-management':
|
|
||||||
return <OvertimeManagement onNewOvertime={() => setShowOvertimeModal(true)} />
|
|
||||||
default:
|
default:
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,14 @@ import React from 'react'
|
||||||
import { FaCalendarAlt, FaPlus } from 'react-icons/fa'
|
import { FaCalendarAlt, FaPlus } from 'react-icons/fa'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { LeaveStatusEnum, LeaveTypeEnum } from '../../../types/hr'
|
import { LeaveStatusEnum, LeaveTypeEnum } from '../../../types/hr'
|
||||||
import { mockEmployeeLeaves } from '@/mocks/mockEmployeeLeaves'
|
import { LeaveDto } from '@/proxy/intranet/models'
|
||||||
|
|
||||||
interface LeaveManagementProps {
|
interface LeaveManagementProps {
|
||||||
|
leaves: LeaveDto[]
|
||||||
onNewLeave: () => void
|
onNewLeave: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const LeaveManagement: React.FC<LeaveManagementProps> = ({ onNewLeave }) => {
|
const LeaveManagement: React.FC<LeaveManagementProps> = ({ leaves, onNewLeave }) => {
|
||||||
return (
|
return (
|
||||||
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
||||||
<div className="p-4 border-b border-gray-200 dark:border-gray-700">
|
<div className="p-4 border-b border-gray-200 dark:border-gray-700">
|
||||||
|
|
@ -32,16 +33,21 @@ const LeaveManagement: React.FC<LeaveManagementProps> = ({ onNewLeave }) => {
|
||||||
|
|
||||||
{/* Son izin talepleri */}
|
{/* Son izin talepleri */}
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
{mockEmployeeLeaves.slice(0, 3).map((leave) => (
|
{leaves.slice(0, 3).map((leave) => (
|
||||||
<div
|
<div
|
||||||
key={leave.id}
|
key={leave.id}
|
||||||
className="p-3 rounded-lg bg-gray-50 dark:bg-gray-900/20 border border-gray-200 dark:border-gray-700"
|
className="p-3 rounded-lg bg-gray-50 dark:bg-gray-900/20 border border-gray-200 dark:border-gray-700"
|
||||||
>
|
>
|
||||||
<div className="flex items-start justify-between mb-1">
|
<div className="flex items-start justify-between mb-1">
|
||||||
<h4 className="text-sm font-medium text-gray-900 dark:text-white">
|
<h4 className="text-sm font-medium text-gray-900 dark:text-white">
|
||||||
{leave.leaveType === LeaveTypeEnum.Annual ? '🏖️ Yıllık' :
|
{leave.leaveType === LeaveTypeEnum.Annual
|
||||||
leave.leaveType === LeaveTypeEnum.Sick ? '🏥 Hastalık' :
|
? '🏖️ Yıllık'
|
||||||
leave.leaveType === LeaveTypeEnum.Unpaid ? '💼 Ücretsiz' : '📋 Diğer'} İzin
|
: leave.leaveType === LeaveTypeEnum.Sick
|
||||||
|
? '🏥 Hastalık'
|
||||||
|
: leave.leaveType === LeaveTypeEnum.Unpaid
|
||||||
|
? '💼 Ücretsiz'
|
||||||
|
: '📋 Diğer'}{' '}
|
||||||
|
İzin
|
||||||
</h4>
|
</h4>
|
||||||
<span
|
<span
|
||||||
className={`text-xs px-2 py-1 rounded-full ${
|
className={`text-xs px-2 py-1 rounded-full ${
|
||||||
|
|
@ -52,12 +58,16 @@ const LeaveManagement: React.FC<LeaveManagementProps> = ({ onNewLeave }) => {
|
||||||
: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300'
|
: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{leave.status === LeaveStatusEnum.Approved ? 'Onaylandı' :
|
{leave.status === LeaveStatusEnum.Approved
|
||||||
leave.status === LeaveStatusEnum.Pending ? 'Bekliyor' : 'Reddedildi'}
|
? 'Onaylandı'
|
||||||
|
: leave.status === LeaveStatusEnum.Pending
|
||||||
|
? 'Bekliyor'
|
||||||
|
: 'Reddedildi'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs text-gray-600 dark:text-gray-400">
|
<p className="text-xs text-gray-600 dark:text-gray-400">
|
||||||
{dayjs(leave.startDate).format('DD MMM')} - {dayjs(leave.endDate).format('DD MMM')} ({leave.totalDays} gün)
|
{dayjs(leave.startDate).format('DD MMM')} - {dayjs(leave.endDate).format('DD MMM')}{' '}
|
||||||
|
({leave.totalDays} gün)
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,6 @@ import { MealDto } from '@/proxy/intranet/models'
|
||||||
dayjs.extend(isBetween)
|
dayjs.extend(isBetween)
|
||||||
|
|
||||||
const MealWeeklyMenu: React.FC<{ meals: MealDto[] }> = ({ meals }) => {
|
const MealWeeklyMenu: React.FC<{ meals: MealDto[] }> = ({ meals }) => {
|
||||||
// const mealWeekMenus = meals.filter((menu) => {
|
|
||||||
// const menuDate = dayjs(menu.date)
|
|
||||||
// const today = dayjs()
|
|
||||||
// const weekStart = today.startOf('week')
|
|
||||||
// const weekEnd = today.endOf('week')
|
|
||||||
// return menuDate.isBetween(weekStart, weekEnd, null, '[]')
|
|
||||||
// })
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
||||||
<div className="p-4 border-b border-gray-200 dark:border-gray-700">
|
<div className="p-4 border-b border-gray-200 dark:border-gray-700">
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,14 @@ import React from 'react'
|
||||||
import { FaClock, FaPlus } from 'react-icons/fa'
|
import { FaClock, FaPlus } from 'react-icons/fa'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { LeaveStatusEnum } from '../../../types/hr'
|
import { LeaveStatusEnum } from '../../../types/hr'
|
||||||
import { mockOvertimes } from '@/mocks/mockOvertimes'
|
import { OvertimeDto } from '@/proxy/intranet/models'
|
||||||
|
|
||||||
interface OvertimeManagementProps {
|
interface OvertimeManagementProps {
|
||||||
|
overtimes: OvertimeDto[]
|
||||||
onNewOvertime: () => void
|
onNewOvertime: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const OvertimeManagement: React.FC<OvertimeManagementProps> = ({ onNewOvertime }) => {
|
const OvertimeManagement: React.FC<OvertimeManagementProps> = ({ overtimes, onNewOvertime }) => {
|
||||||
return (
|
return (
|
||||||
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
||||||
<div className="p-4 border-b border-gray-200 dark:border-gray-700">
|
<div className="p-4 border-b border-gray-200 dark:border-gray-700">
|
||||||
|
|
@ -27,7 +28,7 @@ const OvertimeManagement: React.FC<OvertimeManagementProps> = ({ onNewOvertime }
|
||||||
|
|
||||||
{/* Son mesai talepleri */}
|
{/* Son mesai talepleri */}
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
{mockOvertimes.slice(0, 3).map((overtime) => (
|
{overtimes.slice(0, 3).map((overtime) => (
|
||||||
<div
|
<div
|
||||||
key={overtime.id}
|
key={overtime.id}
|
||||||
className="p-3 rounded-lg bg-gray-50 dark:bg-gray-900/20 border border-gray-200 dark:border-gray-700"
|
className="p-3 rounded-lg bg-gray-50 dark:bg-gray-900/20 border border-gray-200 dark:border-gray-700"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue