25 lines
1006 B
Plaintext
25 lines
1006 B
Plaintext
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// AppliedSLA represents a SLA policy applied to a conversation.
|
|
// Reference: P2B M11 spec
|
|
type AppliedSLA struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
SlaPolicyID uint `gorm:"not null;index" json:"sla_policy_id"`
|
|
ConversationID uint `gorm:"not null;index" json:"conversation_id"`
|
|
AccountID uint `gorm:"not null;index" json:"account_id"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
|
|
|
|
SlaPolicy SlaPolicy `gorm:"foreignKey:SlaPolicyID" json:"sla_policy,omitempty"`
|
|
Conversation Conversation `gorm:"foreignKey:ConversationID" json:"conversation,omitempty"`
|
|
SlaEvents []SlaEvent `gorm:"foreignKey:AppliedSlaID" json:"sla_events,omitempty"`
|
|
}
|
|
|
|
func (AppliedSLA) TableName() string { return "applied_slas" } |