from rest_framework import viewsets
from .models import Employee, WorkTimeLog, Leave, OvertimeReport, Report
from .serializers import (
    EmployeeSerializer, WorkTimeLogSerializer, LeaveSerializer,
    OvertimeReportSerializer, ReportSerializer
)

# ViewSet для модели Employee
class EmployeeViewSet(viewsets.ModelViewSet):
    queryset = Employee.objects.all()
    serializer_class = EmployeeSerializer

# ViewSet для модели WorkTimeLog
class WorkTimeLogViewSet(viewsets.ModelViewSet):
    queryset = WorkTimeLog.objects.all()
    serializer_class = WorkTimeLogSerializer

# ViewSet для модели Leave
class LeaveViewSet(viewsets.ModelViewSet):
    queryset = Leave.objects.all()
    serializer_class = LeaveSerializer

# ViewSet для модели OvertimeReport
class OvertimeReportViewSet(viewsets.ModelViewSet):
    queryset = OvertimeReport.objects.all()
    serializer_class = OvertimeReportSerializer

# ViewSet для модели Report
class ReportViewSet(viewsets.ModelViewSet):
    queryset = Report.objects.all()
    serializer_class = ReportSerializer
