Files
agent-desk-ng/internal/models/support_availability.go
mono 2f7a491666 feat: harden support, localize knowledge and add operator availability [skip ci]
Source-only publication of reviewed commit 64e96a7f423673dc29ad56485be9fc79bce8af1c.

Passed in isolation: focused frontend/backend tests, race checks, TypeScript typecheck, lint, Go compilation, Flowgram build, and deterministic SDK build/tests.

Not accepted as a production release: Next.js export/native assembly remains blocked by environment memory limits; browser interaction and MySQL staging acceptance remain unverified. No production server, database/schema, runtime configuration, deployment, release tag, or workflow execution was performed.

Expected source tree: 0a4a7528e9.
2026-10-16 15:21:42 +00:00

25 lines
1011 B
Go

package models
import "time"
// SupportCalendar is opt-in. Absence of a team row preserves dated schedules.
// TeamID zero stores the deployment-wide timezone, not another organization.
type SupportCalendar struct {
ID int64 `gorm:"primaryKey;autoIncrement"`
TeamID int64 `gorm:"not null;uniqueIndex"`
Mode string `gorm:"type:varchar(20);not null;default:'legacy'"`
Timezone string `gorm:"type:varchar(100);not null;default:''"`
WeeklyJSON string `gorm:"type:text;not null"`
ExceptionsJSON string `gorm:"type:text;not null"`
UpdatedAt time.Time
}
// AgentPresenceLease contains no bearer credential or client address. Multiple
// independent connections may lease presence for the same authenticated user.
type AgentPresenceLease struct {
ID string `gorm:"type:varchar(64);primaryKey"`
UserID int64 `gorm:"not null;index"`
LoginSessionID int64 `gorm:"not null;index"`
ExpiresAt time.Time `gorm:"not null;index"`
}