Files
ophelias-oasis/OpheliasOasis/Models/Reservation.cs
雲華 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

87 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ophelias.Models;
namespace Ophelias.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 void ChangeReservation(ReservationType type, Transaction t, BaseRate b)
{
Status = ReservationStatus.Changed;
Type = type;
t.Penalize(this, b.Rate);
}
internal void CancelReservation(Transaction t)
{
Status = ReservationStatus.Cancelled;
t.Penalize(this);
}
}
internal enum ReservationStatus
{
Active,
Changed,
Cancelled,
Ended,
}
internal enum ReservationType
{
Conventional,
Prepaid,
Incentive,
SixtyDayAdvance,
}
internal class ReservationList
{
internal List<Reservation> Reservations;
internal ReservationList()
{
Reservations = new List<Reservation>();
}
}
}