package models import "time" // DBTicket is a model that stores Ticket records from Zoho Desk. // // - The intention of the model is to map JSON -> struct -> JSON // // Table Schema: // // Primary Key: Id // Indexes: Id // JSON Fields: Assignee, CF, Contact, DescAttachment, EntitySkills, FirstThread, LayoutDetails, SecondaryContacts, SharedDepartments, Source // // NOTE: CF stands for Custom Fields and stores all layout fields that are not in this struct (this struct contains only the defaults). type DBTicket struct { AccountId int ApprovalCount int Assignee string `gorm:"type:json"` AssigneeId int AttachmentCount int Category string CF string `gorm:"type:json"` Channel string ChannelCode string ChannelRelatedInfo string Classification string ClosedTime *time.Time CommentCount int Contact string `gorm:"type:json"` ContactId int CreatedBy int CreatedTime time.Time CustomerResponseTime time.Time DepartmentId int DescAttachments string `gorm:"type:json"` Description string DueDate *time.Time Email string EntitySkills string `gorm:"type:json"` FirstThread string `gorm:"type:json"` FollowerCount int Id string `gorm:"primaryKey"` IsArchived bool IsDeleted bool IsEscalated bool IsOverdue bool IsResponseOverdue bool IsSpam bool IsTrashed bool Language string LayoutDetails string `gorm:"type:json"` LayoutId int ModifiedBy int ModifiedTime time.Time OnHoldTime *time.Time Phone string Priority string ProductId string Resolution string ResponseDueDate *time.Time SecondaryContacts string `gorm:"type:json"` Sentiment string SharedDepartments string `gorm:"type:json"` Source string `gorm:"type:json"` Status string StatusType string SubCategory string Subject string TagCount int TaskCount int TeamId int ThreadCount int TicketNumber int TimeEntryCount int WebUrl string } func (DBTicket) TableName() string { return "zoho_live_tickets" }