udemy-go-web-1/internal/repository/repository.go

23 lines
733 B
Go
Raw Normal View History

package repository
2024-07-09 21:08:31 +00:00
import (
"go-udemy-web-1/internal/models"
"time"
)
type DatabaseRepo interface {
AllUsers() bool
2024-07-09 20:57:07 +00:00
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)
2024-07-22 20:14:48 +00:00
AllReservations() ([]models.Reservation, error)
2024-07-24 12:20:30 +00:00
AllNewReservations() ([]models.Reservation, error)
2024-07-24 20:23:31 +00:00
GetReservationByID(id int) (models.Reservation, error)
}