* 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
42 lines
902 B
Go
42 lines
902 B
Go
package tag
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Type string
|
|
|
|
const (
|
|
SingleValue Type = "single_value"
|
|
MultiValue = "multi_value"
|
|
FreeText = "free_text"
|
|
)
|
|
|
|
type TagEntity struct {
|
|
gorm.Model
|
|
Name string `gorm:"column:name"`
|
|
Label string `gorm:"column:label"`
|
|
PlaceHolder string `gorm:"column:place_holder"`
|
|
ActionId string `gorm:"column:action_id"`
|
|
Type Type `gorm:"column:type"`
|
|
Optional bool `gorm:"column:optional"`
|
|
Active bool `gorm:"column:active"`
|
|
DisplayOrder int8 `gorm:"column:display_order"`
|
|
}
|
|
|
|
func (TagEntity) TableName() string {
|
|
return "tag"
|
|
}
|
|
|
|
func (entity TagEntity) ToDTO() TagDTO {
|
|
return TagDTO{
|
|
Id: entity.ID,
|
|
Name: entity.Name,
|
|
Type: entity.Type,
|
|
Label: entity.Label,
|
|
PlaceHolder: entity.PlaceHolder,
|
|
ActionId: entity.ActionId,
|
|
Optional: entity.Optional,
|
|
}
|
|
}
|