gorm_models/models/session.go

38 lines
1.1 KiB
Go

package models
// DBSession is a model that stores raw 'session' 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, ParticipantId
// JSON Fields: MediaEndpointStats, Metrics, Flow
//
// GORM Specifics:
// - Can be preloaded with Segments []DBSegment
type DBSession struct {
Ani string
Direction string
Dnis string
EdgeId string
Id string `gorm:"primaryKey;index"`
MediaEndpointStats string `gorm:"type:json"`
MediaType string
Metrics string `gorm:"type:json"`
ParticipantId string `gorm:"foreignKey;index"`
ProtocolCallId string
Provider string
Recording bool
RemoteNameDisplayable string
SessionDnis string
Flow string `gorm:"type:json"`
Segments []DBSegment `gorm:"foreignKey:SessionId;references:Id"`
}
func (DBSession) TableName() string {
return "gc_sessions"
}