Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bb7661f94 | |||
| 79bea9002e | |||
| 0e72fa1355 | |||
| db89056468 | |||
| 567470372f | |||
| 674f7dd5f5 | |||
| f50333d223 | |||
| a7f73eb96a |
@ -8,7 +8,7 @@ type DBAmendment struct {
|
|||||||
AmendmentColumn string
|
AmendmentColumn string
|
||||||
AmendmentValue string
|
AmendmentValue string
|
||||||
Requestor string
|
Requestor string
|
||||||
RequestedAt time.Time
|
RequestedAt time.Time `gorm:"index"`
|
||||||
Sequence string
|
Sequence string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -105,3 +105,26 @@ 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;foreignKey"`
|
Id string `json:"id" gorm:"primaryKey"`
|
||||||
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,6 +2,8 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DBParticipant struct {
|
type DBParticipant struct {
|
||||||
@ -23,10 +25,18 @@ type DBParticipant struct {
|
|||||||
WrapupRequired *bool
|
WrapupRequired *bool
|
||||||
|
|
||||||
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 _, seg := range sess.Segments {
|
for idx, 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", session.Id, seg.SegmentType),
|
Id: fmt.Sprintf("%s_%s_%d", session.Id, seg.SegmentType, idx),
|
||||||
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