backend-service/internal/repositories/interfaces.go
ats-tech25 98f4b4392d feat(booking): Implement comprehensive booking management functionality
- Add full implementation for booking handlers with complete CRUD operations
- Implement GetAvailableSlots endpoint to retrieve available booking time slots
- Add CreateBooking handler with robust error handling and validation
- Implement GetUserBookings endpoint to fetch user's booking history
- Add CancelBooking handler with specific error scenarios and authorization checks
- Integrate booking service and middleware for authentication and request processing
- Add support for date parsing and slot availability checking
- Enhance error responses with detailed error messages and appropriate HTTP status codes
- Integrate with existing authentication and middleware components
2025-11-05 16:35:36 +00:00

46 lines
1.4 KiB
Go

package repositories
import (
"time"
"attune-heart-therapy/internal/models"
)
// UserRepository handles user data persistence
type UserRepository interface {
Create(user *models.User) error
GetByID(id uint) (*models.User, error)
GetByEmail(email string) (*models.User, error)
Update(user *models.User) error
GetActiveUsersCount() (int64, error)
}
// BookingRepository handles booking data persistence
type BookingRepository interface {
Create(booking *models.Booking) error
GetByID(id uint) (*models.Booking, error)
GetByUserID(userID uint) ([]models.Booking, error)
GetByPaymentID(paymentID string) (*models.Booking, error)
Update(booking *models.Booking) error
Delete(id uint) error
GetUpcomingBookings() ([]models.Booking, error)
}
// ScheduleRepository handles schedule data persistence
type ScheduleRepository interface {
Create(schedule *models.Schedule) error
GetAvailable(date time.Time) ([]models.Schedule, error)
Update(schedule *models.Schedule) error
GetByID(id uint) (*models.Schedule, error)
IncrementBookedCount(scheduleID uint) error
DecrementBookedCount(scheduleID uint) error
}
// NotificationRepository handles notification data persistence
type NotificationRepository interface {
Create(notification *models.Notification) error
GetByID(id uint) (*models.Notification, error)
Update(notification *models.Notification) error
GetPendingNotifications() ([]models.Notification, error)
}