backend-service/internal/services/interfaces.go
ats-tech25 488be7b8ef feat(project): Initialize project structure and core components
- Add initial project scaffolding with Go module and project structure
- Create server and CLI entry points for application
- Implement Makefile with development and build commands
- Add `.env.example` with comprehensive configuration template
- Set up README.md with project documentation and setup instructions
- Configure basic dependencies for server, database, and CLI tools
- Establish internal package structure for models, services, and handlers
- Add initial configuration and environment management
- Prepare for HTTP server, CLI, and database integration
2025-11-05 15:06:07 +00:00

81 lines
2.7 KiB
Go

package services
import (
"time"
"attune-heart-therapy/internal/models"
"github.com/stripe/stripe-go/v76"
)
// UserService handles user-related operations
type UserService interface {
Register(req RegisterRequest) (*models.User, error)
Login(email, password string) (*models.User, string, error) // returns user and JWT token
GetProfile(userID uint) (*models.User, error)
UpdateProfile(userID uint, req UpdateProfileRequest) (*models.User, error)
}
// BookingService handles booking operations
type BookingService interface {
GetAvailableSlots(date time.Time) ([]models.Schedule, error)
CreateBooking(userID uint, req BookingRequest) (*models.Booking, error)
GetUserBookings(userID uint) ([]models.Booking, error)
CancelBooking(userID, bookingID uint) error
RescheduleBooking(userID, bookingID uint, newScheduleID uint) error
}
// PaymentService handles Stripe integration
type PaymentService interface {
CreatePaymentIntent(amount float64, currency string) (*stripe.PaymentIntent, error)
ConfirmPayment(paymentIntentID string) (*stripe.PaymentIntent, error)
HandleWebhook(payload []byte, signature string) error
}
// NotificationService handles email notifications
type NotificationService interface {
SendWelcomeEmail(user *models.User) error
SendPaymentNotification(user *models.User, booking *models.Booking, success bool) error
SendMeetingInfo(user *models.User, booking *models.Booking) error
SendReminder(user *models.User, booking *models.Booking) error
ScheduleReminder(bookingID uint, reminderTime time.Time) error
}
// JitsiService handles video conference integration
type JitsiService interface {
CreateMeeting(bookingID uint, scheduledAt time.Time) (*JitsiMeeting, error)
GetMeetingURL(roomID string) string
DeleteMeeting(roomID string) error
}
// JitsiMeeting represents a Jitsi meeting
type JitsiMeeting struct {
RoomID string `json:"room_id"`
RoomURL string `json:"room_url"`
}
// Request/Response DTOs
type RegisterRequest struct {
FirstName string `json:"first_name" binding:"required"`
LastName string `json:"last_name" binding:"required"`
Email string `json:"email" binding:"required,email"`
Phone string `json:"phone"`
Location string `json:"location"`
DateOfBirth time.Time `json:"date_of_birth"`
Password string `json:"password" binding:"required,min=6"`
}
type UpdateProfileRequest struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Phone string `json:"phone"`
Location string `json:"location"`
DateOfBirth time.Time `json:"date_of_birth"`
}
type BookingRequest struct {
ScheduleID uint `json:"schedule_id" binding:"required"`
Notes string `json:"notes"`
Amount float64 `json:"amount" binding:"required"`
}