tejas2805

PROJECT: HMS+

This project portfolio documents my individual contributions to the HMS+ project. It includes an overview of the project, the summary of the features that I have implemented and my contributions to other features of the project. Some extracts of my documentation from the HMS+ User Guide and Developer Guide have also been included.

Project Overview

The purpose of the project was to prepare us for the real world. The project was structured in a way that it resembled an intermediate stage of a non-trivial real-life software project. We had to optimize or morph an already existing AddressBook into a different product. Through this, we learned how to conceptualize and implement enhancements to a given product so that it could be used by future developers.

Application Overview

HMS+ is a computer application that targets all the hotels around the world. It aims to make the life of the hotel management staff easy by giving them a single, integrated, and highly customizable hotel management system so that the tedious process of running a hotel can be made easier and more effective.

Since HMS+ is for those who prefer using the keyboard over a mouse, it uses a Command Line Interface (CLI) for input. However, all the output is displayed in a traditional Graphical User Interface (GUI) - which is just a computer jargon for a display that includes panes, menus and message boxes. This has been done to keep the user engaged.

Main Features :

  • Simple customer database management.

  • Effortless service booking and room reservation management.

  • Easy bill management.

  • Highly customizable services and room types.

Summary of contributions

This section encompasses an overview of all the enhancements I implemented in HMS+. I have encapsulated in a nutshell how each of these augmentations adds value to the overall system in order to enable it to run in a more efficient manner.

  • Major enhancement: This enhancement added the functionality to generate bills for the customers by the hotel management staff.

    • What it does: It allows the hotel staff to generate booking bills, reservation bills and the total bill for the customers.

    • Justification: Generally, hotels give a large number of bills in quantity to the customer to pay. This makes it very confusing for the customer to understand and pay the bills. This is also a very tedious task for the hotel management staff as they have to keep track of all customer spendings at the hotel at all times and make sure everything is accounted for. The generate-bill commands implemented do all this in one go making the lives of the customers and the hotel management staff easier.

    • Highlights: This enhancement is an end-to-end feature that allows the hotel staff to generate bills for a specific customer, a specific booking or a specific reservation. I had to make sure that I use the already implemented reservation and booking models while creating the newer bill model. I also had to make sure that this model has access to all bookings and reservations simultaneously so that it could generate the bill based on the command entered by the user.

    • Credits: I mainly used the concepts from the existing codebase and those that were taught in CS2103T to implement my features.

    • Related Files:

  • Minor enhancements:

    1. Find Reservation Command: This enhancement added the functionality that the hotel management staff can easily find a specific room reservation.

      • What it does: It allows the hotel staff to find a specific room reservation done by the customer based on the customer’s Identification Number or Room Type or Dates of Reservation or all of the above.

      • Justification: Whenever the hotel staff needs to edit or delete a specific reservation, he or she needs to go through the entire reservation list to find that specific booking. This is a tedious process. Through the FindReservationCommand, the hotel staff can find the specific reservation in one go thereby reducing his or her workload.

      • Highlights: This enhancement is an end-to-end feature that allows the hotel staff to find specific bookings based on three filters - customer’s Identification number, the Room Type and the Dates of Reservation. While implementing this I had to ensure that I use the already placed prefixes so that it does not become confusing for the staff to handle too many prefixes and that the command is easy enough for them to use.

      • Relevant Pull Requests: #147 and #165

  • Code contributed: RepoSense

  • Other contributions:

    • Project management on Github:

      • Created necessary labels.

      • Created a separate issue for all the user stories with labels, milestones and assignees(Issues #82 to #110).

      • Managed the jar release of v1.3 for Dry Run of CS2103 Practical Exam.

    • Enhancements to existing features:

      • Made the Address field of a customer optional for the user to input (Pull request #132).

      • Made the UI more understandable for a first time user (Pull Requests #145, #146, and #233).

      • Wrote additional tests for existing features and features implemented by team-mates to increase coverage and bring it above 70% (Pull Requests #123, #126, #212, #219, #230 and #234).

      • Added aliases for each command so that the user can type a shorter version of the same command (Pull Request #2).

    • Documentation:

      • Kept on updating the user guide based on the features getting implemented in the application with relevant tips, notes and cautions (Pull Requests #1, #33, #35, #43, #94, #96, #130, #167, and #235).

      • Added Prefix list to the user guide so that the user can easily refer to the prefixes in case required. Also added color-coding to the user guide so that the user can easily understand the difference between the command word, the command prefix and the command parameters. (Pull Requests #137).

      • Added all user stories to developer guide (Pull Requests #95).

      • Added Glossary, Product Scope, Use Cases and Instructions for Manual Testing so that new developers coming to work on the project can easily understand what the project is about and how it works, so it becomes easier for them to do implement new features (Pull Request: #238

      • Updated the diagrams of the Ui Component and Storage Component to make them represent the current stage of the application. (Pull Request #227).

    • Community:

      • Approved and reviewed several PRs with non-trivial comments (Pull Requests #22 #26, #173, #222 and #225).

      • Reported bugs along with suggestions for other teams in the class (Issues #1, #2, #3, #4, and #5).

    • Tools:

      • Set Up Asciidoctor. This helps in converting asciidocs to html files and viewing how will the file look as a Web page.

      • Set Up Netlify.

Contributions to the User Guide

I have structured the user guide in a way such that the users of the system can work through it with ease. My purpose was to explicitly instruct them regarding the process and functionality of the app with relevant examples and respective screenshots of the software.

Major Enhancement: Generate Bills for Customers

This section contains an extract from the User Guide that shows how the users can use the generate-bill commands and help them understand the commands.

Start of Extract (from User Guide)

Generate customer’s bill : generate-bill-customer, gb-c

Effect: Generates the bill for the customer based on his total room reservations and service bookings.
Format: {generate-bill-customer/gb-c} INDEX

This command is a super set of all the other "generate bill" commands and can be used to obtain the complete breakup for a customer.

Example:

  • lc, then `generate-bill-customer 1
    Returns the total bill (includes all bookings and reservations) for the customer at index 1.

gbc1
Figure 1. Example for the generate-bill-customer 1 command

End of Extract (from User Guide)

Minor Enhancement: Find Specific Room Reservation

This section contains an extract from the User Guide that shows how I helped the users understand how the FindReservationCommand works and how to use it.

Start of Extract (from User Guide)

Find a reservation: find-reservation, fr

Effect: Displays a reservation list based on the filters given by the user.
Format: {find-reservation/fr} [ id/ IDENTIFICATION_NO ] [ r/ ROOM_TYPE ] [ d/ START_DATE - END_DATE ]

  • The searching is done in the whole reservation list.

  • If you just enter the command fr, it displays all the reservations in the database.

  • If you enter fr d/4/6/2019 - 7/6/2019, it displays all reservations between 4th June to 7th June. This consists of reservations which include the date 4th June but does not include reservations which include the date 7th June.

Example:

End of Extract (from User Guide)

Contributions to the Developer Guide

The developer guide has been written by me, keeping in mind the information required by new developers, who would work on this app hereafter. I have stated the data needed by them to improve the system by extending the existing functions

Major Enhancement: Generate Bills for Customers

This section contains an extract from the Developer Guide that showcases how the generate-bill commands have been implemented by me so that a new developer can easily understand its implementation and accordingly extend its features.

Start of Extract (from Developer Guide)

Generating Bill for Customers

Current Implementation

The generate bill for customer functionality is facilitated by the GenerateBillForCustomerCommand class and is used whenever the hotel staff wants to generate bills for its customers. It allows the hotel staff to generate bills for their customers in one go. To facilitate this, it depends on the BillModel interface and the CustomerModel interface which provide the API for the bill component.

The GenerateBillForCustomerCommand extends from the BillCommand class which in turn extends from the Command class. This is illustrated in the UML diagram shown below.

GenerateBillForCustomerCommandUMLDiagram
Figure 2. GenerateBillForCustomerCommand UML Diagram

The GenerateBillForCustomerCommand involves the use of multiple components of the HMS+ application. The figure below shows the high level Sequence Diagram for the GenerateBillForCustomerCommand.

GenerateBillLogicSequenceDiagram
Figure 3. High Level Sequence Diagram for the generate-bill-customer 1 command

As seen from the above diagram, there is no storage created for the bill as a result of which the bill generated is never stored. Therefore, the bill needs to be generated every time.

The GenerateBillForCustomerCommandParser is responsible for parsing the command. It return an GenerateBillForCustomerCommand object after parsing the index of the customer whose bill is to be generated. The figure below depicts the Sequence Diagram for interactions within the Logic component for the execute(generate-bill-customer 1) API call.

gbcLogicDiagram
Figure 4. Interactions inside the Logic Component for the generate-bill-customer 1 command

The GenerateBillForCustomerCommand#execute() method invokes the updateBill(bill) method from the BillModel. Complying with the rules of [abstraction], the Logic component calls on Model to handle the internal details for updating.

The code used for generating the booking bill for the customer is shown in the snippet below:

public HashMap<ServiceType, Pair<Double, Integer>> generateHashMapForBooking(ObservableList<Booking>
                                                                                bookingObservableList) {

        HashMap<ServiceType, Pair<Double, Integer>> bookingBill = new HashMap<>();
        for (ServiceType st: serviceTypeList) {
            bookingBill.put(st, generateTotalBillBasedOnServiceType(bookingObservableList, st));
        }
        return bookingBill;
    }

 private Pair<Double, Integer> generateTotalBillBasedOnServiceType(ObservableList<Booking> bookingObservableList,
                                                                      ServiceType serviceType) {
        int totalTime = 0;
        double totalAmount = 0.0;
        for (Booking booking : bookingObservableList) {
            if ((booking.getService().equals(serviceType))) {
                TimeRange timeRange = booking.getTiming();
                int hoursBooked = timeRange.numOfHours();
                totalTime = totalTime + hoursBooked;
                double ratePerHour = booking.getService().getRatePerHour();
                double amount = hoursBooked * ratePerHour;
                totalAmount = totalAmount + amount;
            }
        }
        return new Pair<>(totalAmount, totalTime);
    }

The reservation bill for the customer is also generated in the same manner and has therefore not been shown. The two bills are then combined and showed to the user.

Design Consideration

Aspect: How should bill generation be implemented
  • Alternative 1 (current choice): An entirely new model, BillModel has been implemented which helps in generating a bill.

    • Pros: The BillModel interface can be extended to perform other functions related to bill generation if required. If new features get added, the BillModel will help in extending them without hassle or changing already implemented functions.

    • Cons: Initially, a lot of work needs to go in implementing the model.

  • Alternative 2: Adding functions to the HotelManagementSystem class which will generate the bill.

    • Pros: Easy to implement. Takes less time and less work required.

    • Cons: Every-time a new feature is to be added, changes in the already implemented functions will also have to be done accordingly, creating more work.

Aspect: Memory storage for bill

  • Alternate 1 (current choice): Bill doesn’t get stored.

    • Pros: No work required to be done for storing the bills. Storage space is also saved.

    • Cons: While implementing new features that require history of bills, the system will not be able to provide it.

  • Alternative 2: Bill gets stored.

    • Pros: If bill history is required for a new feature, system will be able to provide it.

    • Cons: Storing of bills will create duplicates of most of the data, as bill uses only existing data to generate output to customer and doesn’t add any new data. As a result of this, if bill gets stored it will just create duplication of data and cost the user more space.

End of Extract (from Developer Guide)

Minor Enhancement: Find Specific Room Reservation

This section contains an extract from the Developer Guide that will help new developers understand how the FindReservationCommand has been implemented and make it easier for them to extend its features if they ever require.

Start of Extract (from Developer Guide)

Filtering Room Reservation functionality

Current Implementation

The finding a specific room reservation functionality is facilitated by the FindReservationCommand class and is used whenever the hotel staff wants to find a specific reservation done by the customer. It reduces the tedious process that the hotel staff needs to do and helps them find the reservation in one go. To facilitate this, it depends on the ReservationModel interface which provides the API for the room reservation and room type component.

The FindReservationCommand extends from the ReservationCommand class which in turn extends from the Command class. This is illustrated in the UML diagram shown below.

FindReservationCommandUMLDiagram
Figure 5. FindReservationCommand UML Diagram

The FindReservationCommand involves the use of multiple components of the HMS+ application. The figure below shows the high level Sequence Diagram for the FindReservationCommand.

FindReservationLogicSequenceDiagram
Figure 6. High Level Sequence Diagram for the find-reservation id/A0176684J command

As seen from the above diagram, this command doesn’t affect storage at all as the purpose of this command is to just find a specific reservation.

The Logic is responsible for parsing FindReservationCommand. It return a FindReservationCommand object after parsing the filters provided by the hotel staff.

The FindReservationCommand#execute() method invokes the updateFilteredList(reservationPredicate) method from the ReservationModel.

The ReservationModel component filters the reservation list based on the filters given by the user and sends this filtered list back to the Logic which in turn sends it back to the Ui for displaying the specific room reservation.

Design Consideration

Aspect: How to find the customer whose specific reservation is to be found
  • Alternative 1 (current choice): We use the customer’s identification number to find the particular customer

    • Pros: Identification number of a customer is unique making it easy to find the customer.

    • Cons: The extensibility of the program is low as it only uses identification number.

  • Alternative 2: We allow any customer field to be used as a filter.

    • Pros: The extensibility of the program is high as any customer field can be used a filter.

    • Cons: Filters for all customer fields need to be created and some customer fields like name or date of birth are not unique to customers.

End of Extract (from Developer Guide)

Achievements and Learnings

  • Learned how to work on a large code base with more 10000 lines of code.

  • Learned how to effectively work in a team when everyone is working on the same project.