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.
This commit is contained in:
雲華
2022-04-06 02:20:59 -04:00
parent 7441ac2e68
commit 91825d0292
8 changed files with 317 additions and 0 deletions

137
.gitignore vendored Normal file
View File

@@ -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*

25
OpheliasOasis.sln Normal file
View File

@@ -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

View File

@@ -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;
}
}
}

View File

@@ -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,
}
}

View File

@@ -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
{
}
}

View File

@@ -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
{
}
}

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SQLite" Version="1.0.115.5" />
</ItemGroup>
</Project>

18
OpheliasOasis/Program.cs Normal file
View File

@@ -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?: "
);
}
}