from rest_framework import viewsets
from .models import Product, Employee, Position, StorageLocation, Contractor, SupplyContract, Truck
from .serializers import (
    ProductSerializer, EmployeeSerializer, PositionSerializer,
    StorageLocationSerializer, ContractorSerializer, SupplyContractSerializer, TruckSerializer
)

class ProductViewSet(viewsets.ModelViewSet):
    queryset = Product.objects.all()
    serializer_class = ProductSerializer


class EmployeeViewSet(viewsets.ModelViewSet):
    queryset = Employee.objects.all()
    serializer_class = EmployeeSerializer


class PositionViewSet(viewsets.ModelViewSet):
    queryset = Position.objects.all()
    serializer_class = PositionSerializer


class StorageLocationViewSet(viewsets.ModelViewSet):
    queryset = StorageLocation.objects.all()
    serializer_class = StorageLocationSerializer


class ContractorViewSet(viewsets.ModelViewSet):
    queryset = Contractor.objects.all()
    serializer_class = ContractorSerializer


class SupplyContractViewSet(viewsets.ModelViewSet):
    queryset = SupplyContract.objects.all()
    serializer_class = SupplyContractSerializer


class TruckViewSet(viewsets.ModelViewSet):
    queryset = Truck.objects.all()
    serializer_class = TruckSerializer