gorm_models/models/segment.go

31 lines
865 B
Go
Raw Normal View History

2025-06-16 17:49:27 +10:00
package models
import (
"time"
)
2025-11-10 10:10:46 +11:00
// DBSegment is a model that stores raw 'segment' payloads from GenesysCloud API requests.
//
// - The ExtractWithoutAttributes function handles the conversion from JSON data (map) into formatted JSON string for gcq-details requests.
//
// Table Schema:
//
// Primary Key: Id
// Indexes: Id, SegmentEnd, SegmentStart, SegmentType, SessionId
// JSON Fields: q950ResponseCodes
2025-06-16 17:49:27 +10:00
type DBSegment struct {
Id string `gorm:"primaryKey;index"`
Conference bool
DisconnectType string
Q850ResponseCodes string `gorm:"type:json"`
SegmentEnd time.Time `gorm:"index"`
SegmentStart time.Time `gorm:"index"`
SegmentType string `gorm:"index"`
2025-07-22 11:47:03 +10:00
SessionId string `gorm:"index;foreignKey"`
2025-06-16 17:49:27 +10:00
WrapUpCode string
}
func (DBSegment) TableName() string {
return "gc_segments"
}