2024-07-06 22:55:25 +02:00
|
|
|
package repository
|
|
|
|
|
2024-07-09 23:08:31 +02:00
|
|
|
import (
|
|
|
|
"go-udemy-web-1/internal/models"
|
|
|
|
"time"
|
|
|
|
)
|
2024-07-08 23:04:17 +02:00
|
|
|
|
2024-07-06 22:55:25 +02:00
|
|
|
type DatabaseRepo interface {
|
|
|
|
AllUsers() bool
|
2024-07-08 23:04:17 +02:00
|
|
|
|
2024-07-09 22:57:07 +02:00
|
|
|
InsertReservation(res models.Reservation) (int, error)
|
|
|
|
InsertRoomRestriction(res models.RoomRestriction) error
|
2024-07-09 23:50:54 +02:00
|
|
|
SearchAvailabilityByDatesByRoomID(start, end time.Time, roomID int) (bool, error)
|
|
|
|
SearchAvailabilityForAllRooms(start, end time.Time) ([]models.Room, error)
|
2024-07-10 22:34:27 +02:00
|
|
|
GetRoomById(id int) (models.Room, error)
|
2024-07-19 09:44:27 +02:00
|
|
|
GetUserByID(id int) (models.User, error)
|
|
|
|
UpdateUser(u models.User) error
|
|
|
|
Authenticate(email, testPassword string) (int, string, error)
|
2024-07-22 22:14:48 +02:00
|
|
|
AllReservations() ([]models.Reservation, error)
|
2024-07-24 14:20:30 +02:00
|
|
|
AllNewReservations() ([]models.Reservation, error)
|
2024-07-24 22:23:31 +02:00
|
|
|
GetReservationByID(id int) (models.Reservation, error)
|
2024-07-25 13:13:16 +02:00
|
|
|
UpdateReservation(r models.Reservation) error
|
|
|
|
DeleteReservation(id int) error
|
|
|
|
UpdateProcessedForReservation(id, processed int) error
|
2024-07-06 22:55:25 +02:00
|
|
|
}
|