21 lines
896 B
Java

package com.mirna.hospitalmanagementapi.application.services;
import com.mirna.hospitalmanagementapi.domain.dtos.inventory.SupplierDTO;
import com.mirna.hospitalmanagementapi.domain.entities.inventory.InventorySupplier;
import com.mirna.hospitalmanagementapi.domain.repositories.inventory.InventorySupplierRepository;
import com.mirna.hospitalmanagementapi.domain.services.inventory.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SupplierServiceImpl implements SupplierService {
@Autowired
private InventorySupplierRepository inventorySupplierRepository;
@Override
public InventorySupplier addSupplier(SupplierDTO supplierDTO) {
InventorySupplier newSupplier = new InventorySupplier(supplierDTO);
return inventorySupplierRepository.save(newSupplier);
}
}