add version and translate all pages

This commit is contained in:
m
2026-09-15 13:57:57 +02:00
parent 4659f3abc5
commit 339d55d92f
19 changed files with 205 additions and 70 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
package models
import (
"fmt"
"errors"
)
type Document struct {
@@ -37,19 +37,19 @@ func IsDirectory(documentType int) bool {
return DIRECTORY == documentType
}
func NewDocument(documentName string, documentType int, documentVersion int) (error, *Document) {
func NewDocument(documentName string, documentType int, documentVersion int) (*Document, error) {
documentTypeIsValid := IsDocumentTypeValid(documentType)
if !documentTypeIsValid {
return fmt.Errorf(ERROR_DOCUMENT_TYPE), nil
return nil, errors.New(ERROR_DOCUMENT_TYPE)
}
return nil, &Document{
return &Document{
Name: &documentName,
Type: documentType,
Version: documentVersion,
}
}, nil
}