scheduling

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Working Hours: 40 points - Is this within working hours for all participants?
	ScoreWorkingHoursMax = 40.0

	// Time Quality: 25 points - How good is this time for participants?
	// - 9-11 AM: Excellent (25 points)
	// - 11 AM-2 PM: Good (20 points)
	// - 2-5 PM: Fair (15 points)
	// - 8-9 AM or 5-6 PM: Poor (10 points)
	// - Outside working hours: 0 points
	ScoreTimeQualityMax = 25.0

	// Cultural Considerations: 15 points - Respects cultural norms
	// - No Friday PM meetings (end > 3pm) for some cultures
	// - No lunch hour meetings (12-1pm)
	// - No Monday early AM (before 10am)
	ScoreCulturalMax = 15.0

	// Weekday Preference: 10 points
	// - Tuesday/Wednesday: 10 points (best)
	// - Monday/Thursday: 8 points
	// - Friday: 5 points
	ScoreWeekdayMax = 10.0

	// Holiday Check: 10 points
	// - No holidays: 10 points
	// - Holiday for some: 5 points
	// - Holiday for all: 0 points
	ScoreHolidayMax = 10.0
)

Scoring weights for the 100-point scoring algorithm

Variables

This section is empty.

Functions

func GetQualityLabel

func GetQualityLabel(localTime time.Time, isWorking bool) (string, string)

GetQualityLabel returns a human-readable quality label for a time.

func GetScoreColor

func GetScoreColor(score float64) string

GetScoreColor returns a color indicator based on the total score.

Types

type ParticipantTime

type ParticipantTime struct {
	TimeZone    string
	LocalTime   time.Time
	IsWorking   bool
	Quality     string // "Excellent", "Good", "Fair", "Poor", "Bad"
	QualityIcon string // "✨", "", "⚠️", "🔴"
}

ParticipantTime represents a participant's local time for a meeting slot.

type ScoreBreakdown

type ScoreBreakdown struct {
	WorkingHours float64 // 0-40 points
	TimeQuality  float64 // 0-25 points
	Cultural     float64 // 0-15 points
	Weekday      float64 // 0-10 points
	Holiday      float64 // 0-10 points
	Total        float64 // Sum of all (0-100)
}

ScoreBreakdown shows detailed scoring for transparency.

func ScoreTimeSlot

func ScoreTimeSlot(startTime, endTime time.Time, participants []ParticipantTime) ScoreBreakdown

ScoreTimeSlot calculates a 100-point score for a given time slot.

type TimeSlot

type TimeSlot struct {
	StartTime time.Time
	EndTime   time.Time
	Score     float64
	Breakdown ScoreBreakdown
}

TimeSlot represents a potential meeting time with scoring.

type WorkingHours

type WorkingHours struct {
	Start time.Time // e.g., 9:00 AM
	End   time.Time // e.g., 5:00 PM
}

WorkingHours represents standard working hours for a timezone.

Jump to

Keyboard shortcuts

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