Compare commits
No commits in common. "main" and "v1.0.51" have entirely different histories.
@ -8,7 +8,7 @@ type DBAmendment struct {
|
|||||||
AmendmentColumn string
|
AmendmentColumn string
|
||||||
AmendmentValue string
|
AmendmentValue string
|
||||||
Requestor string
|
Requestor string
|
||||||
RequestedAt time.Time `gorm:"index"`
|
RequestedAt time.Time
|
||||||
Sequence string
|
Sequence string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -105,26 +105,3 @@ type Breakdown struct {
|
|||||||
func (Breakdown) TableName() string {
|
func (Breakdown) TableName() string {
|
||||||
return "gc_call_breakdown"
|
return "gc_call_breakdown"
|
||||||
}
|
}
|
||||||
|
|
||||||
type CallMetrics struct {
|
|
||||||
ClientConversationId string `gorm:"primaryKey;index"`
|
|
||||||
//
|
|
||||||
TotalDuration int
|
|
||||||
TotalClientResponseDuration int
|
|
||||||
TotalSystemDuration int
|
|
||||||
TotalTalkDuration int
|
|
||||||
//
|
|
||||||
AgentAlertDuration int
|
|
||||||
AgentHoldDuration int
|
|
||||||
AgentTalkDuration int
|
|
||||||
//
|
|
||||||
SearchingDuration int
|
|
||||||
ConfigurationDuration int
|
|
||||||
QueueDuration int
|
|
||||||
//
|
|
||||||
Metadata *string `gorm:"type:json"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (CallMetrics) TableName() string {
|
|
||||||
return "gc_call_metrics"
|
|
||||||
}
|
|
||||||
|
|||||||
@ -192,7 +192,7 @@ type UsersQuery struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GCUser struct {
|
type GCUser struct {
|
||||||
Id string `json:"id" gorm:"primaryKey"`
|
Id string `json:"id" gorm:"primaryKey;foreignKey"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
|
|||||||
@ -2,8 +2,6 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type DBParticipant struct {
|
type DBParticipant struct {
|
||||||
@ -26,17 +24,9 @@ type DBParticipant struct {
|
|||||||
|
|
||||||
Sessions []DBSession `gorm:"foreignKey:ParticipantId;references:Id"`
|
Sessions []DBSession `gorm:"foreignKey:ParticipantId;references:Id"`
|
||||||
Calls []DBCall `gorm:"foreignKey:ParticipantId;references:Id"`
|
Calls []DBCall `gorm:"foreignKey:ParticipantId;references:Id"`
|
||||||
User *GCUser `gorm:"foreignKey:UserId;references:Id"`
|
User *GCUser `gorm:"foreignKey:UserId;references:Id`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (DBParticipant) TableName() string {
|
func (DBParticipant) TableName() string {
|
||||||
return "gc_participants"
|
return "gc_participants"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *DBParticipant) BeforeSave(tx *gorm.DB) error {
|
|
||||||
// Convert empty string to nil
|
|
||||||
if p.UserId != nil && *p.UserId == "" {
|
|
||||||
p.UserId = nil
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|||||||
@ -95,7 +95,7 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
|||||||
}
|
}
|
||||||
sessions = append(sessions, session)
|
sessions = append(sessions, session)
|
||||||
|
|
||||||
for idx, seg := range sess.Segments {
|
for _, seg := range sess.Segments {
|
||||||
|
|
||||||
segmentStart, err := time.Parse(time.RFC3339, seg.SegmentStart)
|
segmentStart, err := time.Parse(time.RFC3339, seg.SegmentStart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -113,7 +113,7 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
|||||||
}
|
}
|
||||||
|
|
||||||
segment := models.DBSegment{
|
segment := models.DBSegment{
|
||||||
Id: fmt.Sprintf("%s_%s_%d", session.Id, seg.SegmentType, idx),
|
Id: fmt.Sprintf("%s_%s", session.Id, seg.SegmentType),
|
||||||
Conference: seg.Conference,
|
Conference: seg.Conference,
|
||||||
DisconnectType: seg.DisconnectType,
|
DisconnectType: seg.DisconnectType,
|
||||||
Q850ResponseCodes: string(q850ResponseCodesBytes),
|
Q850ResponseCodes: string(q850ResponseCodesBytes),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user