22 lines
566 B
Go
22 lines
566 B
Go
|
|
package repositories
|
||
|
|
|
||
|
|
import "gorm.io/gorm"
|
||
|
|
|
||
|
|
// Repositories holds all repository instances
|
||
|
|
type Repositories struct {
|
||
|
|
User UserRepository
|
||
|
|
Booking BookingRepository
|
||
|
|
Schedule ScheduleRepository
|
||
|
|
Notification NotificationRepository
|
||
|
|
}
|
||
|
|
|
||
|
|
// NewRepositories creates and returns all repository instances
|
||
|
|
func NewRepositories(db *gorm.DB) *Repositories {
|
||
|
|
return &Repositories{
|
||
|
|
User: NewUserRepository(db),
|
||
|
|
Booking: NewBookingRepository(db),
|
||
|
|
Schedule: NewScheduleRepository(db),
|
||
|
|
Notification: NewNotificationRepository(db),
|
||
|
|
}
|
||
|
|
}
|