package integration

import (
	"testing"
	"time"
)

func TestHostSalarySettlementDueDates(t *testing.T) {
	tests := []struct {
		name          string
		now           time.Time
		wantHalfMonth bool
		wantMonthEnd  bool
	}{
		{name: "normal day", now: time.Date(2026, time.May, 14, 10, 0, 0, 0, time.UTC), wantHalfMonth: false, wantMonthEnd: false},
		{name: "half month day", now: time.Date(2026, time.May, 15, 10, 0, 0, 0, time.UTC), wantHalfMonth: true, wantMonthEnd: false},
		{name: "month end in 31 day month", now: time.Date(2026, time.May, 31, 10, 0, 0, 0, time.UTC), wantHalfMonth: false, wantMonthEnd: true},
		{name: "month end in 28 day month", now: time.Date(2026, time.February, 28, 10, 0, 0, 0, time.UTC), wantHalfMonth: false, wantMonthEnd: true},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := isHostSalaryHalfMonthDue(tt.now); got != tt.wantHalfMonth {
				t.Fatalf("half-month due mismatch: got %v want %v", got, tt.wantHalfMonth)
			}
			if got := isHostSalaryMonthEndDue(tt.now); got != tt.wantMonthEnd {
				t.Fatalf("month-end due mismatch: got %v want %v", got, tt.wantMonthEnd)
			}
		})
	}
}
