Initial
This commit is contained in:
30
app/models/company.go
Normal file
30
app/models/company.go
Normal file
@ -0,0 +1,30 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/mozillazg/go-slugify"
|
||||
)
|
||||
|
||||
type Company struct {
|
||||
Id uuid.UUID `gorm:"type(uuid);unique;default:uuid_generate_v4()"`
|
||||
CertificateId *uuid.UUID `gorm:"type(uuid)" faker:"-"`
|
||||
Name string `faker:"name"`
|
||||
Address string
|
||||
City string
|
||||
Email string `faker:"email"`
|
||||
Oib string `faker:"-"`
|
||||
TaxSystem bool
|
||||
IsActive bool `faker:"-"`
|
||||
CreatedAt time.Time `faker:"-"`
|
||||
UpdatedAt time.Time `faker:"-"`
|
||||
}
|
||||
|
||||
func (m *Company) TableName() string {
|
||||
return "companies"
|
||||
}
|
||||
|
||||
func (m *Company) SlugifyName() string {
|
||||
return slugify.Slugify(m.Name)
|
||||
}
|
||||
Reference in New Issue
Block a user