38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
|
package dbrepo
|
||
|
|
||
|
import (
|
||
|
"go-udemy-web-1/internal/models"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func (m *testDBRepo) AllUsers() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// InsertReservation inserts a reservation into the database
|
||
|
func (m *testDBRepo) InsertReservation(res models.Reservation) (int, error) {
|
||
|
return 1, nil
|
||
|
}
|
||
|
|
||
|
// InsertRoomRestriction inserts a room restriction into the database
|
||
|
func (m *testDBRepo) InsertRoomRestriction(r models.RoomRestriction) error {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// SearchAvailabilityByDatesByRoomID returns true if availability exists for roomID, and false if no availability
|
||
|
func (m *testDBRepo) SearchAvailabilityByDatesByRoomID(start, end time.Time, roomID int) (bool, error) {
|
||
|
return false, nil
|
||
|
}
|
||
|
|
||
|
// SearchAvailabilityForAllRooms returns a slice of rooms, if any, for given date range
|
||
|
func (m *testDBRepo) SearchAvailabilityForAllRooms(start, end time.Time) ([]models.Room, error) {
|
||
|
var rooms []models.Room
|
||
|
return rooms, nil
|
||
|
}
|
||
|
|
||
|
// GetRoomById gets a room by id
|
||
|
func (m *testDBRepo) GetRoomById(id int) (models.Room, error) {
|
||
|
var room models.Room
|
||
|
return room, nil
|
||
|
}
|