[R4] Deactivate doctors method in service class
This commit is contained in:
parent
bbde76cedc
commit
83ca208352
@ -127,4 +127,23 @@ public class DoctorServiceImpl implements DoctorService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deactivates an existing doctor record by provided id
|
||||||
|
* @param id Long that represents the doctor's unique identifier
|
||||||
|
*
|
||||||
|
* @return The deactivated doctor if successful, or null if there is an error.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Doctor deactivateDoctor(Long id) {
|
||||||
|
Doctor doctor = findDoctorById.execute(id);
|
||||||
|
|
||||||
|
if (doctor != null) {
|
||||||
|
doctor.setActive(false);
|
||||||
|
|
||||||
|
return saveDoctor.execute(doctor);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,4 +43,12 @@ public interface DoctorService {
|
|||||||
* @return The updated doctor if successful, or null if there is an error.
|
* @return The updated doctor if successful, or null if there is an error.
|
||||||
*/
|
*/
|
||||||
public Doctor updateDoctor(DoctorUpdatedDataDTO doctorUpdatedDataDTO);
|
public Doctor updateDoctor(DoctorUpdatedDataDTO doctorUpdatedDataDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deactivates an existing doctor record by provided id
|
||||||
|
* @param id Long that represents the doctor's unique identifier
|
||||||
|
*
|
||||||
|
* @return The deactivated doctor if successful, or null if there is an error.
|
||||||
|
*/
|
||||||
|
public Doctor deactivateDoctor(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user