23 lines
733 B
Go
23 lines
733 B
Go
package repository
|
|
|
|
import (
|
|
"go-udemy-web-1/internal/models"
|
|
"time"
|
|
)
|
|
|
|
type DatabaseRepo interface {
|
|
AllUsers() bool
|
|
|
|
InsertReservation(res models.Reservation) (int, error)
|
|
InsertRoomRestriction(res models.RoomRestriction) error
|
|
SearchAvailabilityByDatesByRoomID(start, end time.Time, roomID int) (bool, error)
|
|
SearchAvailabilityForAllRooms(start, end time.Time) ([]models.Room, error)
|
|
GetRoomById(id int) (models.Room, error)
|
|
GetUserByID(id int) (models.User, error)
|
|
UpdateUser(u models.User) error
|
|
Authenticate(email, testPassword string) (int, string, error)
|
|
AllReservations() ([]models.Reservation, error)
|
|
AllNewReservations() ([]models.Reservation, error)
|
|
GetReservationByID(id int) (models.Reservation, error)
|
|
}
|