* INFRA-3705 : Creation of RCA ticket for sev-0 non-escalated non-CX incidents * INFRA-3705 : Self review * INFRA-3705 : Fix tests: * INFRA-3705 : UT's and minor constant changes * INFRA-3705 : Add migration script
57 lines
1.9 KiB
Go
57 lines
1.9 KiB
Go
package team
|
|
|
|
import (
|
|
"github.com/lib/pq"
|
|
"gorm.io/datatypes"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type TeamEntity struct {
|
|
gorm.Model
|
|
Name string `gorm:"column:name"`
|
|
SlackUserIds pq.StringArray `gorm:"column:slack_user_ids;type:text[]"`
|
|
ConfluenceLink string `gorm:"column:confluence_link"`
|
|
OncallHandle string `gorm:"column:oncall_handle"`
|
|
PseOncallHandle string `gorm:"column:pse_oncall_handle"`
|
|
Active bool `gorm:"column:active"`
|
|
WebhookSlackChannel string `gorm:"column:webhook_slack_channel"`
|
|
ManagerHandle string `gorm:"column:manager_handle"`
|
|
CreatedBy string `gorm:"column:created_by"`
|
|
UpdatedBy string `gorm:"column:updated_by"`
|
|
TeamSeverityUpdateRule datatypes.JSON `gorm:"column:team_severity_update_strategy"`
|
|
TeamType string `gorm:"column:team_type"`
|
|
}
|
|
|
|
func (TeamEntity) TableName() string {
|
|
return "team"
|
|
}
|
|
|
|
func (entity *TeamEntity) ToDTO() *TeamDTO {
|
|
return &TeamDTO{
|
|
ID: entity.ID,
|
|
Name: entity.Name,
|
|
SlackUserIds: entity.SlackUserIds,
|
|
ConfluenceLink: entity.ConfluenceLink,
|
|
OncallHandle: entity.OncallHandle,
|
|
PseOncallHandle: entity.PseOncallHandle,
|
|
Active: entity.Active,
|
|
WebhookSlackChannel: entity.WebhookSlackChannel,
|
|
ManagerHandle: entity.ManagerHandle,
|
|
CreatedBy: entity.CreatedBy,
|
|
UpdatedBy: entity.UpdatedBy,
|
|
TeamSeverityUpdateRule: entity.TeamSeverityUpdateRule,
|
|
TeamType: entity.TeamType,
|
|
}
|
|
}
|
|
|
|
type TeamTagEntity struct {
|
|
gorm.Model
|
|
TeamId int `gorm:"column:team_id"`
|
|
TagId int `gorm:"column:tag_id"`
|
|
Optional bool `gorm:"column:optional"`
|
|
}
|
|
|
|
func (TeamTagEntity) TableName() string {
|
|
return "team_tag"
|
|
}
|