Client controller, and WIP with edits and deletion of notice

This commit is contained in:
2025-04-11 15:53:50 +02:00
parent b826a01a10
commit 4fa138203d
9 changed files with 109 additions and 26 deletions

View File

@@ -46,8 +46,20 @@ public class ClientService {
return clients.stream().map(this::toDto).toList();
}
public boolean getByID(Long id) {
public Client getClientById(Long id) {
return clientRepository.findById(id).orElse(null);
}
public boolean clientExists(Long id) {
return clientRepository.existsById(id);
}
public ClientDTO updateClient(ClientDTO clientDTO) {
Client client = fromDto(clientDTO);
return toDto(clientRepository.save(client));
}
public void deleteClient(Long id) {
clientRepository.deleteById(id);
}
}