Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 79bea9002e | |||
| 0e72fa1355 | |||
| db89056468 | |||
| 567470372f | |||
| 674f7dd5f5 | |||
| f50333d223 | |||
| a7f73eb96a | |||
| 57b4791a4a | |||
| 7737b8b4d2 | |||
| 2f2388caab | |||
| ff0f873dd8 |
@@ -8,7 +8,7 @@ type DBAmendment struct {
|
||||
AmendmentColumn string
|
||||
AmendmentValue string
|
||||
Requestor string
|
||||
RequestedAt time.Time
|
||||
RequestedAt time.Time `gorm:"index"`
|
||||
Sequence string
|
||||
}
|
||||
|
||||
|
||||
@@ -105,3 +105,26 @@ type Breakdown struct {
|
||||
func (Breakdown) TableName() string {
|
||||
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"
|
||||
}
|
||||
|
||||
@@ -184,3 +184,22 @@ type NotificationConversationWithAttributes struct {
|
||||
SecurePause bool `json:"securePause"`
|
||||
UtilizationLabelId string `json:"utilizationLabelId"`
|
||||
}
|
||||
|
||||
type UsersQuery struct {
|
||||
Entities []GCUser `json:"entities"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
type GCUser struct {
|
||||
Id string `json:"id" gorm:"primaryKey"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
State string `json:"state"`
|
||||
Username string `json:"username"`
|
||||
AcdAutoAnswer bool `json:"acdAutoAnswer"`
|
||||
}
|
||||
|
||||
func (GCUser) TableName() string {
|
||||
return "gc_users"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type DBParticipant struct {
|
||||
@@ -23,8 +25,18 @@ type DBParticipant struct {
|
||||
WrapupRequired *bool
|
||||
|
||||
Sessions []DBSession `gorm:"foreignKey:ParticipantId;references:Id"`
|
||||
Calls []DBCall `gorm:"foreignKey:ParticipantId;references:Id"`
|
||||
User *GCUser `gorm:"foreignKey:UserId;references:Id"`
|
||||
}
|
||||
|
||||
func (DBParticipant) TableName() string {
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user