erp-platform/ui/src/proxy/intranet/models.ts
Sedat Öztürk 988a8d0bfb mockIntranet kaldırıldı
Intranet Dashboard düzeltildi.
2025-10-29 22:24:40 +03:00

420 lines
8.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Address, BankAccount } from '@/types/common'
import {
EmployeeStatusEnum,
EmploymentTypeEnum,
GenderEnum,
HrCostCenter,
HrDisciplinaryAction,
HrEmergencyContact,
HrPerformanceEvaluation,
HrTraining,
HrWorkSchedule,
JobLevelEnum,
LeaveStatusEnum,
LeaveTypeEnum,
MaritalStatusEnum,
} from '@/types/hr'
export interface IntranetDashboardDto {
events: EventDto[]
birthdays: EmployeeDto[]
visitors: VisitorDto[]
reservations: ReservationDto[]
trainings: TrainingDto[]
expenses: ExpensesDto
documents: DocumentDto[]
announcements: AnnouncementDto[]
shuttleRoutes: ShuttleRouteDto[]
meals: MealDto[]
leaves: LeaveDto[]
overtimes: OvertimeDto[]
surveys: SurveyDto[]
socialPosts: SocialPostDto[]
// priorityTasks: TaskDto[]
}
// Etkinlik
export interface EventDto {
id: string
categoryName: string
typeName: string
date: Date
name: string
description: string
place: string
organizer: EmployeeDto
participants: number
photos: string[]
comments: EventCommentDto[]
likes: number
isPublished: boolean
}
// Etkinlik Yorumu
export interface EventCommentDto {
id: string
author: EmployeeDto
content: string
creationTime: Date
likes: number
}
export interface EmployeeDto {
// İnsan Kaynakları Çalışanı
id: string
code: string
firstName: string
lastName: string
fullName: string
email: string
phone?: string
personalPhone?: string
avatar?: string // Avatar URL
nationalId: string
birthDate: Date
gender: GenderEnum
maritalStatus: MaritalStatusEnum
address: Address
emergencyContact: HrEmergencyContact
hireDate: Date
terminationDate?: Date
employmentType: EmploymentTypeEnum
jobPositionId: string
jobPosition?: JobPositionDto
departmentId: string
department?: DepartmentDto
managerId?: string
manager?: EmployeeDto
baseSalary: number
currency: string
payrollGroup: string
bankAccountId: string
bankAccount?: BankAccount
workLocation: string
workSchedule?: HrWorkSchedule
badgeNumber?: string
employeeStatus: EmployeeStatusEnum
isActive: boolean
leaves: LeaveDto[]
evaluations: HrPerformanceEvaluation[]
trainings: HrTraining[]
disciplinaryActions: HrDisciplinaryAction[]
creationTime: Date
lastModificationTime: Date
}
export interface DepartmentDto {
// İnsan Kaynakları Departmanı
id: string
code: string
name: string
description?: string
parentDepartmentId?: string
parentDepartment?: DepartmentDto
subDepartments: DepartmentDto[]
managerId?: string
manager?: EmployeeDto
costCenterId?: string
costCenter?: HrCostCenter
budget: number
isActive: boolean
creationTime: Date
lastModificationTime: Date
}
export interface JobPositionDto {
// İnsan Kaynakları İş Pozisyonu
id: string
code: string
name: string
description?: string
departmentId: string
department?: DepartmentDto
level: JobLevelEnum
minSalary: number
maxSalary: number
currency: string
requiredSkills: string[]
responsibilities: string[]
qualifications: string[]
isActive: boolean
employees: EmployeeDto[]
creationTime: Date
lastModificationTime: Date
}
// Ziyaretçi
export interface VisitorDto {
id: string
fullName: string
companyName: string
email: string
phone: string
purpose: string
visitDate: Date
checkIn?: Date
checkOut?: Date
employeeId: string
employee: EmployeeDto
status: 'scheduled' | 'checked-in' | 'checked-out' | 'cancelled'
badgeNumber?: string
photo?: string
}
// Rezervasyon
export interface ReservationDto {
id: string
type: 'room' | 'vehicle' | 'equipment'
resourceName: string
bookedBy: EmployeeDto
startDate: Date
endDate: Date
purpose: string
status: 'pending' | 'approved' | 'rejected' | 'completed'
participants?: number
notes?: string
}
// Eğitim
export interface TrainingDto {
id: string
title: string
description: string
instructor: string
category: 'technical' | 'soft-skills' | 'management' | 'compliance' | 'other'
type: 'online' | 'classroom' | 'hybrid'
duration: number // saat
startDate: Date
endDate: Date
maxParticipants: number
enrolled: number
status: 'upcoming' | 'ongoing' | 'completed'
location?: string
thumbnail?: string
}
// Harcama
export interface ExpensesDto {
totalRequested: number
totalApproved: number
last5Expenses: ExpenseDto[]
}
// Harcama
export interface ExpenseDto {
id: string
employee: EmployeeDto
category: 'travel' | 'meal' | 'accommodation' | 'transport' | 'other'
amount: number
currency: string
date: Date
description: string
project?: string
receipts: { name: string; url: string; size: string }[]
status: 'pending' | 'approved' | 'rejected'
approver?: EmployeeDto
approvalDate?: Date
notes?: string
creationTime: Date
}
// Doküman (FileItemDto ile uyumlu)
export interface DocumentDto {
id: string
name: string
type: string // "file" or "folder"
size: number
extension: string
mimeType: string
createdAt: Date
modifiedAt: Date
path: string
parentId: string
isReadOnly: boolean
childCount: number
}
// Sertifika
export interface CertificateDto {
id: string
employee: EmployeeDto
trainingTitle: string
issueDate: Date
expiryDate?: Date
certificateUrl: string
score?: number
}
// Duyuru
export interface AnnouncementDto {
id: string
title: string
excerpt: string
content: string
imageUrl?: string
category: string
employeeId: string
employee: EmployeeDto
publishDate: Date
expiryDate?: Date
isPinned: boolean
viewCount: number
departments?: string[]
attachments?: { name: string; url: string; size: string }[]
}
// Servis
export interface ShuttleRouteDto {
id: string
name: string
route: string[]
departureTime: string
arrivalTime: string
capacity: number
available: number
type: string
}
// Yemek Menüsü
export interface MealDto {
id: string
branchId: string
date: Date
type: 'breakfast' | 'lunch' | 'dinner'
totalCalorie?: number
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
}
// Anket Cevap
export interface SurveyAnswerDto {
questionId: string
questionType: 'rating' | 'multiple-choice' | 'text' | 'textarea' | 'yes-no'
value: string | number | string[]
}
// Sosyal Duvar - Comment Interface
export interface SocialCommentDto {
id: string
creator: EmployeeDto
content: string
creationTime: Date
}
export interface SocialPollOptionDto {
id: string
text: string
votes: number
}
// Sosyal Duvar - Social Media Interface
export interface SocialMediaDto {
id?: string
type: 'image' | 'video' | 'poll'
// Ortak alanlar
urls?: string[]
// Anket (poll) ile ilgili alanlar doğrudan burada
pollQuestion?: string
pollOptions?: SocialPollOptionDto[]
pollTotalVotes?: number
pollEndsAt?: Date
pollUserVoteId?: string
}
// Sosyal Duvar - Ana Interface
export interface SocialPostDto {
id: string
employee: EmployeeDto
content: string
locationJson?: string
media?: SocialMediaDto
likeCount: number
isLiked: boolean
likeUsers: EmployeeDto[]
comments: SocialCommentDto[]
isOwnPost: boolean
creationTime: Date
}
// Anket Cevabı
export interface SurveyResponseDto {
id: string
surveyId: string
respondentId?: string // Anonymous ise null
submissionTime: Date
answers: SurveyAnswerDto[]
}
// Anket Sorusu Seçeneği
export interface SurveyQuestionOptionDto {
id: string
text: string
order: number
}
// Anket Sorusu
export interface SurveyQuestionDto {
id: string
surveyId: string
questionText: string
type: 'rating' | 'multiple-choice' | 'text' | 'textarea' | 'yes-no'
order: number
isRequired: boolean
options?: SurveyQuestionOptionDto[]
}
// Anket
export interface SurveyDto {
id: string
title: string
description: string
creatorId: EmployeeDto
creationTime: Date
deadline: Date
questions: SurveyQuestionDto[]
responses: number
targetAudience: string[]
status: 'draft' | 'active' | 'closed'
isAnonymous: boolean
}