Giter Club home page Giter Club logo

grand-strand-systems's Introduction

image


My name is Randy Rowland and I started my journey out by getting a degree in programming. After a few years I decided I needed a change of pace and moved into the cyber security realm.

I still code occasionally, but it is very limited and mostly small scripts or utilizing MkDocs to write playbooks.

If you'd like to know more about me, please checkout randyrowland.me or something below!

badge


โœ Blog & Writing

I don't write much but when I do, it's on my website.


๐Ÿ”ง Technologies, Tools, & Languages


GitKraken Shield




๐Ÿ“ˆ GitHub Stats

rowland007's GitHub Stats

Additional Projects


grand-strand-systems's People

Contributors

restyled-io[bot] avatar rowland007 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

grand-strand-systems's Issues

Update Task Name

Requirement

The task service shall be able to update task fields per taskId. The following fields are updatable: name

Class

TaskService

Method

public void updateName(Task task, String task) {
        contact.updateName(task);
}

Task Description

Requirement

The task object shall have a required description String field that cannot be longer than 50 characters. The description field shall not be null.

Class

Task

Method

public void updateDescription(String taskDescription) {
    if (taskDescription == null || taskDescription.length() > 50) {
        throw new IllegalArgumentException("Task description is invalid. Ensure it is shorter than 50 characters and not empty.");
    } else {
        this.description = taskDescription;
    }
}

Appointment Date

Requirement

The appointment object shall have a required appointment Date field. The appointmentDate field cannot be in the past. The appointmentDate field shall not be null.

Class

Appointment

Methods

NOTE: Use java.util.Date for the appointmentDate field and use before(new Date()) to check if the date is in the past.

Contact Tests

Tests need to be re-written so they are more streamlined and not trying to test everything or different methods when they shouldn't be. They also need to test the refactored Contact methods after they've been corrected to search by ID instead of passed an object.

Appointment ID

Requirement

The appointment object shall have a required unique appointment ID String that cannot be longer than 10 characters. The appointment ID shall not be null and shall not be updatable.

Class

Appointment

Method

public void updateAppointmentId(String appointmentId) {
    if (appointmentId == null || appointmentId.length() > 10) {
        throw new IllegalArgumentException("Unable to update the appointment ID because it is either longer than 10 characters or empty");
    } else {
        this.id = appointmentId;
    }
}

Task ID

Requirement

The task object shall have a required unique task ID String that cannot be longer than 10 characters. The task ID shall not be null and shall not be updatable.

Class

Task

Method

public void updateTaskId(String taskId) {
    if (taskId == null || taskId.length() > 10) {
        throw new IllegalArgumentException("Unable to update the task ID because it is either longer than 10 characters or empty");
    } else {
        this.id = taskId;
    }
}

Appointment Description

Requirement

The appointment object shall have a required description String field that cannot be longer than 50 characters. The description field shall not be null.

Class

Appointment

Method

public void updateDescription(String description)  {
    if (description == null || description.length() > 50) {
        throw new IllegalArgumentException("The description length is invalid. Ensure it is shorter than 50 characters and not empty");
    } else {
        this.description = description;
    }
}

Add New Tasks

Requirement

The task service shall be able to add tasks with a unique ID.

Class

TaskService

Methods and Fields

Generate a unique ID that is 10 characters:

String uniqueId = UUID.randomUUID().toString().substring(0, Math.min(toString().length(), 10));

Add the new task to the ArrayList:

public void newTask() {
    Task task = new Task(newUniqueId());
    taskList.add(task);
}

Contact Address

Requirement

The contact object shall have a required address field that must be no longer than 30 characters. The address field shall not be null.

Expected

The contact's address should never be longer than 30 characters or null.

Issue

During initialization of the object, through the constructor, there is a possibility of the address be initialized with more than 30 characters or being null.

Suggested Fix

Use the public method that validates the input and use that method inside the constructor instead of assigning the variable directly. Existing method:

public void updateAddress(String address) throws NullPointerException {
        if (address.length() > 30) {
            throw new IllegalArgumentException("Address length is invalid. Ensure it is shorter than 30 characters.");
        } else {
            this.address = address;
        }
    }

ContactService does not use Contact ID

To perform updates or deletions on Contact objects, they're supposed to be searched by Contact ID. Currently, the methods are passed a whole contact object instead of finding the object by the ID. Need to refactor the methods to search by ID instead.

