services

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindNextFriday

func FindNextFriday(after time.Time) time.Time

FindNextFriday returns the date of the next Friday after the given date

Types

type NotificationConfig

type NotificationConfig struct {
	Enabled    bool
	SMTPHost   string
	SMTPPort   int
	SMTPUser   string
	SMTPPass   string
	SenderName string
	SenderMail string
}

NotificationConfig holds configuration for email sending

type NotificationService

type NotificationService struct {
	// contains filtered or unexported fields
}

NotificationService handles sending notifications to users

func NewNotificationService

func NewNotificationService(
	userRepo models.UserRepository,
	talkRepo models.TalkRepository,
	attendanceRepo models.AttendanceRepository,
	config NotificationConfig,
) *NotificationService

NewNotificationService creates a new NotificationService

func (*NotificationService) SendEmail

func (n *NotificationService) SendEmail(to, subject, body string) error

SendEmail sends an email to a recipient

func (*NotificationService) SendFeedbackRequest

func (n *NotificationService) SendFeedbackRequest(ctx context.Context, talkID int) error

SendFeedbackRequest sends a request for feedback after a talk is completed

func (*NotificationService) SendReminderToAttendees

func (n *NotificationService) SendReminderToAttendees(ctx context.Context, talkID int) error

SendReminderToAttendees sends a reminder to confirmed attendees a day before a talk

func (*NotificationService) SendReminderToSpeaker

func (n *NotificationService) SendReminderToSpeaker(ctx context.Context, talkID int) error

SendReminderToSpeaker sends a reminder to the speaker a day before their talk

func (*NotificationService) SendTalkAnnouncementToAll

func (n *NotificationService) SendTalkAnnouncementToAll(ctx context.Context, talkID int) error

SendTalkAnnouncementToAll sends an announcement about a new scheduled talk to all users

func (*NotificationService) SendTalkConfirmationToSpeaker

func (n *NotificationService) SendTalkConfirmationToSpeaker(ctx context.Context, talkID int) error

SendTalkConfirmationToSpeaker sends a confirmation email to a talk speaker

func (*NotificationService) SendWeeklyTalkDigest

func (n *NotificationService) SendWeeklyTalkDigest(ctx context.Context) error

SendWeeklyTalkDigest sends a weekly digest of upcoming talks

type SchedulerService

type SchedulerService struct {
	// contains filtered or unexported fields
}

SchedulerService handles talk scheduling logic

func NewSchedulerService

func NewSchedulerService(
	talkRepo models.TalkRepository,
	voteRepo models.VoteRepository,
	attendanceRepo models.AttendanceRepository,
) *SchedulerService

NewSchedulerService creates a new SchedulerService

func (*SchedulerService) FindBestTalksForDate

func (s *SchedulerService) FindBestTalksForDate(ctx context.Context, date time.Time) ([]*TalkRanking, error)

FindBestTalksForDate finds the best candidate talks for a given date

func (*SchedulerService) GetUpcomingFridays

func (s *SchedulerService) GetUpcomingFridays(weeks int) []time.Time

GetUpcomingFridays returns a list of upcoming Fridays

func (*SchedulerService) IsDateScheduled

func (s *SchedulerService) IsDateScheduled(ctx context.Context, date time.Time) (bool, error)

IsDateScheduled checks if a date already has a scheduled talk

func (*SchedulerService) ScheduleTalk

func (s *SchedulerService) ScheduleTalk(ctx context.Context, talkID int, date time.Time) error

ScheduleTalk schedules a talk for a specific date

func (*SchedulerService) SuggestNextFriday

func (s *SchedulerService) SuggestNextFriday(ctx context.Context, weeksAhead int) (time.Time, []*TalkRanking, error)

SuggestNextFriday finds the best date and talk for the next Friday sessions

type TalkRanking

type TalkRanking struct {
	Talk           *models.Talk
	InterestScore  int     // Sum of interest levels
	AvailableUsers int     // Number of users available on the proposed date
	FinalScore     float64 // Calculated final score for ranking
}

TalkRanking represents a talk with its computed ranking score

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL