From 61ab306ac734dd92185fd5a24d9074a2d0b8e836 Mon Sep 17 00:00:00 2001 From: Trevor Sawler Date: Mon, 5 Apr 2021 20:36:55 -0300 Subject: [PATCH] Database models --- internal/models/models.go | 61 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/internal/models/models.go b/internal/models/models.go index 65a0382..3323cee 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -1,5 +1,7 @@ package models +import "time" + // Reservation holds reservation data type Reservation struct { FirstName string @@ -7,3 +9,62 @@ type Reservation struct { Email string Phone string } + +// User is the user model +type User struct { + ID int + FirstName string + LastName string + Email string + Password string + AccessLevel int + CreatedAt time.Time + UpdatedAt time.Time +} + +// Room is the room model +type Room struct { + ID int + RoomName string + CreatedAt time.Time + UpdatedAt time.Time +} + +// Restrictions is the restriction model +type Restrictions struct { + ID int + RestrictionName string + CreatedAt time.Time + UpdatedAt time.Time +} + +// Reservations is the reservation model +type Reservations struct { + ID int + FirstName string + LastName string + Email string + Phone string + StartDate time.Time + EndDate time.Time + RoomID int + CreatedAt time.Time + UpdatedAt time.Time + Room Room + Processed int +} + +// RoomRestrictions is the room restriction model +type RoomRestrictions struct { + ID int + StartDate time.Time + EndDate time.Time + RoomID int + ReservationID int + RestrictionID int + CreatedAt time.Time + UpdatedAt time.Time + Room Room + Reservation Reservations + Restriction Restrictions +}