* 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
41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
package externalTeam
|
|
|
|
import (
|
|
"gorm.io/datatypes"
|
|
"time"
|
|
)
|
|
|
|
type ExternalTeamEntity struct {
|
|
ID uint `gorm:"primaryKey"`
|
|
ExternalTeamID string `gorm:"column:external_team_id"`
|
|
ExternalTeamName string `gorm:"column:external_team_name"`
|
|
Metadata datatypes.JSON `gorm:"column:metadata"`
|
|
ProviderName string `gorm:"column:provider_name"`
|
|
TeamID uint `gorm:"column:team_id"`
|
|
IsActive bool `gorm:"column:is_active"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
CreatedBy string `gorm:"column:created_by"`
|
|
UpdatedBy string `gorm:"column:updated_by"`
|
|
}
|
|
|
|
func (ExternalTeamEntity) TableName() string {
|
|
return "external_team"
|
|
}
|
|
|
|
func (entity *ExternalTeamEntity) ToDTO() *ExternalTeamDTO {
|
|
return &ExternalTeamDTO{
|
|
ID: entity.ID,
|
|
ExternalTeamID: entity.ExternalTeamID,
|
|
ExternalTeamName: entity.ExternalTeamName,
|
|
Metadata: entity.Metadata,
|
|
ProviderName: entity.ProviderName,
|
|
TeamID: entity.TeamID,
|
|
IsActive: entity.IsActive,
|
|
CreatedAt: entity.CreatedAt,
|
|
UpdatedAt: entity.UpdatedAt,
|
|
CreatedBy: entity.CreatedBy,
|
|
UpdatedBy: entity.UpdatedBy,
|
|
}
|
|
}
|