Initial
This commit is contained in:
23
app/models/api_key.go
Normal file
23
app/models/api_key.go
Normal file
@ -0,0 +1,23 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type ApiKey struct {
|
||||
Key uuid.UUID `gorm:"type(uuid);unique;default:uuid_generate_v4()"`
|
||||
CompanyId uuid.UUID `gorm:"type(uuid)" faker:"-"`
|
||||
ActiveFrom *time.Time `faker:"-"`
|
||||
ActiveTo *time.Time `faker:"-"`
|
||||
LastUsed *time.Time
|
||||
CreatedAt time.Time `faker:"-"`
|
||||
UpdatedAt time.Time `faker:"-"`
|
||||
|
||||
Company Company `faker:"-"`
|
||||
}
|
||||
|
||||
func (m *ApiKey) TableName() string {
|
||||
return "api_keys"
|
||||
}
|
||||
28
app/models/cert.go
Normal file
28
app/models/cert.go
Normal file
@ -0,0 +1,28 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Cert struct {
|
||||
Id uuid.UUID `gorm:"type(uuid);unique;default:uuid_generate_v4()"`
|
||||
CompanyId uuid.UUID `gorm:"type(uuid)" faker:"-"`
|
||||
Company Company `faker:"-"`
|
||||
Alive bool `faker:"-"`
|
||||
SerialNumber string
|
||||
Issuer string
|
||||
Subject string
|
||||
ValidAfter time.Time `faker:"-"`
|
||||
ValidBefore time.Time `faker:"-"`
|
||||
CertFile string
|
||||
KeyFile string
|
||||
KeyPassword string
|
||||
CreatedAt time.Time `faker:"-"`
|
||||
UpdatedAt time.Time `faker:"-"`
|
||||
}
|
||||
|
||||
func (m *Cert) TableName() string {
|
||||
return "certificates"
|
||||
}
|
||||
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)
|
||||
}
|
||||
27
app/models/fisk_log_item.go
Normal file
27
app/models/fisk_log_item.go
Normal file
@ -0,0 +1,27 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
||||
type FiskLogItem struct {
|
||||
Id uuid.UUID `gorm:"type(uuid);unique"`
|
||||
ApiKeyId uuid.UUID `gorm:"type(uuid)"`
|
||||
CompanyId uuid.UUID `gorm:"type(uuid)"`
|
||||
IsDemo bool
|
||||
RequestData datatypes.JSONMap `gorm:"type:jsonb;not null"`
|
||||
ResponseData *datatypes.JSONMap `gorm:"type:jsonb"`
|
||||
IznosUkupno int
|
||||
Zki *string
|
||||
Jir *uuid.UUID `gorm:"type(uuid)"`
|
||||
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func (m *FiskLogItem) TableName() string {
|
||||
return "fisk_log"
|
||||
}
|
||||
Reference in New Issue
Block a user