src/main/java/seedu/address/logic/commands/commandEdit/EditStaffCommand.java
private static Staff createEditedTeacher(Staff teacherToEdit,
                                             EditTeacherDescriptor editTeacherDescriptor) {
        assert teacherToEdit != null;

        Name updatedName = editTeacherDescriptor.getName().orElse(teacherToEdit.getName());
        Gender updatedGender = editTeacherDescriptor.getGender().orElse(teacherToEdit.getGender());
        Phone updatedPhone = editTeacherDescriptor.getPhone().orElse(teacherToEdit.getPhone());
        Email updatedEmail = editTeacherDescriptor.getEmail().orElse(teacherToEdit.getEmail());
        Salary updatedSalary = editTeacherDescriptor.getSalary().orElse(teacherToEdit.getSalary());
        Address updatedAddress = editTeacherDescriptor.getAddress().orElse(teacherToEdit.getAddress());
        Set<Tag> updatedTags = editTeacherDescriptor.getTags().orElse(teacherToEdit.getTags());

        // fields that cannot edit
        ID id = teacherToEdit.getId();
        Level updatedLevel = teacherToEdit.getLevel();
        Set<ID> assignedCoursesID = teacherToEdit.getAssignedCoursesID();
        return new Staff(updatedName, id, updatedGender, updatedLevel, updatedPhone, updatedEmail, updatedSalary, updatedAddress,
                assignedCoursesID, updatedTags);
    }
/**
     * Creates and returns a {@code Teacher} with the details of {@code teacherToEdit} edited with
     * {@code editTeacherDescriptor}.
     */
Creates and returns a  Teacher with the details of  teacherToEdit edited with
editTeacherDescriptor.
Creates and returns a Teacher with the details of teacherToEdit edited with editTeacherDescriptor .
private static Staff createEditedTeacher(Staff teacherToEdit,
                                             EditTeacherDescriptor editTeacherDescriptor) {
        assert teacherToEdit != null;
        Name updatedName = editTeacherDescriptor.getName().orElse(teacherToEdit.getName());
        Gender updatedGender = editTeacherDescriptor.getGender().orElse(teacherToEdit.getGender());
        Phone updatedPhone = editTeacherDescriptor.getPhone().orElse(teacherToEdit.getPhone());
        Email updatedEmail = editTeacherDescriptor.getEmail().orElse(teacherToEdit.getEmail());
        Salary updatedSalary = editTeacherDescriptor.getSalary().orElse(teacherToEdit.getSalary());
        Address updatedAddress = editTeacherDescriptor.getAddress().orElse(teacherToEdit.getAddress());
        Set<Tag> updatedTags = editTeacherDescriptor.getTags().orElse(teacherToEdit.getTags());
        ID id = teacherToEdit.getId();
        Level updatedLevel = teacherToEdit.getLevel();
        Set<ID> assignedCoursesID = teacherToEdit.getAssignedCoursesID();
        return new Staff(updatedName, id, updatedGender, updatedLevel, updatedPhone, updatedEmail, updatedSalary, updatedAddress,
                assignedCoursesID, updatedTags);
    }
private static Staff createEditedTeacher ( Staff teacherToEdit , EditTeacherDescriptor editTeacherDescriptor ) { assert teacherToEdit != null ; Name updatedName = editTeacherDescriptor . getName ( ) . orElse ( teacherToEdit . getName ( ) ) ; Gender updatedGender = editTeacherDescriptor . getGender ( ) . orElse ( teacherToEdit . getGender ( ) ) ; Phone updatedPhone = editTeacherDescriptor . getPhone ( ) . orElse ( teacherToEdit . getPhone ( ) ) ; Email updatedEmail = editTeacherDescriptor . getEmail ( ) . orElse ( teacherToEdit . getEmail ( ) ) ; Salary updatedSalary = editTeacherDescriptor . getSalary ( ) . orElse ( teacherToEdit . getSalary ( ) ) ; Address updatedAddress = editTeacherDescriptor . getAddress ( ) . orElse ( teacherToEdit . getAddress ( ) ) ; Set < Tag > updatedTags = editTeacherDescriptor . getTags ( ) . orElse ( teacherToEdit . getTags ( ) ) ; ID id = teacherToEdit . getId ( ) ; Level updatedLevel = teacherToEdit . getLevel ( ) ; Set < ID > assignedCoursesID = teacherToEdit . getAssignedCoursesID ( ) ; return new Staff ( updatedName , id , updatedGender , updatedLevel , updatedPhone , updatedEmail , updatedSalary , updatedAddress , assignedCoursesID , updatedTags ) ; }
Creates and returns a {@code Teacher} with the details of {@code teacherToEdit} edited with
 {@code editTeacherDescriptor}.
Creates and returns a { @code Teacher } with the details of { @code teacherToEdit } edited with { @code editTeacherDescriptor } .
// fields that cannot edit