From 91825d0292766734d92c8c5100fbf60eb6513fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B2=E8=8F=AF?= <42814579+yunwah@users.noreply.github.com> Date: Wed, 6 Apr 2022 02:20:59 -0400 Subject: [PATCH] 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. --- .gitignore | 137 ++++++++++++++++++++++++++++ OpheliasOasis.sln | 25 +++++ OpheliasOasis/Models/Guest.cs | 34 +++++++ OpheliasOasis/Models/Reservation.cs | 65 +++++++++++++ OpheliasOasis/Models/Room.cs | 12 +++ OpheliasOasis/Models/Transaction.cs | 12 +++ OpheliasOasis/OpheliasOasis.csproj | 14 +++ OpheliasOasis/Program.cs | 18 ++++ 8 files changed, 317 insertions(+) create mode 100644 .gitignore create mode 100644 OpheliasOasis.sln create mode 100644 OpheliasOasis/Models/Guest.cs create mode 100644 OpheliasOasis/Models/Reservation.cs create mode 100644 OpheliasOasis/Models/Room.cs create mode 100644 OpheliasOasis/Models/Transaction.cs create mode 100644 OpheliasOasis/OpheliasOasis.csproj create mode 100644 OpheliasOasis/Program.cs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5f36235 --- /dev/null +++ b/.gitignore @@ -0,0 +1,137 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.svclog +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Visual Studio cache files +*.vs + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml +*.azurePubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +packages/ +## TODO: If the tool you use requires repositories.config, also uncomment the next line +!packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +![Ss]tyle[Cc]op.targets +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml + +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +_NCrunch* + diff --git a/OpheliasOasis.sln b/OpheliasOasis.sln new file mode 100644 index 0000000..e96a389 --- /dev/null +++ b/OpheliasOasis.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32328.378 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpheliasOasis", "OpheliasOasis\OpheliasOasis.csproj", "{69288F69-68F7-4A9E-A740-507AE1CBF6CF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {69288F69-68F7-4A9E-A740-507AE1CBF6CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69288F69-68F7-4A9E-A740-507AE1CBF6CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69288F69-68F7-4A9E-A740-507AE1CBF6CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69288F69-68F7-4A9E-A740-507AE1CBF6CF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A72041BE-1FE9-4C15-AED6-91C0217466EA} + EndGlobalSection +EndGlobal diff --git a/OpheliasOasis/Models/Guest.cs b/OpheliasOasis/Models/Guest.cs new file mode 100644 index 0000000..d0e91f9 --- /dev/null +++ b/OpheliasOasis/Models/Guest.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ophelias.Guest.Models +{ + internal class Guest + { + internal int Id; + internal string FirstName; + internal string LastName; + internal string Email; + internal string? CreditCard; + + internal Guest(int id, string fname, string lname, string email) + { + Id = id; + FirstName = fname; + LastName = lname; + Email = email; + } + internal Guest(int id, string fname, string lname, string email, string cc) + { + Id = id; + FirstName = fname; + LastName = lname; + Email = email; + CreditCard = cc; + } + + } +} diff --git a/OpheliasOasis/Models/Reservation.cs b/OpheliasOasis/Models/Reservation.cs new file mode 100644 index 0000000..28d0ace --- /dev/null +++ b/OpheliasOasis/Models/Reservation.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Oasis.Reservation.Models +{ + internal class Reservation + { + internal int Id; + internal int RoomId; + internal int GuestId; + internal int TransactionId; + + internal bool IsNoShow; + + internal ReservationType Type; + internal ReservationStatus Status; + + internal DateTime CreationDate; + internal DateTime StartDate; + internal DateTime EndDate; + + internal DateTime? CheckIn; + internal DateTime? CheckOut; + internal DateTime? DateChanged; + + internal Reservation(int id, int gid, int tid, int room, ReservationType type, ReservationStatus status, + DateTime startdate, DateTime enddate) + { + Id = id; + RoomId = room; + GuestId = gid; + TransactionId = tid; + + IsNoShow = false; + + Type = type; + Status = status; + + CreationDate = DateTime.Now; + StartDate = startdate; + EndDate = enddate; + + CheckIn = null; + CheckOut = null; + DateChanged = null; + } + } + + internal enum ReservationStatus + { + Active, + Changed, + Cancelled, + } + internal enum ReservationType + { + Conventional, + Prepaid, + Incentive, + SixtyDayAdvance, + } +} diff --git a/OpheliasOasis/Models/Room.cs b/OpheliasOasis/Models/Room.cs new file mode 100644 index 0000000..505d30e --- /dev/null +++ b/OpheliasOasis/Models/Room.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OpheliasOasis.Models +{ + internal class Class1 + { + } +} diff --git a/OpheliasOasis/Models/Transaction.cs b/OpheliasOasis/Models/Transaction.cs new file mode 100644 index 0000000..d2b458d --- /dev/null +++ b/OpheliasOasis/Models/Transaction.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OpheliasOasis +{ + internal class Class1 + { + } +} diff --git a/OpheliasOasis/OpheliasOasis.csproj b/OpheliasOasis/OpheliasOasis.csproj new file mode 100644 index 0000000..beb2f6a --- /dev/null +++ b/OpheliasOasis/OpheliasOasis.csproj @@ -0,0 +1,14 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + diff --git a/OpheliasOasis/Program.cs b/OpheliasOasis/Program.cs new file mode 100644 index 0000000..20150ef --- /dev/null +++ b/OpheliasOasis/Program.cs @@ -0,0 +1,18 @@ +using Reservations +class Program +{ + Reservation CreateReservation() + { + GuestInformation guestInformation = new GuestInformation(); + Console.WriteLine + Console.ReadLine() + } + static void Main() + { + Console.WriteLine( + "1. Employee\n" + + "2. Customer\n" + + "Are you an employee or customer?: " + ); + } +} \ No newline at end of file