Commit Graph

8 Commits

Author SHA1 Message Date
雲華
34bebca414 Finishes the guest part of the models and UI integration
This commit branch has been muddled with changes that are out of scope
and cover more than just the models. Specifically it includes
completion of basic guest related models, database access, command line interface
integration and preventing SQL injection.

Total summary of changes:

**IMPORTANT CHANGE: All queries are now parameterized to prevent SQL
injections. Prior versions are subject to it since the strings were
built.

- HotelManager
This class is used to provide database operations that are outside of
scope from a given model. Furthermore if there is no model to work off
of, such as creating a new model based off an existing entry, these
functions live outside of the model since it makes no sense for models
to contain functions where it would retrieve itself with no context.
Realistically this could be placed in an empty constructor and address
itself, however, for now this functionality has been moved off the model
since it is a one use and is not guaranteed to generate a guest. Some
functionality for the coming employee management functions are already
in there since they share overlap with the guest module. Specifically
GetBaseRate for checking and getting the base rate.

- DatabaseManager
This class has mostly migrated functionality out or switch to
parameterized query generation to prevent SQL injections.

- Guest, Reservation, and Transaction Classes
Migrated functionality to create the database entry and a new entry of
guest upon creation as well as update them.

- Program (Terminal app)
Fully integrated the guest module. Has not undergone extensive testing
but does work as of this commit.
2022-04-15 02:29:55 -04:00
雲華
8764c2e57c Begun integration of models and managers
The HotelManager class now has been connected to some aspects of the
command line interface and is functioning for a few cases such as
logging in as a specific guest via email, chaging a guests information
and creating a new guest account. This was implemented first over the
reservation system to test and implement something on a smaller scale.
Furthermore, the reservation depends on an existing guest account since
a Guest ID needs to be linked to the reservation that is created.
Other changes include redesigning, tweaking/ adjusting, and/ or fixing
of other modules that have not yet been implemented or are partially
implemented.
2022-04-13 23:53:17 -04:00
雲華
306ac411b3 Further major refactoring of code
This is another commit to mostly version the code. There have been a
considerable number of changes and there is functionality that I am
still determining whether it should lie within the manager or the model
class itself. It makes the most sense to possibly add the "Update" or
database manipulation functions on the models themselves. On the other
hand, instead of creating and generating the ID in the model, the
current design is to create the entry in the database first, get the
last insert row ID and create a new and complete model that is returned
back by the function. This allows us to leverage the autoincrement
functionality of the database rather than trying to design a function
and/ or make an additional call to the database.

**NOTE: Code is non-functional due to some classes not having their
errors resolved.
2022-04-13 02:59:21 -04:00
雲華
349589674f Manager classes added and model updates
This commit introduces a large number of changes. Namely there are a
number of additions to a new set of classes that manage the database
and/ or the models shared between the code and databse. There is
fragmented non-functional code in this commit and there may be debug/
old code that still needs to be removed. This commit is just to version
these changes as they were not commited previously. There is also some
console interface code written, but has next to no functionality
attached to any existing prompts. More details will be published per .cs
file, ie specific manager or model, once they are finished as they are
undergoing rapid and significant changes regularly.
2022-04-11 23:40:37 -04:00
雲華
f1a1b5d067 Update models with more functionality
This is a small commit that aims to add some more descriptive
functionality to the models.

Guest now has more creditcard information
such as CCV and an expiration date to bring it in-line with what would
be expected.

Reservation implemented a very loose cancellation function,
this may be moved out.

Transaction has a few more tweaks that follows the same goal as guest,
however this functionality may be migrated as well.
2022-04-09 04:45:42 -04:00
雲華
c1526a123f Updated and added various models
This commit includes functionality for many of the models that the
program will use. The transaction model, rate, and room model have been
implemented, but still need further review to determine if they are
finished. The same applies to guest and reservation. Currently all
models include a simple list class, the decision to use a database or
a serialized object (JSON, array, list, etc). These lists are currently
a placeholder and are not guaranteed to land in main.
2022-04-08 15:23:48 -04:00
雲華
91825d0292 Adds several core models needed for functionality
This commit includes the following models:
- Guest
- Reservation
- Room
- Transaction

The guest model is used to represent a guest which will create a unique
guest entry represented through its ID. The model also collects
represents and reflects a guests first and last name and their personal
information including email and credit card, phone number still needs to
be included.

The reservation model focuses on #9. See the issue for more specific
details. The changes made to better define this model include changing
the original Cancellation variable to a more meaningful one called
Status. The Status variable can either be Active, Changed, or Cancelled
and enums are used as a better approach than creating and setting an int
value for an int variable. The same approach was used for the
reservation types. Furthermore, the original model was missing the
StartDate and EndDate, confusing them for the CheckIn and CheckOut date,
which can, but is not guaranteed to be identical. NoShow was moved from
the transaction model to the reservation model because it made more
sense.

The Transaction and Room models are currently empty and were created in
preperation of work. Transaction, formerly Payments, did have a model
built, however git stash did not properly store these changes.

Additional changes include the beginning of working on the main
Program.cs, however, this was mostly to ensure that the console was
outputting and the project was building.

Other (less important) notes...
A .gitignore has been added for C#, this is modified to include .vs
files since they are mostly cache files. If this breaks the project it
can always be dropped later.

The project file itself has been versioned, it may not play nice on
other machines, but ideally should be fine and nothing should go wrong
when running the project file.
2022-04-06 02:20:59 -04:00
雲華
7441ac2e68 Initial commit 2022-02-21 10:19:15 -05:00