from rest_framework import serializers from .models import Product, Employee, Contractor, ContractorContact class ProductSerializer(serializers.ModelSerializer): class Meta: model = Product fields = [ 'id', 'name', 'manufacturer', 'manufacturer_country', 'manufacturer_code', 'dimensions', 'unit', 'shelf_life', 'barcode', 'additional_info' ] class EmployeeSerializer(serializers.ModelSerializer): class Meta: model = Employee fields = [ 'id', 'full_name', 'passport_series', 'passport_number', 'birth_date', 'position', 'department', 'login', 'password', 'role', 'work_phone', 'personal_phone', 'email' ] class ContractorSerializer(serializers.ModelSerializer): class Meta: model = Contractor fields = ['id', 'name', 'contract_number', 'address'] class ContractorContactSerializer(serializers.ModelSerializer): class Meta: model = ContractorContact fields = ['id', 'contractor', 'full_name', 'phone', 'email']