src/main/java/seedu/insurancepal/logic/commands/EditCommand.java
/**
     * Creates and returns a {@code Person} with the details of {@code personToEdit}
     * edited with {@code editPersonDescriptor}.
     */
Creates and returns a  Person with the details of  personToEdit
edited with  editPersonDescriptor.
Creates and returns a Person with the details of personToEdit edited with editPersonDescriptor .
private static Person createEditedPerson(Person personToEdit, EditPersonDescriptor editPersonDescriptor) {
        assert personToEdit != null;
        Name updatedName = editPersonDescriptor.getName().orElse(personToEdit.getName());
        Phone updatedPhone = editPersonDescriptor.getPhone().orElse(personToEdit.getPhone());
        Email updatedEmail = editPersonDescriptor.getEmail().orElse(personToEdit.getEmail());
        Revenue updatedRevenue = editPersonDescriptor.getRevenue().orElse(personToEdit.getRevenue());
        Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress());
        Set<Tag> updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags());
        Set<Insurance> updatedInsurances = editPersonDescriptor.getInsurances()
                .orElse(personToEdit.getInsurances());
        Set<Claim> originalClaims = personToEdit.getClaims();
        Note updatedNote = editPersonDescriptor.getNote().orElse(personToEdit.getNote());
        Appointment originalAppointment = personToEdit.getAppointment();
        return new Person(updatedName, updatedPhone, updatedEmail, updatedRevenue, updatedAddress,
                updatedTags, updatedInsurances, updatedNote, originalAppointment, originalClaims);
    }
private static Person createEditedPerson ( Person personToEdit , EditPersonDescriptor editPersonDescriptor ) { assert personToEdit != null ; Name updatedName = editPersonDescriptor . getName ( ) . orElse ( personToEdit . getName ( ) ) ; Phone updatedPhone = editPersonDescriptor . getPhone ( ) . orElse ( personToEdit . getPhone ( ) ) ; Email updatedEmail = editPersonDescriptor . getEmail ( ) . orElse ( personToEdit . getEmail ( ) ) ; Revenue updatedRevenue = editPersonDescriptor . getRevenue ( ) . orElse ( personToEdit . getRevenue ( ) ) ; Address updatedAddress = editPersonDescriptor . getAddress ( ) . orElse ( personToEdit . getAddress ( ) ) ; Set < Tag > updatedTags = editPersonDescriptor . getTags ( ) . orElse ( personToEdit . getTags ( ) ) ; Set < Insurance > updatedInsurances = editPersonDescriptor . getInsurances ( ) . orElse ( personToEdit . getInsurances ( ) ) ; Set < Claim > originalClaims = personToEdit . getClaims ( ) ; Note updatedNote = editPersonDescriptor . getNote ( ) . orElse ( personToEdit . getNote ( ) ) ; Appointment originalAppointment = personToEdit . getAppointment ( ) ; return new Person ( updatedName , updatedPhone , updatedEmail , updatedRevenue , updatedAddress , updatedTags , updatedInsurances , updatedNote , originalAppointment , originalClaims ) ; }
Creates and returns a {@code Person} with the details of {@code personToEdit}
 edited with {@code editPersonDescriptor}.
Creates and returns a { @code Person } with the details of { @code personToEdit } edited with { @code editPersonDescriptor } .