diff --git a/api/NotificationDataClasses/OvertimeData.cs b/api/NotificationDataClasses/OvertimeData.cs index ee466862..74852e1b 100644 --- a/api/NotificationDataClasses/OvertimeData.cs +++ b/api/NotificationDataClasses/OvertimeData.cs @@ -9,6 +9,11 @@ public class OvertimeData public string Type { get; set; } = default!; public string Status { get; set; } = default!; public string? Remarks { get; set; } = default!; + + public bool? IsManagerApproved { get; set; } + public bool? IsLeaderApproved { get; set; } + + public string? OvertimeId { get; set; } } public class OvertimeManagerData : OvertimeData diff --git a/api/Schema/Queries/OvertimeQuery.cs b/api/Schema/Queries/OvertimeQuery.cs index dd38de32..311eba19 100644 --- a/api/Schema/Queries/OvertimeQuery.cs +++ b/api/Schema/Queries/OvertimeQuery.cs @@ -15,6 +15,11 @@ public OvertimeQuery(OvertimeService overtimeService) return await _overtimeService.GetOvertime(UserId); } + public async Task GetOvertimeById(int id) + { + return await _overtimeService.GetOvertimeById(id); + } + public async Task> GetAllOvertime() { return await _overtimeService.Index(); diff --git a/api/Services/ApprovalService.cs b/api/Services/ApprovalService.cs index 42ce1f87..1ebd61fd 100644 --- a/api/Services/ApprovalService.cs +++ b/api/Services/ApprovalService.cs @@ -35,102 +35,134 @@ public async Task ApproveDisapproveOvertime(ApproveOvertimeRequest overtim errors = _customInputValidation.checkApproveOvertimeRequestInput(overtimeRequest); if (errors.Count > 0) throw new GraphQLException(errors); - // check if approving/disapproving is manager - if (_customInputValidation.CheckManagerUser(overtimeRequest.UserId).Result) + try { - // validate input for manager case - errors = _customInputValidation.checkManagerApproveOvertimeRequestInput(overtimeRequest); - if (errors.Count > 0) throw new GraphQLException(errors); - - // approve/disapprove operation - var headManager = await context.Users.Where(x => x.PositionId == PositionEnum.MANAGER || (x.PositionId == PositionEnum.ASSISTANT_MANAGER && x.Id == overtimeRequest.UserId)).ToListAsync(); - var notification = await context.OvertimeNotifications.Where(x => x.OvertimeId == overtimeRequest.OvertimeId && x.RecipientId == overtimeRequest.UserId && x.Type == NotificationTypeEnum.OVERTIME).FirstOrDefaultAsync(); - var overtime = await context.Overtimes - .Include(x => x.TimeEntry.TimeIn) - .Include(x => x.TimeEntry.TimeOut) - .FirstOrDefaultAsync(x => x.Id == overtimeRequest.OvertimeId); - var notificationData = notification != null ? JsonConvert.DeserializeObject(notification.Data) : null; - - if ((overtime != null && notificationData != null) || headManager.Count > 0) + // check if approving/disapproving is manager + if (_customInputValidation.CheckManagerUser(overtimeRequest.UserId).Result) { - overtime!.IsManagerApproved = overtimeRequest.IsApproved; - - if (overtimeRequest.IsApproved) - { - if (notificationData != null) - notificationData!.Status = RequestStatus.APPROVED; - overtime.ApprovedMinutes = overtimeRequest.ApprovedMinutes; - } - if (!overtimeRequest.IsApproved) + // validate input for manager case + errors = _customInputValidation.checkManagerApproveOvertimeRequestInput(overtimeRequest); + if (errors.Count > 0) throw new GraphQLException(errors); + + // approve/disapprove operation + var headManager = await context.Users.Where(x => x.PositionId == PositionEnum.MANAGER || (x.PositionId == PositionEnum.ASSISTANT_MANAGER && x.Id == overtimeRequest.UserId)).ToListAsync(); + var notification = await context.OvertimeNotifications.Where(x => x.OvertimeId == overtimeRequest.OvertimeId && x.RecipientId == overtimeRequest.UserId && x.Type == NotificationTypeEnum.OVERTIME).FirstOrDefaultAsync(); + var overtime = await context.Overtimes + .Include(x => x.TimeEntry.TimeIn) + .Include(x => x.TimeEntry.TimeOut) + .FirstOrDefaultAsync(x => x.Id == overtimeRequest.OvertimeId); + var notificationData = notification != null ? JsonConvert.DeserializeObject(notification.Data) : null; + + if ((overtime != null && notificationData != null) || headManager.Count > 0) { - if (notificationData != null) - notificationData!.Status = RequestStatus.DISAPPROVED; - overtime.ApprovedMinutes = 0; + overtime!.IsManagerApproved = overtimeRequest.IsApproved; + + if (overtimeRequest.IsApproved) + { + if (notificationData != null) + notificationData!.Status = RequestStatus.APPROVED; + overtime.ApprovedMinutes = overtimeRequest.ApprovedMinutes; + } + if (!overtimeRequest.IsApproved) + { + if (notificationData != null) + notificationData!.Status = RequestStatus.DISAPPROVED; + overtime.ApprovedMinutes = 0; + } + + overtime.ManagerRemarks = overtimeRequest.ManagerRemarks; } - overtime.ManagerRemarks = overtimeRequest.ManagerRemarks; - } + if (notification != null) notification.Data = JsonConvert.SerializeObject(notificationData); - if (notification != null) notification.Data = JsonConvert.SerializeObject(notificationData); + // create notification + if (overtime != null && overtime.IsManagerApproved == true && overtime.IsLeaderApproved == true) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, APPROVED); - // create notification - if (overtime != null && overtime.IsManagerApproved == true && overtime.IsLeaderApproved == true) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, APPROVED); + if (overtime != null && (overtime.IsLeaderApproved == null && overtime.IsManagerApproved == false)) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); + else if (overtime != null && (overtime.IsLeaderApproved == true && overtime.IsManagerApproved == false)) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); + else if (overtime != null && (overtime.IsLeaderApproved == false && overtime.IsManagerApproved == false)) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); - if (overtime != null && (overtime.IsLeaderApproved == null && overtime.IsManagerApproved == false)) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); - else if (overtime != null && (overtime.IsLeaderApproved == true && overtime.IsManagerApproved == false)) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); - else if (overtime != null && (overtime.IsLeaderApproved == false && overtime.IsManagerApproved == false)) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); + await context.SaveChangesAsync(); + return true; + } - await context.SaveChangesAsync(); - return true; } + catch (Exception e) + { + Console.WriteLine($"Manager Error: {e.Message}"); + Console.WriteLine($"Manager Stack Trace: {e.StackTrace}"); + + // Optionally, if you are using a logging framework: + // _logger.LogError(e, "Unexpected Execution Error BISHH"); - // check if approving/disapproving is projectleader (from notifications) - if (_customInputValidation.checkProjectLeaderUser(overtimeRequest.UserId).Result) + // Rethrow the exception with a custom message + throw new GraphQLException("Unexpected Execution Error BISHH", e); + } + + try { - // validate input for project leader case - errors = _customInputValidation.checkLeaderApproveOvertimeRequestInput(overtimeRequest); - if (errors.Count > 0) throw new GraphQLException(errors); - - // approve/disapprove operation - var notification = await context.OvertimeNotifications.FindAsync(overtimeRequest.NotificationId); - var overtime = await context.Overtimes.FindAsync(notification?.OvertimeId); - var notificationData = notification != null ? JsonConvert.DeserializeObject(notification.Data) : null; - - // if approving project leader doesn't match - var isProjectLeader = _customInputValidation.checkApprovingProjectLeader(overtimeRequest.UserId, overtime!.Id, MultiProjectTypeEnum.OVERTIME).Result; - if (!isProjectLeader) throw new GraphQLException(ErrorBuilder.New().SetMessage(InputValidationMessageEnum.MISMATCH_PROJECT_LEADER).Build()); - - if (overtime != null && isProjectLeader) - overtime.IsLeaderApproved = overtimeRequest.IsApproved; - - // Update notification data - if (overtimeRequest.IsApproved && notificationData != null) notificationData!.Status = RequestStatus.APPROVED; - if (!overtimeRequest.IsApproved && notificationData != null) notificationData!.Status = RequestStatus.DISAPPROVED; - - if (notification != null) notification.Data = JsonConvert.SerializeObject(notificationData); - - // create notification - if (overtime != null && overtime.IsManagerApproved == true && overtime.IsLeaderApproved == true) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, APPROVED); - else if (overtime != null && overtime.IsManagerApproved == null && overtime.IsLeaderApproved == true) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, APPROVED); - if (overtime != null && (overtime.IsLeaderApproved == false && overtime.IsManagerApproved == null)) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); - else if (overtime != null && (overtime.IsLeaderApproved == null && overtime.IsManagerApproved == false)) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); - else if (overtime != null && (overtime.IsLeaderApproved == false && overtime.IsManagerApproved == false)) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); - else if (overtime != null && (overtime.IsLeaderApproved == true && overtime.IsManagerApproved == false)) - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); - - // end - await context.SaveChangesAsync(); - return true; + // check if approving/disapproving is projectleader (from notifications) + if (_customInputValidation.checkProjectLeaderUser(overtimeRequest.UserId).Result) + { + // validate input for project leader case + errors = _customInputValidation.checkLeaderApproveOvertimeRequestInput(overtimeRequest); + if (errors.Count > 0) throw new GraphQLException(errors); + + // approve/disapprove operation + var notification = await context.OvertimeNotifications.FindAsync(overtimeRequest.NotificationId); + var overtime = await context.Overtimes.FindAsync(notification?.OvertimeId); + var notificationData = notification != null ? JsonConvert.DeserializeObject(notification.Data) : null; + + // if approving project leader doesn't match + var isProjectLeader = _customInputValidation.checkApprovingProjectLeader(overtimeRequest.UserId, overtime!.Id, MultiProjectTypeEnum.OVERTIME).Result; + if (!isProjectLeader) throw new GraphQLException(ErrorBuilder.New().SetMessage(InputValidationMessageEnum.MISMATCH_PROJECT_LEADER).Build()); + + if (overtime != null && isProjectLeader) + overtime.IsLeaderApproved = overtimeRequest.IsApproved; + + // Update notification data + if (overtimeRequest.IsApproved && notificationData != null) notificationData!.Status = RequestStatus.APPROVED; + if (!overtimeRequest.IsApproved && notificationData != null) notificationData!.Status = RequestStatus.DISAPPROVED; + + if (notification != null) notification.Data = JsonConvert.SerializeObject(notificationData); + + // create notification + if (overtime != null && overtime.IsManagerApproved == true && overtime.IsLeaderApproved == true) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, APPROVED); + else if (overtime != null && overtime.IsManagerApproved == null && overtime.IsLeaderApproved == true) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, APPROVED); + if (overtime != null && (overtime.IsLeaderApproved == false && overtime.IsManagerApproved == null)) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); + else if (overtime != null && (overtime.IsLeaderApproved == null && overtime.IsManagerApproved == false)) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); + else if (overtime != null && (overtime.IsLeaderApproved == false && overtime.IsManagerApproved == false)) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); + else if (overtime != null && (overtime.IsLeaderApproved == true && overtime.IsManagerApproved == false)) + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); + + // end + await context.SaveChangesAsync(); + return true; + } + + } + catch (Exception e) + { + // Log the exception details first + Console.WriteLine($"Error: {e.Message}"); + Console.WriteLine($"Stack Trace: {e.StackTrace}"); + + // Optionally, if you are using a logging framework: + // _logger.LogError(e, "Unexpected Execution Error BISHH"); + + // Rethrow the exception with a custom message + throw new GraphQLException("Unexpected Execution Error BISHH", e); } + } return false; } @@ -186,7 +218,7 @@ public async Task ApproveDisapproveSummaryOvertime(ApproveOvertimeRequest bool isManagerApproved = overtime.IsManagerApproved == true; if (!isLeaderApproved || !isManagerApproved) { - await _notificationService.createOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); + await _notificationService.CreateOvertimeApproveDisapproveNotification(overtime!, overtimeRequest.UserId, DISAPPROVED); } } diff --git a/api/Services/NotificationService.cs b/api/Services/NotificationService.cs index a178e664..33343cc0 100644 --- a/api/Services/NotificationService.cs +++ b/api/Services/NotificationService.cs @@ -143,7 +143,10 @@ public async Task> createOvertimeNotification(Overtim DateFiled = (DateTime)overtime.CreatedAt!, Type = NotificationDataTypeEnum.REQUEST, Status = _overtimeService.GetOvertimeRequestStatus(overtime), - Remarks = overtime.Remarks + Remarks = overtime.Remarks, + IsLeaderApproved = overtime.IsLeaderApproved, + IsManagerApproved = overtime.IsManagerApproved, + OvertimeId = overtime.Id.ToString() } ); @@ -175,7 +178,11 @@ public async Task> createOvertimeNotification(Overtim DateFiled = (DateTime)overtime.CreatedAt, Type = NotificationDataTypeEnum.REQUEST, Status = _overtimeService.GetOvertimeRequestStatus(overtime), - Remarks = overtime.Remarks + Remarks = overtime.Remarks, + IsLeaderApproved = overtime.IsLeaderApproved, + IsManagerApproved = overtime.IsManagerApproved, + OvertimeId = overtime.Id.ToString() + // TODO: create the part when either the manager/leader disapproves, it will update so that the other can't update } ); @@ -561,22 +568,45 @@ public async Task createLeaveApproveDisapproveNotification(Le } } - public async Task createOvertimeApproveDisapproveNotification(Overtime overtime, int fromUserId, bool IsApproved) + public async Task CreateOvertimeApproveDisapproveNotification(Overtime overtime, int fromUserId, bool IsApproved) { using (HrisContext context = _contextFactory.CreateDbContext()) { + //for time entries + var timeEntry = context.TimeEntries.Find(overtime.TimeEntryId); + //from the time entry, get the time in and time out + var timeInEntry = timeEntry?.EndTime + TimeSpan.FromHours(1); + var timeOutEntry = context.Times.Find(timeEntry?.TimeOutId); + + var timeIn = timeInEntry?.ToString(@"hh\:mm"); + var timeOut = timeOutEntry?.TimeHour.ToString(@"hh\:mm"); + + var managerStatus = overtime.IsManagerApproved switch + { + true => RequestStatus.APPROVED, + false => RequestStatus.DISAPPROVED, + null => RequestStatus.PENDING // if IsManagerApproved is nullable + }; + + var leaderStatus = overtime.IsLeaderApproved switch + { + true => RequestStatus.APPROVED, + false => RequestStatus.DISAPPROVED, + null => RequestStatus.PENDING // if IsLeaderApproved is nullable + }; + var user = context.Users.Find(fromUserId); var projectNames = context.MultiProjects.Where(x => x.OvertimeId == overtime.Id && x.Type == MultiProjectTypeEnum.OVERTIME).Select(x => x.ProjectId == ProjectId.OTHER_PROJECT ? overtime.OtherProject : x.Project.Name); var dataToUser = JsonSerializer.Serialize(new { User = new { - Id = user?.Id, + Id = user?.Id, // Explicitly naming the properties Name = user?.Name, AvatarLink = _userService.GenerateAvatarLink(user?.ProfileImageId ?? default(int)) }, - Projects = projectNames, - RequestedMinutes = overtime.RequestedMinutes, + Projects = projectNames, // This one is fine because it's already a named property + RequestedMinutes = overtime.RequestedMinutes, // Explicitly naming the properties DateRequested = overtime.OvertimeDate, ApprovedMinutes = overtime.ApprovedMinutes, DateFiled = overtime.CreatedAt, @@ -584,10 +614,14 @@ public async Task createOvertimeApproveDisapproveNotificat Status = IsApproved ? RequestStatus.APPROVED : RequestStatus.DISAPPROVED, Remarks = overtime.Remarks, ManagerRemarks = overtime.ManagerRemarks, - RequestedTimeIn = overtime.TimeEntry.TimeIn!.TimeHour.ToString(@"hh\:mm"), - RequestedTimeOut = overtime.TimeEntry.TimeOut!.TimeHour.ToString(@"hh\:mm") - } - ); + RequestedTimeIn = timeIn, + RequestedTimeOut = timeOut, + Duration = overtime.RequestedMinutes, + ManagerApproveStatus = managerStatus, + LeaderApproveStatus = leaderStatus, + + }); + // Notification to Requesting User var notificationToUser = new OvertimeNotification diff --git a/api/Services/OvertimeService.cs b/api/Services/OvertimeService.cs index 73b220bc..0e176910 100644 --- a/api/Services/OvertimeService.cs +++ b/api/Services/OvertimeService.cs @@ -97,6 +97,26 @@ public async Task> GetOvertime(int UserId) .ToListAsync(); } } + + public async Task GetOvertimeById(int id) + { + using (HrisContext context = _contextFactory.CreateDbContext()) + { + // Find the Overtime entity by ID and return a single DTO object + return await context.Overtimes + .Include(x => x.MultiProjects) + .ThenInclude(x => x.Project) + .Include(x => x.MultiProjects) + .ThenInclude(x => x.ProjectLeader) + .Include(x => x.Manager) + .ThenInclude(x => x.Role) + .Where(w => w.Id == id) + .OrderByDescending(x => x.CreatedAt) + .Select(x => new MyOvertimeDTO(x)) + .SingleOrDefaultAsync(); // Use SingleOrDefaultAsync to return a single MyOvertimeDTO or null + } + } + public async Task> Index() { var domain = _httpService.getDomainURL(); diff --git a/api_v2/src/graphql/graphql.ts b/api_v2/src/graphql/graphql.ts index 184a7e41..89faf608 100644 --- a/api_v2/src/graphql/graphql.ts +++ b/api_v2/src/graphql/graphql.ts @@ -1,3 +1,4 @@ + /* * ------------------------------------------------------- * THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY) @@ -8,1182 +9,1071 @@ /* eslint-disable */ export enum WorkStatusEnum { - ONDUTY = 'ONDUTY', - ABSENT = 'ABSENT', - REST = 'REST', - AWAITING = 'AWAITING', + ONDUTY = "ONDUTY", + ABSENT = "ABSENT", + REST = "REST", + AWAITING = "AWAITING" } export class AddMemberToScheduleRequestInput { - userId: number; - employeeIds: number[]; - scheduleId: number; + userId: number; + employeeIds: number[]; + scheduleId: number; } export class AddNewEmployeeRequestInput { - email: string; - positionId: number; - roleId: number; - scheduleId?: Nullable; - firstName: string; - middleName?: Nullable; - lastName: string; + email: string; + positionId: number; + roleId: number; + scheduleId?: Nullable; + firstName: string; + middleName?: Nullable; + lastName: string; } export class ApproveChangeShiftRequestInput { - userId: number; - notificationId: number; - isApproved: boolean; + userId: number; + notificationId: number; + isApproved: boolean; } export class ApproveESLChangeShiftRequestInput { - teamLeaderId: number; - notificationId: number; - isApproved: boolean; + teamLeaderId: number; + notificationId: number; + isApproved: boolean; } export class ApproveLeaveUndertimeRequestInput { - userId: number; - notificationId: number; - isApproved: boolean; + userId: number; + notificationId: number; + isApproved: boolean; } export class ApproveOvertimeRequestInput { - userId: number; - overtimeId?: Nullable; - notificationId?: Nullable; - approvedMinutes?: Nullable; - isApproved: boolean; - managerRemarks?: Nullable; + userId: number; + overtimeId?: Nullable; + notificationId?: Nullable; + approvedMinutes?: Nullable; + isApproved: boolean; + managerRemarks?: Nullable; } export class ApproveOvertimeSummaryRequestInput { - approveOvertimeRequests: ApproveOvertimeRequestInput[]; + approveOvertimeRequests: ApproveOvertimeRequestInput[]; } export class CancelLeaveRequestInput { - userId: number; - leaveId: number; + userId: number; + leaveId: number; } export class ChangeSchedRequestInput { - leaderIds: number[]; - workingDays: WorkingDayTimesRequestInput[]; + leaderIds: number[]; + workingDays: WorkingDayTimesRequestInput[]; } export class CreateBulkOvertimeRequestInput { - managerId: number; - otherProject?: Nullable; - requestedMinutes: number; - remarks: string; - date: string; - employeeIds: number[]; - projectId: number; + managerId: number; + otherProject?: Nullable; + requestedMinutes: number; + remarks: string; + date: string; + employeeIds: number[]; + projectId: number; } export class CreateChangeShiftRequestInput { - userId: number; - timeEntryId: number; - managerId: number; - timeIn: string; - timeOut: string; - otherProject?: Nullable; - description: string; - projects: MultiProjectRequestInput[]; + userId: number; + timeEntryId: number; + managerId: number; + timeIn: string; + timeOut: string; + otherProject?: Nullable; + description: string; + projects: MultiProjectRequestInput[]; } export class CreateESLChangeShiftRequestInput { - userId: number; - timeEntryId: number; - teamLeaderId: number; - timeIn: string; - timeOut: string; - description: string; - eslOffsetIDs: number[]; + userId: number; + timeEntryId: number; + teamLeaderId: number; + timeIn: string; + timeOut: string; + description: string; + eslOffsetIDs: number[]; } export class CreateESLOffsetRequestInput { - userId: number; - timeEntryId: number; - teamLeaderId: number; - timeIn: string; - timeOut: string; - title: string; - description: string; + userId: number; + timeEntryId: number; + teamLeaderId: number; + timeIn: string; + timeOut: string; + title: string; + description: string; } export class CreateEmployeeScheduleRequestInput { - userId: number; - scheduleName?: Nullable; - workingDays: WorkingDayTimesRequestInput[]; + userId: number; + scheduleName?: Nullable; + workingDays: WorkingDayTimesRequestInput[]; } export class CreateInterruptionRequestInput { - timeEntryId: number; - workInterruptionTypeId: number; - timeOut?: Nullable; - timeIn?: Nullable; - remarks?: Nullable; - otherReason?: Nullable; + timeEntryId: number; + workInterruptionTypeId: number; + timeOut?: Nullable; + timeIn?: Nullable; + remarks?: Nullable; + otherReason?: Nullable; } export class CreateLeaveRequestInput { - userId: number; - leaveTypeId: number; - managerId: number; - otherProject?: Nullable; - reason?: Nullable; - leaveProjects: MultiProjectRequestInput[]; - leaveDates: LeaveDateRequestInput[]; + userId: number; + leaveTypeId: number; + managerId: number; + otherProject?: Nullable; + reason?: Nullable; + leaveProjects: MultiProjectRequestInput[]; + leaveDates: LeaveDateRequestInput[]; } export class CreateOvertimeRequestInput { - userId: number; - managerId: number; - timeEntryId: number; - otherProject?: Nullable; - requestedMinutes: number; - remarks?: Nullable; - date: string; - overtimeProjects: MultiProjectRequestInput[]; + userId: number; + managerId: number; + timeEntryId: number; + otherProject?: Nullable; + requestedMinutes: number; + remarks?: Nullable; + date: string; + overtimeProjects: MultiProjectRequestInput[]; } export class CreateSummaryRequestInput { - startDate: string; - endDate: string; + startDate: string; + endDate: string; } export class DeleteEmployeeScheduleRequestInput { - userId: number; - employeeScheduleId: number; + userId: number; + employeeScheduleId: number; } export class LeaveDateRequestInput { - leaveDate: string; - isWithPay: boolean; - days: number; + leaveDate: string; + isWithPay: boolean; + days: number; } export class LogoutRequestInput { - token: string; + token: string; } export class MultiProjectRequestInput { - projectId: number; - projectLeaderId: number; + projectId: number; + projectLeaderId: number; } export class NotificationRequestInput { - id: number; - readAt?: Nullable; + id: number; + readAt?: Nullable; } export class SearchEmployeesByScheduleRequestInput { - employeeScheduleId: number; - searchKey: string; + employeeScheduleId: number; + searchKey: string; } export class ShowInterruptionRequestInput { - timeEntryId: number; + timeEntryId: number; } export class TimeInRequestInput { - id: number; - userId: number; - timeHour: TimeSpan; - date: DateTime; - startTime: TimeSpan; - endTime: TimeSpan; - remarks?: Nullable; - files?: Nullable; + id: number; + userId: number; + timeHour: TimeSpan; + date: DateTime; + startTime: TimeSpan; + endTime: TimeSpan; + remarks?: Nullable; + files?: Nullable; } export class TimeOutRequestInput { - userId: number; - timeEntryId?: Nullable; - timeHour: TimeSpan; - remarks?: Nullable; - workedHours?: Nullable; + userId: number; + timeEntryId?: Nullable; + timeHour: TimeSpan; + remarks?: Nullable; + workedHours?: Nullable; } export class UpdateEmployeeScheduleRequestInput { - userId: number; - employeeScheduleId: number; - scheduleName?: Nullable; - workingDays: WorkingDayTimesRequestInput[]; + userId: number; + employeeScheduleId: number; + scheduleName?: Nullable; + workingDays: WorkingDayTimesRequestInput[]; } export class UpdateInterruptionRequestInput { - id: number; - workInterruptionTypeId: number; - timeOut?: Nullable; - timeIn?: Nullable; - remarks?: Nullable; - otherReason?: Nullable; + id: number; + workInterruptionTypeId: number; + timeOut?: Nullable; + timeIn?: Nullable; + remarks?: Nullable; + otherReason?: Nullable; } export class UpdateLeaveRequestInput { - userId: number; - leaveTypeId: number; - leaveId: number; - managerId: number; - otherProject?: Nullable; - reason?: Nullable; - leaveProjects: MultiProjectRequestInput[]; - leaveDates: LeaveDateRequestInput[]; + userId: number; + leaveTypeId: number; + leaveId: number; + managerId: number; + otherProject?: Nullable; + reason?: Nullable; + leaveProjects: MultiProjectRequestInput[]; + leaveDates: LeaveDateRequestInput[]; } export class UpdateMemberScheduleRequestInput { - userId: number; - employeeId: number; - scheduleId: number; + userId: number; + employeeId: number; + scheduleId: number; } export class UpdateTimeEntryInput { - userId: number; - timeEntryId: number; - timeIn?: Nullable; - timeOut?: Nullable; + userId: number; + timeEntryId: number; + timeIn?: Nullable; + timeOut?: Nullable; } export class WorkingDayTimesRequestInput { - day?: Nullable; - from?: Nullable; - to?: Nullable; - breakFrom?: Nullable; - breakTo?: Nullable; + day?: Nullable; + from?: Nullable; + to?: Nullable; + breakFrom?: Nullable; + breakTo?: Nullable; } export class ChangeScheduleRequest { - id: number; - userId: number; - isManagerApproved?: Nullable; - isLeaderApproved?: Nullable; - data: string; - user: User; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + userId: number; + isManagerApproved?: Nullable; + isLeaderApproved?: Nullable; + data: string; + user: User; + createdAt?: Nullable; + updatedAt?: Nullable; } export class ChangeShiftDTO { - timeIn: string; - timeOut: string; - id: number; - userId: number; - timeEntryId: number; - managerId: number; - otherProject?: Nullable; - description: string; - isManagerApproved?: Nullable; - isLeaderApproved?: Nullable; - user: User; - manager: User; - timeEntry: TimeEntry; - multiProjects: MultiProject[]; - createdAt?: Nullable; - updatedAt?: Nullable; + timeIn: string; + timeOut: string; + id: number; + userId: number; + timeEntryId: number; + managerId: number; + otherProject?: Nullable; + description: string; + isManagerApproved?: Nullable; + isLeaderApproved?: Nullable; + user: User; + manager: User; + timeEntry: TimeEntry; + multiProjects: MultiProject[]; + createdAt?: Nullable; + updatedAt?: Nullable; } export class ChangeShiftNotification { - changeShiftRequestId: number; - changeShiftRequest: ChangeShiftRequest; - id: number; - recipientId?: Nullable; - relatedEntityId?: Nullable; - type: string; - data: string; - readAt?: Nullable; - isRead: boolean; - recipient?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + changeShiftRequestId: number; + changeShiftRequest: ChangeShiftRequest; + id: number; + recipientId?: Nullable; + relatedEntityId?: Nullable; + type: string; + data: string; + readAt?: Nullable; + isRead: boolean; + recipient?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class ChangeShiftRequest { - id: number; - userId: number; - timeEntryId: number; - managerId: number; - timeIn: TimeSpan; - timeOut: TimeSpan; - otherProject?: Nullable; - description: string; - isManagerApproved?: Nullable; - isLeaderApproved?: Nullable; - user: User; - manager: User; - timeEntry: TimeEntry; - multiProjects: MultiProject[]; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + userId: number; + timeEntryId: number; + managerId: number; + timeIn: TimeSpan; + timeOut: TimeSpan; + otherProject?: Nullable; + description: string; + isManagerApproved?: Nullable; + isLeaderApproved?: Nullable; + user: User; + manager: User; + timeEntry: TimeEntry; + multiProjects: MultiProject[]; + createdAt?: Nullable; + updatedAt?: Nullable; } export class Day { - isDaySelected?: Nullable; - workingDay?: Nullable; - timeIn?: Nullable; - timeOut?: Nullable; - breakFrom?: Nullable; - breakTo?: Nullable; + isDaySelected?: Nullable; + workingDay?: Nullable; + timeIn?: Nullable; + timeOut?: Nullable; + breakFrom?: Nullable; + breakTo?: Nullable; } export class ESLChangeShiftDTO { - timeIn: string; - timeOut: string; - id: number; - userId: number; - timeEntryId: number; - teamLeaderId: number; - description: string; - isLeaderApproved?: Nullable; - user: User; - teamLeader: User; - timeEntry: TimeEntry; - eslOffsets: ESLOffset[]; - createdAt?: Nullable; - updatedAt?: Nullable; + timeIn: string; + timeOut: string; + id: number; + userId: number; + timeEntryId: number; + teamLeaderId: number; + description: string; + isLeaderApproved?: Nullable; + user: User; + teamLeader: User; + timeEntry: TimeEntry; + eslOffsets: ESLOffset[]; + createdAt?: Nullable; + updatedAt?: Nullable; } export class ESLChangeShiftNotification { - eslChangeShiftRequestId: number; - eslChangeShiftRequest: ESLChangeShiftRequest; - id: number; - recipientId?: Nullable; - relatedEntityId?: Nullable; - type: string; - data: string; - readAt?: Nullable; - isRead: boolean; - recipient?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + eslChangeShiftRequestId: number; + eslChangeShiftRequest: ESLChangeShiftRequest; + id: number; + recipientId?: Nullable; + relatedEntityId?: Nullable; + type: string; + data: string; + readAt?: Nullable; + isRead: boolean; + recipient?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class ESLChangeShiftRequest { - id: number; - userId: number; - timeEntryId: number; - teamLeaderId: number; - timeIn: TimeSpan; - timeOut: TimeSpan; - description: string; - isLeaderApproved?: Nullable; - user: User; - teamLeader: User; - timeEntry: TimeEntry; - eslOffsets: ESLOffset[]; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + userId: number; + timeEntryId: number; + teamLeaderId: number; + timeIn: TimeSpan; + timeOut: TimeSpan; + description: string; + isLeaderApproved?: Nullable; + user: User; + teamLeader: User; + timeEntry: TimeEntry; + eslOffsets: ESLOffset[]; + createdAt?: Nullable; + updatedAt?: Nullable; } export class ESLOffset { - id: number; - userId: number; - timeEntryId: number; - teamLeaderId: number; - eslChangeShiftRequestId?: Nullable; - timeIn: TimeSpan; - timeOut: TimeSpan; - title: string; - description: string; - isLeaderApproved?: Nullable; - isUsed: boolean; - user: User; - teamLeader: User; - timeEntry: TimeEntry; - eslChangeShiftRequest: ESLChangeShiftRequest; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + userId: number; + timeEntryId: number; + teamLeaderId: number; + eslChangeShiftRequestId?: Nullable; + timeIn: TimeSpan; + timeOut: TimeSpan; + title: string; + description: string; + isLeaderApproved?: Nullable; + isUsed: boolean; + user: User; + teamLeader: User; + timeEntry: TimeEntry; + eslChangeShiftRequest: ESLChangeShiftRequest; + createdAt?: Nullable; + updatedAt?: Nullable; } export class ESLOffsetDTO { - timeIn: string; - timeOut: string; - id: number; - userId: number; - timeEntryId: number; - teamLeaderId: number; - eslChangeShiftRequestId?: Nullable; - title: string; - description: string; - isLeaderApproved?: Nullable; - isUsed: boolean; - user: User; - teamLeader: User; - timeEntry: TimeEntry; - eslChangeShiftRequest: ESLChangeShiftRequest; - createdAt?: Nullable; - updatedAt?: Nullable; + timeIn: string; + timeOut: string; + id: number; + userId: number; + timeEntryId: number; + teamLeaderId: number; + eslChangeShiftRequestId?: Nullable; + title: string; + description: string; + isLeaderApproved?: Nullable; + isUsed: boolean; + user: User; + teamLeader: User; + timeEntry: TimeEntry; + eslChangeShiftRequest: ESLChangeShiftRequest; + createdAt?: Nullable; + updatedAt?: Nullable; } export class ESLOffsetNotification { - eslOffsetId: number; - eslOffset: ESLOffset; - id: number; - recipientId?: Nullable; - relatedEntityId?: Nullable; - type: string; - data: string; - readAt?: Nullable; - isRead: boolean; - recipient?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + eslOffsetId: number; + eslOffset: ESLOffset; + id: number; + recipientId?: Nullable; + relatedEntityId?: Nullable; + type: string; + data: string; + readAt?: Nullable; + isRead: boolean; + recipient?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class EmployeeSchedule { - id: number; - name?: Nullable; - users: User[]; - workingDayTimes: WorkingDayTime[]; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + name?: Nullable; + users: User[]; + workingDayTimes: WorkingDayTime[]; + createdAt?: Nullable; + updatedAt?: Nullable; } export class EmployeeScheduleDTO { - id?: Nullable; - scheduleName?: Nullable; - days: Day[]; - memberCount: number; - employeeScheduleId: number; - day?: Nullable; - from: TimeSpan; - to: TimeSpan; - breakFrom: TimeSpan; - breakTo: TimeSpan; - employeeSchedule: EmployeeSchedule; - createdAt?: Nullable; - updatedAt?: Nullable; + id?: Nullable; + scheduleName?: Nullable; + days: Day[]; + memberCount: number; + employeeScheduleId: number; + day?: Nullable; + from: TimeSpan; + to: TimeSpan; + breakFrom: TimeSpan; + breakTo: TimeSpan; + employeeSchedule: EmployeeSchedule; + createdAt?: Nullable; + updatedAt?: Nullable; } export class File { - mimeType: string; - link: string; - fileName: string; + mimeType: string; + link: string; + fileName: string; } export class HeatMapDTO { - leaveValue?: number; - day: number; - value: number; - leaveName?: Nullable; + leaveValue?: number; + day: number; + value: number; + leaveName?: Nullable; } export class Leave { - id: number; - userId: number; - leaveTypeId: number; - managerId?: Nullable; - otherProject?: Nullable; - reason?: Nullable; - leaveDate: DateTime; - days: number; - isWithPay: boolean; - isLeaderApproved?: Nullable; - isManagerApproved?: Nullable; - isDeleted: boolean; - leaveProjects: MultiProject[]; - leaveType: LeaveType; - manager: User; - user: User; - leaveNotifications: LeaveNotification[]; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + userId: number; + leaveTypeId: number; + managerId?: Nullable; + otherProject?: Nullable; + reason?: Nullable; + leaveDate: DateTime; + days: number; + isWithPay: boolean; + isLeaderApproved?: Nullable; + isManagerApproved?: Nullable; + isDeleted: boolean; + leaveProjects: MultiProject[]; + leaveType: LeaveType; + manager: User; + user: User; + leaveNotifications: LeaveNotification[]; + createdAt?: Nullable; + updatedAt?: Nullable; } export class LeaveBreakdownDTO { - sickLeave: number; - undertime: number; - vacationLeave: number; - emergencyLeave: number; - bereavementLeave: number; - maternityLeave: number; - withoutPayTotal: number; - withPayTotal: number; - pending: number; + sickLeave: number; + undertime: number; + vacationLeave: number; + emergencyLeave: number; + bereavementLeave: number; + maternityLeave: number; + withoutPayTotal: number; + withPayTotal: number; + pending: number; } export class LeaveDTO { - userId?: Nullable; - avatar?: Nullable; - userName?: Nullable; - userRole?: Nullable; - leaveType?: Nullable; - manager?: Nullable; - reason?: Nullable; - leaveDate?: Nullable; - isWithPay?: Nullable; - isLeaderApproved?: Nullable; - isManagerApproved?: Nullable; - days?: Nullable; - createdAt?: Nullable; - id: number; - leaveTypeId: number; - managerId?: Nullable; - otherProject?: Nullable; - isDeleted: boolean; - leaveProjects?: Nullable; - user: User; - leaveNotifications: LeaveNotification[]; - updatedAt?: Nullable; + userId?: Nullable; + avatar?: Nullable; + userName?: Nullable; + userRole?: Nullable; + leaveType?: Nullable; + manager?: Nullable; + reason?: Nullable; + leaveDate?: Nullable; + isWithPay?: Nullable; + isLeaderApproved?: Nullable; + isManagerApproved?: Nullable; + days?: Nullable; + createdAt?: Nullable; + id: number; + leaveTypeId: number; + managerId?: Nullable; + otherProject?: Nullable; + isDeleted: boolean; + leaveProjects?: Nullable; + user: User; + leaveNotifications: LeaveNotification[]; + updatedAt?: Nullable; } export class LeaveHeatMapDTO { - january: HeatMapDTO[]; - february: HeatMapDTO[]; - march: HeatMapDTO[]; - april: HeatMapDTO[]; - may: HeatMapDTO[]; - june: HeatMapDTO[]; - july: HeatMapDTO[]; - august: HeatMapDTO[]; - september: HeatMapDTO[]; - october: HeatMapDTO[]; - november: HeatMapDTO[]; - december: HeatMapDTO[]; + january: HeatMapDTO[]; + february: HeatMapDTO[]; + march: HeatMapDTO[]; + april: HeatMapDTO[]; + may: HeatMapDTO[]; + june: HeatMapDTO[]; + july: HeatMapDTO[]; + august: HeatMapDTO[]; + september: HeatMapDTO[]; + october: HeatMapDTO[]; + november: HeatMapDTO[]; + december: HeatMapDTO[]; } export class LeaveNotification { - leaveId: number; - leave: Leave; - id: number; - recipientId?: Nullable; - relatedEntityId?: Nullable; - type: string; - data: string; - readAt?: Nullable; - isRead: boolean; - recipient?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + leaveId: number; + leave: Leave; + id: number; + recipientId?: Nullable; + relatedEntityId?: Nullable; + type: string; + data: string; + readAt?: Nullable; + isRead: boolean; + recipient?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class LeaveType { - id: number; - name: string; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + name: string; + createdAt?: Nullable; + updatedAt?: Nullable; } export class LeavesDTO { - heatmap: LeaveHeatMapDTO; - table: LeavesTableDTO[]; - breakdown: LeaveBreakdownDTO; - user?: Nullable; - totalNumberOfFiledLeaves?: Nullable; + heatmap: LeaveHeatMapDTO; + table: LeavesTableDTO[]; + breakdown: LeaveBreakdownDTO; + user?: Nullable; + totalNumberOfFiledLeaves?: Nullable; } export class LeavesTableDTO { - date?: Nullable; - createdAt?: Nullable; - leaveTypeId: number; - isWithPay: boolean; - reason?: Nullable; - status?: Nullable; - numLeaves: number; - userName?: Nullable; - leaveName?: Nullable; - isLeaderApproved?: Nullable; - isManagerApproved?: Nullable; - leaveId: number; - userId: number; + date?: Nullable; + createdAt?: Nullable; + leaveTypeId: number; + isWithPay: boolean; + reason?: Nullable; + status?: Nullable; + numLeaves: number; + userName?: Nullable; + leaveName?: Nullable; + isLeaderApproved?: Nullable; + isManagerApproved?: Nullable; + leaveId: number; + userId: number; } export class Media { - id: number; - collectionName?: Nullable; - name?: Nullable; - fileName?: Nullable; - mimeType?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + collectionName?: Nullable; + name?: Nullable; + fileName?: Nullable; + mimeType?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class MultiProject { - id: number; - type: string; - projectId?: Nullable; - projectLeaderId?: Nullable; - leaveId?: Nullable; - overtimeId?: Nullable; - changeShiftRequestId?: Nullable; - project: Project; - projectLeader: User; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + type: string; + projectId?: Nullable; + projectLeaderId?: Nullable; + leaveId?: Nullable; + overtimeId?: Nullable; + changeShiftRequestId?: Nullable; + project: Project; + projectLeader: User; + createdAt?: Nullable; + updatedAt?: Nullable; } export abstract class IMutation { - abstract updateTimeIn(timeIn: TimeInRequestInput): string | Promise; + abstract updateTimeIn(timeIn: TimeInRequestInput): string | Promise; - abstract updateTimeOut( - timeOut: TimeOutRequestInput, - ): string | Promise; + abstract updateTimeOut(timeOut: TimeOutRequestInput): string | Promise; - abstract createSignIn(): string | Promise; + abstract createSignIn(): string | Promise; - abstract logout(logOut: LogoutRequestInput): string | Promise; + abstract logout(logOut: LogoutRequestInput): string | Promise; - abstract createWorkInterruption( - interruption: CreateInterruptionRequestInput, - ): WorkInterruptionDTO | Promise; + abstract createWorkInterruption(interruption: CreateInterruptionRequestInput): WorkInterruptionDTO | Promise; - abstract updateWorkInterruption( - interruption: UpdateInterruptionRequestInput, - ): boolean | Promise; + abstract updateWorkInterruption(interruption: UpdateInterruptionRequestInput): boolean | Promise; - abstract deleteWorkInterruption(id: number): boolean | Promise; + abstract deleteWorkInterruption(id: number): boolean | Promise; - abstract updateOneTimeEntry( - updatedTimeEntry: UpdateTimeEntryInput, - ): string | Promise; + abstract updateOneTimeEntry(updatedTimeEntry: UpdateTimeEntryInput): string | Promise; - abstract createLeave( - leave: CreateLeaveRequestInput, - ): Leave[] | Promise; + abstract createLeave(leave: CreateLeaveRequestInput): Leave[] | Promise; - abstract updateLeave( - leave: UpdateLeaveRequestInput, - ): Nullable | Promise>; + abstract updateLeave(leave: UpdateLeaveRequestInput): Nullable | Promise>; - abstract cancelLeave( - request: CancelLeaveRequestInput, - ): string | Promise; + abstract cancelLeave(request: CancelLeaveRequestInput): string | Promise; - abstract readNotification( - notification: NotificationRequestInput, - ): string | Promise; + abstract readNotification(notification: NotificationRequestInput): string | Promise; - abstract isReadAll(id: number): Notification[] | Promise; + abstract isReadAll(id: number): Notification[] | Promise; - abstract createOvertime( - overtime: CreateOvertimeRequestInput, - ): Overtime | Promise; + abstract createOvertime(overtime: CreateOvertimeRequestInput): Overtime | Promise; - abstract createSummarizedOvertime( - overtimeSummary: CreateSummaryRequestInput, - ): string | Promise; + abstract createSummarizedOvertime(overtimeSummary: CreateSummaryRequestInput): string | Promise; - abstract createBulkOvertime( - request: CreateBulkOvertimeRequestInput, - ): Overtime[] | Promise; + abstract createBulkOvertime(request: CreateBulkOvertimeRequestInput): Overtime[] | Promise; - abstract approveDisapproveOvertime( - approvingData: ApproveOvertimeRequestInput, - ): boolean | Promise; + abstract approveDisapproveOvertime(approvingData: ApproveOvertimeRequestInput): boolean | Promise; - abstract approveDisapproveAllOvertimeSummary( - approvingDatas: ApproveOvertimeSummaryRequestInput, - ): string | Promise; + abstract approveDisapproveAllOvertimeSummary(approvingDatas: ApproveOvertimeSummaryRequestInput): string | Promise; - abstract approveDisapproveLeave( - approvingData: ApproveLeaveUndertimeRequestInput, - ): boolean | Promise; + abstract approveDisapproveLeave(approvingData: ApproveLeaveUndertimeRequestInput): boolean | Promise; - abstract approveDisapproveUndertime( - approvingData: ApproveLeaveUndertimeRequestInput, - ): boolean | Promise; + abstract approveDisapproveUndertime(approvingData: ApproveLeaveUndertimeRequestInput): boolean | Promise; - abstract approveDisapproveChangeShift( - approvingData: ApproveChangeShiftRequestInput, - ): boolean | Promise; + abstract approveDisapproveChangeShift(approvingData: ApproveChangeShiftRequestInput): boolean | Promise; - abstract createChangeShift( - request: CreateChangeShiftRequestInput, - ): ChangeShiftRequest | Promise; + abstract createChangeShift(request: CreateChangeShiftRequestInput): ChangeShiftRequest | Promise; - abstract createESLChangeShift( - request: CreateESLChangeShiftRequestInput, - ): ESLChangeShiftRequest | Promise; + abstract createESLChangeShift(request: CreateESLChangeShiftRequestInput): ESLChangeShiftRequest | Promise; - abstract approveDisapproveESLChangeShiftStatus( - request: ApproveESLChangeShiftRequestInput, - ): ESLChangeShiftRequest | Promise; + abstract approveDisapproveESLChangeShiftStatus(request: ApproveESLChangeShiftRequestInput): ESLChangeShiftRequest | Promise; - abstract createESLOffset( - request: CreateESLOffsetRequestInput, - ): ESLOffset | Promise; + abstract createESLOffset(request: CreateESLOffsetRequestInput): ESLOffset | Promise; - abstract approveDisapproveChangeOffsetStatus( - request: ApproveESLChangeShiftRequestInput, - ): ESLOffset | Promise; + abstract approveDisapproveChangeOffsetStatus(request: ApproveESLChangeShiftRequestInput): ESLOffset | Promise; - abstract createEmployeeSchedule( - request: CreateEmployeeScheduleRequestInput, - ): string | Promise; + abstract createEmployeeSchedule(request: CreateEmployeeScheduleRequestInput): string | Promise; - abstract updateEmployeeSchedule( - request: UpdateEmployeeScheduleRequestInput, - ): string | Promise; + abstract updateEmployeeSchedule(request: UpdateEmployeeScheduleRequestInput): string | Promise; - abstract addMembersToSchedule( - request: AddMemberToScheduleRequestInput, - ): string | Promise; + abstract addMembersToSchedule(request: AddMemberToScheduleRequestInput): string | Promise; - abstract updateMemberSchedule( - request: UpdateMemberScheduleRequestInput, - ): string | Promise; + abstract updateMemberSchedule(request: UpdateMemberScheduleRequestInput): string | Promise; - abstract deleteEmployeeSchedule( - request: DeleteEmployeeScheduleRequestInput, - ): string | Promise; + abstract deleteEmployeeSchedule(request: DeleteEmployeeScheduleRequestInput): string | Promise; - abstract changeScheduleRequest( - request: ChangeSchedRequestInput, - ): ChangeScheduleRequest | Promise; + abstract changeScheduleRequest(request: ChangeSchedRequestInput): ChangeScheduleRequest | Promise; - abstract addNewEmployee( - request: AddNewEmployeeRequestInput, - ): boolean | Promise; + abstract addNewEmployee(request: AddNewEmployeeRequestInput): boolean | Promise; } export class MyOvertimeDTO { - id: number; - projects: MultiProject[]; - otherProject?: Nullable; - supervisor: string; - dateFiled?: Nullable; - remarks: string; - overtimeDate?: Nullable; - requestedMinutes?: Nullable; - approvedMinutes?: Nullable; - isLeaderApproved?: Nullable; - isManagerApproved?: Nullable; - userId: number; - managerId?: Nullable; - timeEntryId: number; - managerRemarks?: Nullable; - multiProjects: MultiProject[]; - manager: User; - user: User; - timeEntry: TimeEntry; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + projects: MultiProject[]; + otherProject?: Nullable; + supervisor: string; + dateFiled?: Nullable; + remarks: string; + overtimeDate?: Nullable; + requestedMinutes?: Nullable; + approvedMinutes?: Nullable; + isLeaderApproved?: Nullable; + isManagerApproved?: Nullable; + userId: number; + managerId?: Nullable; + timeEntryId: number; + managerRemarks?: Nullable; + multiProjects: MultiProject[]; + manager: User; + user: User; + timeEntry: TimeEntry; + createdAt?: Nullable; + updatedAt?: Nullable; } export class Notification { - id: number; - recipientId?: Nullable; - relatedEntityId?: Nullable; - type: string; - data: string; - readAt?: Nullable; - isRead: boolean; - recipient?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + recipientId?: Nullable; + relatedEntityId?: Nullable; + type: string; + data: string; + readAt?: Nullable; + isRead: boolean; + recipient?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class Over { - id: number; - link: string; - name: string; - roleId: number; - roleName: string; + id: number; + link: string; + name: string; + roleId: number; + roleName: string; } export class Overtime { - id: number; - userId: number; - managerId?: Nullable; - timeEntryId: number; - otherProject?: Nullable; - remarks?: Nullable; - overtimeDate: DateTime; - requestedMinutes: number; - approvedMinutes?: Nullable; - isLeaderApproved?: Nullable; - isManagerApproved?: Nullable; - managerRemarks?: Nullable; - multiProjects: MultiProject[]; - manager: User; - user: User; - timeEntry: TimeEntry; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + userId: number; + managerId?: Nullable; + timeEntryId: number; + otherProject?: Nullable; + remarks?: Nullable; + overtimeDate: DateTime; + requestedMinutes: number; + approvedMinutes?: Nullable; + isLeaderApproved?: Nullable; + isManagerApproved?: Nullable; + managerRemarks?: Nullable; + multiProjects: MultiProject[]; + manager: User; + user: User; + timeEntry: TimeEntry; + createdAt?: Nullable; + updatedAt?: Nullable; } export class OvertimeDTO { - user?: Nullable; - id: number; - projects?: Nullable; - otherProject?: Nullable; - supervisor?: Nullable; - dateFiled?: Nullable; - remarks?: Nullable; - overtimeDate?: Nullable; - approvedMinutes?: Nullable; - isLeaderApproved?: Nullable; - isManagerApproved?: Nullable; - managerRemarks?: Nullable; - userId: number; - managerId?: Nullable; - timeEntryId: number; - requestedMinutes: number; - multiProjects?: Nullable; - manager: User; - timeEntry: TimeEntry; - createdAt?: Nullable; - updatedAt?: Nullable; + user?: Nullable; + id: number; + projects?: Nullable; + otherProject?: Nullable; + supervisor?: Nullable; + dateFiled?: Nullable; + remarks?: Nullable; + overtimeDate?: Nullable; + approvedMinutes?: Nullable; + isLeaderApproved?: Nullable; + isManagerApproved?: Nullable; + managerRemarks?: Nullable; + userId: number; + managerId?: Nullable; + timeEntryId: number; + requestedMinutes: number; + multiProjects?: Nullable; + manager: User; + timeEntry: TimeEntry; + createdAt?: Nullable; + updatedAt?: Nullable; } export class OvertimeNotification { - overtimeId: number; - overtime: Overtime; - id: number; - recipientId?: Nullable; - relatedEntityId?: Nullable; - type: string; - data: string; - readAt?: Nullable; - isRead: boolean; - recipient?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + overtimeId: number; + overtime: Overtime; + id: number; + recipientId?: Nullable; + relatedEntityId?: Nullable; + type: string; + data: string; + readAt?: Nullable; + isRead: boolean; + recipient?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class Position { - id: number; - name: string; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + name: string; + createdAt?: Nullable; + updatedAt?: Nullable; } export class Project { - id: number; - projectLeaderId?: Nullable; - projectSubLeaderId?: Nullable; - name: string; - projectLeader?: Nullable; - projectSubLeader?: Nullable; - leaves: Leave[]; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + projectLeaderId?: Nullable; + projectSubLeaderId?: Nullable; + name: string; + projectLeader?: Nullable; + projectSubLeader?: Nullable; + leaves: Leave[]; + createdAt?: Nullable; + updatedAt?: Nullable; } export abstract class IQuery { - abstract getHello(): string | Promise; + abstract getHello(): string | Promise; - abstract userById(id: number): Nullable | Promise>; + abstract userById(id: number): Nullable | Promise>; - abstract userByEmail( - email: string, - ): Nullable | Promise>; + abstract userByEmail(email: string): Nullable | Promise>; - abstract allUsers(): User[] | Promise; + abstract allUsers(): User[] | Promise; - abstract allESLUsers( - exceptUserId?: Nullable, - ): User[] | Promise; + abstract allESLUsers(exceptUserId?: Nullable): User[] | Promise; - abstract timeById( - id: number, - ): Nullable | Promise>; + abstract timeById(id: number): Nullable | Promise>; - abstract specificTimeEntryById( - id: number, - ): Nullable | Promise>; + abstract specificTimeEntryById(id: number): Nullable | Promise>; - abstract specificUserProfileDetail( - id: number, - ): Nullable | Promise>; + abstract specificUserProfileDetail(id: number): Nullable | Promise>; - abstract timeEntriesByEmployeeId( - id: number, - ): Nullable | Promise>; + abstract timeEntriesByEmployeeId(id: number): Nullable | Promise>; - abstract timeEntries( - date?: Nullable, - status?: Nullable, - ): TimeEntryDTO[] | Promise; + abstract timeEntries(date?: Nullable, status?: Nullable): TimeEntryDTO[] | Promise; - abstract timesheetSummary( - startDate?: Nullable, - endDate?: Nullable, - ): TimeEntriesSummaryDTO[] | Promise; + abstract timesheetSummary(startDate?: Nullable, endDate?: Nullable): TimeEntriesSummaryDTO[] | Promise; - abstract allWorkInterruptionTypes(): - | WorkInterruptionType[] - | Promise; + abstract allWorkInterruptionTypes(): WorkInterruptionType[] | Promise; - abstract interruptionsByTimeEntryId( - interruption: ShowInterruptionRequestInput, - ): WorkInterruptionDTO[] | Promise; + abstract interruptionsByTimeEntryId(interruption: ShowInterruptionRequestInput): WorkInterruptionDTO[] | Promise; - abstract allLeaves(): LeaveDTO[] | Promise; + abstract allLeaves(): LeaveDTO[] | Promise; - abstract leaveTypes(): LeaveType[] | Promise; + abstract leaveTypes(): LeaveType[] | Promise; - abstract leaves( - userId: number, - year: number, - leaveTypeId: number, - ): LeavesDTO | Promise; + abstract leaves(userId: number, year: number, leaveTypeId: number): LeavesDTO | Promise; - abstract leavesByDate( - userId: number, - date: string, - ): LeavesDTO | Promise; + abstract leavesByDate(userId: number, date: string): LeavesDTO | Promise; - abstract yearlyAllLeaves( - year: number, - leaveTypeId: number, - ): LeavesDTO | Promise; + abstract yearlyAllLeaves(year: number, leaveTypeId: number): LeavesDTO | Promise; - abstract yearlyAllLeavesByDate(date: string): LeavesDTO | Promise; + abstract yearlyAllLeavesByDate(date: string): LeavesDTO | Promise; - abstract paidLeaves(id: number): number | Promise; + abstract paidLeaves(id: number): number | Promise; - abstract userLeave(leaveId: number): LeaveDTO[] | Promise; + abstract userLeave(leaveId: number): LeaveDTO[] | Promise; - abstract projects(): Project[] | Promise; + abstract projects(): Project[] | Promise; - abstract allLeaders(projectId?: Nullable): User[] | Promise; + abstract allLeaders(projectId?: Nullable): User[] | Promise; - abstract notificationByRecipientId( - id: number, - ): Notification[] | Promise; + abstract notificationByRecipientId(id: number): Notification[] | Promise; - abstract overtime(userId: number): MyOvertimeDTO[] | Promise; + abstract overtime(userId: number): MyOvertimeDTO[] | Promise; - abstract allOvertime(): OvertimeDTO[] | Promise; + abstract allOvertime(): OvertimeDTO[] | Promise; - abstract changeShiftByTimeEntry( - timeEntryId: number, - ): ChangeShiftRequest | Promise; + abstract changeShiftByTimeEntry(timeEntryId: number): ChangeShiftRequest | Promise; - abstract eslOffsetsByTimeEntry( - timeEntryId: number, - onlyUnused: boolean, - ): ESLOffsetDTO[] | Promise; + abstract eslOffsetsByTimeEntry(timeEntryId: number, onlyUnused: boolean): ESLOffsetDTO[] | Promise; - abstract allESLOffsets( - isUsed?: Nullable, - ): ESLOffsetDTO[] | Promise; + abstract allESLOffsets(isUsed?: Nullable): ESLOffsetDTO[] | Promise; - abstract eslChangeShiftByTimeEntry( - timeEntryId: number, - ): ESLChangeShiftRequest | Promise; + abstract eslChangeShiftByTimeEntry(timeEntryId: number): ESLChangeShiftRequest | Promise; - abstract allEmployeeScheduleDetails(): - | EmployeeScheduleDTO[] - | Promise; + abstract allEmployeeScheduleDetails(): EmployeeScheduleDTO[] | Promise; - abstract employeeScheduleDetails( - employeeScheduleId: number, - ): EmployeeScheduleDTO[] | Promise; + abstract employeeScheduleDetails(employeeScheduleId: number): EmployeeScheduleDTO[] | Promise; - abstract employeesBySchedule( - employeeScheduleId: number, - ): UserDTO[] | Promise; + abstract employeesBySchedule(employeeScheduleId: number): UserDTO[] | Promise; - abstract employeeChangeScheduleRequest( - userId: number, - ): - | Nullable - | Promise>; + abstract employeeChangeScheduleRequest(userId: number): Nullable | Promise>; - abstract searchEmployeesBySchedule( - request: SearchEmployeesByScheduleRequestInput, - ): UserDTO[] | Promise; + abstract searchEmployeesBySchedule(request: SearchEmployeesByScheduleRequestInput): UserDTO[] | Promise; } export class Role { - id: number; - name?: Nullable; - users: User[]; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + name?: Nullable; + users: User[]; + createdAt?: Nullable; + updatedAt?: Nullable; } export class SpecificTimeDTO { - media?: Nullable; - id: number; - timeHour?: Nullable; - remarks?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + media?: Nullable; + id: number; + timeHour?: Nullable; + remarks?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class SubscriptionObjectType { - subscribeAllLeave: Leave; - overtimeSummaryCreated?: Notification; - leaveCreated?: LeaveNotification; - overtimeCreated?: OvertimeNotification; - changeShiftCreated?: ChangeShiftNotification; - eslChangeShiftCreated?: ESLChangeShiftNotification; - eslOffsetCreated?: ESLOffsetNotification; - notificationCreated?: Notification; + subscribeAllLeave: Leave; + overtimeSummaryCreated?: Notification; + leaveCreated?: LeaveNotification; + overtimeCreated?: OvertimeNotification; + changeShiftCreated?: ChangeShiftNotification; + eslChangeShiftCreated?: ESLChangeShiftNotification; + eslOffsetCreated?: ESLOffsetNotification; + notificationCreated?: Notification; } export class Time { - id: number; - timeHour: TimeSpan; - remarks?: Nullable; - media?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + id: number; + timeHour: TimeSpan; + remarks?: Nullable; + media?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class TimeDTO { - timeHour?: Nullable; - id: number; - remarks?: Nullable; - media?: Nullable; - createdAt?: Nullable; - updatedAt?: Nullable; + timeHour?: Nullable; + id: number; + remarks?: Nullable; + media?: Nullable; + createdAt?: Nullable; + updatedAt?: Nullable; } export class TimeEntriesSummaryDTO { - user: UserDTO; - leave: number; - absences: number; - late?: Nullable; - undertime?: Nullable; - overtime?: Nullable; + user: UserDTO; + leave: number; + absences: number; + late?: Nullable; + undertime?: Nullable; + overtime?: Nullable; } export class TimeEntry { - id: number; - userId: number; - timeInId?: Nullable; - timeOutId?: Nullable; - startTime: TimeSpan; - endTime: TimeSpan; - breakStartTime: TimeSpan; - breakEndTime: TimeSpan; - date: DateTime; - workedHours?: Nullable; - trackedHours: TimeSpan; - user: User; - timeIn?: Nullable