Will force the tests to be rewritten as well.

Contact ID

Requirement

The contact object shall have a required unique contact ID String that cannot be longer than 10 characters. The contact ID shall not be null and shall not be updatable.

Expected

The contact ID String should never be longer than 10 characters or null

Issue

During initialization of the object, through the constructor, there is a possibility of the contact ID be initialized with more than 10 characters or being null

Suggested Fix

Create a private helper function that can validate the input and use that method inside the constructor instead of assigning the variable directly.

private void updateContactId(String id) {
        if (id == null || id.length() > 10) {
            throw new IllegalArgumentException("Unable to update contact ID because it is either longer than 10 characters or empty");
        } else {
            this.contactId = id;
        }
    }

Add New Appointment

Requirement

The appointment service shall be able to add appointments with a unique appointmentId.

Class

AppointmentService

Methods and Fields

Generate a unique ID that is 10 characters:

String uniqueId = UUID.randomUUID().toString().substring(0, Math.min(toString().length(), 10));

Add the new appointment to the ArrayList:

public void newAppointment() {
    Appointment appointment = new Appointment(newUniqueId());
    appointmentList.add(appointment);
}

Contact First Name

Requirement

The contact object shall have a required firstName String field that cannot be longer than 10 characters. The firstName field shall not be null.

Expected

The contact's first name should never be longer than 10 characters or null

Issue

During initialization of the object, through the constructor, there is a possibility of the first name be initialized with more than 10 characters or being null

Suggested Fix

Use the public method that validates the input and use that method inside the constructor instead of assigning the variable directly. Existing method:

public void updateFirstName(String firstName) {
        if (firstName == null || firstName.length() > 10) {
            throw new IllegalArgumentException("Unable to update first name because it is either longer than 10 characters or empty");
        } else {
            this.firstName = firstName;
        }
    }

Contact Last Name

Requirement

The contact object shall have a required lastName String field that cannot be longer than 10 characters. The lastName field shall not be null.

Expected

The contact's last name should never be longer than 10 characters or null

Issue

During initialization of the object, through the constructor, there is a possibility of the last name be initialized with more than 10 characters or being null

Suggested Fix

Use the public method that validates the input and use that method inside the constructor instead of assigning the variable directly. Existing method:

public void updateLastName(String lastName) {
        if (lastName == null || lastName.length() > 10) {
            throw new IllegalArgumentException("Unable to update last name because it is either longer than 10 characters or empty");
        } else {
            this.lastName = lastName;
        }
    }

Delete a Task

Requirement

The task service shall be able to delete tasks per taskId.

Class

TaskService

Method

public void deleteTask(Task task) {
    taskList.remove(task);
}

Delete Appointment

Requirement

The appointment service shall be able to delete appointments per appointmentId.

Class

AppointmentService

Method

public void deleteAppointment(Appointment appointment) {
    appointmentList.remove(appointment);
}

Update Task Description

Requirement

The task service shall be able to update task fields per taskId. The following fields are updatable: description

Class

TaskService

Method

public void updateDescription(Task task, String description) {
        contact.updateDescription(description);
}

Contact Phone Number

Requirement

The contact object shall have a required phone String field that must be exactly 10 digits. The phone field shall not be null.

Expected

The contact's should be exactly 10 digits.

Issue

During initialization of the object, through the constructor, there is a possibility of the phone number be initialized not being exactly 10 digits, not being digits at all (such as alpha characters or punctuation), or being null.

Suggested Fix

Use the public method that validates the input and use that method inside the constructor instead of assigning the variable directly. Update the method to check for non-digit characters to also throw and exception. Existing method:

public void updatePhoneNumber(String phoneNumber) {
        if (phoneNumber.length() != 10) {
            throw new IllegalArgumentException("Phone number length invalid. Ensure it is 10 digits.");
        } else {
            this.phoneNumber = phoneNumber;
        }
    }

Task Name

Requirement

The task object shall have a required name String field that cannot be longer than 20 characters. The name field shall not be null.

Class

Task

Method

public void updateName(String taskName) {
    if (taskName == null || taskName.length() > 20) {
        throw new IllegalArgumentException("Task name is invalid. Ensure it is shorter than 20 characters and not empty.");
    } else {
        this.name = taskName;
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.