Files
houston-be/model/tag/entity.go
Vijay Joshi 843274cf48 INFRA-3703 : Houston side changes to accomodate QA use case (#452)
* 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
2024-09-05 19:27:42 +05:30

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