Changed the data types to be able to hold a companys NIF
This commit is contained in:
+11
-7
@@ -8,15 +8,19 @@ import (
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
type Company struct {
|
||||
Name string `json:"name" yaml:"name"`
|
||||
NIF string `json:"nif" yaml:"nif"`
|
||||
}
|
||||
|
||||
// SW holds the data that describe an AT certified invoicing software
|
||||
type SW struct {
|
||||
Name string `json:"name" yaml:"name"`
|
||||
Version string `json:"version" yaml:"version"`
|
||||
Developer string `json:"developer" yaml:"developer"`
|
||||
CertNo int `json:"certNo" yaml:"certNo"`
|
||||
State string `json:"state" yaml:"state"`
|
||||
DeveloperNIF string `json:"string" yaml:"string"`
|
||||
CertDate time.Time `json:"certDate" yaml:"certDate"`
|
||||
Name string `json:"name" yaml:"name"`
|
||||
Version string `json:"version" yaml:"version"`
|
||||
Developer Company `json:"developer" yaml:"developer"`
|
||||
CertNo int `json:"certNo" yaml:"certNo"`
|
||||
State string `json:"state" yaml:"state"`
|
||||
CertDate time.Time `json:"certDate" yaml:"certDate"`
|
||||
}
|
||||
|
||||
// SWList is just a list of SW
|
||||
|
||||
@@ -60,3 +60,7 @@ func (yr YamlRepo) Get(id int) (models.SW, error) {
|
||||
|
||||
return models.SW{}, errors.New("not found")
|
||||
}
|
||||
|
||||
func (yr YamlRepo) Count() int {
|
||||
return len(yr.Data)
|
||||
}
|
||||
|
||||
@@ -5,4 +5,5 @@ import models "github.com/ESilva15/PTInvCertSWDB/sw/models"
|
||||
|
||||
type SWRepo interface {
|
||||
Get(id int) (models.SW, error)
|
||||
Count() int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user