Changed the data types to be able to hold a companys NIF

This commit is contained in:
2025-09-20 23:47:44 +01:00
parent b578976dad
commit 3821c3fffc
8 changed files with 24672 additions and 9 deletions
+11 -7
View File
@@ -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
+4
View File
@@ -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)
}
+1
View File
@@ -5,4 +5,5 @@ import models "github.com/ESilva15/PTInvCertSWDB/sw/models"
type SWRepo interface {
Get(id int) (models.SW, error)
Count() int
}
+4
View File
@@ -45,3 +45,7 @@ func StartSWService(rt RepoType) error {
func Get(id int) (models.SW, error) {
return service.SWRepo.Get(id)
}
func Count() int {
return service.SWRepo.Count()
}