Files
houston-be/model/externalTeam/entity.go
Vijay Joshi fd2a977e82 INFRA-3705 : Creation of RCA ticket for sev-0 non-escalated non-CX incidents (#456)
* 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
2024-09-17 10:01:07 +05:30

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,
}
}