src.dualinventive.com/go/companies-service/internal/domain/company.go

30 lines
650 B
Go

package domain
//Company is a table structure definition
type Company struct {
ID uint `gorm:"column:company_id;primary_key"`
Name string `gorm:"column:company_name"`
Code string `gorm:"column:company_code"`
}
// TableName returns the name of the Company table
func (Company) TableName() string {
return "company"
}
// SortCol represents the sorting column
type SortCol string
// SortCol constants
const (
SortColIDAsc SortCol = "id:asc"
SortColIDDesc SortCol = "id:desc"
SortColNameAsc SortCol = "name:asc"
SortColNameDesc SortCol = "name:desc"
)
// String for SortCol
func (sc SortCol) String() string {
return string(sc)
}