* INFRA-3703 : Houston side changes to accomodate QA use case * INFRA-3703 : UT failure fix * INFRA-3703 : Minor changes * INFRA-3703 : Unique constraint * INFRA-3703 : Edit migration file * INFRA-3703 : PR review comments and UT's * INFRA-3703 : Channel name resolution
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package incidentTeamTagValue
|
|
|
|
import (
|
|
"houston/model/incidentTeam"
|
|
"houston/model/tagValue"
|
|
"time"
|
|
)
|
|
|
|
type IncidentTeamTagValueEntity struct {
|
|
ID uint `json:"id"`
|
|
IncidentTeamID uint `gorm:"column:incident_team_id;not null;uniqueIndex:incident_team_incident_team_id_tag_value_id_key"`
|
|
TagValueID uint `gorm:"column:tag_value_id;not null;uniqueIndex:incident_team_incident_team_id_tag_value_id_key"`
|
|
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
|
|
|
|
IncidentTeam incidentTeam.IncidentTeamEntity `gorm:"foreignKey:IncidentTeamID"`
|
|
TagValue tagValue.TagValueEntity `gorm:"foreignKey:TagValueID"`
|
|
}
|
|
|
|
func (IncidentTeamTagValueEntity) TableName() string {
|
|
return "incident_team_tag_value"
|
|
}
|
|
|
|
func (entity IncidentTeamTagValueEntity) ToDTO() IncidentTeamTagValueDTO {
|
|
return IncidentTeamTagValueDTO{
|
|
ID: entity.ID,
|
|
IncidentTeamID: entity.IncidentTeamID,
|
|
TagValueID: entity.TagValueID,
|
|
CreatedAt: entity.CreatedAt,
|
|
IncidentTeam: entity.IncidentTeam.ToDTO(),
|
|
TagValue: entity.TagValue.ToDTO(),
|
|
}
|
|
}
|